Browse Source

20220719 v1.7 增加了提供给黑点库模块的验证接口

lifuquan 2 years ago
parent
commit
8403fec3ad

+ 2 - 2
acl提供给投诉分析的接口.md

@@ -12,11 +12,11 @@ fromSystem 参数是从top系统带过来的 投诉预测应为 top
 system 固定为fenxi
 
 ```http
-POST http://133.96.94.176:12128/api/verification
+POST http://127.0.0.1:12128/api/verification
 Content-Type: application/json
 
 {
-  "token": "test_token_hebei1",
+  "token": "test_token_hebei",
   "fromSystem": "test",
   "system": "fenxi"
 }

+ 1 - 1
acl提供给投诉大屏的接口.md

@@ -12,7 +12,7 @@ system 是固定值 daping
 ###  system 由调用接口的系统确定
 
 ```http
-POST http://133.96.94.176:12128/api/verification
+POST http://127.0.0.1:12128/api/verification
 Content-Type: application/json
 
 {

+ 1 - 1
acl提供给投诉预测的接口.md

@@ -11,7 +11,7 @@ fromSystem 参数是从top系统带过来的 投诉预测应为 top
 system 投诉预测固定为 yuce
 
 ```http
-POST http://133.96.94.176:12128/api/verification
+POST http://127.0.0.1:12128/api/verification
 Content-Type: application/json
 
 {

+ 12 - 12
acl提供给流程的接口.md

@@ -10,7 +10,7 @@ POST http://127.0.0.1:12128/api/verification
 Content-Type: application/json
 
 {
-  "token": "test_token_abc",
+  "token": "test_token_123",
   "fromSystem": "test",
   "system": "liucheng"
 }
@@ -42,12 +42,12 @@ callType  findRoleList
 userName  用户名,支持模糊搜索
 
 ```http
-POST http://133.96.94.176:12128/rest/flow/api
+POST http://127.0.0.1:12128/rest/flow/api
 Content-Type: application/json
 
 {
   "callType": "findRoleList",
-  "userName": ""
+  "userName": ""
 }
 ```
 
@@ -82,7 +82,7 @@ Connection: close
 callType  findToPage
 
 ```http
-POST http://133.96.94.176:12128/rest/flow/api
+POST http://127.0.0.1:12128/rest/flow/api
 Content-Type: application/json
 
 {
@@ -93,7 +93,7 @@ Content-Type: application/json
 ## 根据登录账号获取用户
 
 ```http
-POST http://133.96.94.176:12128/rest/flow/api
+POST http://127.0.0.1:12128/rest/flow/api
 Content-Type: application/json
 
 {
@@ -132,12 +132,12 @@ Connection: close
 ## 根据用户ID获取用户接口
 
 ```http
-POST http://133.96.94.176:12128/rest/flow/api
+POST http://127.0.0.1:12128/rest/flow/api
 Content-Type: application/json
 
 {
   "callType": "get",
-  "userId": "3"
+  "userId": "4"
 }
 ```
 
@@ -168,15 +168,15 @@ Connection: close
 
 ```
 
-## 根据角色id获取用户id列表
+## 根据用户id获取角色id列表
 
 ```http
-POST http://133.96.94.176:12128/rest/flow/api
+POST http://127.0.0.1:12128/rest/flow/api
 Content-Type: application/json
 
 {
   "callType": "findRoleIdByUserId",
-  "userId": "3"
+  "userId": "4"
 }
 ```
 
@@ -202,7 +202,7 @@ Connection: close
 ## 根据角色id获取用户id列表
 
 ```http
-POST http://133.96.94.176:12128/rest/flow/api
+POST http://127.0.0.1:12128/rest/flow/api
 Content-Type: application/json
 
 {
@@ -220,7 +220,7 @@ userName 可选 为空字符串与不传这个参数相同处理  可模糊查
 loginId  可选 为空字符串与不传这个参数相同处理
 
 ```http
-POST http://133.96.94.176:12128/rest/flow/api
+POST http://127.0.0.1:12128/rest/flow/api
 Content-Type: application/json
 
 {

+ 98 - 0
acl提供给黑点库的接口.md

@@ -0,0 +1,98 @@
+# acl提供给黑点库的接口
+
+部署环境 133.96.94.176:12128
+本地环境 127.0.0.1:12128
+
+## 鉴权接口
+
+token  测试token test_token_*** 正式token来自入口url
+fromSystem 测试token为test 正式token是top
+system 是固定值 heidianku
+
+```http
+POST http://127.0.0.1:12128/api/verification
+Content-Type: application/json
+
+{
+  "token": "test_token_handan",
+  "fromSystem": "test",
+  "system": "heidianku"
+}
+```
+
+- 仅包含查询权限
+
+```json
+HTTP/1.1 200 
+Content-Type: application/json
+Transfer-Encoding: chunked
+Date: Tue, 19 Jul 2022 07:48:51 GMT
+Connection: close
+
+{
+  "success": true,
+  "code": 1,
+  "message": "成功",
+  "data": {
+    "loginName": "test_hebei",
+    "userName": "测试用户_全省",
+    "province": "河北省",
+    "city": "河北省",
+    "roles": [
+      "黑点库查询"
+    ]
+  }
+}
+
+```
+
+- 增删改查权限
+
+```json
+HTTP/1.1 200 
+Content-Type: application/json
+Transfer-Encoding: chunked
+Date: Tue, 19 Jul 2022 07:49:35 GMT
+Connection: close
+
+{
+  "success": true,
+  "code": 1,
+  "message": "成功",
+  "data": {
+    "loginName": "test_123",
+    "userName": "李小明",
+    "province": "河北省",
+    "city": "石家庄市",
+    "roles": [
+      "黑点库管理",
+      "黑点库查询"
+    ]
+  }
+}
+
+```
+
+- 无权限
+
+```json
+HTTP/1.1 200 
+Content-Type: application/json
+Transfer-Encoding: chunked
+Date: Tue, 19 Jul 2022 07:50:24 GMT
+Connection: close
+
+{
+  "success": true,
+  "code": 1,
+  "message": "成功",
+  "data": {
+    "loginName": "test_handan",
+    "userName": "测试用户_邯郸市",
+    "province": "河北省",
+    "city": "邯郸市",
+    "roles": []
+  }
+}
+
+```

+ 1 - 1
pom.xml

@@ -4,7 +4,7 @@
 
     <groupId>com.nokia</groupId>
     <artifactId>acl_tousu</artifactId>
-    <version>1.6.1</version>
+    <version>1.7</version>
 
     <parent>
         <groupId>com.nokia</groupId>

+ 4 - 2
readme.md

@@ -4,9 +4,11 @@
 
 [acl提供给投诉大屏的接口](acl%E6%8F%90%E4%BE%9B%E7%BB%99%E6%8A%95%E8%AF%89%E5%A4%A7%E5%B1%8F%E7%9A%84%E6%8E%A5%E5%8F%A3.md)
 
-[acl提供给投诉分析的接口]()
+[acl提供给投诉分析的接口](acl%E6%8F%90%E4%BE%9B%E7%BB%99%E6%8A%95%E8%AF%89%E5%88%86%E6%9E%90%E7%9A%84%E6%8E%A5%E5%8F%A3.md)
 
-[acl提供给投诉预测的接口]()
+[acl提供给投诉预测的接口](acl%E6%8F%90%E4%BE%9B%E7%BB%99%E6%8A%95%E8%AF%89%E9%A2%84%E6%B5%8B%E7%9A%84%E6%8E%A5%E5%8F%A3.md)
+
+[acl提供给黑点库的接口](acl%E6%8F%90%E4%BE%9B%E7%BB%99%E9%BB%91%E7%82%B9%E5%BA%93%E7%9A%84%E6%8E%A5%E5%8F%A3.md)
 
 ## 20220715 更新了acl提供给流程的接口 v1.6
 

+ 4 - 3
src/main/java/com/nokia/controller/UserController.java

@@ -2,7 +2,8 @@ package com.nokia.controller;
 
 import com.nokia.common.R;
 import com.nokia.pojo.UserEntity;
-import com.nokia.service.user.UserServiceImpl;
+import com.nokia.service.UserService;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -12,10 +13,10 @@ import java.util.Map;
 @RestController
 @RequestMapping("rest/api/user")
 public class UserController {
-    private final UserServiceImpl userServiceImpl;
+    private final UserService userServiceImpl;
 
     @Autowired
-    public UserController(UserServiceImpl userServiceImpl) {
+    public UserController(UserService userServiceImpl) {
         this.userServiceImpl = userServiceImpl;
     }
 

+ 4 - 0
src/main/java/com/nokia/controller/VerificationController.java

@@ -8,6 +8,8 @@ import com.nokia.vo.DapingUserVo;
 import com.nokia.vo.FenxiUserVo;
 import com.nokia.vo.LiuchengUserVo;
 import com.nokia.vo.YuceUserVo;
+import com.nokia.vo.HeidiankuUserVo;
+
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -67,6 +69,8 @@ public class VerificationController {
                     return R.ok().data(new DapingUserVo(userEntity));
                 case "yuce":
                     return R.ok().data(new YuceUserVo(userEntity));
+                case "heidianku":
+                    return R.ok().data(new HeidiankuUserVo(userEntity));
                 default:
                     return R.error().message("当前允许的system为:liucheng/fenxi/daping/yuce");
             }

+ 7 - 0
src/main/java/com/nokia/dao/RoleDao.java

@@ -2,8 +2,15 @@ package com.nokia.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.nokia.pojo.RoleEntity;
+
+import java.util.List;
+
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
 
 @Mapper
 public interface RoleDao extends BaseMapper<RoleEntity> {
+
+    @Select("select r.role_id, r.role_name, r.system from sqmdb_rpt.acl_role r, sqmdb_rpt.acl_user_role ur where r.role_id = ur.role_id and ur.user_id = #{userId}")
+    List<RoleEntity> findByUserId(Integer userId);
 }

+ 8 - 5
src/main/java/com/nokia/dao/UserDao.java

@@ -13,13 +13,14 @@ public interface UserDao extends BaseMapper<UserEntity> {
         /**
          * 支持username模糊查询
          */
-        @Select("select distinct r.role_id, r.role_name from sqmdb_rpt.acl_user u, sqmdb_rpt.acl_role r, sqmdb_rpt.acl_user_role ur where u.user_id = ur.user_id and r.role_id = ur.role_id and u.user_name like concat('%',#{username},'%')")
+        @Select("select distinct r.role_id, r.role_name from sqmdb_rpt.acl_user u, sqmdb_rpt.acl_role r, sqmdb_rpt.acl_user_role ur"
+                        + " where u.user_id = ur.user_id and r.role_id = ur.role_id and r.system='flow' and u.user_name like concat('%',#{username},'%')")
         List<FlowRoleVo> findRoleList(String username);
 
         /**
          * 查询全部
          */
-        @Select("select role_id, role_name from sqmdb_rpt.acl_role")
+        @Select("select role_id, role_name from sqmdb_rpt.acl_role where system = 'flow'")
         List<FlowRoleVo> findRoleList2();
 
         /**
@@ -61,7 +62,7 @@ public interface UserDao extends BaseMapper<UserEntity> {
                         + " where a.city_id = c.city_id and user_id=#{userId}")
         FlowUserVo getFlowUserVoByUserId(Integer userId);
 
-        @Select("select r.role_id from  sqmdb_rpt.acl_role r,  sqmdb_rpt.acl_user_role ur where r.role_id = ur.role_id and ur.user_id=#{userId}")
+        @Select("select r.role_id from  sqmdb_rpt.acl_role r,  sqmdb_rpt.acl_user_role ur where r.role_id = ur.role_id and r.system='flow' and ur.user_id=#{userId}")
         List<Integer> findRoleIdByUserId(Integer userId);
 
         @Select("select u.user_id from sqmdb_rpt.acl_user u,  sqmdb_rpt.acl_user_role ur where u.user_id = ur.user_id and ur.role_id=#{roleId}")
@@ -91,10 +92,12 @@ public interface UserDao extends BaseMapper<UserEntity> {
                         + "</script>")
         List<FlowUserVo> findAuthorizedUser(String loginId, Integer roleId, String userName);
 
-        @Select("select * from sqmdb_rpt.acl_user where login_name=#{loginName} ")
         @Results({
                         @Result(column = "city_id", property = "cityId"),
-                        @Result(column = "city_id", property = "city", one = @One(select = "com.nokia.dao.CityDao.findByCityId"))
+                        @Result(column = "user_id", property = "userId"),
+                        @Result(column = "city_id", property = "city", one = @One(select = "com.nokia.dao.CityDao.findByCityId")),
+                        @Result(column = "user_id", property = "roles", many = @Many(select = "com.nokia.dao.RoleDao.findByUserId"))
         })
+        @Select("select * from sqmdb_rpt.acl_user where login_name=#{loginName} ")
         UserEntity getByLoinName(String loginName);
 }

+ 4 - 10
src/main/java/com/nokia/pojo/RoleEntity.java

@@ -1,24 +1,18 @@
 package com.nokia.pojo;
 
+import java.io.Serializable;
+
 import com.baomidou.mybatisplus.annotation.*;
 import lombok.Data;
 
-import java.util.Date;
-import java.util.List;
-
 /**
  * 角色类
  */
 @Data
 @TableName("sqmdb_rpt.acl_role")
-public class RoleEntity {
+public class RoleEntity implements Serializable {
     @TableId(type = IdType.AUTO)
     private Integer roleId;
     private String roleName;
-    @TableField(fill = FieldFill.INSERT)
-    private Date createTime;
-    @TableField(fill = FieldFill.INSERT_UPDATE)
-    private Date updateTime;
-    @TableField(exist = false)
-    private List<UserEntity> userEntities;
+    private String system;
 }

+ 2 - 2
src/main/java/com/nokia/pojo/UserEntity.java

@@ -5,7 +5,7 @@ import lombok.Data;
 
 import java.io.Serializable;
 import java.util.Date;
-import java.util.List;
+import java.util.Set;
 
 @Data
 @TableName("sqmdb_rpt.acl_user")
@@ -38,5 +38,5 @@ public class UserEntity implements Serializable {
     @TableField(fill = FieldFill.INSERT_UPDATE)
     private Date updateTime;
     @TableField(exist = false)
-    private List<Integer> roleIdList;
+    private Set<RoleEntity> roles;
 }

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

@@ -35,12 +35,11 @@ public class AclService {
 
     public UserEntity verifySystem(String token, String fromSystem) {
         UserEntity userEntity = null;
-        log.debug("{}", redisTemplate.opsForValue().get(token));
+        // 从redis中查询
         userEntity = (UserEntity) redisTemplate.opsForValue().get(token);
-
         if (userEntity != null) {
             log.debug("redis查询成功: {}", userEntity);
-            // 2.1 可以查到用户信息
+            // 2.1 可以查到用户信息,重置redis中的用户信息,刷新到期时间
             redisTemplate.opsForValue().set(token, userEntity, timeoutSeconds, TimeUnit.SECONDS);
             // 3 返回用户信息
             return userEntity;

+ 12 - 0
src/main/java/com/nokia/service/RoleService.java

@@ -0,0 +1,12 @@
+package com.nokia.service;
+
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.nokia.dao.RoleDao;
+import com.nokia.pojo.RoleEntity;
+
+@Service
+public class RoleService extends ServiceImpl<RoleDao, RoleEntity> {
+    
+}

+ 20 - 13
src/main/java/com/nokia/service/user/UserServiceImpl.java → src/main/java/com/nokia/service/UserService.java

@@ -1,13 +1,13 @@
-package com.nokia.service.user;
+package com.nokia.service;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.nokia.dao.CityDao;
-import com.nokia.dao.RoleDao;
 import com.nokia.dao.UserDao;
 import com.nokia.dao.UserRoleDao;
 import com.nokia.pojo.CityEntity;
+import com.nokia.pojo.RoleEntity;
 import com.nokia.pojo.UserEntity;
 import com.nokia.pojo.UserRoleEntity;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -17,16 +17,18 @@ import org.springframework.transaction.annotation.Transactional;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 @Service
-public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements UserService {
+public class UserService extends ServiceImpl<UserDao, UserEntity> {
 
+    private final UserDao userDao;
     private final UserRoleDao userRoleDao;
-
     private final CityDao cityDao;
 
     @Autowired
-    public UserServiceImpl(RoleDao roleDao, UserRoleDao userRoleDao, CityDao cityDao) {
+    public UserService(UserDao userDao, UserRoleDao userRoleDao, CityDao cityDao) {
+        this.userDao = userDao;
         this.userRoleDao = userRoleDao;
         this.cityDao = cityDao;
     }
@@ -41,18 +43,17 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
         } else {
             table2User.setCityId(table2User.getCityId());
             baseMapper.insert(table2User);
-            List<Integer> roleEntityList1 = table2User.getRoleIdList();
+            Set<RoleEntity> roleEntityList1 = table2User.getRoles();
             UserRoleEntity userRoleEntity = new UserRoleEntity();
-            for (Integer integer : roleEntityList1) {
+            for (RoleEntity role : roleEntityList1) {
                 userRoleEntity.setUserId(table2User.getUserId());
-                userRoleEntity.setRoleId(integer);
+                userRoleEntity.setRoleId(role.getRoleId());
                 userRoleDao.insert(userRoleEntity);
             }
         }
         return "ok";
     }
 
-    @Override
     @Transactional
     public String delete(Integer userId) {
         // UserEntity userEntity = baseMapper.selectById(userId);
@@ -68,24 +69,30 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
         return "ok";
     }
 
-    @Override
     @Transactional
     public String update(UserEntity user) {
+        // 更新user表
         baseMapper.updateById(user);
+        // 更新user_role 分为2步
         Integer userId = user.getUserId();
         QueryWrapper<UserRoleEntity> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("user_id", userId);
+        // 1. 删除原user_role
         userRoleDao.delete(queryWrapper);
-        for (Integer rolid : user.getRoleIdList()) {
+        // 2. 添加新的user_role
+        for (RoleEntity role : user.getRoles()) {
             UserRoleEntity userRoleEntity = new UserRoleEntity();
             userRoleEntity.setUserId(user.getUserId());
-            userRoleEntity.setRoleId(rolid);
+            userRoleEntity.setRoleId(role.getRoleId());
             userRoleDao.insert(userRoleEntity);
         }
         return "ok";
     }
 
-    @Override
+    public UserEntity getByLoginName(String loginName) {
+        return userDao.getByLoinName(loginName);
+    }
+
     public Map<String, Object> select(Integer userId) {
         Map<String, Object> hashMap = new HashMap<>();
         if (userId == null) {

+ 0 - 12
src/main/java/com/nokia/service/user/UserService.java

@@ -1,12 +0,0 @@
-package com.nokia.service.user;
-
-import com.nokia.pojo.UserEntity;
-
-import java.util.Map;
-
-public interface UserService {
-     String add(UserEntity table2User);
-     String delete(Integer userId);
-     String update(UserEntity table2User);
-     Map<String, Object> select(Integer userId);
-}

+ 34 - 0
src/main/java/com/nokia/vo/HeidiankuUserVo.java

@@ -0,0 +1,34 @@
+package com.nokia.vo;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.nokia.pojo.UserEntity;
+
+import lombok.Data;
+
+/**
+ * 黑点库用户信息
+ */
+@Data
+public class HeidiankuUserVo {
+    private String loginName;
+    private String userName;
+    private String province;
+    private String city;
+    private List<String> roles;
+
+    public HeidiankuUserVo(UserEntity userEntity) {
+        this.loginName = userEntity.getLoginName();
+        this.userName = userEntity.getUserName();
+        this.province = userEntity.getProvince();
+        this.city = userEntity.getCity().getCityNameZh();
+        List<String> roles = new ArrayList<>();
+        userEntity.getRoles().forEach(role -> {
+            if ("heidianku".equals(role.getSystem())) {
+                roles.add(role.getRoleName());
+            }
+        });
+        this.roles = roles;
+    }
+}

+ 0 - 19
src/test/java/com/nokia/RedisTest.java

@@ -1,19 +0,0 @@
-package com.nokia;
-
-import org.junit.jupiter.api.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.data.redis.core.RedisTemplate;
-
-@SpringBootTest
-public class RedisTest {
-    
-    @Autowired
-    private RedisTemplate<String, Object> redisTemplate;
-
-    @Test
-    public void test() {
-        Boolean delete = redisTemplate.delete("test_token_abc");
-        System.out.println(delete);
-    }
-}

+ 50 - 0
src/test/java/com/nokia/UserModifyTest.java

@@ -0,0 +1,50 @@
+package com.nokia;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.data.redis.core.RedisTemplate;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.nokia.pojo.RoleEntity;
+import com.nokia.pojo.UserEntity;
+import com.nokia.service.RoleService;
+import com.nokia.service.UserService;
+
+/**
+ * 操作数据库中的用户信息
+ */
+@SpringBootTest
+public class UserModifyTest {
+
+    @Autowired
+    private RedisTemplate<String, Object> redisTemplate;
+
+    @Autowired
+    private UserService userService;
+
+    @Autowired
+    private RoleService roleService;
+
+    // 清除redis
+    @Test
+    void test() {
+        Boolean delete = redisTemplate.delete("test_token_abc");
+        System.out.println(delete);
+    }
+
+    // 修改用户--增加黑点库权限
+    @Test
+    void test1() {
+        UserEntity user = userService.getByLoginName("test_shijiazhuang");
+        // RoleEntity role = new RoleEntity();
+        // role.setRoleName("黑点库管理");
+        // role = roleService.getOne(Wrappers.query(role));
+        // user.getRoles().add(role);
+        RoleEntity role2 = new RoleEntity();
+        role2.setRoleName("黑点库查询");
+        role2 = roleService.getOne(Wrappers.query(role2));
+        user.getRoles().add(role2);
+        userService.update(user);
+    }
+}

+ 7 - 15
src/test/java/com/nokia/dao/RoleDaoTest.java

@@ -1,10 +1,13 @@
 package com.nokia.dao;
 
-import com.nokia.pojo.RoleEntity;
+import java.util.List;
+
 import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 
+import com.nokia.pojo.RoleEntity;
+
 @SpringBootTest
 public class RoleDaoTest {
 
@@ -12,19 +15,8 @@ public class RoleDaoTest {
     private RoleDao roleDao;
 
     @Test
-    public void insertRoles() {
-        RoleEntity role = new RoleEntity();
-        // role.setRoleName("管理");
-        // roleDao.insert(role);
-        role.setRoleName("分析组");
-        roleDao.insert(role);
-        role.setRoleName("优化组");
-        roleDao.insert(role);
-        role.setRoleName("维护组");
-        roleDao.insert(role);
-        role.setRoleName("建设组");
-        roleDao.insert(role);
-        role.setRoleName("审核组");
-        roleDao.insert(role);
+    void testFindByUserId() {
+        List<RoleEntity> roles = roleDao.findByUserId(10);
+        System.out.println(roles);
     }
 }

+ 51 - 6
src/test/java/com/nokia/dao/UserDaoTest.java

@@ -1,27 +1,72 @@
 package com.nokia.dao;
 
 import com.nokia.pojo.UserEntity;
+import com.nokia.vo.FlowRoleVo;
 import com.nokia.vo.FlowUserVo;
+
+import java.util.List;
+
 import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 
-
-
 @SpringBootTest
 public class UserDaoTest {
 
-    @Autowired UserDao userDao;
+    @Autowired
+    UserDao userDao;
 
     @Test
-    public void getByLoinName() {
-        UserEntity usr = userDao.getByLoinName("13111111111");
+    void testGetByLoinName() {
+        UserEntity usr = userDao.getByLoinName("test_hebei");
         System.out.println(usr);
     }
 
     @Test
-    public void testGetFlowUserVoByUserId() {
+    void testGetFlowUserVoByUserId() {
         FlowUserVo flowUserVo = userDao.getFlowUserVoByUserId(3);
         System.out.println(flowUserVo);
     }
+
+    @Test
+    void testFindRoleList() {
+        List<FlowRoleVo> flowRoleVos = userDao.findRoleList("测试用户_全省");
+        System.out.println(flowRoleVos);
+    }
+
+    @Test
+    void testFindRoleList2() {
+        List<FlowRoleVo> flowRoleVos = userDao.findRoleList2();
+        System.out.println(flowRoleVos);
+    }
+
+    @Test
+    void testFindToPage() {
+        List<FlowUserVo> flowRoleVos = userDao.findToPage();
+        System.out.println(flowRoleVos);
+    }
+
+    @Test
+    void testGetFlowUserVoByLoginId() {
+        FlowUserVo flowUserVo = userDao.getFlowUserVoByLoginId("test_hebei");
+        System.out.println(flowUserVo);
+    }
+
+    @Test
+    void testFindRoleIdByUserId() {
+        List<Integer> roleIds = userDao.findRoleIdByUserId(4);
+        System.out.println(roleIds);
+    }
+
+    @Test
+    void testFindUserIdByRoleId() {
+        List<Integer> userIds = userDao.findUserIdByRoleId(6);
+        System.out.println(userIds);
+    }
+
+    @Test
+    void testFindAuthorizedUser() {
+        List<FlowUserVo> flowUserVos = userDao.findAuthorizedUser(null, null, null);
+        System.out.println(flowUserVos);
+    }
 }