feat:kyc uri
This commit is contained in:
@@ -33,8 +33,10 @@ public class SysFileController {
|
||||
// 上传并返回访问地址
|
||||
FileUploadResult urlResult = sysFileService.uploadFile(file);
|
||||
SysFile sysFile = new SysFile();
|
||||
sysFile.setName(FileUtils.getName(urlResult.getUri()));
|
||||
sysFile.setName(FileUtils.getName(urlResult.getLocalUrl()));
|
||||
sysFile.setName(FileUtils.getName(urlResult.getGatewayUrl()));
|
||||
sysFile.setUri(urlResult.getUri());
|
||||
sysFile.setLocalUrl(urlResult.getLocalUrl());
|
||||
sysFile.setUrl(urlResult.getGatewayUrl());
|
||||
return R.ok(sysFile);
|
||||
|
||||
@@ -42,6 +42,6 @@ public class FastDfsSysFileServiceImpl implements ISysFileService
|
||||
FileTypeUtils.getExtension(file), null);
|
||||
IoUtils.closeQuietly(inputStream);
|
||||
String fileUrl = domain + "/" + storePath.getFullPath();
|
||||
return new LocalSysFileServiceImpl.FileUploadResult(fileUrl, fileUrl);
|
||||
return new LocalSysFileServiceImpl.FileUploadResult(fileUrl, fileUrl, fileUrl);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,20 +49,27 @@ public class LocalSysFileServiceImpl implements ISysFileService
|
||||
@Override
|
||||
public FileUploadResult uploadFile(MultipartFile file) throws Exception {
|
||||
String name = FileUploadUtils.upload(localFilePath, file);
|
||||
String uri = localFilePrefix + name;
|
||||
String localUrl = domain + localFilePrefix + name;
|
||||
String gatewayUrl = gateway + pathPrefix + localFilePrefix + name;
|
||||
return new FileUploadResult(localUrl, gatewayUrl);
|
||||
return new FileUploadResult(uri, localUrl, gatewayUrl);
|
||||
}
|
||||
|
||||
public static class FileUploadResult {
|
||||
private final String uri;
|
||||
private final String localUrl;
|
||||
private final String gatewayUrl;
|
||||
|
||||
public FileUploadResult(String localUrl, String gatewayUrl) {
|
||||
public FileUploadResult(String uri, String localUrl, String gatewayUrl) {
|
||||
this.uri = uri;
|
||||
this.localUrl = localUrl;
|
||||
this.gatewayUrl = gatewayUrl;
|
||||
}
|
||||
|
||||
public String getUri() {
|
||||
return uri;
|
||||
}
|
||||
|
||||
public String getLocalUrl() {
|
||||
return localUrl;
|
||||
}
|
||||
|
||||
@@ -45,6 +45,6 @@ public class MinioSysFileServiceImpl implements ISysFileService
|
||||
client.putObject(args);
|
||||
IoUtils.closeQuietly(inputStream);
|
||||
String fileUrl = minioConfig.getUrl() + "/" + minioConfig.getBucketName() + "/" + fileName;
|
||||
return new LocalSysFileServiceImpl.FileUploadResult(fileUrl, fileUrl);
|
||||
return new LocalSysFileServiceImpl.FileUploadResult(fileUrl, fileUrl, fileUrl);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user