private static final Logger log = LoggerFactory.getLogger(VodVideoEncryptionTest.class);
/**
* 修改视频的授权方式
*/
@Test
public void testUpdateAuthLevel() throws Exception, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String secretKey = super.secretKey;
String userId = super.userId;
String ptime = String.valueOf(System.currentTimeMillis());
//业务参数
String url = String.format("http://api.polyv.net/v2/config/%s/hlslevel", userId);
String vids = "1b448be323b68b2999802799a98dba54_1,1b448be323ae991b1dfc5136597618d1_1";
String hlslevel = "app";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("userid", userId);
requestMap.put("ptime", ptime);
requestMap.put("vids", vids);
requestMap.put("hlslevel", hlslevel);
requestMap.put("sign", VodSignUtil.getSign(requestMap, secretKey));
String response = HttpUtil.postFormBody(url, requestMap);
log.debug("测试修改视频的授权方式,{}", response);
//do somethings
}