private static final Logger log = LoggerFactory.getLogger(VodVideoPosterTest.class);
/**
* 获取视频封面
*/
@Test
public void testGetPoster() throws Exception, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String secretKey = super.secretKey;
String userid = super.userId;
String ptime = String.valueOf(System.currentTimeMillis());
//业务参数
String url = String.format("http://api.polyv.net/v2/video/%s/get-image",userid);
String vid = "1b448be323dec2a7bed6db61bd7d8a77_1";
String t = "1";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("ptime", ptime);
requestMap.put("vid", vid);
requestMap.put("t",t);
//系统只部分参数进行签名
Map<String, String> signMap = new HashMap<>();
signMap.put("ptime", ptime);
signMap.put("vid", vid);
signMap.put("t",t);
requestMap.put("sign", VodSignUtil.getSign(signMap, secretKey));
String response = HttpUtil.get(url, requestMap);
log.debug("测试获取视频封面,{}", response);
//do somethings
}