Commit 711f0b44 authored by wangxiaoshuang's avatar wangxiaoshuang

wxs

parent 12e07b97
...@@ -21,13 +21,87 @@ public class DuibadoUpdateObject { ...@@ -21,13 +21,87 @@ public class DuibadoUpdateObject {
@Autowired @Autowired
Authorization authorization; Authorization authorization;
/*
{,"attributes":[{"skuInfo":{"remaining":"100","supplyPrice":"10","salePrice":"22","facePrice":"11","merchantCoding":"TTTYYY"},"children":null}]}
*/
//单规格实物---兑吧商品 //单规格实物---兑吧商品
public Response doUpdateObject(String name) throws Exception { public Response doUpdateObject(String name) throws Exception {
String url="http://"+ManagerHost+"/goods/object/doUpdateObject";
Map<String,Object> map = new HashMap<>();
map.put("type","object");//商品类型 object:实物,coupon:优惠券,virtual:虚拟商品 ,phonebill:话费 , alipay:支付宝 ,qb:Q币 ,phoneflow:流量
map.put("multiImage","[\"//yun.dui88.com/images/201811/ndz1zqhyh3.png\"]");//商品主图列表
map.put("preSaasMallVTypeList","[]");//未修改前SAAS版本限购
map.put("saasMallVTypeList","[1,2,3,4]");//SAAS版本限购
map.put("expressType","unity");//运费类型,free:包邮,unity:统一运费,template:运费模板
map.put("directRecharge","0");//实物兑换直充类 值为:0 | 1 | 2 | 3; NOR_MALL(0, "无(非直充类)"), PRO_MALL(1, "话费、流量(手机号)"), FLAG_MALL(2, "Q币(QQ号)"), EXTRAME_MALL(3, "支付宝(姓名、支付宝账号)");
map.put("multiSku","false");//是否为多规格,true:是, false:否
map.put("attrsCopy","[]");//
map.put("opTypeActivity","off");//是否活动专用 on 是,off 否
map.put("activityImage","");//活动图片
map.put("name",name);//商品名称
map.put("memo","兑吧商品备注");//商品备注
map.put("smallImage","//yun.dui88.com/images/201811/8quo3igywn.png");//商品缩略图
map.put("expressPrice","3");//运费价格
map.put("description","商品描述分享信息");//详情
map.put("alertMessage","999");//待发货文案
//规格属性
map.put("attributes","[{\"skuInfo\":{\"remaining\":\"100\",\"supplyPrice\":\"10\",\"salePrice\":\"22\",\"facePrice\":\"11\",\"merchantCoding\":\"TTTYYY\"},\"children\":null}]");//
//json 格式转成form表单
JSONObject jsonParam = JSONObject.parseObject(JSON.toJSONString(map));
Response response=given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.ssoLogin()).body(jsonParam).post(url);
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 moreDoUpdateObject(String name) throws Exception {
String url="http://"+ManagerHost+"/goods/object/doUpdateObject";
Map<String,Object> map = new HashMap<>();
map.put("","");
map.put("","");
map.put("","");
map.put("","");
map.put("","");
map.put("","");
map.put("","");
map.put("","");
map.put("","");
map.put("","");
map.put("","");
map.put("","");
map.put("","");
map.put("","");
map.put("","");
map.put("","");
map.put("","");
map.put("","");
map.put("","");
map.put("","");
map.put("","");
map.put("","");
map.put("","");
map.put("","");
map.put("","");
map.put("","");
//json 格式转成form表单
JSONObject jsonParam = JSONObject.parseObject(JSON.toJSONString(map));
Response response=given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.ssoLogin()).body(jsonParam).post(url);
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 ActivityDoUpdateObject(String name) throws Exception {
String url="http://"+ManagerHost+"/goods/object/doUpdateObject"; String url="http://"+ManagerHost+"/goods/object/doUpdateObject";
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("type","object"); map.put("type","object");
...@@ -36,17 +110,16 @@ public class DuibadoUpdateObject { ...@@ -36,17 +110,16 @@ public class DuibadoUpdateObject {
map.put("saasMallVTypeList","[1,2,3,4]"); map.put("saasMallVTypeList","[1,2,3,4]");
map.put("expressType","unity"); map.put("expressType","unity");
map.put("directRecharge","0"); map.put("directRecharge","0");
map.put("multiSku","false"); map.put("multiSku","true");//
map.put("attrsCopy","[]"); map.put("attrsCopy","[]");
map.put("opTypeActivity","off"); map.put("opTypeActivity","on");//是否开启活动
map.put("activityImage","//yun.dui88.com/images/201811/8quo3igywn.png");//活动中奖图片
map.put("name",name); map.put("name",name);
map.put("memo","兑吧商品备注"); map.put("memo","兑吧商品备注");
map.put("multiImageStr","//yun.dui88.com/images/201811/ndz1zqhyh3.png");//商品主图
map.put("smallImage","//yun.dui88.com/images/201811/8quo3igywn.png");//商品缩略图 map.put("smallImage","//yun.dui88.com/images/201811/8quo3igywn.png");//商品缩略图
map.put("expressPrice","3"); map.put("expressPrice","3");
map.put("description","商品描述分享信息"); map.put("description","商品描述分享信息");
map.put("alertMessage","999"); map.put("alertMessage","999");
map.put("attributes","888");
map.put("attributes","[{\"skuInfo\":{\"remaining\":\"100\",\"supplyPrice\":\"10\",\"salePrice\":\"22\",\"facePrice\":\"11\",\"merchantCoding\":\"TTTYYY\"},\"children\":null}]"); map.put("attributes","[{\"skuInfo\":{\"remaining\":\"100\",\"supplyPrice\":\"10\",\"salePrice\":\"22\",\"facePrice\":\"11\",\"merchantCoding\":\"TTTYYY\"},\"children\":null}]");
//json 格式转成form表单 //json 格式转成form表单
JSONObject jsonParam = JSONObject.parseObject(JSON.toJSONString(map)); JSONObject jsonParam = JSONObject.parseObject(JSON.toJSONString(map));
...@@ -61,4 +134,5 @@ public class DuibadoUpdateObject { ...@@ -61,4 +134,5 @@ public class DuibadoUpdateObject {
return response; 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