Commit 536fbc63 authored by 钱雯君's avatar 钱雯君

add service

parent 66e00698
...@@ -165,6 +165,38 @@ ...@@ -165,6 +165,38 @@
<artifactId>commons-lang</artifactId> <artifactId>commons-lang</artifactId>
<version>2.6</version> <version>2.6</version>
</dependency> </dependency>
<dependency>
<groupId>cn.com.duiba.activity-center</groupId>
<artifactId>activity-center-api</artifactId>
<version>2.7.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cn.com.duiba.activity-comm-center</groupId>
<artifactId>activity-common-api</artifactId>
<version>1.0.7.black3-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.18</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
/**
* Copyright (C), 2015-2018
* FileName: 集卡商品测试_DuibaTest
* Author: qianwenjun
* Date: 2018/10/29 20:27
* Description:
*/
package http.cases.CollectRuleTest;
import base.DuibaLog;
import base.DuibaTestBase;
import http.service.Authorization;
import io.restassured.response.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.Test;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static io.restassured.RestAssured.given;
/**
* 〈〉
*
* @author qianwenjun
* @create 2018/10/29
* @since 1.0.0
*/
public class 集卡商品测试_DuibaTest extends DuibaTestBase {
private DuibaLog logger = DuibaLog.getLogger();
@Value("${manager.host}")
//ManagerHost = mng.duibatest.com.cn
String ManagerHost;
@Autowired
Authorization authorization;
private List<String> ids = new ArrayList<>();
private List<String> extrIds = new ArrayList<>();
@Test(description = "普通集卡商品")
public void 新建普通集卡商品测试() throws Exception{
String url = ManagerHost + "/AItem/doUpdateCollectGoods";
Map<String,Object> map = new HashMap<>();
map.put("name","qwj集卡自动化测试");
map.put("subtitle","qwj集卡自动化测试");
map.put("description","qwj集卡自动化测试");
map.put("smallImage","//yun.duiba.com.cn/developer/img/default_img.jpg");
map.put("bannerImgNew","//yun.duiba.com.cn/developer/img/default_img.jpg");
map.put("collectType","0");
map.put("remaining","99999");
map.put("limitCount","888");
map.put("limitScope","forever");
map.put("saveType","save");
Response response = given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.ssoLogin()).params(map).post("http://"+url);
response.prettyPrint();//http接口访问结果为空,不需要校验response结果
List<Map<String,Object>> results = jdbc.findModeResult("select * from goods.item where description = ?","qwj集卡自动化测试");
Assert.assertFalse((results.size()==0),"创建失败,存数据库数据为空");
for (int i=0;i<results.size();i++){
ids.add(results.get(i).get("id").toString());
Assert.assertEquals(results.get(i).get("remaining").toString(),"99999","保存的库存数据校验失败");
Assert.assertEquals(results.get(i).get("type").toString(),"collectGoods","保存的商品类型校验失败");
Map<String,Object> result1 = jdbc.findSimpleResult("select * from goods.tb_item_new_extra where item_id = ? and prop_name = 'collectGoodsType'\n",results.get(i).get("id").toString());
Assert.assertEquals(result1.get("prop_value").toString(),"0","校验保存集卡商品类型失败");
}
}
@Test(description = "新建随机-全局红包集卡商品")
public void 新建全局红包集卡商品测试() throws Exception{
String url = ManagerHost + "/AItem/doUpdateCollectGoods";
Map<String,Object> map = new HashMap<>();
map.put("name","qwj集卡自动化测试-全局红包参数");
map.put("subtitle","qwj集卡自动化测试-全局红包参数");
map.put("description","qwj集卡自动化测试-全局红包参数");
map.put("smallImage","//yun.duiba.com.cn/developer/img/default_img.jpg");
map.put("bannerImgNew","//yun.duiba.com.cn/developer/img/default_img.jpg");
//用于全局红包玩法的参数
map.put("collectType","1");//商品类型-随机红包
map.put("rewardType","0");//账户类型-全局红包
map.put("bonusAreaA","5");
map.put("bonusAreaB","100");
map.put("remaining","99999");
map.put("limitScope","forever");
map.put("saveType","save");
map.put("stockWarnValue","10");//库存预警和通知人
map.put("adminId","1");
map.put("ownerAppId","1,2,3");
Response response = given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.ssoLogin()).params(map).post("http://"+url);
response.prettyPrint();
List<Map<String,Object>> results = jdbc.findModeResult("select * from goods.item where description = ?","qwj集卡自动化测试-全局红包参数");
Assert.assertFalse((results.size()==0),"创建失败,存数据库数据为空");
for (int i=0;i<results.size();i++){
ids.add(results.get(i).get("id").toString());
Assert.assertEquals(results.get(i).get("remaining").toString(),"99999","保存的库存数据校验失败");
Assert.assertEquals(results.get(i).get("type").toString(),"collectGoods","保存的商品类型校验失败");
Map<String,Object> result1 = jdbc.findSimpleResult("select * from goods.item_extra where item_id = ?\n",results.get(i).get("id").toString());
Assert.assertEquals(result1.get("owner_app_ids").toString(),"1,2,3","保存的定向的app数据校验失败");
Assert.assertEquals(result1.get("bonus_area").toString(),"500,10000","保存的红包区间数据校验失败");
extrIds.add(result1.get("id").toString());
Map<String,Object> result2 = jdbc.findSimpleResult("select * from goods.tb_item_new_extra where item_id = ? and prop_name = 'collectGoodsType'\n",results.get(i).get("id").toString());
Assert.assertEquals(result2.get("prop_value").toString(),"1","校验保存集卡商品类型失败");
Map<String,Object> result3 = jdbc.findSimpleResult("select * from goods.tb_item_new_extra where item_id = ? and prop_name = 'rewardType'\n",results.get(i).get("id").toString());
Assert.assertEquals(result3.get("prop_value").toString(),"0","校验保存集卡商品类型失败");
}
}
@Test(description = "新建随机-手气红包集卡商品")
public void 新建手气红包集卡商品测试() throws Exception{
String url = ManagerHost + "/AItem/doUpdateCollectGoods";
Map<String,Object> map = new HashMap<>();
map.put("name","qwj集卡自动化测试-手气红包参数");
map.put("subtitle","qwj集卡自动化测试-手气红包参数");
map.put("description","qwj集卡自动化测试-手气红包参数");
map.put("smallImage","//yun.duiba.com.cn/developer/img/default_img.jpg");
map.put("bannerImgNew","//yun.duiba.com.cn/developer/img/default_img.jpg");
//用于全局红包玩法的参数
map.put("collectType","1");//商品类型-随机红包
map.put("rewardType","1");//账户类型-手气红包
map.put("bonusAreaA","10");
map.put("bonusAreaB","90");
map.put("remaining","99999");
map.put("limitScope","forever");
map.put("saveType","save");
map.put("stockWarnValue","10");//库存预警和通知人
map.put("adminId","1");
map.put("ownerAppId","1,2");
Response response = given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.ssoLogin()).params(map).post("http://"+url);
response.prettyPrint();
//普通商品存储
List<Map<String,Object>> results = jdbc.findModeResult("select * from goods.item where description = ?","qwj集卡自动化测试-手气红包参数");
Assert.assertFalse((results.size()==0),"创建失败,存数据库数据为空");
for (int i=0;i<results.size();i++){
ids.add(results.get(i).get("id").toString());
Assert.assertEquals(results.get(i).get("remaining").toString(),"99999","保存的库存数据校验失败");
Assert.assertEquals(results.get(i).get("type").toString(),"collectGoods","保存的商品类型校验失败");
Map<String,Object> result1 = jdbc.findSimpleResult("select * from goods.item_extra where item_id = ?\n",results.get(i).get("id").toString());
Assert.assertEquals(result1.get("owner_app_ids").toString(),"1,2","保存的定向的app数据校验失败");
Assert.assertEquals(result1.get("bonus_area").toString(),"1000,9000","保存的红包区间数据校验失败");
extrIds.add(result1.get("id").toString());
Map<String,Object> result2 = jdbc.findSimpleResult("select * from goods.tb_item_new_extra where item_id = ? and prop_name = 'collectGoodsType'\n",results.get(i).get("id").toString());
Assert.assertEquals(result2.get("prop_value").toString(),"1","校验保存集卡商品类型失败");
Map<String,Object> result3 = jdbc.findSimpleResult("select * from goods.tb_item_new_extra where item_id = ? and prop_name = 'rewardType'\n",results.get(i).get("id").toString());
Assert.assertEquals(result3.get("prop_value").toString(),"1","校验保存集卡商品类型失败");
}
}
@AfterClass
public void tearDown() {
try {
// Boolean result5 = jdbc.update("delete from goods.item where description = ?","qwj集卡自动化测试-手气红包参数");
// Boolean result4 = jdbc.update("delete from goods.item where description = ?","qwj集卡自动化测试-全局红包参数");
for (int i=0;i<ids.size();i++){
Boolean result1 = jdbc.update("delete from goods.item where id = ?",ids.get(i));
Boolean result2 = jdbc.update("delete from goods.item_extra where item_id = ?",ids.get(i));
Boolean result3 = jdbc.update("delete from goods.tb_item_new_extra where item_id = ?",ids.get(i));
}
} catch (SQLException e) {
e.printStackTrace();
}
}
}
\ No newline at end of file
/**
* Copyright (C), 2015-2018
* FileName: 集卡规则_中奖属性配置_DuibaTest
* Author: qianwenjun
* Date: 2018/10/29 20:32
* Description:
*/
package http.cases.CollectRuleTest;
import base.DuibaLog;
import base.DuibaTestBase;
import cn.com.duiba.activity.center.api.dto.activity.CLRuleDto;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import http.service.Authorization;
import io.restassured.response.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.Test;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static io.restassured.RestAssured.given;
/**
* 〈〉
*
* @author qianwenjun
* @create 2018/10/29
* @since 1.0.0
*/
public class 集卡规则_中奖属性配置_DuibaTest extends DuibaTestBase {
private DuibaLog logger = DuibaLog.getLogger();
@Value("${manager.host}")
//ManagerHost = mng.duibatest.com.cn
String ManagerHost;
@Autowired
Authorization authorization;
private List<Map<String,Object>> propKeys;
private List<Map<String,Object>> rules;
private String newId;
@Test(priority = 1,description = "新建集卡中奖属性配置")
public void createClCardPropTest() throws Exception{
String savePropertyUrl = ManagerHost + "/newmanager/clcard/saveProperty";
this.prepareData("create");
Map<String,Object> map = new HashMap<>();
map.put("clName","集卡规则-中奖属性-新建测试");
map.put("propsKeyList",propKeys);
map.put("rules",rules);
JSONObject jsonParam = JSONObject.parseObject(JSON.toJSONString(map));
// logger.info("jsonParam的信息为"+ jsonParam);
Response response = given().contentType("application/json;charset=UTF-8").cookies(authorization.ssoLogin()).body(jsonParam).post("http://"+savePropertyUrl);
response.prettyPrint();
Assert.assertEquals(response.jsonPath().getString("success"),"true","新建集卡属性配置失败");
newId = response.jsonPath().getString("data");
logger.info("校验新建集卡属性配置成功,新建的中奖属性配置id为"+newId);
// logger.info("新建的规则id为"+newId);
}
@Test(priority = 2,description = "修改集卡中奖属性配置")
public void editClCardPropTest() throws Exception{
String savePropertyUrl = ManagerHost + "/newmanager/clcard/saveProperty";
this.prepareData("edit");
Map<String,Object> map = new HashMap<>();
map.put("clName","集卡规则-中奖属性-修改测试");
map.put("propsKeyList",propKeys);
map.put("rules",rules);
map.put("id",newId);
JSONObject jsonParam = JSONObject.parseObject(JSON.toJSONString(map));
// logger.info("jsonParam的信息为"+ jsonParam);
Response response = given().contentType("application/json;charset=UTF-8").cookies(authorization.ssoLogin()).body(jsonParam).post("http://"+savePropertyUrl);
response.prettyPrint();
//校验修改内容
Map<String,Object> selectResult = jdbc.findSimpleResult("select * from act_com_conf.tb_clcard_config where id =?",newId);
List<String> rules = JSONArray.parseArray(selectResult.get("rules").toString(),String.class);
CLRuleDto dto1 = JSONObject.parseObject(rules.get(0),CLRuleDto.class);
CLRuleDto dto2 = JSONObject.parseObject(rules.get(1),CLRuleDto.class);
// logger.info("dto1的信息为"+JSON.toJSONString(dto1));
Assert.assertEquals(selectResult.get("cl_name").toString(),"集卡规则-中奖属性-修改测试","修改cl_name失败");
Assert.assertEquals(dto1.getProperyVal().toString(),"3","修改propsVaul失败");
Assert.assertEquals(dto2.getTitle().toString(),"D5-修改","修改title失败");
logger.info("校验修改propsVaul、title成功");
}
@Test(priority = 3,description = "删除集卡中奖属性配置")
public void deleteClCardPropTest() throws Exception{
String deleteUrl = ManagerHost + "/newmanager/clcard/deleteById";
Map<String,String> map = new HashMap<>();
map.put("id",newId);
Response response = given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.ssoLogin()).params(map).get("http://"+deleteUrl);
response.prettyPrint();
Assert.assertTrue(response.jsonPath().get("success"),"删除中奖配置失败");
//校验修改内容
Map<String,Object> selectResult = jdbc.findSimpleResult("select * from act_com_conf.tb_clcard_config where id =?",newId);
Assert.assertEquals(selectResult.get("deleted").toString(),"true","删除中奖条件失败");
logger.info("校验删除属性配置成功");
}
public void prepareData(String type) throws Exception {
propKeys = new ArrayList<>();
Map<String,Object> propKey1 = new HashMap<>();
propKey1.put("name","增加倍数");
propKey1.put("value","plus_multiple");
Map<String,Object> propKey2 = new HashMap<>();
propKey2.put("name","减少倍数");
propKey2.put("value","plus_score");
Map<String,Object> propKey3 = new HashMap<>();
propKey3.put("name","增加分数");
propKey3.put("value","plus_multiple");
Map<String,Object> propKey4 = new HashMap<>();
propKey4.put("name","减少分数");
propKey4.put("value","reduce_score");
propKeys.add(propKey1);
propKeys.add(propKey2);
propKeys.add(propKey3);
propKeys.add(propKey4);
rules = new ArrayList<>();
Map<String,Object> rule1 = new HashMap<>();
Map<String,Object> propKey11 = new HashMap<>();
if (type.equals("edit")){
rule1.put("propName","增加倍数");
rule1.put("type","collectGoods");
propKey11.put("properyVal","3");
rule1.put("properyVal","3");//修改
}else if (type.equals("create")){
propKey11.put("properyVal","5");
rule1.put("properyVal","5");
}
propKey11.put("propName","增加倍数");
propKey11.put("properyKey","plus_multiple");
rule1.put("id","27179");
rule1.put("img","//yun.dui88.com/images/201804/6llpke07o7.png");
rule1.put("name","【勿动】自动化-E5");
rule1.put("propery",JSONObject.parseObject(JSON.toJSONString(propKey11)));
rule1.put("properyKey","plus_multiple");
rule1.put("selImg","//yun.dui88.com/images/201804/4o6m5hym9f.png");
rule1.put("title","E5");
Map<String,Object> rule2 = new HashMap<>();
Map<String,Object> propKey22 = new HashMap<>();
if (type.equals("edit")){
rule2.put("propName","减少倍数");
rule2.put("type","collectGoods");
rule2.put("title","D5-修改");//修改
}else if (type.equals("create")){
rule2.put("title","D5");
}
propKey22.put("propName","减少倍数");
propKey22.put("properyKey","plus_score");
propKey22.put("properyVal","3");
rule2.put("id","27178");
rule2.put("img","//yun.dui88.com/images/201804/fzi156of2i.png");
rule2.put("name","【勿动】自动化-D5");
rule2.put("propery",JSONObject.parseObject(JSON.toJSONString(propKey22)));
rule2.put("properyKey","reduce_multiple");
rule2.put("properyVal","3");
rule2.put("selImg","//yun.dui88.com/images/201804/eqyz7bkicr.png");
Map<String,Object> rule3 = new HashMap<>();
Map<String,Object> propKey33 = new HashMap<>();
propKey33.put("propName","增加分数");
propKey33.put("properyKey","plus_multiple");
propKey33.put("properyVal","100");
rule3.put("id","27177");
rule3.put("img","//yun.dui88.com/images/201804/iml7vof7pl.png");
rule3.put("name","【勿动】自动化-C5");
rule3.put("propery",JSONObject.parseObject(JSON.toJSONString(propKey3)));
rule3.put("properyKey","plus_score");
rule3.put("properyVal","100");
rule3.put("selImg","//yun.dui88.com/images/201804/v2bkoqt94t.png");
rule3.put("title","C5");
if (type.equals("edit")){
rule3.put("propName","增加分数");
rule3.put("type","collectGoods");
}
Map<String,Object> rule4 = new HashMap<>();
Map<String,Object> propKey44 = new HashMap<>();
propKey44.put("propName","减少分数");
propKey44.put("properyKey","reduce_score");
propKey44.put("properyVal","50");
rule4.put("id","27176");
rule4.put("img","//yun.dui88.com/images/201804/mof8hzzh95.png");
rule4.put("name","【勿动】自动化-B5");
rule4.put("propery",JSONObject.parseObject(JSON.toJSONString(propKey4)));
rule4.put("properyKey","reduce_score");
rule4.put("properyVal","50");
rule4.put("selImg","//yun.dui88.com/images/201804/gzfoni8w0i.png");
rule4.put("title","B5");
if (type.equals("edit")){
rule4.put("propName","减少分数");
rule4.put("type","collectGoods");
}
rules.add(rule1);
rules.add(rule2);
rules.add(rule3);
rules.add(rule4);
}
@AfterClass
public void tearDown() {
try {
Boolean result = jdbc.update("delete from act_com_conf.tb_clcard_config where id =?",newId);
} catch (SQLException e) {
e.printStackTrace();
}
}
}
\ No newline at end of file
package http.enums;
/**
* 出奖方式
* Created by hubinbin on 2018/4/4.
*/
public enum ActivityDataTypeEnum {
HDTOOL("hdtool","概率出奖"),
QUESTION("question","答题"),
QHDTOOL("qhdtool","答题活动-概率出奖"),
GUESS("guess","竞猜"),
GAME("game","游戏前置开奖"),
THOUGH("through","闯关游戏");
String key;
String desc;
ActivityDataTypeEnum(String key,String desc){
this.key = key;
this.desc = desc;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}
package http.enums;
/**
* 奖品类型枚举 (支付宝 福袋 谢谢参与等..)
* Created by hubinbin on 2018/4/12.
*/
public enum PrizeTypeEnum {
PHONEBILL("phonebill","话费充值"),
ALIPAY("alipay","支付宝充值"),
QB("qb","Q币"),
OBJECT("object","实物商品"),
COUPON("coupon","优惠券"),
LUCKY("lucky","幸运奖"),
THANKS("thanks","谢谢参与");
String type;
String desc;
PrizeTypeEnum(String type,String desc) {
this.type = type;
this.desc = desc;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}
This diff is collapsed.
/**
* Copyright (C), 2015-2018
* FileName: BetMngVo
* Author: qianwenjun
* Date: 2018/8/5 10:12
* Description:
*/
package http.model;
import java.util.List;
/**
* 〈〉
*
* @author qianwenjun
* @create 2018/8/5
* @since 1.0.0
*/
public class BetMngVo {
public List<BetOptionVo> getBetOptionDtoList() {
return betOptionDtoList;
}
public void setBetOptionDtoList(List<BetOptionVo> betOptionDtoList) {
this.betOptionDtoList = betOptionDtoList;
}
private List<BetOptionVo> betOptionDtoList;
private String betType;
private String bonusAmount;
private String bonusType;
private String configStatus;
private String creditsValue;
private String endTime;
private String shareExp;
private String startTime;
private String title;
private String id;
private String pluginId;
private String prizeLimit;
public String getPluginId() {
return pluginId;
}
public void setPluginId(String pluginId) {
this.pluginId = pluginId;
}
public String getPrizeLimit() {
return prizeLimit;
}
public void setPrizeLimit(String prizeLimit) {
this.prizeLimit = prizeLimit;
}
public String getBetType() {
return betType;
}
public void setBetType(String betType) {
this.betType = betType;
}
public String getBonusAmount() {
return bonusAmount;
}
public void setBonusAmount(String bonusAmount) {
this.bonusAmount = bonusAmount;
}
public String getBonusType() {
return bonusType;
}
public void setBonusType(String bonusType) {
this.bonusType = bonusType;
}
public String getConfigStatus() {
return configStatus;
}
public void setConfigStatus(String configStatus) {
this.configStatus = configStatus;
}
public String getCreditsValue() {
return creditsValue;
}
public void setCreditsValue(String creditsValue) {
this.creditsValue = creditsValue;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
public String getShareExp() {
return shareExp;
}
public void setShareExp(String shareExp) {
this.shareExp = shareExp;
}
public String getStartTime() {
return startTime;
}
public void setStartTime(String startTime) {
this.startTime = startTime;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}
\ No newline at end of file
/**
* Copyright (C), 2015-2018
* FileName: BetMobileVo
* Author: qianwenjun
* Date: 2018/8/5 14:09
* Description:
*/
package http.model;
import java.util.List;
/**
* 〈〉
*
* @author qianwenjun
* @create 2018/8/5
* @since 1.0.0
*/
public class BetMobileVo {
public BetConfig getBetConfig() {
return betConfig;
}
public void setBetConfig(BetConfig betConfig) {
this.betConfig = betConfig;
}
public List<Option> getOptions() {
return options;
}
public void setOptions(List<Option> options) {
this.options = options;
}
private BetConfig betConfig;
private List<Option> options;
public String getPrizeName() {
return prizeName;
}
public void setPrizeName(String prizeName) {
this.prizeName = prizeName;
}
private String prizeName;
//静态内部类
//JSON反序列化失败的原因是序列化框架不知道BetConfig是内部类,所以需要定义成静态的
public static class BetConfig{
public BetConfig(){}
private String betType;
private String bonusType;
private String configStatus;
private String creditsValue;
private String endTime;
private String shareExp;
private String id;
private String startTime;
private String title;
private String unitName;
public String getPluginId() {
return pluginId;
}
public void setPluginId(String pluginId) {
this.pluginId = pluginId;
}
private String pluginId;
public String getBetType() {
return betType;
}
public void setBetType(String betType) {
this.betType = betType;
}
public String getBonusType() {
return bonusType;
}
public void setBonusType(String bonusType) {
this.bonusType = bonusType;
}
public String getConfigStatus() {
return configStatus;
}
public void setConfigStatus(String configStatus) {
this.configStatus = configStatus;
}
public String getCreditsValue() {
return creditsValue;
}
public void setCreditsValue(String creditsValue) {
this.creditsValue = creditsValue;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
public String getShareExp() {
return shareExp;
}
public void setShareExp(String shareExp) {
this.shareExp = shareExp;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getStartTime() {
return startTime;
}
public void setStartTime(String startTime) {
this.startTime = startTime;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getUnitName() {
return unitName;
}
public void setUnitName(String unitName) {
this.unitName = unitName;
}
}
public static class Option{
public Option(){
}
public String getBetTimes() {
return betTimes;
}
public void setBetTimes(String betTimes) {
this.betTimes = betTimes;
}
public String getChooseThisOption() {
return chooseThisOption;
}
public void setChooseThisOption(String chooseThisOption) {
this.chooseThisOption = chooseThisOption;
}
public String getOptionId() {
return optionId;
}
public void setOptionId(String optionId) {
this.optionId = optionId;
}
public String getOptionImg() {
return optionImg;
}
public void setOptionImg(String optionImg) {
this.optionImg = optionImg;
}
public String getOptionName() {
return optionName;
}
public void setOptionName(String optionName) {
this.optionName = optionName;
}
private String betTimes;
private String chooseThisOption;
private String optionId;
private String optionImg;
private String optionName;
}
}
\ No newline at end of file
/**
* Copyright (C), 2015-2018
* FileName: BetOptionVo
* Author: qianwenjun
* Date: 2018/7/31 15:59
* Description:
*/
package http.model;
/**
* 〈〉
*
* @author qianwenjun
* @create 2018/7/31
* @since 1.0.0
*/
public class BetOptionVo {
private String optionImg;
private String optionName;
public String getOptionImg() {
return optionImg;
}
public void setOptionImg(String optionImg) {
this.optionImg = optionImg;
}
public String getOptionName() {
return optionName;
}
public void setOptionName(String optionName) {
this.optionName = optionName;
}
}
\ No newline at end of file
/**
* Copyright (C), 2015-2018
* FileName: CollectGoodsInfo
* Author: qianwenjun
* Date: 2018/10/12 15:25
* Description:
*/
package http.model;
/**
* 〈〉
*
* @author qianwenjun
* @create 2018/10/12
* @since 1.0.0
*/
//@Setter
//@Getter
//@Builder
public class CollectGoodsInfo {
private String count;
private String id;
private String img;
public String getCount() {
return count;
}
public void setCount(String count) {
this.count = count;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getImg() {
return img;
}
public void setImg(String img) {
this.img = img;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
private String name;
}
\ No newline at end of file
This diff is collapsed.
/**
* Copyright (C), 2015-2018
* FileName: GameOptionVo
* Author: qianwenjun
* Date: 2018/9/4 16:05
* Description:
*/
package http.model;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
/**
* 〈〉
*
* @author qianwenjun
* @create 2018/9/4
* @since 1.0.0
*/
@Getter
@Setter
@Builder
public class GameOptionVo {
private String id;
private String img;
private String show;
private String prizeTag;
private String description;
private String guarantee;
private String optionLimitCount;
private String limitDays;
private String limitTimeType;
private String rate;
private String value;
private String limit;
private String low;
private String oldRemaind;
private String isMutliPrizeLimit;
private String autoOpen;
private String remaind;
private String appItemId;
private String type;
private String title;
public void setAllDefault(){
this.img = "/yun.duiba.com.cn/developer/img/activityTool/shake/alipay.png";
this.show = "true";
this.prizeTag = "null";
this.description = "";
this.guarantee = "false";
this.optionLimitCount = "";
this.limitDays = "";
this.limitTimeType = "";
this.rate = "null";
this.value = "1";
this.limit = "null";
this.low = "null";
this.oldRemaind = "null";
this.isMutliPrizeLimit = "false";
}
}
\ No newline at end of file
/**
* Copyright (C), 2015-2018
* FileName: GameVo
* Author: qianwenjun
* Date: 2018/9/4 16:09
* Description:
*/
package http.model;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
/**
* 〈〉
*
* @author qianwenjun
* @create 2018/9/4
* @since 1.0.0
*/
@Getter
@Setter
@Builder
@AllArgsConstructor
public class GameVo {
private String id;
private String switches;
private String openBlack = "false";
private String openFreeRule = "false";
private String openMutliPrizeLimit = "false";
private String openCoinPusher = "false";
private String openSpecify = "false";
private String theme = "girl";
private String shareApp;
private String skin;
private String mutliPrizeLimitCount;
private String duibaGameBrickId = "1";//皮肤id
private String recommendSkinStatus = "open";//推荐位开关-开
private String rule = "规则";
private String freeRule;
private String banner = "//yun.duiba.com.cn/upload/jj8peq2vqe.png";
private String bannerImgNew = "//yun.duiba.com.cn/upload/cxumauf7d9.png";
private String whiteImage = "//yun.duiba.com.cn/upload/njs3rmzom5.jpg";
private String recommendImage = "//yun.duiba.com.cn/upload/ub0gy7947h.png";
private String logo = "//yun.duiba.com.cn/upload/188mxc3qbw.jpg";
private String showcaseOne;
private String showcaseTwoOrThree;
private String anticheatLimit = "false";//多奖项限制
private String channelType = "0";//投放渠道
private String activityCategoryId = "-1";//归类-无
private String deletedIds;
private String tag = "null";
private String createUser;
private String plotterUser;
private String consumptionRate;
//要填写
private String title;
private String creditsPrice;
private String limitCount;
private String limitScope;
private String freeLimit;
private String freeScope;
private String optionsJson;
private String autoOffDate;
private String unopen;
private String openTotalScore;//是否累计得分开奖-关;false
private String dailyRankType;//0-单次最近
public void setAllDefault(){
this.rule = "规则规则";
this.openBlack = "false";
this.openFreeRule = "false";
this.openMutliPrizeLimit = "false";
this.openCoinPusher = "false";
this.openSpecify = "false";
this.theme = "girl";
this.duibaGameBrickId = "1";//皮肤id
this.recommendSkinStatus = "open";//推荐位开关-开
this.banner = "//yun.duiba.com.cn/upload/jj8peq2vqe.png";
this.bannerImgNew = "//yun.duiba.com.cn/upload/cxumauf7d9.png";
this.whiteImage = "//yun.duiba.com.cn/upload/njs3rmzom5.jpg";
this.recommendImage = "//yun.duiba.com.cn/upload/ub0gy7947h.png";
this.logo = "//yun.duiba.com.cn/upload/188mxc3qbw.jpg";
this.anticheatLimit = "false";//多奖项限制
this.channelType = "0";//投放渠道
this.activityCategoryId = "-1";//归类-无
this.tag = "null";
}
public static void main(String[] args) {
// GameVo game = GameVo.builder().title("【勿动】自动化-测试开大奖游戏").creditsPrice("100")
// .limitScope("everyday").freeLimit("100").freeScope("everyday")
// .optionsJson("[{\"type\":\"phonebill\",\"title\":\"第一名\",\"img\":\"//yun.duiba.com.cn/developer/img/activityTool/shake/phone.png\",\"show\":true,\"prizeTag\":null,\"description\":\"\",\"guarantee\":false,\"optionLimitCount\":\"\",\"limitDays\":\"\",\"limitTimeType\":\"\",\"rate\":null,\"appItemId\":1,\"value\":\"1\",\"limit\":null,\"low\":null,\"remaind\":\"1\",\"oldRemaind\":null,\"isMutliPrizeLimit\":false,\"autoOpen\":false},{\"type\":\"alipay\",\"title\":\"2-3名\",\"img\":\"//yun.duiba.com.cn/developer/img/activityTool/shake/alipay.png\",\"show\":true,\"prizeTag\":null,\"description\":\"\",\"guarantee\":false,\"optionLimitCount\":\"\",\"limitDays\":\"\",\"limitTimeType\":\"\",\"rate\":null,\"appItemId\":55,\"value\":\"1\",\"limit\":null,\"low\":null,\"remaind\":\"2\",\"oldRemaind\":null,\"isMutliPrizeLimit\":false,\"autoOpen\":false}]")
// .unopen("0").autoOffDate("2018-09-05 23:00")
// .openTotalScore("false").dailyRankType("0").build();
// game.setAllDefault();
//
// System.out.println(JSONObject.toJSONString(game));
}
}
\ No newline at end of file
package http.model;
import java.util.HashMap;
import java.util.Map;
/**
* Created by hanzhanli on 2017/7/18.
*/
public class Hello {
private static Map<String,String> dafuwengCookies = new HashMap<>();
public static void main(String[] args) {
Hello hello = new Hello();
if(hello.dafuwengCookies==null){
System.out.println("it is null");
}
if(hello.dafuwengCookies.size()==0){
System.out.println("it is 0");
}
}
}
package http.model;
/**
* Created by hubinbin on 2018/4/8.
*/
public class QuestionAnswerVO {
private Integer id; //题目id
private Integer option; //用户选择答案
public QuestionAnswerVO(){}
public QuestionAnswerVO(Integer id,Integer option){
this.id = id;
this.option = option;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getOption() {
return option;
}
public void setOption(Integer option) {
this.option = option;
}
}
/**
* Copyright (C), 2015-2018
* FileName: UserInfo
* Author: qianwenjun
* Date: 2018/9/6 13:33
* Description:
*/
package http.model;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
/**
* 〈〉
*
* @author qianwenjun
* @create 2018/9/6
* @since 1.0.0
*/
@Setter
@Getter
@Builder
public class UserInfo {
private Integer uid;
private String consumerId;
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
package http.service.Activity;
import base.DuibaLog;
import io.restassured.http.Cookies;
import io.restassured.response.Response;
import org.springframework.stereotype.Service;
import org.testng.Assert;
import java.util.HashMap;
import java.util.Map;
import static io.restassured.RestAssured.given;
@Service
public class NewtoolsService {
// @Value("${activity.host}")
// String activityHost;
private String activityHost = "http://activity.m.duibatest.com.cn";
private DuibaLog logger = DuibaLog.getLogger();
public Response autoLogin(Cookies cookies,String appKey){
Map<String,String> map = new HashMap<>();
map.put("appKey",appKey);
Response response = given().cookies(cookies).params(map).post(activityHost+"/activity/autoLogin");
response.prettyPrint();
System.out.println(response.getDetailedCookies());
return response;
}
public Cookies getCookies(String id,String appKey){
String url = activityHost+"/activity/acShareIndex?url="+activityHost+"/newtools/index?id="+id+"&apk="+appKey;
Response response = given().get(url);
response.prettyPrint();
System.out.println(response.getDetailedCookies().toString());
return response.getDetailedCookies();
}
public Response index(Cookies cookies,String id) throws Exception {
String testUrl = activityHost+"/hdtool/index";
Map<String,String> map = new HashMap<>();
map.put("id",id);
Response response = given().cookies(cookies).params(map).get(testUrl);
try{
Assert.assertEquals(String.valueOf(response.getStatusCode()).trim(),"200");
}catch(Exception e){
throw new Exception("/newtools/index接口返回异常,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("/newtools/index接口返回异常,返回信息:"+response.asString());
}
return response;
}
public Response getOrderStatus(Cookies cookies,String orderid) throws Exception {
String testUrl = activityHost+"/hdtool/getOrderStatus";
Map<String,String> map = new HashMap<>();
map.put("orderid",orderid);
logger.info("请求/hdtool/getOrderStatus");
Response response = given().cookies(cookies).params(map).post(testUrl);
response.prettyPrint();
try{
Assert.assertEquals(response.jsonPath().getString("success"),"true");
}catch(Exception e){
throw new Exception("/newtools/getOrderStatus接口返回异常,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("/newtools/getOrderStatus接口返回异常,返回信息:"+response.asString());
}
return response;
}
public static void main(String[] args) {
// NewtoolsService service = new NewtoolsService();
// //service.index("17236");
// Cookies cookies = service.getCookies("17236","2wGQc3MZaQsqYFWcX4gguya5PnnS");
// Response response = service.autoLogin(cookies,"2wGQc3MZaQsqYFWcX4gguya5PnnS");
// service.index(response.getDetailedCookies(),"17236");
}
}
package http.service.Activity;
import base.DuibaLog;
import http.service.Authorization;
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;
/**
* 游戏活动
*/
@Service
public class NgapiService {
@Autowired
Authorization authorization;
@Value("${activity.host}")
String activityHost;
private DuibaLog logger = DuibaLog.getLogger();
public Response dostart(int uid,String id,String token) throws Exception {
Map<String,String> map = new HashMap<>();
map.put("id",id);
map.put("token",token);
logger.info("请求dostart接口,activityId="+id);
Response response = given().cookies(authorization.dafuwengLogin(uid)).params(map).post(activityHost+"/ngapi/dostart");
try{
Assert.assertEquals(response.jsonPath().getString("success"),"true","/ngapi/dostart接口失败");
}catch(Exception e){
throw new Exception("/ngapi/dostart接口失败,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("/ngapi/dostart接口失败,返回信息:"+response.asString());
}
return response;
}
public Response getStartStatus(int uid, String ticketId ) throws Exception {
Map<String,String> map = new HashMap<>();
map.put("ticketId",ticketId);
logger.info("请求getOrderStatus接口,ticketId="+ticketId);
Response response = given().cookies(authorization.dafuwengLogin(uid)).params(map).post(activityHost+"/ngapi/getStartStatus");
try{
Assert.assertEquals(response.jsonPath().getString("success"),"true","/ngapi/getStartStatus接口失败");
}catch(Exception e){
throw new Exception("/ngapi/getStartStatus接口失败,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("/ngapi/getStartStatus接口失败,返回信息:"+response.asString());
}
return response;
}
public Response submit(int uid, String ticketId,String device) throws Exception {
Map<String,String> map = new HashMap<>();
map.put("ticketId",ticketId);
map.put("score","2");
map.put("gameData","[{\"num\":1,\"time\":2482,\"pyby\":\"821,819\",\"xy\":\"0,0\",\"player\":\"0,904\"},{\"num\":2,\"time\":583,\"pyby\":\"825,819\",\"xy\":\"0,0\",\"player\":\"126,903\"}]");
map.put("sgin","2b3eca2eebc580e2d06d68df576d2ec0");
Map<String,String> maphead = new HashMap<>();
if ( device.equals("iOS")) {
maphead.put("User-Agent", "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) CriOS/56.0.2924.75 Mobile/14E5239e Safari/602.1");
}else{
maphead.put("User-Agent", "Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Mobile Safari/537.36");
}
logger.info("请求submit接口,ticketId="+ticketId);
Response response = given().headers(maphead).cookies(authorization.dafuwengLogin(uid)).params(map).post(activityHost+"/ngapi/submit");
try{
Assert.assertEquals(response.jsonPath().getString("success"),"true","/ngapi/submit接口失败");
}catch(Exception e){
throw new Exception("/ngapi/submit接口失败,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("/ngapi/submit接口失败,返回信息:"+response.asString());
}
return response;
}
}
/**
* Copyright (C), 2015-2018
* FileName: PkService
* Author: qianwenjun
* Date: 2018/8/5 11:37
* Description:
*/
package http.service.Activity;
import base.DuibaLog;
import http.service.Authorization;
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;
/**
* 〈〉
*
* @author qianwenjun
* @create 2018/8/5
* @since 1.0.0
*/
@Service
public class PkService {
@Autowired
Authorization authorization;
@Value("${activity.host}")
String activityHost;
private DuibaLog logger = DuibaLog.getLogger();
public Response getBetList(Integer uid) throws Exception{
String url = activityHost + "/betActivity2/list";
Map<String,Object> map = new HashMap<>();
map.put("pageNo","1");
map.put("pageSize","30");
Response response = given().cookies(authorization.dafuwengLogin(uid)).params(map).get(url);
// response.prettyPrint();
try{
Assert.assertEquals(response.jsonPath().getString("success"),"true");
}catch(Exception e){
throw new Exception("手机端获取pk列表接口失败,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("手机端获取pk列表接口失败,返回信息:"+response.asString());
}
return response;
}
public Response doJoin(Integer uid,String betId,String optionId) throws Exception{
String url = activityHost + "/betActivity2/doJoin";
Map<String,Object> map = new HashMap<>();
map.put("betId",betId);
map.put("optionId",optionId);
Response response = given().cookies(authorization.dafuwengLogin(uid)).params(map).post(url);
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;
}
public Response doJoin2(Integer uid,String betId,String optionId) throws Exception{
String url = activityHost + "/betActivity2/doJoin";
Map<String,Object> map = new HashMap<>();
map.put("betId",betId);
map.put("optionId",optionId);
Response response = given().cookies(authorization.dafuwengLogin(uid)).params(map).post(url);
return response;
}
public Response doJoin3(String betId,String optionId) throws Exception{
String url = activityHost + "/betActivity2/doJoin";
Map<String,Object> map = new HashMap<>();
map.put("betId",betId);
map.put("optionId",optionId);
Response response = given().params(map).post(url);
return response;
}
public Response getOrderStatus(Integer uid,String orderNum) throws Exception{
String url = activityHost + "/betActivity2/getOrderStatus";
Map<String,Object> map = new HashMap<>();
map.put("orderNum",orderNum);
Response response = given().cookies(authorization.dafuwengLogin(uid)).params(map).get(url);
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;
}
}
\ No newline at end of file
package http.service.Activity;
import base.DuibaLog;
import http.service.Authorization;
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 mabo on 2018/8/15
*/
@Service
public class SeedRedPacketService {
@Autowired
Authorization authorization;
@Value("${activity.host}")
String activityHost;
private DuibaLog logger = DuibaLog.getLogger();
public Response getLandList(Map cookies,String activityId,String floorId) throws Exception {
Map<String,String> map = new HashMap<>();
map.put("floorId",floorId);
map.put("activityId",activityId);
logger.info("请求getLandList接口,activityId="+activityId);
Response response = given().cookies(cookies).params(map).get(activityHost+"/seedRedPacket/getLandList");
try{
Assert.assertEquals(response.jsonPath().getString("success"),"true","/seedRedPacket/getLandList接口失败");
}catch(Exception e){
throw new Exception("/seedRedPacket/getLandList接口失败,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("/seedRedPacket/getLandList接口失败,返回信息:"+response.asString());
}
return response;
}
public Response seed(Map cookies,String activityId,String floorId,String landId) throws Exception {
Map<String,String> map = new HashMap<>();
map.put("floorId",floorId);
map.put("activityId",activityId);
map.put("landId",landId);
map.put("dcm","228.4.2.0");
map.put("dpm","19380.5.424.4");
logger.info("请求seed接口,activityId="+activityId);
Response response = given().cookies(cookies).params(map).get(activityHost+"/seedRedPacket/seed");
try{
Assert.assertEquals(response.jsonPath().getString("success"),"true","/seedRedPacket/seed接口失败");
}catch(Exception e){
throw new Exception("/seedRedPacket/seed接口失败,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("/seedRedPacket/seed接口失败,返回信息:"+response.asString());
}
return response;
}
public Response getOrderStatus(Map cookies,String orderId) throws Exception {
Map<String,String> map = new HashMap<>();
map.put("orderId",orderId);
logger.info("请求getOrderStatus接口,orderId="+orderId);
Response response = given().cookies(cookies).params(map).get(activityHost+"/seedRedPacket/getOrderStatus");
try{
Assert.assertEquals(response.jsonPath().getString("success"),"true","/seedRedPacket/getOrderStatus接口失败");
}catch(Exception e){
throw new Exception("/seedRedPacket/getOrderStatus接口失败,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("/seedRedPacket/getOrderStatus接口失败,返回信息:"+response.asString());
}
return response;
}
public Response reap(Map cookies,String activityId,String redPacketId) throws Exception {
Map<String,String> map = new HashMap<>();
map.put("activityId",activityId);
map.put("redPacketId",redPacketId);
map.put("dcm","228.4.2.0");
map.put("dpm","19380.5.424.4");
logger.info("请求reap接口,redPacketId="+redPacketId);
Response response = given().cookies(cookies).params(map).get(activityHost+"/seedRedPacket/reap");
try{
Assert.assertEquals(response.jsonPath().getString("success"),"true","/seedRedPacket/reap接口失败");
}catch(Exception e){
throw new Exception("/seedRedPacket/reap接口失败,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("/seedRedPacket/reap接口失败,返回信息:"+response.asString());
}
return response;
}
/**
* 解锁土地
* @param cookies
* @param activityId
* @param landId
* @return
* @throws Exception
*/
public Response unlockLand(Map cookies,String activityId,String floorId,String landId) throws Exception {
Map<String,String> map = new HashMap<>();
map.put("activityId",activityId);
map.put("floorId",floorId);
map.put("landId",landId);
map.put("dcm","228.4.2.0");
map.put("dpm","19380.5.424.4");
logger.info("请求unlockLand接口,landId="+landId);
Response response = given().cookies(cookies).params(map).get(activityHost+"/seedRedPacket/unlockLand");
try{
Assert.assertEquals(response.jsonPath().getString("success"),"true","/seedRedPacket/unlockLand接口失败");
}catch(Exception e){
throw new Exception("/seedRedPacket/unlockLand接口失败,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("/seedRedPacket/unlockLand接口失败,返回信息:"+response.asString());
}
return response;
}
/**
* 修改土地解锁状态后门
* @param appId
* @param activityId
* @param landId
* @param consumerId
* @param landStatus
* @return
* @throws Exception
*/
public Response updateUserLand(String appId,String activityId,String landId,String consumerId,String landStatus) throws Exception {
Map<String,String> map = new HashMap<>();
map.put("activityId",activityId);
map.put("appId",appId);
map.put("landId",landId);
map.put("consumerId",consumerId);
map.put("landStatus",landStatus);
logger.info("请求修改用户土地信息后门接口");
Response response = given().params(map).get(activityHost+"/seedRedPacket/updateUserLand");
try{
Assert.assertEquals(response.jsonPath().getString("success"),"true","/seedRedPacket/updateUserLand接口失败");
}catch(Exception e){
throw new Exception("/seedRedPacket/updateUserLand接口失败,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("/seedRedPacket/updateUserLand接口失败,返回信息:"+response.asString());
}
return response;
}
}
This diff is collapsed.
/**
* Copyright (C), 2015-2018
* FileName: TradeService
* Author: qianwenjun
* Date: 2018/6/15 15:32
* Description:
*/
package http.service.Activity;
import base.DuibaLog;
import http.service.Authorization;
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 java.util.HashMap;
import java.util.Map;
import static io.restassured.RestAssured.given;
/**
* 〈〉
*
* @author qianwenjun
* @create 2018/6/15
* @since 1.0.0
*/
@Service
public class TradeService {
@Autowired
@Value("${trade.host}")
private String tradeHost;
@Autowired
Authorization authorization;
private static DuibaLog logger = DuibaLog.getLogger();
public Response recordDetail(String orderId,Integer uid) {
String url = tradeHost + "/crecord/recordDetail";
Map<String,Object> map = new HashMap<>();
map.put("orderId",orderId);
map.put("after","1");
Response response = given().cookies(authorization.dafuwengLogin(uid)).params(map).get(url);
return response;
}
}
\ No newline at end of file
This diff is collapsed.
...@@ -243,6 +243,24 @@ public class Authorization { ...@@ -243,6 +243,24 @@ public class Authorization {
return hdCookiesSaas; return hdCookiesSaas;
} }
public Map hdLoginSaas(String appId){
Response token=this.hdGetToken();
String url = PROTOCOL + hdHost + hdLoginPath;
Map<String,String> cookies=token.getCookies();
Map<String, String> paras = new HashMap<>();
paras.put("email", "wxs@duiba.com.cn");
paras.put("password", SecurityUtils.getMD5("dbZcFiIc5yMHcee/o/PJEfyZjug="+from(token.asString()).getString("data.loginsToken")));
paras.put("redirect", "/redirectApp");
paras.put("isAutoLogin", "true");
Response response = given().cookies(cookies).params(paras).post(url);
Map<String,String> hdCookiesSaasByApp=new HashMap<>(response.getCookies());
//取消安全校验
hdCookiesSaasByApp.remove("csrf_token");
hdCookiesSaasByApp.put("appId",appId);
return hdCookiesSaasByApp;
}
//密码为duibaduiba123 //密码为duibaduiba123
public Map hdLoginCommon(String email){ public Map hdLoginCommon(String email){
int i=10; int i=10;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
package http.service.app;
public class SupplierProdurtService {
}
This diff is collapsed.
This diff is collapsed.
package http.service.hd;
import org.springframework.stereotype.Service;
/**
* 游戏接口服务
* 对应activity-access-web中的ActivityGameCtrl类
*
* Created by hubinbin on 2018/4/12.
*/
@Service
public class ActivityGameCtrlService {
/**
* 查询前置开奖 结果
* @param orderId
*/
public void getOrderInfo(Long orderId) {
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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