Commit 71f930b2 authored by 吕雯燕's avatar 吕雯燕

lv

parent c5bec6fa
......@@ -504,6 +504,78 @@ public class gawService {
return response;
}
//新Qb兑换接口
public Response qbExchange (int uid, String actualCredits, String degreeId, String appItemId, String credits, String qq) throws Exception {
Map<String,Object> map = new HashMap<>();
Map<String,Object> mapList = new HashMap<>();
List<Map> list = new ArrayList<>();
mapList.put("appItemId",appItemId);
mapList.put("credits",credits);
list.add(mapList);
map.put("actualCredits",actualCredits); //总积分
map.put("actualPrice","0");
map.put("degreeId",degreeId);
map.put("itemParam",list.toArray());
map.put("qq",qq);
map.put("remark","");
map.put("token","yrJRr7Cddp2YeQd");
map.put("validate","");
JSONObject jsonParam = JSONObject.parseObject(JSON.toJSONString(map));
logger.info("请求Qb兑换接口:"+ "/gaw/qbExchange/create");
Response response = given().contentType("application/json; charset=UTF-8").cookies(authorization.dafuwengLogin(uid)).body(jsonParam).post("http://"+goodsHost+"/gaw/qbExchange/create");
try{
Assert.assertEquals(response.jsonPath().getString("success"),"true");
}catch(Exception e){
throw new Exception("/gaw/qbExchange/create接口返回异常,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("/gaw/qbExchange/create接口返回异常,返回信息:"+response.asString());
}
return response;
}
public Response qbExchange (Map cookies, String actualCredits, String degreeId, String appItemId, String credits, String qq) throws Exception {
Map<String,Object> map = new HashMap<>();
Map<String,Object> mapList = new HashMap<>();
List<Map> list = new ArrayList<>();
mapList.put("appItemId",appItemId);
mapList.put("credits",credits);
list.add(mapList);
map.put("actualCredits",actualCredits); //总积分
map.put("actualPrice","0");
map.put("degreeId",degreeId);
map.put("itemParam",list.toArray());
map.put("qq",qq);
map.put("remark","");
map.put("token","yrJRr7Cddp2YeQd");
map.put("validate","");
JSONObject jsonParam = JSONObject.parseObject(JSON.toJSONString(map));
logger.info("请求Qb兑换接口:"+ "/gaw/qbExchange/create");
Response response = given().contentType("application/json; charset=UTF-8").cookies(cookies).body(jsonParam).post("http://"+goodsHost+"/gaw/qbExchange/create");
try{
Assert.assertEquals(response.jsonPath().getString("success"),"true");
}catch(Exception e){
throw new Exception("/gaw/qbExchange/create接口返回异常,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("/gaw/qbExchange/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