浏览代码

feat: fromSystem增加unicom,和top逻辑一致

weijianghai 1 年之前
父节点
当前提交
6bf0cbde6b

+ 2 - 1
src/main/java/com/nokia/controller/TestController.java

@@ -1,5 +1,6 @@
 package com.nokia.controller;
 
+import cn.hutool.core.util.IdUtil;
 import io.swagger.v3.oas.annotations.Hidden;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -16,6 +17,6 @@ public class TestController {
      */
     @GetMapping("/alert")
     public Object alert() {
-        throw new RuntimeException("短信告警测试");
+        throw new RuntimeException("短信告警测试: " + IdUtil.fastSimpleUUID());
     }
 }

+ 4 - 2
src/main/java/com/nokia/service/AclService.java

@@ -77,7 +77,8 @@ public class AclService {
     public R verifySystem(TokenVo tokenEntity, HttpSession session, boolean logVerification) {
         log.debug("sessionId: {}", session.getId());
         Map<String, String> map = new HashMap<>();
-        if (tokenEntity.getFromSystem().equalsIgnoreCase("top")) {
+        if (tokenEntity.getFromSystem().equalsIgnoreCase("top")
+                || tokenEntity.getFromSystem().equalsIgnoreCase("unicom")) {
             map.put("redirect", topRedirectUrl);
         } else if (tokenEntity.getFromSystem().equalsIgnoreCase("dop")) {
             map.put("redirect", dopRedirectUrl);
@@ -283,7 +284,8 @@ public class AclService {
     private TokenFlagVo getVerifyResult(String token, String fromSystem) {
         if (fromSystem.trim().equalsIgnoreCase("dop")) {
             return dopService.dopReturn(token);
-        } else if (fromSystem.trim().equalsIgnoreCase("top")) {
+        } else if (fromSystem.trim().equalsIgnoreCase("top")
+                || fromSystem.trim().equalsIgnoreCase("unicom")) {
             return topService.topReturn(token);
         } else if (fromSystem.trim().equalsIgnoreCase("woyunwei")) {
             return woyunweiService.woyunweiReturn(token);

+ 4 - 0
src/main/java/com/nokia/service/TopService.java

@@ -1,13 +1,16 @@
 package com.nokia.service;
 
 
+import com.alibaba.fastjson2.JSON;
 import com.nokia.vo.TokenFlagVo;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.web.client.RestTemplate;
 
 import java.util.HashMap;
 
+@Slf4j
 @Service
 public class TopService{
 
@@ -22,6 +25,7 @@ public class TopService{
         hashMap.put("fromSystem",fromSystem);
         RestTemplate restTemplate = new RestTemplate();
         TokenFlagVo tokenFlagVo = restTemplate.postForObject(topUrl, hashMap, TokenFlagVo.class);
+        log.info("top接口响应: {}", JSON.toJSONString(tokenFlagVo));
         return tokenFlagVo;
     }
 

+ 3 - 4
src/main/resources/application-test.properties

@@ -11,11 +11,10 @@ spring.datasource.url=jdbc:postgresql://192.168.50.5:5432/sqmmt
 spring.datasource.username=sqmdb
 spring.datasource.password=sqmdb_1QAZ
 
-# 测试环境redis配置 由于测试环境redis尚不具备,暂时先用正式环境的 10 顶替一下,具备后再调整
-spring.redis.host=192.168.70.125
+# 测试环境redis配置
+spring.redis.host=192.168.50.3
 spring.redis.port=6379
-spring.redis.database=10
-spring.redis.password=Richr00t
+spring.redis.password=gciVrjQGBiYrpA0VfQhW
 redis.timeoutSeconds=600
 # minio配置
 minio.endpoint=http://192.168.10.7:19000/