Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
test-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
马博
test-platform
Commits
14f2fdab
Commit
14f2fdab
authored
Dec 12, 2018
by
wangxiaoshuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wxs
parent
f466cb4c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
404 additions
and
28 deletions
+404
-28
自有卡券库.java
src/test/java/http/cases/GoodsAndTradeTest/自有卡券库.java
+20
-0
DevCards.java
src/test/java/http/service/goods/DevCards.java
+85
-0
DevDoUpdateCoupon.java
src/test/java/http/service/goods/DevDoUpdateCoupon.java
+227
-0
DevDoUpdateObject.java
src/test/java/http/service/goods/DevDoUpdateObject.java
+0
-28
DoUpdateCredits.java
src/test/java/http/service/goods/DoUpdateCredits.java
+72
-0
No files found.
src/test/java/http/cases/GoodsAndTradeTest/自有卡券库.java
0 → 100644
View file @
14f2fdab
package
http
.
cases
.
GoodsAndTradeTest
;
import
base.Config
;
import
org.springframework.test.context.ContextConfiguration
;
import
org.springframework.test.context.testng.AbstractTestNGSpringContextTests
;
import
org.testng.annotations.Test
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
@ContextConfiguration
(
classes
=
Config
.
class
)
public
class
自有卡券库
extends
AbstractTestNGSpringContextTests
{
@Test
public
void
t333
(){
Date
date
=
new
Date
();
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM--dd"
);
simpleDateFormat
.
format
(
date
);
System
.
out
.
println
(
"---------"
+
simpleDateFormat
.
format
(
date
));
}
}
src/test/java/http/service/goods/DevCards.java
0 → 100644
View file @
14f2fdab
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
DevCards
{
@Value
(
"${hdserver.host}"
)
String
hdHost
;
@Autowired
Authorization
authorization
;
//添加券码
public
Response
cardsSave
(
String
appId
,
String
type
,
String
name
)
throws
Exception
{
String
url
=
"http://"
+
hdHost
+
"/cardLibrary/save"
;
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"appId"
,
appId
);
//应用ID
map
.
put
(
"type"
,
type
);
//类型
map
.
put
(
"name"
,
name
);
//名称
map
.
put
(
"fileUrl"
,
"http%3A%2F%2Fyun.dui88.com%2Fcoupons%2F1544497069778.txt"
);
//文件地址
map
.
put
(
"startDay"
,
""
);
//有效期--开始时间
map
.
put
(
"endDay"
,
""
);
//有效期--结束时间
Response
response
=
given
().
contentType
(
"application/x-www-form-urlencoded;charset=UTF-8"
).
cookies
(
authorization
.
hdLoginSaas
()).
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
list
(
String
appId
,
String
name
)
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"
,
""
);
Response
response
=
given
().
contentType
(
"application/x-www-form-urlencoded;charset=UTF-8"
).
cookies
(
authorization
.
hdLoginSaas
()).
get
(
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
delete
(
String
appId
,
String
id
)
throws
Exception
{
String
url
=
"http://"
+
hdHost
+
"/cardLibrary/delete"
;
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"appId"
,
appId
);
map
.
put
(
"id"
,
id
);
Response
response
=
given
().
contentType
(
"application/x-www-form-urlencoded;charset=UTF-8"
).
cookies
(
authorization
.
hdLoginSaas
()).
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
;
}
}
src/test/java/http/service/goods/DevDoUpdateCoupon.java
0 → 100644
View file @
14f2fdab
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
DevDoUpdateCoupon
{
@Value
(
"${hdserver.host}"
)
String
hdHost
;
@Autowired
Authorization
authorization
;
//添加普通券码
public
Response
doupdateCouponPT
(
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
(
"classifyIds"
,
classifyIds
);
//商品分组
map
.
put
(
"arealimitAreas"
,
" [{provinceCode: \"340000\", provinceName: \"安徽省\", cityName: \"全省范围\", cityCode: \"all\"}]"
);
map
.
put
(
"arealimitSwitch"
,
"true"
);
//是否勾选地域限制 true 勾选,false 未勾选
map
.
put
(
"arealimitType"
,
"1"
);
//类型 1白名单 2 黑名单
map
.
put
(
"attributes"
,
"[\n"
+
"{\n"
+
"\"skuInfo\": {\n"
+
"\"remaining\": 10000,\n"
+
"\"salePrice\": \"9.32\",\n"
+
"\"facePrice\": \"9.20\",\n"
+
"\"merchantCoding\": \"232323\"\n"
+
"},\n"
+
"\"children\": null\n"
+
"}\n"
+
"]"
);
map
.
put
(
"isOwner"
,
"true"
);
//是否自有商品
map
.
put
(
"multiImage"
,
"[\n"
+
"\"//yun.dui88.com/images/201812/fjwhiijs6j.jpg\",\n"
+
"\"//yun.dui88.com/images/201812/243svyhvv0.png\"\n"
+
"]"
);
map
.
put
(
"multiSku"
,
"false"
);
map
.
put
(
"levelLimitType"
,
"1"
);
map
.
put
(
"levelCheckbox"
,
"[]"
);
map
.
put
(
"validDaterange"
,
"[]"
);
map
.
put
(
"showJumpButton"
,
"true"
);
map
.
put
(
"cardLibraryId"
,
"46"
);
//关联卡券
map
.
put
(
"cardLibraryName"
,
"卡券"
);
//关联卡券名称
map
.
put
(
"showBarCode"
,
"true"
);
map
.
put
(
"linkUrl"
,
"http://www.baidu.com"
);
//跳转链接
map
.
put
(
"title"
,
title
);
map
.
put
(
"sellingPoint"
,
"卖点描述"
);
map
.
put
(
"smallImage"
,
"//yun.dui88.com/images/201812/bqrfryl2bd.png"
);
map
.
put
(
"devAudit"
,
"true"
);
map
.
put
(
"weixinShareDesc"
,
"这是分享描述文案,分享后可以查看"
);
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
(
"limitType"
,
"forever"
);
map
.
put
(
"expressType"
,
"free"
);
//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
doupdateCouponLianjie
(
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
(
"classifyIds"
,
classifyIds
);
//商品分组
map
.
put
(
"arealimitSwitch"
,
"true"
);
//是否勾选地域限制 true 勾选,false 未勾选
map
.
put
(
"arealimitType"
,
"2"
);
//类型 1白名单 2 黑名单
map
.
put
(
"attributes"
,
"[\n"
+
" {\n"
+
" \"skuInfo\":{\n"
+
" \"remaining\":\"10\",\n"
+
" \"salePrice\":\"80\",\n"
+
" \"facePrice\":\"20\",\n"
+
" \"merchantCoding\":\"STREE001\"\n"
+
" },\n"
+
" \"children\":null\n"
+
" }\n"
+
" ]"
);
map
.
put
(
"isOwner"
,
"true"
);
//是否自有商品
map
.
put
(
"multiImage"
,
"[\n"
+
"\"//yun.dui88.com/images/201812/fjwhiijs6j.jpg\",\n"
+
"\"//yun.dui88.com/images/201812/243svyhvv0.png\"\n"
+
"]"
);
map
.
put
(
"multiSku"
,
"false"
);
map
.
put
(
"levelLimitType"
,
"1"
);
map
.
put
(
"levelCheckbox"
,
"[]"
);
map
.
put
(
"validDaterange"
,
"[\n"
+
" \"2018-12-11\",\n"
+
" \"2018-12-13\"\n"
+
" ]"
);
map
.
put
(
"showJumpButton"
,
""
);
map
.
put
(
"cardLibraryId"
,
""
);
//关联卡券
map
.
put
(
"cardLibraryName"
,
""
);
//关联卡券名称
map
.
put
(
"showBarCode"
,
""
);
map
.
put
(
"linkUrl"
,
"https://hz.58.com"
);
//跳转链接
map
.
put
(
"couponCode"
,
""
);
map
.
put
(
"couponCount"
,
"10"
);
//数量
map
.
put
(
"title"
,
title
);
map
.
put
(
"sellingPoint"
,
"卖点描述"
);
map
.
put
(
"smallImage"
,
"//yun.dui88.com/images/201812/bqrfryl2bd.png"
);
map
.
put
(
"devAudit"
,
"true"
);
map
.
put
(
"arealimitAreas"
,
"[\n"
+
" {\n"
+
" \"provinceCode\":\"360000\",\n"
+
" \"provinceName\":\"江西省\",\n"
+
" \"cityName\":\"全省范围\",\n"
+
" \"cityCode\":\"all\"\n"
+
" }\n"
+
" ]"
);
map
.
put
(
"weixinShareDesc"
,
"这是分享描述文案,分享后可以查看"
);
map
.
put
(
"autoOffDate"
,
"2025-12-27 00:00"
);
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
(
"limitType"
,
"forever"
);
map
.
put
(
"expressType"
,
"free"
);
map
.
put
(
"validStartDay"
,
"2018-12-11"
);
map
.
put
(
"validEndDay"
,
"2018-12-13"
);
//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
doupdateCouponChongfu
(
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
(
"classifyIds"
,
classifyIds
);
//商品分组
map
.
put
(
"arealimitSwitch"
,
"true"
);
//是否勾选地域限制 true 勾选,false 未勾选
map
.
put
(
"arealimitType"
,
"2"
);
//类型 1白名单 2 黑名单
map
.
put
(
"attributes"
,
"[\n"
+
" {\n"
+
" \"skuInfo\":{\n"
+
" \"remaining\":\"10\",\n"
+
" \"salePrice\":\"80\",\n"
+
" \"facePrice\":\"20\",\n"
+
" \"merchantCoding\":\"STREE001\"\n"
+
" },\n"
+
" \"children\":null\n"
+
" }\n"
+
" ]"
);
map
.
put
(
"isOwner"
,
"true"
);
//是否自有商品
map
.
put
(
"multiImage"
,
"[\n"
+
"\"//yun.dui88.com/images/201812/fjwhiijs6j.jpg\",\n"
+
"\"//yun.dui88.com/images/201812/243svyhvv0.png\"\n"
+
"]"
);
map
.
put
(
"multiSku"
,
"false"
);
map
.
put
(
"levelLimitType"
,
"1"
);
map
.
put
(
"levelCheckbox"
,
"[]"
);
map
.
put
(
"validDaterange"
,
"[\n"
+
" \"2018-12-11\",\n"
+
" \"2022-12-13\"\n"
+
" ]"
);
map
.
put
(
"showJumpButton"
,
""
);
map
.
put
(
"cardLibraryId"
,
""
);
//关联卡券
map
.
put
(
"cardLibraryName"
,
""
);
//关联卡券名称
map
.
put
(
"showBarCode"
,
""
);
map
.
put
(
"linkUrl"
,
"https://hz.58.com"
);
//跳转链接
map
.
put
(
"couponCode"
,
"TTT0001"
);
//券码
map
.
put
(
"couponCount"
,
"10"
);
//数量
map
.
put
(
"title"
,
title
);
map
.
put
(
"sellingPoint"
,
"卖点描述"
);
map
.
put
(
"smallImage"
,
"//yun.dui88.com/images/201812/bqrfryl2bd.png"
);
map
.
put
(
"devAudit"
,
"true"
);
map
.
put
(
"arealimitAreas"
,
"[\n"
+
" {\n"
+
" \"provinceCode\":\"360000\",\n"
+
" \"provinceName\":\"江西省\",\n"
+
" \"cityName\":\"全省范围\",\n"
+
" \"cityCode\":\"all\"\n"
+
" }\n"
+
" ]"
);
map
.
put
(
"weixinShareDesc"
,
"这是分享描述文案,分享后可以查看"
);
map
.
put
(
"autoOffDate"
,
"2025-12-27 00:00"
);
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
(
"limitType"
,
"forever"
);
map
.
put
(
"expressType"
,
"free"
);
map
.
put
(
"validStartDay"
,
"2018-12-11"
);
map
.
put
(
"validEndDay"
,
"2022-12-13"
);
//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
;
}
}
src/test/java/http/service/goods/DevDoUpdateObject.java
View file @
14f2fdab
...
...
@@ -84,33 +84,5 @@ public class DevDoUpdateObject {
}
return
response
;
}
//保存积分配置
public
Response
doUpdateCredits
(
String
appId
,
String
appItemId
)
throws
Exception
{
String
url
=
"http://"
+
hdHost
+
"/devItemNew/doUpdateCredits"
;
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"appId"
,
appId
);
//appid
map
.
put
(
"appItemId"
,
appItemId
);
//商品ID
map
.
put
(
"buttonText"
,
""
);
map
.
put
(
"creditsInfos"
,
"[{skuId: \"0\"}]"
);
//自定义
map
.
put
(
"dateRage"
,
"[\"2018-11-29\", \"2019-05-31\"]"
);
map
.
put
(
"exchangeType"
,
"1"
);
//兑换类型,1:自动 2:自定义
map
.
put
(
"indexHidden"
,
"true"
);
//是否在首页商品区隐藏,true:隐藏 false:显示
map
.
put
(
"limitDate"
,
"2018-11-29,2019-05-31"
);
//兑换日期限制
map
.
put
(
"limitEverydayQuantity"
,
"6"
);
//每日限量
map
.
put
(
"multiSku"
,
"false"
);
map
.
put
(
"onSale"
,
"false"
);
//是否上架 true:立即上架 false:放入仓库
map
.
put
(
"originalPriceBuy"
,
"true"
);
//是否支持原价购买 ,true:支持 false:不支持
//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
;
}
}
src/test/java/http/service/goods/DoUpdateCredits.java
0 → 100644
View file @
14f2fdab
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
DoUpdateCredits
{
@Value
(
"${hdserver.host}"
)
String
hdHost
;
@Autowired
Authorization
authorization
;
//获取商品ID
public
Response
getCreditsDetail
(
String
appId
,
String
appItemId
)
throws
Exception
{
String
url
=
"http://"
+
hdHost
+
"devItemNew/getCreditsDetail"
;
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"appId"
,
appId
);
//appid
map
.
put
(
"appItemId"
,
appItemId
);
//商品ID
//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
).
get
(
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
doUpdateCredits
(
String
appId
,
String
appItemId
,
String
creditsInfos
)
throws
Exception
{
String
url
=
"http://"
+
hdHost
+
"/devItemNew/doUpdateCredits"
;
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"appId"
,
appId
);
//appid
map
.
put
(
"appItemId"
,
appItemId
);
//商品ID
map
.
put
(
"buttonText"
,
""
);
map
.
put
(
"creditsInfos"
,
creditsInfos
);
//自定义
map
.
put
(
"dateRage"
,
"[\"2018-11-29\", \"2019-05-31\"]"
);
map
.
put
(
"exchangeType"
,
"1"
);
//兑换类型,1:自动 2:自定义
map
.
put
(
"indexHidden"
,
"true"
);
//是否在首页商品区隐藏,true:隐藏 false:显示
map
.
put
(
"limitDate"
,
"2018-11-29,2019-05-31"
);
//兑换日期限制
map
.
put
(
"limitEverydayQuantity"
,
"6"
);
//每日限量
map
.
put
(
"multiSku"
,
"false"
);
map
.
put
(
"onSale"
,
"false"
);
//是否上架 true:立即上架 false:放入仓库
map
.
put
(
"originalPriceBuy"
,
"true"
);
//是否支持原价购买 ,true:支持 false:不支持
//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
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment