Bladeren bron

build 新增oss2

mamingxu 1 maand geleden
bovenliggende
commit
50e70c358e
1 gewijzigde bestanden met toevoegingen van 85 en 0 verwijderingen
  1. 85 0
      yyc-common-oss/src/main/java/net/yyc/common/oss/OssProperties2.java

+ 85 - 0
yyc-common-oss/src/main/java/net/yyc/common/oss/OssProperties2.java

@@ -0,0 +1,85 @@
+/*
+ *    Copyright (c) 2018-2025, hnqz All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: hnqz
+ */
+
+package net.yyc.common.oss;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+
+/**
+ * aws 配置信息
+ *
+ * @author hnqz
+ * @author 858695266 配置文件添加: oss: enable: true endpoint: http://127.0.0.1:9000 #
+ * pathStyleAccess 采用nginx反向代理或者AWS S3 配置成true,支持第三方云存储配置成false pathStyleAccess: false
+ * access-key: hnqz secret-key: hnqz bucket-name: hnqz region: custom-domain:
+ * https://oss.xxx.com/hnqz
+ * <p>
+ * bucket 设置公共读权限
+ */
+@Data
+@ConfigurationProperties(prefix = "oss2")
+public class OssProperties2 {
+
+	/**
+	 * 对象存储服务的URL
+	 */
+	private String endpoint;
+
+	/**
+	 * 自定义域名
+	 */
+	private String customDomain;
+
+	/**
+	 * true path-style nginx 反向代理和S3默认支持 pathStyle {http://endpoint/bucketname} false
+	 * supports virtual-hosted-style 阿里云等需要配置为 virtual-hosted-style
+	 * 模式{http://bucketname.endpoint}
+	 */
+	private Boolean pathStyleAccess;
+
+	/**
+	 * 应用ID
+	 */
+	private String appId;
+
+	/**
+	 * 区域
+	 */
+	private String region;
+
+	/**
+	 * Access key就像用户ID,可以唯一标识你的账户
+	 */
+	private String accessKey;
+
+	/**
+	 * Secret key是你账户的密码
+	 */
+	private String secretKey;
+
+	/**
+	 * 默认的存储桶名称
+	 */
+	private String bucketName;
+
+	/**
+	 * 对象key前缀,默认为空
+	 */
+	private String objectKeyPre;
+
+}