private static final Logger log = LoggerFactory.getLogger(LiveInteractionTest.class);
/**
* 新增修改频道答题卡
* @throws IOException
*/
@Test
public void testAddEditQuestion() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId=super.appId;
String appSecret=super.appSecret;
String timestamp=String.valueOf(System.currentTimeMillis());
//业务参数
String channelId = "4760542";
String url = "https://api.polyv.net/live/v3/channel/interact/question/add-edit-question";
//http 调用逻辑
Map<String,String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp",timestamp);
requestMap.put("channelId",channelId);
requestMap.put("type", "R");
requestMap.put("answer", "A");
requestMap.put("name", "test");
requestMap.put("itemType", "0");
requestMap.put("option1", "正确");
requestMap.put("option2", "错误");
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
String response = HttpUtil.postFormBody(url, requestMap);
log.info("测试频道答题卡新增修改接口返回值:{}",response);
//do somethings
}