Browse Source

项目初始化

dchen 1 week ago
parent
commit
8a6d014864

+ 8 - 12
src/main/java/com/tiangua/star/service/impl/XinLuDataProcessor.java

@@ -15,11 +15,13 @@ import org.apache.http.client.utils.URIBuilder;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClients;
 import org.apache.http.util.EntityUtils;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.SpringApplication;
 import org.springframework.context.ConfigurableApplicationContext;
 import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.PostConstruct;
 import java.io.IOException;
 import java.net.URISyntaxException;
 import java.nio.charset.StandardCharsets;
@@ -39,21 +41,15 @@ public class XinLuDataProcessor implements XinLuService {
     private static final CloseableHttpClient httpClient = HttpClients.createDefault();
 
 
-//    @Value("${xinlu.callback.url}")
-//    private String url;
+    @Value("${xinlu.callback.url}")
+    private String url;
 
 
-//    @PostConstruct
-//    public void init() {
-//        System.out.println("Loaded XinLu callback URL: " + environment.getProperty("xinlu.callback.url"));
-//        System.out.println("Loaded XinLu callback URL: " + environment.getProperty("spring.application.name"));
-//        System.out.println("Loaded XinLu callback URL: " + environment.getProperty("spring.application.name"));
-////        log.info("Loaded XinLu callback URL: {}", url); // 查看日志输出
-//    }
+    @PostConstruct
+    public void init() {
+       log.info("xinlu init{}",url);
+    }
 
-////    private static final String URL =  "https://loan-web-api2.internal.jiebide.xin/xinlu/callback";
-////    private static final String URL =  "https://api.hryk.net/xinlu/callback";
-    private static final String url =  "http://192.168.0.61:810/xinlu/callback";
 
     /**
      * 处理机构数据入口

+ 0 - 6
src/main/resources/application-pre.yml

@@ -1,9 +1,3 @@
-server:
-  port: 8801
-spring:
-  application:
-    name: loan-call-back-star
-
 xinlu:
   callback:
     url: https://loan-web-api2.internal.jiebide.xin/xinlu/request

+ 0 - 8
src/main/resources/application-prod.yml

@@ -1,11 +1,3 @@
-# tomcat配置
-server:
-  port: 8801
-spring:
-  application:
-    name: loan-call-back-star
-
-
 xinlu:
   callback:
     url: https://api.hryk.net/xinlu/request

+ 5 - 0
src/main/resources/application.yml

@@ -1,6 +1,11 @@
 spring:
   profiles:
     active: pre
+  application:
+    name: loan-call-back-star
 logging.config: classpath:logback-${spring.profiles.active}.xml
 
+server:
+  port: 8801
+