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
87c4f601
Commit
87c4f601
authored
Dec 03, 2018
by
钱雯君
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
baf1ca9b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
0 deletions
+74
-0
PkActivityService.java
src/test/java/http/service/Manager/PkActivityService.java
+74
-0
No files found.
src/test/java/http/service/Manager/PkActivityService.java
View file @
87c4f601
...
...
@@ -20,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.testng.Assert
;
import
utils.MatcherString
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
...
...
@@ -303,6 +304,79 @@ public class PkActivityService {
}
//创建pk开奖的插件活动id
public
Response
pluginSave
(
String
pkActivityId
)
throws
Exception
{
String
saveUrl
=
ManagerHost
+
"/plugin/save"
;
String
configUrl
=
ManagerHost
+
"/plugin/editConfig.htm"
;
//获取创建活动的token
Response
response
=
given
().
contentType
(
"text/html;charset=UTF-8"
).
cookies
(
authorization
.
ssoLogin
()).
get
(
"http://"
+
configUrl
);
String
token
=
MatcherString
.
getString
(
response
.
asString
(),
"token: '(.*?)'"
,
1
);
List
<
Map
<
String
,
String
>>
listPrizes
=
new
ArrayList
<>();
Map
<
String
,
String
>
award
=
new
HashMap
<>();
award
.
put
(
"type"
,
"coupon"
);
award
.
put
(
"description"
,
"优惠券"
);
award
.
put
(
"logo"
,
"//yun.duiba.com.cn/developer/img/activityTool/slotMachine/coupon.png"
);
award
.
put
(
"valid"
,
"true"
);
award
.
put
(
"rate"
,
"100"
);
award
.
put
(
"arealimit"
,
"false"
);
award
.
put
(
"stockBeforeChange"
,
"0"
);
award
.
put
(
"rewardFalg"
,
"false"
);
award
.
put
(
"prizeTag"
,
""
);
award
.
put
(
"winLimitScope"
,
"1"
);
award
.
put
(
"prizesLimitScope"
,
"daily"
);
award
.
put
(
"itemId"
,
"27097"
);
award
.
put
(
"name"
,
"LV优惠券自动化测试链接券"
);
award
.
put
(
"stockAfterChange"
,
"10"
);
award
.
put
(
"remaining"
,
"10"
);
listPrizes
.
add
(
award
);
String
prizes
=
JSON
.
toJSONString
(
listPrizes
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"title"
,
"【自动化】pk开奖插件"
);
map
.
put
(
"brickId"
,
"0"
);
map
.
put
(
"ruleDescription"
,
"自动化活动规则"
);
map
.
put
(
"rateDescription"
,
"自动化概率说明"
);
map
.
put
(
"multiSkinsMode"
,
"false"
);
map
.
put
(
"multiSkinIds"
,
"[]"
);
map
.
put
(
"triggerTime"
,
"[]"
);
map
.
put
(
"limitCount"
,
"1"
);
map
.
put
(
"exitDays"
,
"7"
);
map
.
put
(
"anticheatExchangeLimit"
,
"false"
);
map
.
put
(
"limitScope"
,
"forever"
);
map
.
put
(
"prizes"
,
prizes
);
map
.
put
(
"tag"
,
"[]"
);
map
.
put
(
"triggerType"
,
"1"
);
map
.
put
(
"hiddenForDeveloper"
,
"false"
);
map
.
put
(
"joinVerificy"
,
"false"
);
map
.
put
(
"duibaRelateMode"
,
"false"
);
map
.
put
(
"channelType"
,
"0"
);
map
.
put
(
"token"
,
token
);
map
.
put
(
"copy"
,
"false"
);
map
.
put
(
"subType"
,
"plugdraw"
);
map
.
put
(
"joinVerificyMode"
,
"15"
);
map
.
put
(
"pkId"
,
pkActivityId
);
logger
.
info
(
"请求保存插件活动接口:"
+
saveUrl
);
Response
saveResponse
=
given
().
contentType
(
"application/x-www-form-urlencoded;charset=UTF-8"
).
cookies
(
authorization
.
ssoLogin
()).
params
(
map
).
post
(
"http://"
+
saveUrl
);
saveResponse
.
prettyPrint
();
try
{
Assert
.
assertEquals
(
saveResponse
.
jsonPath
().
getString
(
"success"
),
"true"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"创建插件活动接口失败,返回信息:"
+
saveResponse
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"创建插件活动接口失败,返回信息:"
+
saveResponse
.
asString
());
}
return
saveResponse
;
}
// public static void main(String[] args) throws Exception{
// String endTime = "2021-12-31 23:55:00";
// PkActivityService pkActivityService = new PkActivityService();
...
...
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