فهرست منبع

项目推进提交代码

nahida 1 سال پیش
والد
کامیت
4943d4845a

+ 14 - 0
data-service/src/main/java/com/zksy/data/config/XinyonghuaihuaProperty.java

@@ -0,0 +1,14 @@
+package com.zksy.data.config;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+@Component
+@Data
+@ConfigurationProperties(prefix = "xinyonghuaihua.api")
+public class XinyonghuaihuaProperty {
+    private String host;
+    private String refreshToken;
+    private String address;
+}

+ 6 - 3
data-service/src/main/java/com/zksy/data/utils/XhRequestUtil.java

@@ -7,6 +7,7 @@ import com.zksy.common.domain.response.BaseResponse;
 import com.zksy.common.exception.CommonException;
 import com.zksy.common.utils.BeanUtils;
 import com.zksy.data.config.XhConfigProperty;
+import com.zksy.data.config.XinyonghuaihuaProperty;
 import com.zksy.data.constant.RedisKeyConstant;
 import com.zksy.data.domain.po.BasePo;
 import lombok.extern.slf4j.Slf4j;
@@ -26,6 +27,8 @@ public class XhRequestUtil {
     @Autowired
     private XhConfigProperty xhConfigProperty;
     @Autowired
+    private XinyonghuaihuaProperty xinyonghuaihuaProperty;
+    @Autowired
     private OkHttpClient okHttpClient;
     @Autowired
     private ObjectMapper objectMapper;
@@ -127,7 +130,7 @@ public class XhRequestUtil {
         refreshToken();
         HttpUrl url = new HttpUrl.Builder()
                 .scheme("http")
-                .host("59.231.127.12")
+                .host(xinyonghuaihuaProperty.getHost())
                 .addPathSegment("interface/v1/doublePublic/findLicensingList")
                 .build();
         Map<String, Object> requestBodyMap = new HashMap<>();
@@ -165,9 +168,9 @@ public class XhRequestUtil {
     private void refreshToken() {
         HttpUrl url = new HttpUrl.Builder()
                 .scheme("http")
-                .host("59.231.127.12")
+                .host(xinyonghuaihuaProperty.getHost())
                 .addPathSegment("interface/v1/auth/getToken")
-                .addQueryParameter("refreshToken", "sV7l0nLP2Ui157VRd1TvIkSpfixf22ij")
+                .addQueryParameter("refreshToken", xinyonghuaihuaProperty.getRefreshToken())
                 .build();
         Request request = new Request.Builder()
                 .url(url)