|
|
@@ -0,0 +1,56 @@
|
|
|
+package com.ruoyi.logistics.config;
|
|
|
+
|
|
|
+import lombok.Data;
|
|
|
+import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+@Data
|
|
|
+@Component
|
|
|
+@ConfigurationProperties(prefix = "jd.express")
|
|
|
+public class JDExpressConfig {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 应用编码
|
|
|
+ */
|
|
|
+ private String appKey;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 应用密钥
|
|
|
+ */
|
|
|
+ private String appSecret;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 访问令牌
|
|
|
+ */
|
|
|
+ private String accessToken;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 刷新令牌
|
|
|
+ */
|
|
|
+ private String refreshToken;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * UAT环境API地址
|
|
|
+ */
|
|
|
+ private String uatServerUrl;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 生产环境API地址
|
|
|
+ */
|
|
|
+ private String prodServerUrl;
|
|
|
+
|
|
|
+ private Environment environment;
|
|
|
+
|
|
|
+ // 环境枚举
|
|
|
+ public enum Environment {
|
|
|
+ UAT, PROD
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取当前环境的API地址
|
|
|
+ */
|
|
|
+ public String getCurrentApiUrl() {
|
|
|
+ return environment == Environment.UAT ? uatServerUrl : prodServerUrl;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|