private static final Logger log = LoggerFactory.getLogger(PasswordTest.class);
/**
* 设置视频播放密码
* @throws Exception
* @throws NoSuchAlgorithmException
*/
@Test
public void testSetVideoPassword() throws Exception, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String secretKey = super.secretKey;
String userId = super.userId;
String ptime = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/v2/video/"+userId+"/video-setting-save";
String vids = "1b448be323631e6e80e12e0790609f68_1,1b448be323d7e4c49d5634abd5af0bcb_1";
String tag = "标签";
String title = "视频标题";
String password = "123456";
String describ = "描述";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("userId", userId);
requestMap.put("ptime", ptime);
requestMap.put("vids", vids);
requestMap.put("tag", tag);
requestMap.put("title", title);
requestMap.put("password", password);
requestMap.put("describ", describ);
requestMap.put("sign", VodSignUtil.getSign(requestMap, secretKey));
String response = HttpUtil.postFormBody(url,requestMap);
log.debug("测试设置视频播放密码,{}", response);
//do somethings
}