Browse Source

用户管理接口 接口

chejianzheng 3 months ago
parent
commit
2c371eb6f5

+ 3 - 3
portal-service-infrastructure/src/main/java/com/hfln/portal/infrastructure/gateway/impl/UserGatewayImpl.java

@@ -189,7 +189,7 @@ public class UserGatewayImpl implements UserGateway {
         // 2 校验当前用户是否已登录
         boolean isLogin = StpUtil.isLogin();
         if (!isLogin) {
-            StpUtil.login(userInfo.getUserId(), DeviceType.WX.getCode());
+            StpUtil.login(RedisCacheConstant.WX_USER_PRE + userInfo.getUserId(), DeviceType.WX.getCode());
 
             // 这里可以考虑 在session 中插入信息
             // 同账户多设备 登录共享信息
@@ -288,7 +288,7 @@ public class UserGatewayImpl implements UserGateway {
         redisService.del(redisKey);
 
         // 登录
-        StpUtil.login(String.valueOf(user.getUserId()));
+        StpUtil.login(RedisCacheConstant.WX_USER_PRE + user.getUserId(), DeviceType.WX.getCode());
         SaTokenInfo tokenInfo = StpUtil.getTokenInfo();
 
         // 构造返回对象
@@ -567,7 +567,7 @@ public class UserGatewayImpl implements UserGateway {
         }
 
         if (!StpUtil.isLogin()) {
-            StpUtil.login(userInfo.getUserId(), DeviceType.WX.getCode());
+            StpUtil.login(RedisCacheConstant.WX_USER_PRE + userInfo.getUserId(), DeviceType.WX.getCode());
         }
     }
 

+ 7 - 3
portal-service-server/src/test/java/com/hfln/portal/test/service/TblDicItemServiceTest.java

@@ -18,6 +18,7 @@ import org.junit.runner.RunWith;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.util.List;
 
@@ -47,14 +48,17 @@ public class TblDicItemServiceTest {
     private TblDicItemMapper tblDicItemMapper;
 
     @Test
+    @Transactional
     public void add() {
 
         TblDicItem tblDicItem = new TblDicItem();
-        tblDicItem.setDicType("test");
-        tblDicItem.setItemCode("test");
-        tblDicItem.setItemName("test");
+        tblDicItem.setDicType("test3");
+        tblDicItem.setItemCode("test4");
+        tblDicItem.setItemName("test5");
         boolean save = tblDicItemService.save(tblDicItem);
+
         System.out.println(JSON.toJSONString(save, JSONWriter.Feature.PrettyFormat));
+        System.out.println(JSON.toJSONString(tblDicItem, JSONWriter.Feature.PrettyFormat));
     }
 
     @Test