Commit da1f6f2c authored by xiamengchen's avatar xiamengchen

新增秒杀互动-管理后台配置秒杀轮次

parent e68a02e1
......@@ -2351,7 +2351,7 @@ public class SaveLive implements Authorization {
public void 添加秒杀互动() {
Map<String, Object> secKillAddPar = new HashMap<>();
secKillAddPar.put("goodsId", secKillGoodsId);
secKillAddPar.put("goodsAmount", 0.01);
secKillAddPar.put("goodsAmount", 1); // 1 == 0.01
secKillAddPar.put("interactNum", 3);
secKillAddPar.put("ableAgent", 0); // 代理人不可参与
secKillAddPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
......@@ -2373,8 +2373,8 @@ public class SaveLive implements Authorization {
Response liveSecKillRes = network.getResponse(liveSecKillPar, BasicConfig.MANAGER_secondKillLists);
List<SecondKillList> secondKillLists;
try {
secondKillLists = JsonUtil.parseResponseToPageBean(liveSecKillRes, SecondKillList.class);
}catch (JsonParseException e){
secondKillLists = JsonUtil.parseResponseToListBean(liveSecKillRes, SecondKillList.class);
}catch (Exception e){
System.out.println(liveSecKillRes.body().asString());
e.printStackTrace();
return;
......@@ -2383,9 +2383,9 @@ public class SaveLive implements Authorization {
long goodsId = secondKillList.getGoodsId();
Assert.assertEquals(goodsId, secKillGoodsId, network.message(liveSecKillPar, BasicConfig.MANAGER_secondKillLists, "商品id与实际添加的不符", liveSecKillRes.body().asString()));
int goodsAmount = secondKillList.getGoodsAmount();
Assert.assertEquals(goodsAmount, 0.01, network.message(liveSecKillPar, BasicConfig.MANAGER_secondKillLists, "商品价格与实际添加的不符", liveSecKillRes.body().asString()));
Assert.assertEquals(goodsAmount, 1, network.message(liveSecKillPar, BasicConfig.MANAGER_secondKillLists, "商品价格与实际添加的不符", liveSecKillRes.body().asString()));
String goodsTitle = secondKillList.getGoodsTitle();
Assert.assertEquals(goodsTitle, LiveMaterial.skGoodsTitle, network.message(liveSecKillPar, BasicConfig.MANAGER_secondKillLists, "商品名称与实际添加的不符", liveSecKillRes.body().asString()));
Assert.assertEquals(goodsTitle, "自动化专用商品", network.message(liveSecKillPar, BasicConfig.MANAGER_secondKillLists, "商品名称与实际添加的不符", liveSecKillRes.body().asString()));
int interactNum = secondKillList.getInteractNum();
Assert.assertEquals(interactNum, 3, network.message(liveSecKillPar, BasicConfig.MANAGER_secondKillLists, "商品数量与实际添加的不符", liveSecKillRes.body().asString()));
int surplusNum = secondKillList.getSurplusNum();
......@@ -2427,7 +2427,7 @@ public class SaveLive implements Authorization {
Response liveSecKillRes = network.getResponse(liveSecKillPar, BasicConfig.MANAGER_secondKillLists);
List<SecondKillList> secondKillLists = null;
try{
secondKillLists = JsonUtil.parseResponseToPageBean(liveSecKillRes, SecondKillList.class);
secondKillLists = JsonUtil.parseResponseToListBean(liveSecKillRes, SecondKillList.class);
}catch (NullPointerException e){
e.printStackTrace();
}
......
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