Commit 34646b81 authored by liqin's avatar liqin 💬

Merge branch 'master' of http://111.203.232.171:8888/licc/shop-mall into master

parents f307c01e d8137ccf
......@@ -56,12 +56,12 @@ public class UploadServiceImpl implements UploadService {
+ ":" + request.getServerPort()+"/mimi/upload/video/";
Long time = System.currentTimeMillis();
String zxName = file.getOriginalFilename();//文件原始名称
//.getOriginalFilename()
String zxName = file.getName();//文件原始名称
String suffixName = zxName.substring(zxName.lastIndexOf("."));//从最后一个.开始截取。截取zxName的后缀名
String newzxName = time+suffixName; //文件新名称
//设置文件存储路径,可以存放在你想要指定的路径里面
String rootPath="http:/mimi/"+File.separator+"upload/video/"; //上传视频存放位置
String rootPath=basePath+File.separator+"upload/video/"; //上传视频存放位置
String filePath = rootPath+newzxName;
......
......@@ -58,7 +58,7 @@ public class UploadController {
@ApiImplicitParam(name = "zxAddress", value = "资讯发布地址", dataType = "String"),
@ApiImplicitParam(name = "userId", value = "用户手机号(发布人)", required = true, dataType = "String")})
@RequestMapping(value = "/uploadVideo", method = RequestMethod.POST)
public Map<String, Object> uploadVideo(MultipartFile file, HttpServletRequest request, String userId, String zxField, String zxAddress) throws Exception {
public Map<String, Object> uploadVideo(@RequestParam(value = "files")MultipartFile file, HttpServletRequest request, String userId, String zxField, String zxAddress) throws Exception {
return uploadService.uploadVideo(file, request, userId, zxField, zxAddress);
}
......@@ -76,7 +76,7 @@ public class UploadController {
@ApiImplicitParam(name = "zxAddress", value = "资讯发布地址", dataType = "String"),
@ApiImplicitParam(name = "userId", value = "用户手机号", required = true, dataType = "String")})
@RequestMapping(value = "/uploadImage", method = RequestMethod.POST)
public Map<String, Object> uploadImage(MultipartFile file, HttpServletRequest request, String userId, String zxField, String zxAddress) throws Exception {
public Map<String, Object> uploadImage(@RequestParam(value = "files")MultipartFile file, HttpServletRequest request, String userId, String zxField, String zxAddress) throws Exception {
return uploadService.uploadImage(file, request, userId, zxField, zxAddress);
......
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