private static final Logger log = LoggerFactory.getLogger(ChannelOperateTest.class);
/**
* 查询频道商品设置
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void testUpdateProductSetting() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId = super.appId;
String appSecret = super.appSecret;
String userId = super.userId;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "https://api.polyv.net/live/v4/channel/product/push/rule";
String channelId = "2779045";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("channelId", channelId);
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
String jsonStr = "{\"productPushRule\":\"smallCard\",\"productLinkJumpTipEnabled\":\"N\"," +
"\"productLinkJumpTipDetail\":{\"ordinaryProductTip\":\"查看了\",\"financialProductTip\":\"购买了\"," +
"\"jobProductTip\":\"投递了\"},\"productHotEffectEnabled\":\"Y\",\"normalProductHotEffectTips\":\"热卖中\"," +
"\"jobProductHotEffectTips\":\"投送中\",\"financeProductHotEffectTips\":\"选购中\"}";
url = HttpUtil.appendUrl(url, requestMap);
String response = HttpUtil.postJsonBody(url, jsonStr, null);
log.info("测试修改频道商品配置,返回值:{}", response);
//do somethings
}