private static final Logger log = LoggerFactory.getLogger(getClass());
/**
* 审核通过聊天信息
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void messageAuditTest() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId = super.appId;
String appSecret = super.appSecret;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/live/v4/chat/message/audit";
String channelId = "1965681";
//http 调用逻辑
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("channelId", channelId);
requestMap.put("timestamp", timestamp);
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
url = HttpUtil.appendUrl(url, requestMap);
Map<String, String> jsonMap = new HashMap<>();
jsonMap.put("msgId","msg-1");
jsonMap.put("content","我发送了一条消息");
jsonMap.put("viewerId","sadboy");
jsonMap.put("nickName","polyv");
List<Map<String, String>> list = new ArrayList<>();
list.add(jsonMap);
String response = HttpUtil.postJsonBody(url,JSON.toJSONString(list),null);
log.info("测试审核通过聊天信息成功:{}", response);
//do somethings
}