Commit 73e751be by yangjian

数据中心-上课数据

parent d7e78f5b
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);
}
}
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);
}
}
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);
}
}
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