private static final Logger log = LoggerFactory.getLogger(VodChapterMakerTest.class);
/**
* 设置打点信息
* @throws Exception
* @throws NoSuchAlgorithmException
*/
@Test
public void testAddChapterMarker() 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/saveKeyFrame", userId);
String vid = "1b448be323a6a1a6c0c237856f555e88_1";
String desc = "测试打点10s,测试打点20s";
String seconds = "10,20";
String btnsettingswitch = "Y";
String btndesc = "测试打点按钮";
String btnhref = "https://baidu.com";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("userid", userId);
requestMap.put("ptime", ptime);
requestMap.put("vid", vid);
requestMap.put("desc", desc);
requestMap.put("seconds", seconds);
requestMap.put("btnsettingswitch", btnsettingswitch);
requestMap.put("btndesc", btndesc);
requestMap.put("btnhref", btnhref);
//系统只部分参数进行签名
Map<String, String> signMap = new HashMap<>();
signMap.put("userid", userId);
signMap.put("ptime", ptime);
signMap.put("vid", vid);
requestMap.put("sign", VodSignUtil.getSign(signMap, secretKey));
String response = HttpUtil.postFormBody(url, requestMap);
log.debug("测试设置打点信息,{}", response);
//do somethings
}