fix[文件服务]:上传文件后返回的FilePath不需要拼接bucketname,查询的时候直接通过该FilePath查询即可,机库上传传过来的参数本身就是不带bucketname的
This commit is contained in:
@@ -103,6 +103,8 @@ public class OssService extends AbstractIFileService {
|
||||
fileInfo.setIsImg(ossObject.getKey().endsWith(".jpeg") || ossObject.getKey().endsWith(".png") || ossObject.getKey().endsWith(".gif"));
|
||||
if (fileInfo.getIsImg()) {
|
||||
fileInfo.setContentType("image/jpeg");
|
||||
}else {
|
||||
fileInfo.setContentType("video/mp4");
|
||||
}
|
||||
|
||||
int res = baseMapper.insert(fileInfo);
|
||||
|
||||
@@ -36,6 +36,7 @@ public class OrderFile extends SuperEntity {
|
||||
private Long tourismId;
|
||||
|
||||
private String fileType;
|
||||
//该Path不包含bucketName
|
||||
private String filePath;
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
+2
-2
@@ -78,7 +78,7 @@ public class OssTemplate implements InitializingBean {
|
||||
ossClient.putObject(putObjectRequest);
|
||||
|
||||
ObjectInfo obj = new ObjectInfo();
|
||||
obj.setObjectPath(bucketName + PATH_SPLIT + objectName);
|
||||
obj.setObjectPath(objectName);
|
||||
obj.setObjectUrl(getViewUrl(objectName));
|
||||
return obj;
|
||||
}
|
||||
@@ -96,7 +96,7 @@ public class OssTemplate implements InitializingBean {
|
||||
ossClient.putObject(putObjectRequest);
|
||||
|
||||
ObjectInfo obj = new ObjectInfo();
|
||||
obj.setObjectPath(fileProperties.getOss().getBucketName() + PATH_SPLIT + objectName);
|
||||
obj.setObjectPath(objectName);
|
||||
// obj.setObjectUrl(fileProperties.getOss().getEndpoint() + PATH_SPLIT + obj.getObjectPath());
|
||||
//需要重新获取可访问带有认证信息的url
|
||||
obj.setObjectUrl(getViewUrl(objectName));
|
||||
|
||||
Reference in New Issue
Block a user