| package com.ruoyi.common.config; | 
|   | 
| import com.alibaba.fastjson2.JSONObject; | 
| import lombok.Data; | 
| import lombok.extern.slf4j.Slf4j; | 
| import org.springframework.boot.context.properties.ConfigurationProperties; | 
| import org.springframework.stereotype.Component; | 
|   | 
| import javax.annotation.PostConstruct; | 
|   | 
| /** | 
|  * 存储-配置 | 
|  * | 
|  * @author mitao | 
|  */ | 
| @ConfigurationProperties(prefix = "oss") | 
| @Component | 
| @Slf4j | 
| @Data | 
| public class OssConfig { | 
|   | 
|     private String folder = "dev"; | 
|   | 
|     private String accessKeyId; | 
|   | 
|     private String accessKeySecret; | 
|   | 
|     private String uploadEndpoint; | 
|   | 
|     private String downloadEndpoint; | 
|   | 
|     private String bucketName; | 
|   | 
|     public static String FOLDER; | 
|     public static String ACCESS_KEY_ID; | 
|     public static String ACCESS_KEY_SECRET; | 
|     public static String UPLOAD_ENDPOINT; | 
|     public static String DOWNLOAD_ENDPOINT; | 
|     public static String BUCKET_NAME; | 
|   | 
|   | 
|     @PostConstruct | 
|     public void init() { | 
|   | 
|         log.debug("OSS配置信息:" + JSONObject.toJSONString(this)); | 
|         FOLDER = folder; | 
|         ACCESS_KEY_ID = accessKeyId; | 
|         ACCESS_KEY_SECRET = accessKeySecret; | 
|         UPLOAD_ENDPOINT = uploadEndpoint; | 
|         DOWNLOAD_ENDPOINT = downloadEndpoint; | 
|         BUCKET_NAME = bucketName; | 
|     } | 
|   | 
|     public String getStoreFolder() { | 
|   | 
|         return getFolder(); | 
|     } | 
|   | 
| } |