private final Logger log = LoggerFactory.getLogger(getClass());
/**
* 修改任务奖励活动
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void createTaskRewardTest() 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/task-reward-activity/update";
//业务参数
Integer channelId = 5004544;
String activityId = 1134;
String activityName = "demoData";
Integer taskRule = 1;
Long startTime = 1722035312584;
Long endTime = 1722036312584;
List<Task> tasks = new ArrayList();
//http 调用逻辑
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
Map<String, Object> jsonMap = new HashMap<>();
jsonMap.put("channelId", channelId);
jsonMap.put("activityId", activityId);
jsonMap.put("activityName", activityName);
jsonMap.put("taskRule", taskRule);
jsonMap.put("startTime", startTime);
jsonMap.put("endTime", endTime);
jsonMap.put("tasks", tasks);
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
url = HttpUtil.appendUrl(url, requestMap);
String response = HttpUtil.postJsonBody(url, JSON.toJSONString(jsonMap), null);
log.info("测试修改活动结果:{}", response);
//do somethings
}