|
|
|
@ -1,5 +1,6 @@ |
|
|
|
package cn.chjyj.szwh.controller.api; |
|
|
|
|
|
|
|
import cn.chjyj.szwh.bean.Goods; |
|
|
|
import cn.chjyj.szwh.controller.BaseController; |
|
|
|
import cn.chjyj.szwh.service.GoodsService; |
|
|
|
import com.alibaba.fastjson2.JSONObject; |
|
|
|
@ -8,6 +9,8 @@ import org.apache.commons.logging.LogFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
/** |
|
|
|
* API端产品信息 |
|
|
|
*/ |
|
|
|
@ -53,4 +56,30 @@ public class GoodsController extends BaseController { |
|
|
|
jsonObject.put("msg","成功"); |
|
|
|
return jsonObject; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 根据类型获取委托信息 |
|
|
|
* @param type |
|
|
|
* @param createtime |
|
|
|
* @param goods_type |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@PostMapping("/getTypeGoods") |
|
|
|
public JSONObject getTypeGoods(String type,String createtime,String goods_type){ |
|
|
|
//10长的时间戳
|
|
|
|
long startTime = System.currentTimeMillis(); |
|
|
|
List<Goods> goodsList = goodsService.getTypeGoods(type,createtime,goods_type); |
|
|
|
long endtime = System.currentTimeMillis(); |
|
|
|
JSONObject outjson = new JSONObject(); |
|
|
|
if(goodsList!=null){ |
|
|
|
outjson.put("code","success"); |
|
|
|
outjson.put("msg","成功"); |
|
|
|
outjson.put("userTime",(endtime-startTime)/1000l+"ms"); |
|
|
|
outjson.put("data",goodsList); |
|
|
|
}else{ |
|
|
|
outjson.put("code","failure"); |
|
|
|
outjson.put("msg","请求失败"); |
|
|
|
} |
|
|
|
return outjson; |
|
|
|
} |
|
|
|
} |
|
|
|
|