private static final Logger log = LoggerFactory.getLogger(VodVideoCourseWare.class);
/**
* 异步上传课件
*/
@Test
public void testUploadCourseWareAsync() 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/uploadPPT/asyn", userid);
String vid = "1b448be32303e4922a8f70d6b48220ae_1";
String format = "json";
String pptFilePath = getClass().getResource("/file/").getPath() + "Courseware.ppt";
File courseware = new File(pptFilePath);
Map<String, String> requestMap = new HashMap<>();
requestMap.put("ptime", ptime);
requestMap.put("vid", vid);
requestMap.put("format", format);
Map<String, File> fileMap = new HashMap<>();
fileMap.put("courseware", courseware);
requestMap.put("sign", VodSignUtil.getSign(requestMap, secretKey));
String response = HttpUtil.postFile(url, requestMap, fileMap, Constant.UTF8);
log.debug("测试异步上传课件,{}", response);
//do somethings
}