Commit 7b169114 authored by wangxiaoshuang's avatar wangxiaoshuang

wxs

parent 14f2fdab
......@@ -44,14 +44,15 @@ public class DevCards {
return response;
}
//查询
public Response list(String appId,String name) throws Exception {
public Response list(String appId,String name,String type,String excludeRelated) throws Exception {
String url="http://"+hdHost+"/cardLibrary/list";
Map<String,Object> map = new HashMap<>();
map.put("name",name);//名称
map.put("pageNo","1");
map.put("pageSize","15");
map.put("appId",appId);
map.put("type","");
map.put("type",type);//类型:0:券码 1:链接 2:重复 3:卡密
map.put("excludeRelated",excludeRelated);//true:排查已关联的 false:不排除
Response response=given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.hdLoginSaas()).get(url);
try{
Assert.assertEquals(response.jsonPath().getString("desc"),"成功");
......
......@@ -64,7 +64,7 @@ public class DevDoUpdateCoupon {
map.put("usageRule","<p>这是使用规则:</p><p>1、附近考虑到税费就是;</p><p>2、反馈的是浪费就开始;</p><p>3、风刀霜剑发了第三方市领导反馈</p>");
map.put("description","<p>这是图文详情信息,反馈代理商房间</p><p>1反馈到洛杉矶福克斯代理费收代理费水电费疯狂夺金发牢骚的</p>");
map.put("type",type);
map.put("subType","0");
map.put("subType","0");//0:券码 1:链接 2:重复 3:卡密
map.put("limitType","forever");
map.put("expressType","free");
//json 格式转成form表单
......@@ -79,6 +79,7 @@ public class DevDoUpdateCoupon {
}
return response;
}
//添加链接券
public Response doupdateCouponLianjie(String appId, String classifyIds,String title,String type) throws Exception {
String url="http://"+hdHost+"/devItemNew/doUpdateCoupon";
......@@ -135,7 +136,7 @@ public class DevDoUpdateCoupon {
map.put("usageRule","<p>这是使用规则:</p><p>1、附近考虑到税费就是;</p><p>2、反馈的是浪费就开始;</p><p>3、风刀霜剑发了第三方市领导反馈</p>");
map.put("description","<p>这是图文详情信息,反馈代理商房间</p><p>1反馈到洛杉矶福克斯代理费收代理费水电费疯狂夺金发牢骚的</p>");
map.put("type",type);
map.put("subType","1");
map.put("subType","1");//0:券码 1:链接 2:重复 3:卡密
map.put("limitType","forever");
map.put("expressType","free");
map.put("validStartDay","2018-12-11");
......@@ -207,7 +208,7 @@ public class DevDoUpdateCoupon {
map.put("usageRule","<p>这是使用规则:</p><p>1、附近考虑到税费就是;</p><p>2、反馈的是浪费就开始;</p><p>3、风刀霜剑发了第三方市领导反馈</p>");
map.put("description","<p>这是图文详情信息,反馈代理商房间</p><p>1反馈到洛杉矶福克斯代理费收代理费水电费疯狂夺金发牢骚的</p>");
map.put("type",type);
map.put("subType","1");
map.put("subType","2");//0 普通 1:链接 2:重复 3:卡密
map.put("limitType","forever");
map.put("expressType","free");
map.put("validStartDay","2018-12-11");
......
package http.service.goods;
import com.alibaba.fastjson.JSON;
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.springframework.stereotype.Service;
import org.testng.Assert;
import java.util.HashMap;
import java.util.Map;
import static io.restassured.RestAssured.given;
@Service
public class DevDoUpdateKaMi {
@Value("${hdserver.host}")
String hdHost;
@Autowired
Authorization authorization;
//添加无规格卡密
public Response doupdateCouponWuguige(String appId,String classifyIds,String title,String type) throws Exception{
String url="http://"+hdHost+"/devItemNew/doUpdateCoupon";
Map<String,Object> map = new HashMap<>();
map.put("appId",appId);//应用ID
map.put("isOwner","true");
map.put("multiImage","//yun.dui88.com/images/201812/7uukykd9va.png");
map.put("multiSku","false");//是否为多规格,true:是, false:否
map.put("levelLimitType","1");
map.put("arealimitType","1");
map.put("levelCheckbox","[]");
map.put("validDaterange","[]");
map.put("showJumpButton","false");
map.put("cardLibraryId","");
map.put("classifyIds",classifyIds);//商品分组
map.put("title",title);
map.put("sellingPoint","我是卡密无规格的卖点描述");
map.put("smallImage","//yun.dui88.com/images/201812/8oh63tx4ks.jpg");
map.put("devAudit","true");
map.put("arealimitSwitch","false");
map.put("weixinShareDesc","微信分享信息");
map.put("autoOffDate","2030-12-31 00:00");
map.put("usageRule","<p>使用规则</p>");
map.put("description","<p>图文详情</p>");
map.put("type",type);//商品类型
map.put("subType","3");//0:券码 1:链接 2:重复 3:卡密
map.put("limitType","forever");//限制类型
map.put("expressType","free");//运费类型,free:包邮,unity:统一运
//attributes 多规格列表
map.put("attributes","[\n" +
" {\n" +
" \"skuInfo\":{\n" +
" \"cardLibraryId\":\"54\",\n" +
" \"cardLibraryName\":\"5345\",\n" +
" \"remaining\":1,\n" +
" \"salePrice\":\"9.22\",\n" +
" \"facePrice\":\"32.23\",\n" +
" \"merchantCoding\":\"2323232\"\n" +
" },\n" +
" \"children\":null\n" +
" }\n" +
" ]");
//json 格式转成form表单
JSONObject jsonParam = JSONObject.parseObject(JSON.toJSONString(map));
Response response=given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.hdLoginSaas()).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 doupdateCouponDuoguige(String appId,String classifyIds,String title,String type) throws Exception{
String url="http://"+hdHost+"/devItemNew/doUpdateCoupon";
Map<String,Object> map = new HashMap<>();
map.put("appId",appId);//应用ID
map.put("isOwner","true");
map.put("multiImage","//yun.dui88.com/images/201812/7uukykd9va.png");
map.put("multiSku","true");//是否为多规格,true:是, false:否
map.put("levelLimitType","1");
map.put("arealimitType","1");
map.put("levelCheckbox","[]");
map.put("validDaterange","[]");
map.put("showJumpButton","false");
map.put("cardLibraryId","");
map.put("classifyIds",classifyIds);//商品分组
map.put("title",title);
map.put("sellingPoint","我是卡密无规格的卖点描述");
map.put("smallImage","//yun.dui88.com/images/201812/8oh63tx4ks.jpg");
map.put("arealimitSwitch","false");
map.put("weixinShareDesc","微信分享信息");
map.put("autoOffDate","2030-12-31 00:00");
map.put("usageRule","<p>使用规则</p>");
map.put("description","<p>图文详情</p>");
map.put("type",type);//商品类型
map.put("subType","3");//0:普通 1:链接 2:重复 3:卡密
map.put("limitType","forever");//限制类型
map.put("expressType","free");//运费类型,free:包邮,unity:统一运
//attributes 多规格列表
map.put("attributes","[\n" +
" {\n" +
" \"id\":\"117\",\n" +
" \"skuInfo\":{\n" +
" \"salePrice\":\"2\",\n" +
" \"cardLibraryId\":\"82\",\n" +
" \"cardLibraryName\":\"卡密2\",\n" +
" \"remaining\":1,\n" +
" \"facePrice\":\"65.77\",\n" +
" \"merchantCoding\":\"RTTT001\"\n" +
" },\n" +
" \"specId\":\"0\",\n" +
" \"children\":null\n" +
" },\n" +
" {\n" +
" \"id\":\"118\",\n" +
" \"skuInfo\":{\n" +
" \"cardLibraryId\":\"83\",\n" +
" \"cardLibraryName\":\"卡密3\",\n" +
" \"remaining\":9,\n" +
" \"salePrice\":\"3.55\",\n" +
" \"facePrice\":\"7.65\"\n" +
" },\n" +
" \"specId\":\"0\",\n" +
" \"children\":null\n" +
" },\n" +
" {\n" +
" \"id\":\"119\",\n" +
" \"skuInfo\":{\n" +
" \"cardLibraryId\":\"84\",\n" +
" \"cardLibraryName\":\"卡密4\",\n" +
" \"remaining\":9,\n" +
" \"salePrice\":\"5.77\",\n" +
" \"facePrice\":\"55.5\"\n" +
" },\n" +
" \"specId\":\"0\",\n" +
" \"children\":null\n" +
" }\n" +
" ]");
//json 格式转成form表单
JSONObject jsonParam = JSONObject.parseObject(JSON.toJSONString(map));
Response response=given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.hdLoginSaas()).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;
}
}
package http.service.goods;
import com.alibaba.fastjson.JSON;
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.springframework.stereotype.Service;
import org.testng.Assert;
import java.util.HashMap;
import java.util.Map;
import static io.restassured.RestAssured.given;
@Service
public class DevDoUpdateVirtual {
@Value("${hdserver.host}")
String hdHost;
@Autowired
Authorization authorization;
//添加无规格商家充值
public Response doUpdateVirtualWuguige(String appId, String classifyIds, String title, String type) throws Exception{
String url="http://"+hdHost+"/devItemNew/doUpdateVirtual";
Map<String,Object> map = new HashMap<>();
map.put("appId",appId);//应用ID
map.put("isOwner","true");
map.put("multiImage","[\n" +
" \"//yun.dui88.com/images/201812/b0pt4h46nb.png\",\n" +
" \"//yun.dui88.com/images/201812/vkk5btvaec.png\"\n" +
" ]");
map.put("multiSku","false");//是否为多规格,true:是, false:否
map.put("levelLimitType","1");
map.put("arealimitType","1");
map.put("levelCheckbox","[]");
map.put("validDaterange","[]");
map.put("showJumpButton","false");
map.put("cardLibraryId","");
map.put("classifyIds",classifyIds);//商品分组
map.put("needAccount","true");//是否开启账号 true 开启,false 未开启
map.put("accountTitle","账号");
map.put("accountPrompt","请输入账号信");
map.put("title",title);
map.put("sellingPoint","我是卡密无规格的卖点描述");
map.put("smallImage","//yun.dui88.com/images/201812/mlc9aoosfk.jpg");
map.put("arealimitSwitch","false");
map.put("weixinShareDesc","微信分享信息");
map.put("autoOffDate","2030-12-31 00:00");
map.put("description","<p>图文详情</p>");
map.put("type",type);//商品类型
map.put("subType","0");//0:普通 1:链接 2:重复 3:卡密
map.put("limitType","forever");//限制类型
map.put("expressType","free");//运费类型,free:包邮,unity:统一运
//attributes 多规格列表
map.put("attributes","[\n" +
" {\n" +
" \"skuInfo\":{\n" +
" \"remaining\":\"100\",\n" +
" \"merchantCoding\":\"TTT002\",\n" +
" \"salePrice\":\"6.75\",\n" +
" \"facePrice\":\"2.35\"\n" +
" },\n" +
" \"children\":null\n" +
" }\n" +
" ]");
//json 格式转成form表单
JSONObject jsonParam = JSONObject.parseObject(JSON.toJSONString(map));
Response response=given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.hdLoginSaas()).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 doUpdateVirtualDuoguige(String appId, String classifyIds, String title, String type) throws Exception{
String url="http://"+hdHost+"/devItemNew/doUpdateVirtual";
Map<String,Object> map = new HashMap<>();
map.put("appId",appId);//应用ID
map.put("isOwner","true");
map.put("multiImage","[\n" +
" \"//yun.dui88.com/images/201812/b0pt4h46nb.png\",\n" +
" \"//yun.dui88.com/images/201812/vkk5btvaec.png\"\n" +
" ]");
map.put("multiSku","true");//是否为多规格,true:是, false:否
map.put("levelLimitType","1");
map.put("arealimitType","1");
map.put("levelCheckbox","[]");
map.put("validDaterange","[]");
map.put("showJumpButton","false");
map.put("cardLibraryId","");
map.put("classifyIds",classifyIds);//商品分组
map.put("needAccount","true");//是否开启账号 true 开启,false 未开启
map.put("accountTitle","账号");
map.put("accountPrompt","请输入账号信");
map.put("title",title);
map.put("sellingPoint","我是卡密无规格的卖点描述");
map.put("smallImage","//yun.dui88.com/images/201812/mlc9aoosfk.jpg");
map.put("arealimitSwitch","false");
map.put("weixinShareDesc","微信分享信息");
map.put("autoOffDate","2030-12-31 00:00");
map.put("description","<p>图文详情</p>");
map.put("type",type);//商品类型
map.put("subType","0");//0:普通 1:链接 2:重复 3:卡密
map.put("limitType","forever");//限制类型
map.put("expressType","free");//运费类型,free:包邮,unity:统一运
//attributes 多规格列表
map.put("attributes","\n" +
" {\n" +
" \"id\":\"120\",\n" +
" \"skuInfo\":{\n" +
" \"remaining\":\"11\",\n" +
" \"salePrice\":\"13\",\n" +
" \"facePrice\":\"32\",\n" +
" \"merchantCoding\":\"111\"\n" +
" },\n" +
" \"specId\":\"0\",\n" +
" \"children\":null\n" +
" },\n" +
" {\n" +
" \"id\":\"121\",\n" +
" \"skuInfo\":{\n" +
" \"remaining\":\"2\",\n" +
" \"salePrice\":\"23\",\n" +
" \"facePrice\":\"32\",\n" +
" \"merchantCoding\":\"222\"\n" +
" },\n" +
" \"specId\":\"0\",\n" +
" \"children\":null\n" +
" },\n" +
" {\n" +
" \"id\":\"122\",\n" +
" \"skuInfo\":{\n" +
" \"remaining\":\"32\",\n" +
" \"salePrice\":\"24\",\n" +
" \"facePrice\":\"32.23\",\n" +
" \"merchantCoding\":\"333\"\n" +
" },\n" +
" \"specId\":\"0\",\n" +
" \"children\":null\n" +
" },\n" +
" {\n" +
" \"id\":\"123\",\n" +
" \"skuInfo\":{\n" +
" \"remaining\":\"2\",\n" +
" \"salePrice\":\"33\",\n" +
" \"facePrice\":\"32.23\",\n" +
" \"merchantCoding\":\"444\"\n" +
" },\n" +
" \"specId\":\"0\",\n" +
" \"children\":null\n" +
" },\n" +
" {\n" +
" \"id\":\"124\",\n" +
" \"skuInfo\":{\n" +
" \"remaining\":\"3\",\n" +
" \"salePrice\":\"21\",\n" +
" \"facePrice\":\"32.43\",\n" +
" \"merchantCoding\":\"555\"\n" +
" },\n" +
" \"specId\":\"0\",\n" +
" \"children\":null\n" +
" }\n" +
" ]");
//json 格式转成form表单
JSONObject jsonParam = JSONObject.parseObject(JSON.toJSONString(map));
Response response=given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.hdLoginSaas()).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;
}
}
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