pigx-common-oss

This commit is contained in:
sxu 2025-03-14 14:44:19 +08:00
parent 6b16897c70
commit eb85bcc8c2
3 changed files with 1175 additions and 72 deletions

View File

@ -1,7 +1,7 @@
package com.pig4cloud.pigx.common.oss;
import com.pig4cloud.pigx.common.oss.http.OssEndpoint;
import com.pig4cloud.pigx.common.oss.service.OssTemplate;
import lombok.Generated;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
@ -24,15 +24,7 @@ public class OssAutoConfiguration {
return new OssTemplate(this.properties);
}
@Bean
@ConditionalOnProperty(
name = {"oss.info"},
havingValue = "true"
)
public OssEndpoint ossEndpoint(OssTemplate template) {
return new OssEndpoint(template);
}
@Generated
public OssAutoConfiguration(final OssProperties properties) {
this.properties = properties;
}

View File

@ -1,5 +1,6 @@
package com.pig4cloud.pigx.common.oss;
import lombok.Generated;
import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties(
@ -18,94 +19,117 @@ public class OssProperties {
private Integer expiresTime = 604800;
private Boolean useToken = false;
@Generated
public String getEndpoint() {
return this.endpoint;
}
@Generated
public String getCustomDomain() {
return this.customDomain;
}
@Generated
public Boolean getPathStyleAccess() {
return this.pathStyleAccess;
}
@Generated
public String getAppId() {
return this.appId;
}
@Generated
public String getRegion() {
return this.region;
}
@Generated
public String getAccessKey() {
return this.accessKey;
}
@Generated
public String getSecretKey() {
return this.secretKey;
}
@Generated
public String getBucketName() {
return this.bucketName;
}
@Generated
public Boolean getUseHttp() {
return this.useHttp;
}
@Generated
public Integer getExpiresTime() {
return this.expiresTime;
}
@Generated
public Boolean getUseToken() {
return this.useToken;
}
@Generated
public void setEndpoint(final String endpoint) {
this.endpoint = endpoint;
}
@Generated
public void setCustomDomain(final String customDomain) {
this.customDomain = customDomain;
}
@Generated
public void setPathStyleAccess(final Boolean pathStyleAccess) {
this.pathStyleAccess = pathStyleAccess;
}
@Generated
public void setAppId(final String appId) {
this.appId = appId;
}
@Generated
public void setRegion(final String region) {
this.region = region;
}
@Generated
public void setAccessKey(final String accessKey) {
this.accessKey = accessKey;
}
@Generated
public void setSecretKey(final String secretKey) {
this.secretKey = secretKey;
}
@Generated
public void setBucketName(final String bucketName) {
this.bucketName = bucketName;
}
@Generated
public void setUseHttp(final Boolean useHttp) {
this.useHttp = useHttp;
}
@Generated
public void setExpiresTime(final Integer expiresTime) {
this.expiresTime = expiresTime;
}
@Generated
public void setUseToken(final Boolean useToken) {
this.useToken = useToken;
}
@Generated
public boolean equals(final Object o) {
if (o == this) {
return true;
@ -251,10 +275,12 @@ public class OssProperties {
}
}
@Generated
protected boolean canEqual(final Object other) {
return other instanceof OssProperties;
}
@Generated
public int hashCode() {
int PRIME = true;
int result = 1;
@ -283,6 +309,7 @@ public class OssProperties {
return result;
}
@Generated
public String toString() {
String var10000 = this.getEndpoint();
return "OssProperties(endpoint=" + var10000 + ", customDomain=" + this.getCustomDomain() + ", pathStyleAccess=" + this.getPathStyleAccess() + ", appId=" + this.getAppId() + ", region=" + this.getRegion() + ", accessKey=" + this.getAccessKey() + ", secretKey=" + this.getSecretKey() + ", bucketName=" + this.getBucketName() + ", useHttp=" + this.getUseHttp() + ", expiresTime=" + this.getExpiresTime() + ", useToken=" + this.getUseToken() + ")";