Commit cde7fa8a authored by zhouzihao's avatar zhouzihao

dev-完成商品接口

parent 3195fd3f
......@@ -68,9 +68,10 @@ public class Tmp {
Case case2 = null;
case2 = new EmptyCase(sId,uid);
case2 = new BannerListDecorator(case2);
// 获取商品列表
case2 = new MallGoodsDecorator(case2);
case2.check();
log.info("over!");
}
......
package com.vandyo.sentry.core.cases;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.vandyo.sentry.core.collectionMachine.CollectionMachine;
import com.vandyo.sentry.core.dto.Res;
import com.vandyo.sentry.core.tools.Signature;
import java.util.HashMap;
import java.util.Map;
/**
* 商品列表接口
*/
public class MallGoodsDecorator extends CaseDecorator {
private static final String mallGoodsUrl = "/user/mall/goods/list";
public MallGoodsDecorator(Case aCase) {
super(aCase);
}
@Override
public Res<Map<String, String>> check() {
super.check();
Map<String, String> data = new HashMap<>();
HttpResponse response = HttpRequest.post(Signature.host + mallGoodsUrl)
.body("{}")
.execute();
Res<Map<String, String>> newRes = new Res<>();
if (response.isOk()) {
JSONObject json = JSONUtil.parseObj(response.body());
newRes.setSuccess(true);
} else {
newRes.setKey(mallGoodsUrl);
newRes.setStatus(Signature.matchStatus(response.getStatus()));
newRes.setSuccess(false);
}
CollectionMachine.post(newRes);
return newRes;
}
}
......@@ -18,6 +18,7 @@ checkmeta:
"[/car/api/locus/points/list]": 车辆轨迹点接口
"[/car/api/locus/statistics/get]": 轨迹统计数据接口
"[/car/api/locus/event/v111]": 轨迹行驶行为
"[/user/mall/goods/list]": 商品列表接口
test: 测试接口
timeMap:
"[/car/my_car/info]": 6
......@@ -31,6 +32,7 @@ checkmeta:
"[/car/api/locus/points/list]": 6
"[/car/api/locus/statistics/get]": 6
"[/car/api/locus/event/v111]": 6
"[/user/mall/goods/list]": 6
test: 2
emailList[0]: "1042181618@qq.com"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment