修改文件预览地址
This commit is contained in:
parent
f000a43c9c
commit
e8a677f615
|
|
@ -18,6 +18,11 @@ import io.minio.MinioClient;
|
|||
@Data
|
||||
public class MinioConfig
|
||||
{
|
||||
|
||||
/**
|
||||
* 服务地址
|
||||
*/
|
||||
private String url;
|
||||
/**
|
||||
* 服务地址
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ public class FileUtilsServiceImpl {
|
|||
vo.setBucketName(bucketName);
|
||||
String path="/"+bucketName+"/"+filePath;
|
||||
vo.setPath(path);
|
||||
vo.setUrl(minioConfig.getEndpoint());
|
||||
vo.setUrl(minioConfig.getUrl());
|
||||
int num=mapper.insertUploadFile(vo);
|
||||
if(num>0){
|
||||
return vo;
|
||||
|
|
@ -126,7 +126,7 @@ public class FileUtilsServiceImpl {
|
|||
vo.setBucketName(bucketName);
|
||||
String path="/"+bucketName+"/"+filePath;
|
||||
vo.setPath(path);
|
||||
vo.setUrl(minioConfig.getEndpoint());
|
||||
vo.setUrl(minioConfig.getUrl());
|
||||
int num=mapper.insertUploadFile(vo);
|
||||
if(num>0){
|
||||
return vo;
|
||||
|
|
@ -176,7 +176,7 @@ public class FileUtilsServiceImpl {
|
|||
vo.setBucketName(bucketName);
|
||||
String path="/"+bucketName+"/"+filePath;
|
||||
vo.setPath(path);
|
||||
vo.setUrl(minioConfig.getEndpoint());
|
||||
vo.setUrl(minioConfig.getUrl());
|
||||
list.add(vo);
|
||||
}
|
||||
int num=mapper.insertUploadFileList(list);
|
||||
|
|
@ -232,7 +232,7 @@ public class FileUtilsServiceImpl {
|
|||
vo.setBucketName(bucketName);
|
||||
String path="/"+bucketName+"/"+filePath;
|
||||
vo.setPath(path);
|
||||
vo.setUrl(minioConfig.getEndpoint());
|
||||
vo.setUrl(minioConfig.getUrl());
|
||||
list.add(vo);
|
||||
}
|
||||
int num=mapper.insertUploadFileList(list);
|
||||
|
|
@ -255,11 +255,15 @@ public class FileUtilsServiceImpl {
|
|||
List<UploadFileVo> list=mapper.getFileList(id,sourceId,sourceTable,sourceType);
|
||||
for (UploadFileVo vo:list){
|
||||
String url=minioUtils.getFileUrl(vo.getBucketName(),vo.getFilePath(),60*60*12);
|
||||
vo.setLsUrl(url);
|
||||
String lsUrl=url.replace(minioConfig.getEndpoint(),minioConfig.getUrl());
|
||||
vo.setUrl(minioConfig.getUrl()+vo.getPath());
|
||||
vo.setLsUrl(lsUrl);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 文件批量删除
|
||||
* @param id
|
||||
|
|
|
|||
|
|
@ -26,10 +26,13 @@ public class DeviceHandle {
|
|||
public DeviceVo handel(HttpServletRequest req, HttpServletResponse resp){
|
||||
// 任务号
|
||||
String transId = req.getHeader(Constant.DEVICE_HEADER_TRANS_ID);
|
||||
System.err.println("transId===>"+transId);
|
||||
//设备id
|
||||
String devId = req.getHeader(Constant.DEVICE_HEADER_DEV_ID);
|
||||
System.err.println("devId===>"+devId);
|
||||
//设备型号
|
||||
String devModel = req.getHeader(Constant.DEVICE_HEADER_DEV_MODEL);
|
||||
System.err.println("devModel===>"+devModel);
|
||||
if(StringUtils.isEmpty(devId)) {
|
||||
log.error("请求头不含设备编号,不能处理数据");
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Reference in New Issue