Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xm-sportstest
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiamai-test
xm-sportstest
Commits
73e751be
Commit
73e751be
authored
Jul 02, 2024
by
yangjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据中心-上课数据
parent
d7e78f5b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
329 additions
and
0 deletions
+329
-0
src/main/java/com/xiaomai/cases/polar/data/TestCamDataTrend.java
+90
-0
src/main/java/com/xiaomai/cases/polar/data/TestGetCourseCostDetail.java
+82
-0
src/main/java/com/xiaomai/cases/polar/data/TestTetCourseCostData.java
+157
-0
No files found.
src/main/java/com/xiaomai/cases/polar/data/TestCamDataTrend.java
0 → 100644
View file @
73e751be
package
com
.
xiaomai
.
cases
.
polar
.
data
;
import
com.alibaba.fastjson.JSONObject
;
import
com.xiaomai.cases.polar.memberCard.CardTools
;
import
com.xiaomai.enums.ApiModule
;
import
com.xiaomai.enums.LoginAccount
;
import
com.xiaomai.enums.RequestType
;
import
com.xiaomai.enums.Terminal
;
import
com.xiaomai.utils.TimeUtils
;
import
com.xiaomai.utils.XMBaseTest
;
import
com.xiaomai.utils.XMJSONPath
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
import
java.sql.Time
;
public
class
TestCamDataTrend
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
(){
xmAppApi
.
setApiModule
(
ApiModule
.
Polar_Data
)
.
setApiName
(
"API_camDatatrend"
)
.
setLoginUser
(
LoginAccount
.
GYM_PROD
)
.
setTerminal
(
Terminal
.
B
);
dal
.
setCase_owner
(
"yj"
)
.
setCase_name
(
Thread
.
currentThread
().
getStackTrace
()[
1
].
getFileName
().
split
(
"\\."
)[
0
]);
super
.
beforeTest
();
}
@Test
(
description
=
"上课数据-趋势分析-次数"
)
public
void
testcamDatatrend
()
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"dateType"
,
"DAY"
);
jsonObject
.
put
(
"endTime"
,
TimeUtils
.
getWeekLastTime
());
jsonObject
.
put
(
"startTime"
,
TimeUtils
.
getWeekFirstTime
());
jsonObject
.
put
(
"metric"
,
"CLASS_SESSION_NUMBER"
);
jsonObject
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
jsonObject
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
}
@Test
(
description
=
"上课数据-趋势分析-消耗金额"
)
public
void
testcamDatatrend1
()
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"dateType"
,
"DAY"
);
jsonObject
.
put
(
"endTime"
,
TimeUtils
.
getWeekLastTime
());
jsonObject
.
put
(
"startTime"
,
TimeUtils
.
getWeekFirstTime
());
jsonObject
.
put
(
"metric"
,
"TOTAL_COST"
);
jsonObject
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
jsonObject
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
}
@Test
(
description
=
"上课数据-趋势分析-上课人次"
)
public
void
testcamDatatrend2
()
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"dateType"
,
"DAY"
);
jsonObject
.
put
(
"endTime"
,
TimeUtils
.
getWeekLastTime
());
jsonObject
.
put
(
"startTime"
,
TimeUtils
.
getWeekFirstTime
());
jsonObject
.
put
(
"metric"
,
"TOTAL_NUMBER"
);
jsonObject
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
jsonObject
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
}
@Test
(
description
=
"上课数据-趋势分析-上课时长"
)
public
void
testcamDatatrend3
()
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"dateType"
,
"DAY"
);
jsonObject
.
put
(
"endTime"
,
TimeUtils
.
getWeekLastTime
());
jsonObject
.
put
(
"startTime"
,
TimeUtils
.
getWeekFirstTime
());
jsonObject
.
put
(
"metric"
,
"CLASS_HOUR"
);
jsonObject
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
jsonObject
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
}
}
src/main/java/com/xiaomai/cases/polar/data/TestGetCourseCostDetail.java
0 → 100644
View file @
73e751be
package
com
.
xiaomai
.
cases
.
polar
.
data
;
import
com.alibaba.fastjson.JSONObject
;
import
com.xiaomai.enums.ApiModule
;
import
com.xiaomai.enums.LoginAccount
;
import
com.xiaomai.enums.RequestType
;
import
com.xiaomai.enums.Terminal
;
import
com.xiaomai.utils.TimeUtils
;
import
com.xiaomai.utils.XMBaseTest
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
public
class
TestGetCourseCostDetail
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
(){
xmAppApi
.
setApiModule
(
ApiModule
.
Polar_Data
)
.
setApiName
(
"API_getCourseCostDetail"
)
.
setLoginUser
(
LoginAccount
.
GYM_PROD
)
.
setTerminal
(
Terminal
.
B
);
dal
.
setCase_owner
(
"yj"
)
.
setCase_name
(
Thread
.
currentThread
().
getStackTrace
()[
1
].
getFileName
().
split
(
"\\."
)[
0
]);
super
.
beforeTest
();
}
@Test
(
description
=
"数据中心-上课数据-课消明细-团课"
)
public
void
testgetCourseCostDetail
()
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
0
);
jsonObject
.
put
(
"size"
,
20
);
jsonObject
.
put
(
"coachId"
,
""
);
jsonObject
.
put
(
"dateType"
,
"DAY"
);
jsonObject
.
put
(
"sort"
,
"TOTAL_COST_DESC"
);
jsonObject
.
put
(
"consumeType"
,
"GROUP_CLASS"
);
jsonObject
.
put
(
"endTime"
,
TimeUtils
.
getWeekLastTime
());
jsonObject
.
put
(
"startTime"
,
TimeUtils
.
getWeekFirstTime
());
jsonObject
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
jsonObject
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
}
@Test
(
description
=
"数据中心-上课数据-课消明细-私教课"
)
public
void
testgetCourseCostDetail1
()
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
0
);
jsonObject
.
put
(
"size"
,
20
);
jsonObject
.
put
(
"coachId"
,
""
);
jsonObject
.
put
(
"dateType"
,
"DAY"
);
jsonObject
.
put
(
"sort"
,
"TOTAL_COST_DESC"
);
jsonObject
.
put
(
"consumeType"
,
"PERSONAL"
);
jsonObject
.
put
(
"endTime"
,
TimeUtils
.
getWeekLastTime
());
jsonObject
.
put
(
"startTime"
,
TimeUtils
.
getWeekFirstTime
());
jsonObject
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
jsonObject
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
}
@Test
(
description
=
"数据中心-上课数据-课消明细-训练营"
)
public
void
testgetCourseCostDetail2
()
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
0
);
jsonObject
.
put
(
"size"
,
20
);
jsonObject
.
put
(
"coachId"
,
""
);
jsonObject
.
put
(
"dateType"
,
"DAY"
);
jsonObject
.
put
(
"sort"
,
"TOTAL_COST_DESC"
);
jsonObject
.
put
(
"consumeType"
,
"TRAINING_CAMP"
);
jsonObject
.
put
(
"endTime"
,
TimeUtils
.
getWeekLastTime
());
jsonObject
.
put
(
"startTime"
,
TimeUtils
.
getWeekFirstTime
());
jsonObject
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
jsonObject
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
}
}
src/main/java/com/xiaomai/cases/polar/data/TestTetCourseCostData.java
0 → 100644
View file @
73e751be
package
com
.
xiaomai
.
cases
.
polar
.
data
;
import
com.alibaba.fastjson.JSONObject
;
import
com.xiaomai.enums.ApiModule
;
import
com.xiaomai.enums.LoginAccount
;
import
com.xiaomai.enums.RequestType
;
import
com.xiaomai.enums.Terminal
;
import
com.xiaomai.utils.TimeUtils
;
import
com.xiaomai.utils.XMBaseTest
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
public
class
TestTetCourseCostData
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
(){
xmAppApi
.
setApiModule
(
ApiModule
.
Polar_Data
)
.
setApiName
(
"API_getCourseCostData"
)
.
setLoginUser
(
LoginAccount
.
GYM_PROD
)
.
setTerminal
(
Terminal
.
B
);
dal
.
setCase_owner
(
"yj"
)
.
setCase_name
(
Thread
.
currentThread
().
getStackTrace
()[
1
].
getFileName
().
split
(
"\\."
)[
0
]);
super
.
beforeTest
();
}
@Test
(
description
=
"上课数据-课消数据-全部"
)
public
void
testgetCourseCostData
()
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"dateType"
,
"WEEK"
);
jsonObject
.
put
(
"endTime"
,
TimeUtils
.
getWeekLastTime
());
jsonObject
.
put
(
"startTime"
,
TimeUtils
.
getWeekFirstTime
());
jsonObject
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
jsonObject
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
}
@Test
(
description
=
"上课数据-课消数据-团课"
)
public
void
testgetCourseCostData1
()
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"dateType"
,
"WEEK"
);
jsonObject
.
put
(
"consumeType"
,
"GROUP_CLASS"
);
jsonObject
.
put
(
"endTime"
,
TimeUtils
.
getWeekLastTime
());
jsonObject
.
put
(
"startTime"
,
TimeUtils
.
getWeekFirstTime
());
jsonObject
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
jsonObject
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
}
@Test
(
description
=
"上课数据-课消数据-私教课"
)
public
void
testgetCourseCostData2
()
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"dateType"
,
"WEEK"
);
jsonObject
.
put
(
"consumeType"
,
"PERSONAL"
);
jsonObject
.
put
(
"endTime"
,
TimeUtils
.
getWeekLastTime
());
jsonObject
.
put
(
"startTime"
,
TimeUtils
.
getWeekFirstTime
());
jsonObject
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
jsonObject
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
}
@Test
(
description
=
"上课数据-课消数据-训练营"
)
public
void
testgetCourseCostData3
()
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"dateType"
,
"WEEK"
);
jsonObject
.
put
(
"consumeType"
,
"TRAINING_CAMP"
);
jsonObject
.
put
(
"endTime"
,
TimeUtils
.
getWeekLastTime
());
jsonObject
.
put
(
"startTime"
,
TimeUtils
.
getWeekFirstTime
());
jsonObject
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
jsonObject
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
}
@Test
(
description
=
"上课数据-课消数据-手动扣次"
)
public
void
testgetCourseCostData4
()
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"dateType"
,
"WEEK"
);
jsonObject
.
put
(
"consumeType"
,
"MANUAL_DEDUCT"
);
jsonObject
.
put
(
"endTime"
,
TimeUtils
.
getWeekLastTime
());
jsonObject
.
put
(
"startTime"
,
TimeUtils
.
getWeekFirstTime
());
jsonObject
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
jsonObject
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
}
@Test
(
description
=
"上课数据-课消数据-自动消耗"
)
public
void
testgetCourseCostData5
()
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"dateType"
,
"WEEK"
);
jsonObject
.
put
(
"consumeType"
,
"AUTO_CONSUME"
);
jsonObject
.
put
(
"endTime"
,
TimeUtils
.
getWeekLastTime
());
jsonObject
.
put
(
"startTime"
,
TimeUtils
.
getWeekFirstTime
());
jsonObject
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
jsonObject
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
}
@Test
(
description
=
"上课数据-课消数据-单次约课"
)
public
void
testgetCourseCostData6
()
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"dateType"
,
"WEEK"
);
jsonObject
.
put
(
"consumeType"
,
"SINGLE_RESERVE"
);
jsonObject
.
put
(
"endTime"
,
TimeUtils
.
getWeekLastTime
());
jsonObject
.
put
(
"startTime"
,
TimeUtils
.
getWeekFirstTime
());
jsonObject
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
jsonObject
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
}
}
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