Commit a576a82e authored by 马博's avatar 马博

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/test/java/http/service/app/gawService.java
parents 999c5105 1f8fa83f
......@@ -15,5 +15,7 @@ public class Database {
public static String orders8 = "orders_0090";
public static String orders9 = "orders_0203";
public static String orders10 = "orders_0411";
public static String orders11 = "orders_0182";
}
......@@ -439,4 +439,7 @@ public class 兑吧新实物_兑换流程测试_ExchangeTest extends CheckTemple
}
......@@ -74,53 +74,9 @@ public class gawService {
return response;
}
//优惠券兑换接口
public Response couponExchange(int uid, String appItemId,int skuId) throws Exception {
Map<String,Object> map = new HashMap<>();
Map<String,Object> mapList = new HashMap<>();
List<Map> list = new ArrayList<>();
mapList.put("skuId",skuId);
mapList.put("appItemId",appItemId);
mapList.put("credits","100");
mapList.put("price",0);
list.add(mapList);
map.put("remark",""); //买家留言
map.put("degreeId","");
map.put("actualPrice","0"); //总金额
map.put("actualCredits","100"); //总积分
map.put("itemParam",list.toArray());
map.put("payType","3");
map.put("expressPrice","0");
map.put("validate","");
map.put("token","yrJRr7Cddp2YeQd");
JSONObject jsonParam = JSONObject.parseObject(JSON.toJSONString(map));
logger.info("请求实物兑换接口:"+ "/gaw/couponExchange/create");
Response response = given().contentType("application/json; charset=UTF-8").cookies(authorization.dafuwengLogin(uid)).body(jsonParam).post("http://"+goodsHost+"/gaw/couponExchange/create");
// Response saveResponse = given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.dafuwengLogin(uid)).params(map).post("http://"+goodsHost+"/gaw/objectExchange/create");
// response.prettyPrint();
try{
Assert.assertEquals(response.jsonPath().getString("success"),"true");
}catch(Exception e){
throw new Exception("/gaw/couponExchange/create接口返回异常,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("/gaw/couponExchange/create接口返回异常,返回信息:"+response.asString());
}
return response;
}
//sku兑换
//实物sku兑换
public Response objectExchange(Map cookies, String appItemId,String itemId,String skuId) throws Exception {
Map<String,Object> map = new HashMap<>();
......@@ -167,7 +123,7 @@ public class gawService {
}
//优惠券兑换接口
public Response couponExchange(Map cookie, String appItemId,int skuId) throws Exception {
public Response couponExchange(int uid, String appItemId,int skuId) throws Exception {
Map<String,Object> map = new HashMap<>();
Map<String,Object> mapList = new HashMap<>();
......@@ -192,7 +148,7 @@ public class gawService {
JSONObject jsonParam = JSONObject.parseObject(JSON.toJSONString(map));
logger.info("请求实物兑换接口:"+ "/gaw/couponExchange/create");
Response response = given().contentType("application/json; charset=UTF-8").cookies(cookie).body(jsonParam).post("http://"+goodsHost+"/gaw/couponExchange/create");
Response response = given().contentType("application/json; charset=UTF-8").cookies(authorization.dafuwengLogin(uid)).body(jsonParam).post("http://"+goodsHost+"/gaw/couponExchange/create");
// Response saveResponse = given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.dafuwengLogin(uid)).params(map).post("http://"+goodsHost+"/gaw/objectExchange/create");
......@@ -202,20 +158,22 @@ public class gawService {
Assert.assertEquals(response.jsonPath().getString("success"),"true");
}catch(Exception e){
throw new Exception("/gaw/couponExchange/create接口返回异常,返回信息:"+response.asString());
throw new Exception("/gaw/objectExchange/create接口返回异常,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("/gaw/couponExchange/create接口返回异常,返回信息:"+response.asString());
throw new Exception("/gaw/objectExchange/create接口返回异常,返回信息:"+response.asString());
}
return response;
}
//虚拟商品(充值)兑换接口
public Response virtualExchange(Map cookie, String appItemId,int skuId) throws Exception {
//优惠券兑换
public Response couponExchange(Map cookies, String appItemId,String itemId,String skuId) throws Exception {
Map<String,Object> map = new HashMap<>();
Map<String,Object> mapList = new HashMap<>();
List<Map> list = new ArrayList<>();
mapList.put("itemId",itemId);
mapList.put("skuId",skuId);
mapList.put("appItemId",appItemId);
mapList.put("credits","100");
......@@ -224,34 +182,33 @@ public class gawService {
map.put("remark",""); //买家留言
map.put("degreeId","");
map.put("actualPrice","0"); //总金额
map.put("actualCredits","100"); //总积分
map.put("itemParam",list.toArray());
map.put("payType","3");
map.put("expressPrice","0");
map.put("validate","");
map.put("token","yrJRr7Cddp2YeQd");
JSONObject jsonParam = JSONObject.parseObject(JSON.toJSONString(map));
logger.info("请求实物兑换接口:"+ "/gaw/virtualExchange/create");
Response response = given().contentType("application/json; charset=UTF-8").cookies(cookie).body(jsonParam).post("http://"+goodsHost+"/gaw/virtualExchange/create");
// Response saveResponse = given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.dafuwengLogin(uid)).params(map).post("http://"+goodsHost+"/gaw/objectExchange/create");
logger.info("请求实物兑换接口:"+ "/gaw/couponExchange/create");
Response response = given().contentType("application/json; charset=UTF-8").cookies(cookies).body(jsonParam).post("http://"+goodsHost+"/gaw/couponExchange/create");
// response.prettyPrint();
try{
Assert.assertEquals(response.jsonPath().getString("success"),"true");
}catch(Exception e){
throw new Exception("/gaw/virtualExchange/create接口返回异常,返回信息:"+response.asString());
throw new Exception("/gaw/couponExchange/create接口返回异常,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("/gaw/virtualExchange/create接口返回异常,返回信息:"+response.asString());
throw new Exception("/gaw/couponExchange/create接口返回异常,返回信息:"+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