private static final Logger log = LoggerFactory.getLogger(VodVideoEncryptionTest.class);
/**
* 设置账号加密设置
*/
@Test
public void testSetPlaysafe() 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/setting/%s/set-playsafe", userId);
Map<String, String> requestMap = new HashMap<>();
requestMap.put("userid", userId);
requestMap.put("ptime", ptime);
requestMap.put("encrypt", "1");
requestMap.put("hlslevel", "app");
requestMap.put("sign", VodSignUtil.getSign(requestMap, secretKey));
String response = HttpUtil.postFormBody(url, requestMap);
log.debug("测试设置账号加密设置,{}", response);
//do somethings
}