Commit a0235647 authored by 吕雯燕's avatar 吕雯燕

Merge branch 'duiba_wenyan' into develop

parents efb8a4b4 d4c2a34e
......@@ -1110,4 +1110,66 @@ public class DeveloperService {
return response;
}
//保存自有答题活动--所有字段
public Response saveQuestion(String title,String awards,String questionRecord,String creditsType,String freeLimit,String freeScope,String limitCount,String limitScope,String optionNum) throws Exception {
String url=hdHost+"/question/save";
Map<String,String> map = new HashMap<>();
map.put("subType","question");
map.put("title",title);
map.put("anticheatExchangeLimit","true");
map.put("awards",awards);
map.put("questionRecord",questionRecord);
map.put("credits","22");
map.put("creditsType",creditsType);
map.put("banner","//yun.duiba.com.cn/upload/S2T4p1474356849960.png");
map.put("thumbnail","//yun.duiba.com.cn/upload/ljoka1474356876322.png");
map.put("bannerImgNew","//yun.duiba.com.cn/upload/qzfsmsyo9s.png");
map.put("appId","2239");
map.put("freeLimit",freeLimit);
map.put("freeScope",freeScope);
map.put("limitCount",limitCount);
map.put("limitScope",limitScope);
map.put("optionNum",optionNum);
map.put("autoOffDate","2020-12-08 00:00");
map.put("id","");
logger.info("创建自有答题活动:"+url);
Response response=given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.hdLogin()).params(map).post("http://"+url);
response.prettyPrint();
try{
Assert.assertEquals(response.jsonPath().getString("desc"),"成功");
}catch(Exception e){
throw new Exception("创建自有答题活动接口失败,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("创建自有答题活动接口失败,返回信息:"+response.asString());
}
return response;
}
//编辑自有答题活动
public Response editQuestion(String actId) throws Exception {
String url=hdHost+"/question/editData";
Map<String,String> map = new HashMap<>();
map.put("appId","2239");
map.put("actId",actId);
map.put("type","question");
logger.info("请求编辑自有答题活动url:"+url);
Response response=given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.hdLogin()).params(map).post("http://"+url);
response.prettyPrint();
try{
Assert.assertEquals(response.jsonPath().getString("desc"),"成功");
}catch(Exception e){
throw new Exception("编辑自有答题活动接口失败,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("编辑自有答题活动接口失败,返回信息:"+response.asString());
}
return response;
}
}
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