private static final Logger log = LoggerFactory.getLogger(VodStatisticsTest.class);
/**
* 查询观众量统计
* @throws Exception
* @throws NoSuchAlgorithmException
*/
@Test
public void testGetViewerNumber() 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/data/visitor/%s", userId);
String vid = "1b448be323b8d9b9489dcd7e8e09f087_1";
String dr = "last_month";
String startDate = "2021-03-30";
String endDate = "2021-04-01";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("userId", userId);
requestMap.put("ptime", ptime);
requestMap.put("vid", vid);
requestMap.put("startDate", startDate);
requestMap.put("endDate", endDate);
requestMap.put("sign", VodSignUtil.getSign(requestMap, secretKey));
String response = HttpUtil.get(url, requestMap);
log.debug("测试查询观众量统计,{}", response);
//do somethings
}