Commit ed5b97ee authored by 郭姣's avatar 郭姣

秒杀管理后台新增商品、助播端新增商品、下单请求参数修改

parent 79fe9d3a
......@@ -51,6 +51,8 @@ public class ConfSecondKill implements Authorization {
secKillAddPar.put("interactNum", 3);
secKillAddPar.put("ableAgent", 0); // 代理人不可参与
secKillAddPar.put("isNeedQualified", 0); // 不需要秒杀资格
secKillAddPar.put("playType",0);//高级玩法配置,0为不配置,1为秒杀资格,2为秒杀优惠券
secKillAddPar.put("afterPrice","");
secKillAddPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response secKillAddRes = network.postResponse(secKillAddPar, BasicConfig.MANAGER_secondKillSave);
try{
......@@ -70,6 +72,7 @@ public class ConfSecondKill implements Authorization {
secKillAddPar.put("interactNum", 3);
secKillAddPar.put("ableAgent", 0);
secKillAddPar.put("isNeedQualified", 0); // 不需要秒杀资格
secKillAddPar.put("playType",0);
secKillAddPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response secKillAddRes;
boolean data;
......@@ -130,6 +133,7 @@ public class ConfSecondKill implements Authorization {
secKillUpdatePar.put("id", newSecKillId);
secKillUpdatePar.put("ableAgent", 0);
secKillUpdatePar.put("isNeedQualified", 0); // 不需要秒杀资格
secKillUpdatePar.put("playType",0);
Response secKillUpdateRes = network.postResponse(secKillUpdatePar, BasicConfig.MANAGER_secondKillUpdate);
try{
boolean data = secKillUpdateRes.jsonPath().getBoolean("data");
......@@ -195,7 +199,9 @@ public class ConfSecondKill implements Authorization {
params.put("infallibleConfig",infallibleConfig);
params.put("goodsAmount",0);
params.put("interactNum",2);
params.put("isNeedQualified",1);
params.put("isNeedQualified",0);//新增商品时是否需要秒杀资格字段始终默认为0,由playType判断
params.put("afterPrice","");
params.put("playType",1);//高级玩法配置,0为不配置,1为秒杀资格,2为秒杀优惠券
params.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response response = network.postResponse(params,BasicConfig.MANAGER_secondKillSave);
boolean data = response.jsonPath().getBoolean("data");
......@@ -212,8 +218,8 @@ public class ConfSecondKill implements Authorization {
Assert.assertNotNull(cardConfigTwo, network.message(params,BasicConfig.MANAGER_secondKillLists,"获取商品配图2信息失败",response.body().asString()));
Object infallibleConfig = response.jsonPath().getJsonObject("data.get(0).infallibleConfig");
Assert.assertNotNull(infallibleConfig, network.message(params,BasicConfig.MANAGER_secondKillLists,"获取秒杀资格商品信息失败",response.body().asString()));
int isNeedQualified = response.jsonPath().getJsonObject("data.get(0).isNeedQualified");
Assert.assertEquals(isNeedQualified,1,network.message(params,BasicConfig.MANAGER_secondKillLists,"获取秒杀资格配置状态错误",response.body().asString()));
int playType = response.jsonPath().getJsonObject("data.get(0).playType");
Assert.assertEquals(playType,1,network.message(params,BasicConfig.MANAGER_secondKillLists,"获取秒杀资格配置状态错误",response.body().asString()));
ManageQualifiedId = response.jsonPath().getString("data.get(0).id");
System.out.println(ManageQualifiedId);
}
......@@ -223,6 +229,7 @@ public class ConfSecondKill implements Authorization {
params.put("goodsId", secKillGoodsId);
params.put("id",ManageQualifiedId);
params.put("ableAgent",1);
params.put("afterPrice","");
params.put("assistLimit",10);
params.put("assistPeopleNum",1);//秒杀资格需要的助力人数
QualifiedCardList cardConfigOne = new QualifiedCardList();
......@@ -243,6 +250,7 @@ public class ConfSecondKill implements Authorization {
params.put("goodsAmount",0);
params.put("interactNum",2);
params.put("isNeedQualified",1);
params.put("playType",1);
params.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response response = network.postResponse(params,BasicConfig.MANAGER_secondKillUpdate);
boolean data = response.jsonPath().getBoolean("data");
......@@ -275,7 +283,6 @@ public class ConfSecondKill implements Authorization {
secKillAddPar.put("goodsAmount", 5); // 1 == 0.01
secKillAddPar.put("interactNum", 3);
secKillAddPar.put("ableAgent", 0); // 代理人不可参与
secKillAddPar.put("isNeedQualified", 0); // 不需要秒杀资格
secKillAddPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response secKillAddRes = network.postResponse(secKillAddPar, BasicConfig.ANCHOR_secondKillSave);
try {
......@@ -294,7 +301,6 @@ public class ConfSecondKill implements Authorization {
secKillAddPar.put("goodsAmount", 1); // 1 == 0.01
secKillAddPar.put("interactNum", 1);
secKillAddPar.put("ableAgent", 1); // 代理人可参与
secKillAddPar.put("isNeedQualified", 0); // 不需要秒杀资格
secKillAddPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response secKillAddRes = network.postResponse(secKillAddPar, BasicConfig.ANCHOR_secondKillSave);
try {
......@@ -313,7 +319,6 @@ public class ConfSecondKill implements Authorization {
secKillAddPar.put("goodsAmount", 0); // 1 == 0.01
secKillAddPar.put("interactNum", 1);
secKillAddPar.put("ableAgent", 1); // 代理人可参与
secKillAddPar.put("isNeedQualified", 0); // 不需要秒杀资格
secKillAddPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response secKillAddRes = network.postResponse(secKillAddPar, BasicConfig.ANCHOR_secondKillSave);
try {
......@@ -354,7 +359,6 @@ public class ConfSecondKill implements Authorization {
secKillUpdatePar.put("interactNum", 3);
secKillUpdatePar.put("id", skIdFirst);
secKillUpdatePar.put("ableAgent", 0);
secKillUpdatePar.put("isNeedQualified", 0); // 不需要秒杀资格
Response secKillUpdateRes = network.postResponse(secKillUpdatePar, BasicConfig.ANCHOR_secondKillUpdate);
try {
boolean data = secKillUpdateRes.jsonPath().getBoolean("data");
......
......@@ -244,6 +244,7 @@ public class SecondKill implements Authorization {
Map<String, Object> orderPar = new HashMap<>();
orderPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
orderPar.put("confId", ConfSecondKill.skIdFirst);
orderPar.put("couponsId","");
Response orderRes = network.postResponse(orderPar, BasicConfig.MOBILE_secondKill_goodsOrder);
try {
boolean data = orderRes.jsonPath().getBoolean("data");
......@@ -297,6 +298,7 @@ public class SecondKill implements Authorization {
Map<String, Object> orderPar = new HashMap<>();
orderPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
orderPar.put("confId", ConfSecondKill.skIdFirst);
orderPar.put("couponsId","");
Response orderRes = network.postResponse(orderPar, BasicConfig.MOBILE_secondKill_goodsOrder);
try {
boolean data = orderRes.jsonPath().getBoolean("data");
......@@ -365,6 +367,7 @@ public class SecondKill implements Authorization {
Map<String, Object> orderPar = new HashMap<>();
orderPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
orderPar.put("confId", ConfSecondKill.skIdFirst);
orderPar.put("couponsId","");
Response orderRes = network.postResponse(orderPar, BasicConfig.MOBILE_secondKill_goodsOrder);
try {
boolean data = orderRes.jsonPath().getBoolean("data");
......@@ -408,6 +411,7 @@ public class SecondKill implements Authorization {
Map<String, Object> orderPar = new HashMap<>();
orderPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
orderPar.put("confId", ConfSecondKill.skIdThird);
orderPar.put("couponsId","");
Response orderRes = network.postResponse(orderPar, BasicConfig.MOBILE_secondKill_goodsOrder);
try {
boolean data = orderRes.jsonPath().getBoolean("data");
......@@ -593,6 +597,7 @@ public class SecondKill implements Authorization {
Map<String, Object> orderPar = new HashMap<>();
orderPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
orderPar.put("confId", ConfSecondKill.skIdSecond);
orderPar.put("couponsId","");
Response orderRes = network.postResponse(orderPar, BasicConfig.MOBILE_secondKill_goodsOrder);
try {
boolean data = orderRes.jsonPath().getBoolean("data");
......@@ -635,6 +640,7 @@ public class SecondKill implements Authorization {
Map<String, Object> orderPar = new HashMap<>();
orderPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
orderPar.put("confId", ConfSecondKill.skIdSecond);
orderPar.put("couponsId","");
Response orderRes = network.postResponse(orderPar, BasicConfig.MOBILE_secondKill_goodsOrder);
try {
boolean data = orderRes.jsonPath().getBoolean("data");
......@@ -728,6 +734,7 @@ public class SecondKill implements Authorization {
Map<String, Object> orderPar = new HashMap<>();
orderPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
orderPar.put("confId", ConfSecondKill.skIdSecond);
orderPar.put("couponsId","");
Response orderRes = network.postResponse(orderPar, BasicConfig.MOBILE_secondKill_goodsOrder);
try {
boolean data = orderRes.jsonPath().getBoolean("data");
......@@ -900,6 +907,7 @@ public class SecondKill implements Authorization {
Map<String, Object> orderPar = new HashMap<>();
orderPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
orderPar.put("confId", ConfSecondKill.QualifiedId);
orderPar.put("couponsId","");
Response orderRes = network.postResponse(orderPar, BasicConfig.MOBILE_secondKill_goodsOrder);
try {
boolean data = orderRes.jsonPath().getBoolean("data");
......@@ -954,6 +962,7 @@ public class SecondKill implements Authorization {
Map<String, Object> orderPar = new HashMap<>();
orderPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
orderPar.put("confId", ConfSecondKill.skIdFirst);
orderPar.put("couponsId","");
Response orderRes = network.postResponse(orderPar, BasicConfig.MOBILE_secondKill_goodsOrder);
try {
boolean data = orderRes.jsonPath().getBoolean("data");
......
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