private final Logger log = LoggerFactory.getLogger(getClass());
/**
* 查询主播详情
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void getChannelAnchorTest() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId = super.appId;
String appSecret = super.appSecret;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "https://api.polyv.net/live/v4/channel/anchor/get";
Long anchorId = 1L;
//http 调用逻辑
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("anchorId", anchorId);
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
url = HttpUtil.appendUrl(url, requestMap);
String response = HttpUtil.get(url, null);
log.info("测试查询主播详情结果:{}", response);
//do somethings
}