From cbddf31eccd506aa4a0f9062b55800c4e2c1d524 Mon Sep 17 00:00:00 2001
From: xusd <hugeinfo123>
Date: Tue, 17 Sep 2024 19:08:31 +0800
Subject: [PATCH] 环境配置修正;增加正式环境

---
 dyh-service/dyh-sys/src/main/java/cn/huge/module/grid/service/GridUserService.java |   28 +++++++++++++++++++++++-----
 1 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/dyh-service/dyh-sys/src/main/java/cn/huge/module/grid/service/GridUserService.java b/dyh-service/dyh-sys/src/main/java/cn/huge/module/grid/service/GridUserService.java
index 182bdd1..150be21 100644
--- a/dyh-service/dyh-sys/src/main/java/cn/huge/module/grid/service/GridUserService.java
+++ b/dyh-service/dyh-sys/src/main/java/cn/huge/module/grid/service/GridUserService.java
@@ -2,25 +2,34 @@
 
 import cn.huge.base.common.bo.R;
 import cn.huge.base.common.utils.HttpClientUtils;
-import cn.huge.module.grid.domain.vo.GridUserVo;
+import cn.huge.module.grid.domain.vo.*;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import java.util.HashMap;
+import java.util.UUID;
 
 @Slf4j
 @Service
 public class GridUserService {
-    private String gridUrl = "http://219.137.166.84:8061";
+    @Value("${grid.url:http://219.137.166.84:8061}")
+    private String gridUrl;
+    private String testUrl = "http://183.2.142.46:9007";
 
-    public R<GridUserVo> getUserInfo(String token) {
+    public R<GridUserVo> getUserInfo(GridTokenVo gridTokenVo) {
         String s = null;
+        HeadVo headVo = initHeadVo();
+        GridUserRequestVo requestVo = new GridUserRequestVo();
+        requestVo.setHeadVo(headVo);
+        requestVo.setBodyVo(gridTokenVo);
         try {
-            log.info("xsd:{}",JSON.toJSONString(token));
+//            log.info("xsdobject:{}",JSON.toJSONString(requestVo));
             log.info("xsdurl:{}",gridUrl + "/sys/getUserByToken");
-            s = HttpClientUtils.httpPostRaw(gridUrl + "/sys/getUserByToken", JSON.toJSONString(token), new HashMap<>(), "utf-8");
+//            log.info("xsdurl:{}",testUrl + "/sys/getUserByToken");
+            s = HttpClientUtils.httpPostRaw(gridUrl + "/sys/getUserByToken", JSON.toJSONString(requestVo), new HashMap<>(), "utf-8");
             log.info("xsd:{}",s);
         } catch (Exception e) {
             log.info("xsderror:{}",e.getLocalizedMessage());
@@ -29,4 +38,13 @@
         GridUserVo gridUserVo = JSONObject.parseObject(s).getObject("data", GridUserVo.class);
         return R.ok(gridUserVo);
     }
+
+    public HeadVo initHeadVo() {
+        HeadVo headVo = new HeadVo();
+        headVo.setUsername("mtxt001");
+        headVo.setPassword("kd*cCoAb");
+        headVo.setRequestId(UUID.randomUUID().toString());
+        headVo.setSource("string");
+        return headVo;
+    }
 }

--
Gitblit v1.8.0