private static final Logger log = LoggerFactory.getLogger(ChannelOperateTest.class);
/**
* 创建MR频道
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void testCreateMrChannel() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际
String appId = super.appId;
String appSecret = super.appSecret;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/live/v4/channel/mr/create";
String name = "MR直播接口测试";
String categoryId = "391352";
Long startTime = new Date().getTime() + 30 * 60 * 1000l;
//http 调用逻辑
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
Map<String, String> bodyMap = new HashMap<>();
bodyMap.put("name", name);
bodyMap.put("categoryId", categoryId);
bodyMap.put("startTime", String.valueOf(startTime));
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
String body = JSON.toJSONString(bodyMap);
url = HttpUtil.appendUrl(url, requestMap);
String response = HttpUtil.postJsonBody(url, body, null);
log.info("测试创建MR频道成功:{}", response);
//do somethings
}