Commit fe79daba authored by shiyu's avatar shiyu

上传音频

parent 5bcbce87
......@@ -56,9 +56,9 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
"/wx/appletPageConfig/**", "/wx/blindBox/**","/wx/sellActivity/**","/wx/itemTagQrCode/createQrCode",
"/wx/userSignIn/**",
"/wx/userSignIn/testSignIn","/wx/userSignIn/deleteTodayRecord"
"/wx/userSignIn/testSignIn","/wx/userSignIn/deleteTodayRecord",
//下列路径上线注释
"/wx/storage/uploadAudio"
,"/wx/qdUserSignIn/**" , "/wx/qdUserSignInNote/**", "/wx/qdUserSignInTask/**",
"/wx/qdHomePage/**", "/wx/qdGiveLikeRecord/**", "/wx/qdSignInTask/**"
//"/wx/itemTagQrCode/**"
......
......@@ -153,6 +153,22 @@ public class WxStorageController {
return video;*/
}
@PostMapping("/uploadAudio")
@ApiOperation("上传音频")
public Object uploadAudio(@RequestParam("file") MultipartFile file) throws IOException {
logger.info("【请求开始】上传音频,请求参数,file:{}", file.getOriginalFilename());
InputStream fileInputStream = file.getInputStream();
String lastKey = ".wav";
if (StringUtils.isNotBlank(file.getOriginalFilename())) {
lastKey = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
}
String audioName = CommConsts.UPLOAD_PRE_VIDEO_DIRECTORY + CommonUtils.getUUID() + lastKey;
qiniuStorage.store(fileInputStream, file.getSize(), file.getContentType(), audioName);
String url = qiniuStorage.generateUrl(audioName);
return url;
}
/**
* 批量上传文件
*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment