!243 合并 oss 私有库功能

update 优化 支持 oss 私有库功能
This commit is contained in:
疯狂的狮子Li
2022-11-03 03:13:27 +00:00
parent 8bd023b49f
commit cd9c3c3f4f
13 changed files with 332 additions and 173 deletions

View File

@ -0,0 +1,55 @@
package com.ruoyi.oss.enumd;
import com.amazonaws.services.s3.model.CannedAccessControlList;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 桶访问策略配置
*
* @author 陈賝
*/
@Getter
@AllArgsConstructor
public enum AccessPolicyType {
/**
* private
*/
PRIVATE("0", CannedAccessControlList.Private, PolicyType.WRITE),
/**
* public
*/
PUBLIC("1", CannedAccessControlList.PublicRead, PolicyType.READ),
/**
* custom
*/
CUSTOM("2",CannedAccessControlList.PublicRead, PolicyType.READ);
/**
* 桶 权限类型
*/
private final String type;
/**
* 文件对象 权限类型
*/
private final CannedAccessControlList acl;
/**
* 桶策略类型
*/
private final PolicyType policyType;
public static AccessPolicyType getByType(String type) {
for (AccessPolicyType value : values()) {
if (value.getType().equals(type)) {
return value;
}
}
throw new RuntimeException("'type' not found By " + type);
}
}