Commit a00d3c9c authored by 钱雯君's avatar 钱雯君

add

parent 6a4df1ca
......@@ -120,8 +120,14 @@ public class PkActivityService {
if (bonusType.equals("2")){
para.put("bonusAmount","0.1");//实际瓜分红包金额
para.put("title","【自动化】瓜分红包"+time);
}else {
}else if (bonusType.equals("1")){
para.put("title","【自动化】瓜分经验"+time);
}else {
para.put("title","【自动化】新建pk活动-瓜分优惠券");
para.put("bonusAmount","");
para.put("pluginId","12");//插件id
para.put("prizeLimit","1000");//发放上限
}
para.put("configStatus","1");
para.put("creditsValue","1");
......@@ -308,11 +314,11 @@ public class PkActivityService {
//创建pk开奖的插件活动id
public Response pluginSave(String pkActivityId) throws Exception {
String saveUrl = ManagerHost + "/plugin/save";
String configUrl = ManagerHost + "/plugin/editConfig.htm";
String saveUrl = "http://"+ ManagerHost + "/plugin/save";
String configUrl ="http://"+ ManagerHost + "/plugin/editConfig.htm";
//获取创建活动的token
Response response=given().contentType("text/html;charset=UTF-8").cookies(authorization.ssoLogin()).get("http://"+configUrl);
Response response=given().contentType("text/html;charset=UTF-8").cookies(authorization.ssoLogin()).get(configUrl);
String token = MatcherString.getString(response.asString(), "token: '(.*?)'", 1);
List<Map<String,String>> listPrizes = new ArrayList<>();
......@@ -332,31 +338,18 @@ public class PkActivityService {
award.put("name","LV优惠券自动化测试链接券");
award.put("stockAfterChange","10");
award.put("remaining","10");
Map<String,String> award2 = new HashMap<>();
award.put("type","thanks");
award.put("description","谢谢参与");
award.put("logo","//yun.duiba.com.cn/upload/uP99F1462438316972.png");
award.put("valid","true");
award.put("rate","");
award.put("arealimit","false");
award.put("stockBeforeChange","0");
award.put("stockAfterChange","0");
award.put("remaining","0");
listPrizes.add(award);
listPrizes.add(award2);
String prizes = JSON.toJSONString(listPrizes);
Map<String, String> map = new HashMap<>();
map.put("title", "【自动化】pk开奖插件");
map.put("brickId", "0");
map.put("brickId", "92");
map.put("ruleDescription", "自动化活动规则");
map.put("rateDescription", "自动化概率说明");
map.put("multiSkinsMode", "false");
map.put("multiSkinIds","[]");
map.put("triggerTime","[]");
map.put("limitCount","1");
map.put("exitDays", "7");
map.put("anticheatExchangeLimit", "false");
......@@ -373,10 +366,13 @@ public class PkActivityService {
map.put("subType","plugdraw");
map.put("joinVerificyMode","15");
map.put("pkId",pkActivityId);
map.put("scenarios", "chome");
logger.info("请求保存插件活动接口的参数为:" + JSONObject.toJSONString(map));
logger.info("请求保存插件活动接口:" + saveUrl);
Response saveResponse = given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.ssoLogin()).params(map).post("http://"+saveUrl);
Response saveResponse = given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.ssoLogin()).params(map).post(saveUrl);
saveResponse.prettyPrint();
try{
Assert.assertEquals(saveResponse.jsonPath().getString("success"),"true");
......
......@@ -2,6 +2,7 @@ package http.service.Manager;
import base.DuibaLog;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import http.service.Authorization;
import io.restassured.response.Response;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -345,9 +346,4 @@ public class PluginService {
}
}
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