private static final Logger log = LoggerFactory.getLogger(getClass());
/**
* 更新防录屏默认模板设置
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void updateMarqueeTemplateTest() 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/user/template/marquee/update";
String antiRecordType = "marquee";
String autoZoomEnabled = "Y";
String content = "测试跑马灯内容test";
String doubleEnabled = "N";
String enable = "Y";
String fontColor = "#ff4d4f";
String fontSize = "20";
String modelType = "fixed";
String opacity = "80";
String showMode = "flicker";
//http 调用逻辑
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
Map<String, Object> jsonMap = new HashMap<>();
jsonMap.put("antiRecordType", antiRecordType);
jsonMap.put("autoZoomEnabled", autoZoomEnabled);
jsonMap.put("content", content);
jsonMap.put("doubleEnabled", doubleEnabled);
jsonMap.put("enable", enable);
jsonMap.put("fontColor", fontColor);
jsonMap.put("fontSize", fontSize);
jsonMap.put("modelType", modelType);
jsonMap.put("opacity", opacity);
jsonMap.put("showMode", showMode);
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
}