private static final Logger log = LoggerFactory.getLogger(VodPlayAuthTest.class);
/**
* 修改视频的授权播放开关
* @throws Exception
* @throws NoSuchAlgorithmException
*/
@Test
public void testUpdatePlayAuthSetting() 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/video/%S/authplay-status", userId);
String vids = "1b448be32303e4922a8f70d6b48220ae_1,1b448be3239482977934f099f2ceaa0a_1";
String playauth = String.valueOf(0);
Map<String, String> requestMap = new HashMap<>();
requestMap.put("userId", userId);
requestMap.put("ptime", ptime);
requestMap.put("vids", vids);
requestMap.put("playauth", playauth);
requestMap.put("sign", VodSignUtil.getSign(requestMap, secretKey));
String response = HttpUtil.postFormBody(url, requestMap);
log.debug("测试修改视频的授权播放开关,{}", response);
//do somethings
}