Parcourir la source

feat(job): 引入第三方接口配置并替换硬编码URL

- 新增商品审核接口URL配置项
- 新增商品审核结果接口URL配置项
- 替换登录接口硬编码URL为配置项
- 替换商品投诉记录提交接口硬编码URL为配置项
- 替换商品投诉记录结果接口硬编码URL为配置项
zjy il y a 1 semaine
Parent
commit
528e35062e

+ 11 - 3
alien-job/src/main/java/shop/alien/job/second/AiCheckXxlJob.java

@@ -80,6 +80,14 @@ public class AiCheckXxlJob {
     @Value("${third-party-pass-word.base-url}")
     private String passWord;
 
+    // 第三方接口地址 登录接口URL
+    @Value("${third-party-goods.base-url}")
+    private String goodsUrl;
+
+    // 第三方接口地址 登录接口URL
+    @Value("${third-party-goodsresult.base-url}")
+    private String goodsResultUrl;
+
     /**
      * AI自动审核任务处理器
      * <p>
@@ -112,7 +120,7 @@ public class AiCheckXxlJob {
             HttpEntity<MultiValueMap<String, String>> requestEntity = new HttpEntity<>(formData, headers);
             ResponseEntity<String> postForEntity = null;
             try {
-                postForEntity = restTemplate.postForEntity("http://192.168.2.250:9000/ai/user-auth-core/api/v1/auth/login", requestEntity, String.class);
+                postForEntity = restTemplate.postForEntity(loginUrl, requestEntity, String.class);
             } catch (Exception e) {
                 log.error("类:PostMethod 方法:post", e);
             }
@@ -188,7 +196,7 @@ public class AiCheckXxlJob {
                         HttpEntity<Map<String, Object>> request = new HttpEntity<>(requestBody, aiHeaders);
                         ResponseEntity<String> response = null;
                         try {
-                            response = restTemplate.postForEntity("http://192.168.2.250:9000/ai/auto-review/api/v1/product_complaint_record/submit", request, String.class);
+                            response = restTemplate.postForEntity(goodsUrl, request, String.class);
                             log.info("AI自动审核结果:{}", response.getBody());
                             if (response.getStatusCodeValue() != 200) {
                                 throw new RuntimeException("AI门店审核接口调用失败 http状态:" + response.getStatusCode());
@@ -262,7 +270,7 @@ public class AiCheckXxlJob {
                     HttpEntity<Map<String, Object>> request = new HttpEntity<>(requestBody, aiHeaders);
                     ResponseEntity<String> response = null;
                     try {
-                        response = restTemplate.postForEntity("http://192.168.2.250:9000/ai/auto-review/api/v1/product_complaint_record/result", request, String.class);
+                        response = restTemplate.postForEntity(goodsResultUrl, request, String.class);
                         if (response.getStatusCodeValue() != 200) {
                             throw new RuntimeException("AI门店审核接口调用失败 http状态:" + response.getStatusCode());
                         }