private static final Logger log = LoggerFactory.getLogger(VClassLessonTest.class);
/**
* 更新课节信息
* @throws IOException
*/
@Test
public void updateLesson() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId = super.appId;
String appSecret = super.appSecret;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/hi-class-api/open/lesson/v1/update";
String lessonId = "8970";
String name = "测试修改课节";
String startTime = "1634630909795";
String duration = "60";
String linkNumber = "1";
String autoConnectMicroEnabled = "N";
String watchCondition = "CODE";
String code = "5678";
String resolution = "720";
String playResolution = "360";
String cover = "https://liveimages.videocc.net/uploaded/images/2021/08/g1xcu49u12.jpg";
String teacherId = "g3fdl05syf";
String teacherName = "六老师";
String teacherCode = "+86";
String teacherMobile = "15555555555";
String teacherPasswd = "123456";
//http 调用逻辑
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
Map<String, Object> jsonMap = new HashMap<>();
jsonMap.put("lessonId", lessonId);
jsonMap.put("name", name);
jsonMap.put("startTime", startTime);
jsonMap.put("duration", duration);
jsonMap.put("linkNumber", linkNumber);
jsonMap.put("autoConnectMicroEnabled", autoConnectMicroEnabled);
jsonMap.put("watchCondition", watchCondition);
jsonMap.put("code", code);
jsonMap.put("resolution", resolution);
jsonMap.put("playResolution", playResolution);
jsonMap.put("cover", cover);
jsonMap.put("teacherId", teacherId);
jsonMap.put("teacherName", teacherName);
jsonMap.put("teacherCode", teacherCode);
jsonMap.put("teacherMobile", teacherMobile);
jsonMap.put("teacherPasswd", teacherPasswd);
url = HttpUtil.appendUrl(url, requestMap);
String response = HttpUtil.postJsonBody(url, JSON.toJSONString(jsonMap), null);
log.info("测试修改课节成功:{}", response);
}