浏览代码

新增一个终转接口 调用创哥返回前端

王苗苗 1 周之前
父节点
当前提交
a622c07d2f

+ 13 - 0
slibra-admin/src/main/java/com/slibra/web/controller/business/FrontController.java

@@ -1,5 +1,6 @@
 package com.slibra.web.controller.business;
 
+import cn.hutool.http.HttpUtil;
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONWriter;
 import com.github.pagehelper.PageInfo;
@@ -710,6 +711,18 @@ public class FrontController extends BaseController {
     }
 
 
+    /**
+     * 配置预测参数,获取碳源投加计算得到的相关参数-直接调用创哥接口返回前端-做个终转
+     * @return
+     */
+    @PostMapping("/configPredictRemote")
+    public String configPredictRemote(@RequestBody String json)
+    {
+        log.info("进入了 配置预测参数,获取碳源投加计算得到的相关参数-直接调用 接口,收到的请求参数为{}", json);
+        return HttpUtil.post("http://192.168.40.21:30076/setfeedback", json);
+    }
+
+
 
     //--------------------上面是碳排放智能体相关的方法--------------------end
 

+ 1 - 1
slibra-framework/src/main/java/com/slibra/framework/config/SecurityConfig.java

@@ -124,7 +124,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
                 .antMatchers("/login", "/register", "/captchaImage","/sendSmsCode/*","/smsLogin","/test/**", "/demo/**").permitAll()
                 .antMatchers("/websocket/**").permitAll()//websocket的
 //                .antMatchers("/front/**","/grpc/**").permitAll()//临时测试的
-                .antMatchers("/qiniuyun/**", "/out/**", "/business/daily", "/front/bigModel/warning/pageList", "/front/configPredict").permitAll()//文件上传相关 外部接口等
+                .antMatchers("/qiniuyun/**", "/out/**", "/business/daily", "/front/bigModel/warning/pageList", "/front/configPredict", "/front/configPredictRemote").permitAll()//文件上传相关 外部接口等
                 // 静态资源,可匿名访问
                 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
                 .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()

+ 42 - 0
slibra-system/src/main/java/com/slibra/business/service/impl/FrontServiceImpl.java

@@ -1,5 +1,6 @@
 package com.slibra.business.service.impl;
 
+import cn.hutool.http.HttpUtil;
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
 import com.slibra.business.domain.*;
@@ -857,5 +858,46 @@ public class FrontServiceImpl implements IFrontService {
         System.out.println("parse = " + parse);
 
         System.out.println(LocalDateTime.now().format(DateTimeFormatter.ofPattern(DateUtils.YYYYMMDD_TS)));
+
+        String req = "{\"data\": [\n" +
+                "          {\n" +
+                "            \"test_hour\": \"2025/04/22 10\",\n" +
+                "            \"no3Hlj1Jqr\": \"2\",\n" +
+                "            \"no3Qyc1Jqr\": \"3\",\n" +
+                "            \"nh31Jqr\": \"4\"\n" +
+                "          },\n" +
+                "          {\n" +
+                "            \"test_hour\": \"2025/04/23 11\",\n" +
+                "            \"no3Hlj1Jqr\": \"5\",\n" +
+                "            \"no3Qyc1Jqr\": \"6\",\n" +
+                "            \"nh31Jqr\": \"7\"\n" +
+                "          },\n" +
+                "          {\n" +
+                "            \"test_hour\": \"2025/04/22 12\",\n" +
+                "            \"no3Hlj1Jqr\": \"2\",\n" +
+                "            \"no3Qyc1Jqr\": \"3\",\n" +
+                "            \"nh31Jqr\": \"4\"\n" +
+                "          },\n" +
+                "          {\n" +
+                "            \"test_hour\": \"2025/04/23 13\",\n" +
+                "            \"no3Hlj1Jqr\": \"5\",\n" +
+                "            \"no3Qyc1Jqr\": \"6\",\n" +
+                "            \"nh31Jqr\": \"7\"\n" +
+                "          },\n" +
+                "          {\n" +
+                "            \"test_hour\": \"2025/04/22 14\",\n" +
+                "            \"no3Hlj1Jqr\": \"2\",\n" +
+                "            \"no3Qyc1Jqr\": \"3\",\n" +
+                "            \"nh31Jqr\": \"4\"\n" +
+                "          },\n" +
+                "          {\n" +
+                "            \"test_hour\": \"2025/04/23 16\",\n" +
+                "            \"no3Hlj1Jqr\": \"5\",\n" +
+                "            \"no3Qyc1Jqr\": \"6\",\n" +
+                "            \"nh31Jqr\": \"7\"\n" +
+                "          }\n" +
+                "        ]}";
+        String post = HttpUtil.post("http://192.168.40.21:30076/setfeedback", req);
+        System.out.println(post);
     }
 }