http://api.polyv.net/live/v4/chat/batch-checkin
http://api.polyv.net/live/v4/chat/batch-checkin?appId=frlr1zazn3&sign=FD701BFA3DCE2C7DCC362A904DBF48B0×tamp=1636536555144
[
{
"channelId":4032639,
"limitTime":30,
"delayTime":1700734800000,
"message":"tips1"
},
{
"channelId":4032640,
"limitTime":30,
"delayTime":1700734800000,
"message":"tips2"
}
]
private static final Logger log = LoggerFactory.getLogger(getClass());
@Test
public void testBatchCheckin() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际
String appId = super.appId;
String appSecret = super.appSecret;
String userId = super.userId;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/live/v4/chat/batch-checkin";
//http 调用逻辑
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
String body = "[{"channelId":4032639,"limitTime":30,"delayTime":1700734800000},{"channelId":4032640,"limitTime":30,"delayTime":1700734800000}]";
url = HttpUtil.appendUrl(url, requestMap);
String response = HttpUtil.postJsonBody(url,body,null);
log.info("测试批量设置签到功能,返回值:{}", response);
//do somethings
}
{
"code": 200,
"status": "success",
"requestId": "62af5d29-a836-4bfb-8c4d-cbd6a84ea7e9",
"data": true,
"success": true
}
{
"code": 400,
"status": "error",
"requestId": "4081dbac03e6441e8bdd301d8feee5a2.124.16360831818611581",
"error": {
"code": 20001,
"desc": "application not found."
},
"success": false
}
{
"code": 400,
"status": "error",
"requestId": "4081dbac03e6441e8bdd301d8feee5a2.124.16360831818611581",
"error": {
"code": 1097,
"desc": "非法的频道ID"
},
"success": false
}
{
"code": 400,
"status": "error",
"requestId": "4081dbac03e6441e8bdd301d8feee5a2.124.16360831818611581",
"error": {
"code": 1099,
"desc": "签到失败: 序号为[0],时间区间存在重叠或时间区间间隔小于5秒,不允许添加"
},
"success": false
}
{
"code": 400,
"status": "error",
"requestId": "4081dbac03e6441e8bdd301d8feee5a2.124.16360831818611581",
"error": {
"code": 1099,
"desc": "签到失败: 序号为[0,2],签到失败"
},
"success": false
}