Commit 6ddc8550 by zhangyumeng

直播课群发学生

parent 38e4d984
package com.live.cases.largeClassLive; package com.live.cases.apollo;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele; import com.live.enums.ApiModele;
...@@ -33,7 +33,7 @@ public class TestCourseLaunch extends XMBaseTest { ...@@ -33,7 +33,7 @@ public class TestCourseLaunch extends XMBaseTest {
public void courseLaunch(){ public void courseLaunch(){
GetLiveCourseId liveCourseId = new GetLiveCourseId(); GetLiveCourseId liveCourseId = new GetLiveCourseId();
String getLiveCourseId = liveCourseId.getLiveCourseId(); String getLiveCourseId = liveCourseId.createCourse();
List StringList = new ArrayList(); List StringList = new ArrayList();
StringList.add(getLiveCourseId); StringList.add(getLiveCourseId);
......
package com.live.cases.largeClassLive; package com.live.cases.apollo;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele; import com.live.enums.ApiModele;
...@@ -31,7 +31,7 @@ public class TestGetCourseDocList extends XMBaseTest { ...@@ -31,7 +31,7 @@ public class TestGetCourseDocList extends XMBaseTest {
public void getCourseDocList() { public void getCourseDocList() {
GetLiveCourseId liveCourseId = new GetLiveCourseId(); GetLiveCourseId liveCourseId = new GetLiveCourseId();
String getLiveCourseId = liveCourseId.getLiveCourseId(); String getLiveCourseId = liveCourseId.createCourse();
List StringList = new ArrayList(); List StringList = new ArrayList();
StringList.add(getLiveCourseId); StringList.add(getLiveCourseId);
......
package com.live.cases.apollo;
import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele;
import com.live.enums.RequestType;
import com.live.enums.Terminal;
import com.live.utils.GetLiveCourseId;
import com.xiaomai.utils.XMBaseTest;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import java.util.ArrayList;
import java.util.List;
public class TestSendNotify2Student extends XMBaseTest {
@BeforeMethod
public void beforeTest() {
xmAppApi.setApiModule(ApiModele.CloudClass_B_Apollo)
.setApiName("API_sendNotify2Student")
.setLoginUser("zhangYuM_b")
.setTerminal(Terminal.B);
super.beforeTest();
}
@Test
public void getCourseDocList() {
GetLiveCourseId liveCourseId = new GetLiveCourseId();
String getLiveCourseId = liveCourseId.createCourse();
List StringList = new ArrayList();
StringList.add(getLiveCourseId);
JSONObject jsonObject = new JSONObject();
jsonObject.put("liveCourseId", getLiveCourseId);
jsonObject.put("instId",dataApi.getLoginInfo().getInstId());
xmAppApi.doRequest(RequestType.JSON, params, jsonObject.toJSONString(), headers).assetsSuccess(true);
JSONObject responseRes = xmAppApi.getBodyInJSON();
}
}
...@@ -38,7 +38,6 @@ public class TestCreateBigLiveClass extends XMBaseTest { ...@@ -38,7 +38,6 @@ public class TestCreateBigLiveClass extends XMBaseTest {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("coverUrl", "https://image.xiaomaiketang.com/xm/YNfi45JwFA.png");
TimeSetting startTime = new TimeSetting(); TimeSetting startTime = new TimeSetting();
jsonObject.put("startTime", startTime.startTime()); jsonObject.put("startTime", startTime.startTime());
TimeSetting endTime = new TimeSetting(); TimeSetting endTime = new TimeSetting();
......
package com.live.utils; package com.live.utils;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.live.enums.ApiModele; import com.live.enums.ApiModele;
import com.xiaomai.enums.RequestType; import com.xiaomai.enums.RequestType;
import com.xiaomai.enums.Terminal; import com.xiaomai.enums.Terminal;
import com.xiaomai.utils.XMBaseTest; import com.xiaomai.utils.XMBaseTest;
import java.util.ArrayList;
/** /**
* 获取大班直播课程id * 获取大班直播课程id
* by 张雨朦 * by 张雨朦
...@@ -13,24 +16,33 @@ import com.xiaomai.utils.XMBaseTest; ...@@ -13,24 +16,33 @@ import com.xiaomai.utils.XMBaseTest;
public class GetLiveCourseId extends XMBaseTest { public class GetLiveCourseId extends XMBaseTest {
public String getLiveCourseId(){ public String createCourse(){
dataApi.setApiModule(ApiModele.CloudClass_B)
dataApi.setApiModule(ApiModele.CloudClass_B_Apollo) .setApiName("API_createBigLiveCourse")
.setApiName("API_getLargeClassLiveList")
.setTerminal(Terminal.B); .setTerminal(Terminal.B);
super.beforeDataRequest(); super.beforeDataRequest();
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
//jsonObject.put("courseState",""); //获取欢拓课程列表,没有courseState参数,普通机构有这个参数 TimeSetting startTime = new TimeSetting();
jsonObject.put("current","1"); jsonObject.put("startTime", startTime.startTime());
jsonObject.put("size", "10"); TimeSetting endTime = new TimeSetting();
jsonObject.put("instId",dataApi.getLoginInfo().getInstId()); jsonObject.put("endTime", endTime.endTime());
jsonObject.put("teacherId","1323235986786807809");
dataApi.doRequest(RequestType.JSON,dataparams,jsonObject.toJSONString(),dataheadrs).assetsSuccess(true); jsonObject.put("liveType", "LARGE_CLASS_LIVE");
jsonObject.put("adminIds", new ArrayList<>());
jsonObject.put("courseName", "自动化创建直播课");
jsonObject.put("studentIds", new ArrayList<>());
jsonObject.put("consumeStudentIds", new JSONArray());
jsonObject.put("liveCourseMediaRequests", new JSONArray());
jsonObject.put("needRecord", "YES");
jsonObject.put("applyMode", "ANYONE");
dataApi.doRequest(com.live.enums.RequestType.JSON,dataparams,jsonObject.toJSONString(),dataheadrs).assetsSuccess(true);
JSONObject responseRes = dataApi.getBodyInJSON(); JSONObject responseRes = dataApi.getBodyInJSON();
String liveCourseID = responseRes.getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("liveCourseId"); String liveCourseID = responseRes.getString("result");
return liveCourseID; return liveCourseID;
} }
} }
...@@ -79,5 +79,12 @@ ...@@ -79,5 +79,12 @@
"apiContentType": "application/json;charset=utf-8", "apiContentType": "application/json;charset=utf-8",
"apiName": "获取直播课下转码后的文档列表", "apiName": "获取直播课下转码后的文档列表",
"desc": "获取直播课下转码后的文档列表" "desc": "获取直播课下转码后的文档列表"
},
"API_sendNotify2Student": {
"apiPath":"/apollo/public/businessLive/sendNotify2Student",
"apiContentType": "application/json;charset=utf-8",
"apiName": "直播课群发学生",
"desc": "直播课群发学生"
} }
} }
\ No newline at end of file
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