private static final Logger log = LoggerFactory.getLogger(VodStatisticsTest.class);
/**
* 批量查询视频的总播放次数
* @throws Exception
* @throws NoSuchAlgorithmException
*/
@Test
public void testGetVideoPlaytimes() throws Exception, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String secretKey = super.secretKey;
String userId = super.userId;
String ptime = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/v2/data/" + userId + "/play-times";
String vids = "1b448be323dec2a7bed6db61bd7d8a77_1,1b448be323fb327a42539cbb788913b4_1";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("userId", userId);
requestMap.put("ptime", ptime);
requestMap.put("vids", vids);
requestMap.put("sign", VodSignUtil.getSign(requestMap, secretKey));
String response = HttpUtil.postFormBody(url, requestMap);
log.debug("测试批量查询视频的总播放次数,{}", response);
//do somethings
}