private static final Logger log = LoggerFactory.getLogger(ChannelOperateTest.class);
/**
* 分配分帐号资源
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void groupUserPackageTest() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId = super.groupAppId;
String appSecret = super.groupAppSecret;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/live/v4/group/user/package/update";
String email = "polyvtest123456@polyv.net";
String balance = "10";
String concurrent = "101";
String remainFlow = "20";
String remainSpace = "20";
//http 调用逻辑
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
Map<String, Object> jsonMap = new HashMap<>();
jsonMap.put("email", email);
jsonMap.put("balance", balance);
jsonMap.put("concurrent", concurrent);
jsonMap.put("remainFlow", remainFlow);
jsonMap.put("remainSpace", remainSpace);
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
}