Browse Source

add:增加动态刷新配置注解

lyx 21 hours ago
parent
commit
1a308cb998

+ 2 - 0
alien-lawyer/src/main/java/shop/alien/lawyer/controller/AiAutoReview.java

@@ -5,6 +5,7 @@ import io.swagger.annotations.Api;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.cloud.context.config.annotation.RefreshScope;
 import org.springframework.http.HttpEntity;
 import org.springframework.http.HttpHeaders;
 import org.springframework.http.MediaType;
@@ -26,6 +27,7 @@ import java.util.Map;
 @RestController
 @RequestMapping("/aiAutoReview")
 @RequiredArgsConstructor
+@RefreshScope
 public class AiAutoReview {
 
     private final AiAuthTokenUtil aiAuthTokenUtil;

+ 3 - 1
alien-store/src/main/java/shop/alien/store/controller/AiChatController.java

@@ -6,6 +6,7 @@ import io.swagger.annotations.Api;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.cloud.context.config.annotation.RefreshScope;
 import org.springframework.http.HttpEntity;
 import org.springframework.http.HttpHeaders;
 import org.springframework.http.MediaType;
@@ -27,13 +28,14 @@ import java.util.Map;
 @RestController
 @RequestMapping("/aiChat")
 @RequiredArgsConstructor
+@RefreshScope
 public class AiChatController {
 
     private final AiAuthTokenUtil aiAuthTokenUtil;
 
     private final RestTemplate restTemplate;
 
-    @Value("${third-party-ai-chat.base-url:http://192.168.2.250:9000/ai/life-manager/api/v1/question_classification/classify_and_route}")
+    @Value("${third-party-ai-chat.base-url:http://192.168.2.250:9100/ai/life-manager/api/v1/question_classification/classify_and_route}")
     private String aiChatUrl;