Commit 587ad665 authored by 吕雯燕's avatar 吕雯燕

lv

parent a0235647
......@@ -619,7 +619,7 @@ public class DeveloperService {
return response;
}
//删除活动
//删除自有签到活动
public Response delete(String signId) throws Exception {
Map<String,String> map = new HashMap<>();
......@@ -1172,4 +1172,61 @@ public class DeveloperService {
return response;
}
//创建自有弹层签到--所有字段
public Response saveSign(String title,String signType,String prizes,String signCredits) throws Exception {
String url=hdHost+"/signConfig/signSave";
Map<String,String> map = new HashMap<>();
map.put("title",title);
map.put("rateDescription","测试概率shuom");
map.put("ruleDescription","测试活动规则");
map.put("signType",signType);
map.put("prizes",prizes);
map.put("imageUrl","//yun.duiba.com.cn/developer_new/images/activities/sign.jpg");
map.put("triggerType","chome");
map.put("deletedPrizeIds","");
map.put("signCredits",signCredits);
map.put("status","0");
map.put("anticheatExchangeLimit","true");
map.put("appId","2239");
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 editSign(String id) throws Exception {
String url=hdHost+"/signConfig/signEdit";
Map<String,String> map = new HashMap<>();
map.put("id",id);
map.put("appId","2239");
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("success"),"true");
}catch(Exception e){
throw new Exception("编辑自有签到活动接口失败,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("编辑自有签到活动接口失败,返回信息:"+response.asString());
}
return response;
}
}
package http.service.hd;
import http.service.Authorization;
import base.DuibaLog;
import io.restassured.response.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.testng.Assert;
import java.util.HashMap;
import java.util.Map;
import static io.restassured.RestAssured.given;
/**
* Created by lvwenyan on 2018/12/06.
*/
@Service
public class LaunchService {
@Value("${hdserver.host}")
String hdHost;
@Autowired
Authorization authorization;
private DuibaLog logger = DuibaLog.getLogger();
//获取活动默认数据
public Response getDataConfigUrl(String type) throws Exception{
String url = hdHost + "/launch/getDataConfigUrl";
Map<String,String> map = new HashMap<>();
map.put("appId","2239");
map.put("type",type);
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 obtain() throws Exception{
String url = hdHost + "/launch/obtain";
Map<String,String> map = new HashMap<>();
map.put("appId","2239");
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;
}
}
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