Commit 73ef6161 authored by m1991's avatar m1991

资讯模块数据——视频功能修复

parent de681f68
......@@ -48,10 +48,10 @@ public class UploadServiceImpl implements UploadService {
public Map<String, Object> uploadVideo(MultipartFile file,HttpServletRequest request,String zxField,String zxAddress,String inviteCode) throws Exception {
Map<String, Object> resultMap=new HashMap<String, Object>();
/**
* http://路径
* http://路径 request.getScheme() + "://" + request.getServerName()
* + ":" + request.getServerPort()+/upload/";"
*/
String basePath = request.getScheme() + "://" + request.getServerName()
+ ":" + request.getServerPort()+"/upload/";
String basePath ="/upload/";
Long time = new Date().getTime();
String fileName = file.getOriginalFilename();//文件原始名称
......@@ -105,8 +105,9 @@ public class UploadServiceImpl implements UploadService {
*/
Long zxDate= Long.valueOf(System.currentTimeMillis());
String basePath = request.getScheme() + "://" + request.getServerName()
+ ":" + request.getServerPort()+"/mimi/upload/";
// request.getScheme() + "://" + request.getServerName()
// + ":" + request.getServerPort()+"/upload/";
String basePath = "/upload/";
Long time = System.currentTimeMillis();
......@@ -114,7 +115,7 @@ public class UploadServiceImpl implements UploadService {
String suffixName = zxName.substring(zxName.lastIndexOf("."));//从最后一个.开始截取。截取zxName的后缀名
String newzxName = time+suffixName; //文件新名称
//设置文件存储路径,可以存放在你想要指定的路径里面
String rootPath="/opt/upload/video/"; //上传图片存放位置
String rootPath="/opt/upload/"; //上传图片存放位置
String filePath = rootPath+newzxName;
File newFile = new File(filePath);
......@@ -135,6 +136,14 @@ public class UploadServiceImpl implements UploadService {
return resultMap;
}
/**
* 多图片
* @param files
* @param zxField
* @param zxAddress
* @param inviteCode
* @return
*/
@Override
public List imageUpload(MultipartFile[] files, String zxField, String zxAddress,String inviteCode) {
//获取上传图片数量,打印在控制台
......@@ -158,7 +167,7 @@ public class UploadServiceImpl implements UploadService {
String fileType = file.getContentType();
if (fileType.equals("image/jpeg") || fileType.equals("image/png")) {
// 要上传的目标文件存放的绝对路径
String rootPath="D:/mimi/upload/images/"; //上传图片存放位置
String rootPath="D:/upload/"; //上传图片存放位置
//上传后保存的文件名(需要防止图片重名导致的文件覆盖)
//获取文件名
fileName = file.getOriginalFilename();
......
......@@ -22,9 +22,9 @@ public class LastAccountController {
@Autowired
private AccountService accountService;
@ApiOperation(value = "复制表-结构和数据", notes = "复制表-结构和数据", httpMethod = "PUT")
@PutMapping("/add")
public void copyTable(){
accountService.mirrorImage();
}
// @ApiOperation(value = "复制表-结构和数据", notes = "复制表-结构和数据", httpMethod = "PUT")
// @PutMapping("/add")
// public void copyTable(){
// accountService.mirrorImage();
// }
}
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