zhoufan лет назад: 2
Родитель
Сommit
9d840edbbb

+ 9 - 9
webapidemo-api/src/main/java/com/example/controller/HomeController.java

@@ -66,7 +66,7 @@ public class HomeController extends BaseController {
66 66
     @ApiOperation("登录")
67 67
     @PostMapping("/login")
68 68
     public AjaxResult Login(@RequestBody LoginInput input) {
69
-        if (input == null || StringHelper.isEmpty(input.getUsername()) || StringHelper.isEmpty(input.getPassword()) || StringHelper.isEmpty(input.getCode())) {
69
+        if (input == null || StringHelper.isEmpty(input.getUserName()) || StringHelper.isEmpty(input.getPassword()) || StringHelper.isEmpty(input.getCode())) {
70 70
             return Error("请输入账号、密码、验证码");
71 71
         }
72 72
         if (StringHelper.isEmpty(input.getUuid())) {
@@ -78,9 +78,9 @@ public class HomeController extends BaseController {
78 78
             return Error("验证码已过期");
79 79
         }
80 80
         LambdaQueryWrapper<User> qw = new LambdaQueryWrapper<>();
81
-        qw.eq(User::getUser_name, input.getUsername())
81
+        qw.eq(User::getUserName, input.getUserName())
82 82
                 .eq(User::getPassword, DigestUtils.md5DigestAsHex(input.getPassword().getBytes()))
83
-                .eq(User::getDel_flag, 0);
83
+                .eq(User::getDelFlag, 0);
84 84
         User entity = userService.getEntity(qw);
85 85
         if (entity == null) {
86 86
             return Error("账号或者密码错误");
@@ -90,11 +90,11 @@ public class HomeController extends BaseController {
90 90
         }
91 91
         redisHelper.deleteCache(verifyKey);
92 92
 
93
-        List<Long> roleids = userRoleService.getList().stream().filter(p -> p.getUser_id().equals(entity.getUser_id()))
94
-                .map(p -> p.getRole_id()).sorted().collect(Collectors.toList());
93
+        List<Long> roleids = userRoleService.getList().stream().filter(p -> p.getUserId().equals(entity.getUserId()))
94
+                .map(p -> p.getRoleId()).sorted().collect(Collectors.toList());
95 95
 
96 96
         Map<String, Object> cls = new HashMap<String, Object>();
97
-        cls.put("UserId", entity.getUser_id());
97
+        cls.put("UserId", entity.getUserId());
98 98
         cls.put("RoleIds", roleids);
99 99
         String token = JwtHelper.createToken(cls);
100 100
         return Success("登录成功", token);
@@ -104,11 +104,11 @@ public class HomeController extends BaseController {
104 104
     @PostMapping("/login/user")
105 105
     public AjaxResult Login(@RequestBody User user) {
106 106
         if (!userService.checkUserNameUnique(user)) {
107
-            return Error("注册用户'" + user.getUser_name() + "'失败,登录账号已存在");
107
+            return Error("注册用户'" + user.getUserName() + "'失败,登录账号已存在");
108 108
         } else if (StringHelper.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) {
109
-            return Error("注册用户'" + user.getUser_name() + "'失败,手机号码已存在");
109
+            return Error("注册用户'" + user.getUserName() + "'失败,手机号码已存在");
110 110
         } else if (StringHelper.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) {
111
-            return Error("注册用户'" + user.getUser_name() + "'失败,邮箱账号已存在");
111
+            return Error("注册用户'" + user.getUserName() + "'失败,邮箱账号已存在");
112 112
         }
113 113
 
114 114
         String md5Password = DigestUtils.md5DigestAsHex((user.getPassword()).getBytes());

+ 2 - 2
webapidemo-api/src/main/java/com/example/controller/call/BlacklistController.java

@@ -63,7 +63,7 @@ public class BlacklistController extends BaseController {
63 63
             return Error("此号码已经存在");
64 64
         }
65 65
 
66
-        input.setCreateBy(CurrentUser().getUser_name());
66
+        input.setCreateBy(CurrentUser().getUserName());
67 67
         input.setCreateTime(new Date());
68 68
         input.setDelFlag("0");
69 69
         boolean result = blacklistService.insert(input);
@@ -85,7 +85,7 @@ public class BlacklistController extends BaseController {
85 85
             return Error("此号码已经存在");
86 86
         }
87 87
 
88
-        input.setUpdateBy(CurrentUser().getUser_name());
88
+        input.setUpdateBy(CurrentUser().getUserName());
89 89
         input.setUpdateTime(new Date());
90 90
         boolean result = blacklistService.update(input);
91 91
         if (result) {

+ 2 - 2
webapidemo-api/src/main/java/com/example/controller/call/GroupController.java

@@ -63,7 +63,7 @@ public class GroupController extends BaseController {
63 63
             return Error("此编码已经存在");
64 64
         }
65 65
 
66
-        input.setCreateBy(CurrentUser().getUser_name());
66
+        input.setCreateBy(CurrentUser().getUserName());
67 67
         input.setCreateTime(new Date());
68 68
         input.setDelFlag("0");
69 69
         boolean result = groupService.insert(input);
@@ -84,7 +84,7 @@ public class GroupController extends BaseController {
84 84
         if(groupService.getCount(qw)>0){
85 85
             return Error("此编码已经存在");
86 86
         }
87
-        input.setUpdateBy(CurrentUser().getUser_name());
87
+        input.setUpdateBy(CurrentUser().getUserName());
88 88
         input.setUpdateTime(new Date());
89 89
         boolean result = groupService.update(input);
90 90
         if (result) {

+ 2 - 2
webapidemo-api/src/main/java/com/example/controller/call/IvrWordController.java

@@ -58,7 +58,7 @@ public class IvrWordController extends BaseController {
58 58
     @Log(title = "新增ivr文字文件表",businessType = BusinessType.INSERT)
59 59
     @PostMapping
60 60
     public AjaxResult add(@RequestBody IvrWord input) {
61
-        input.setCreateBy(CurrentUser().getUser_name());
61
+        input.setCreateBy(CurrentUser().getUserName());
62 62
         input.setCreateTime(new Date());
63 63
         input.setDelFlag("0");
64 64
         boolean result = ivrwordService.insert(input);
@@ -73,7 +73,7 @@ public class IvrWordController extends BaseController {
73 73
     @Log(title = "编辑ivr文字文件表",businessType = BusinessType.UPDATE)
74 74
     @PutMapping
75 75
     public AjaxResult edit(@RequestBody IvrWord input)  {
76
-        input.setUpdateBy(CurrentUser().getUser_name());
76
+        input.setUpdateBy(CurrentUser().getUserName());
77 77
         input.setUpdateTime(new Date());
78 78
         boolean result = ivrwordService.update(input);
79 79
         if (result) {

+ 2 - 2
webapidemo-api/src/main/java/com/example/controller/quartz/SysJobController.java

@@ -91,7 +91,7 @@ public class SysJobController extends BaseController {
91 91
         if(isError){
92 92
             return Error("新增任务'" + jobName + "'失败,目标字符串存在违规");
93 93
         }
94
-        input.setCreateBy(CurrentUser().getUser_name());
94
+        input.setCreateBy(CurrentUser().getUserName());
95 95
         input.setCreateTime(new Date());
96 96
         boolean result = sysjobService.insert(input);
97 97
         if (result) {
@@ -135,7 +135,7 @@ public class SysJobController extends BaseController {
135 135
         if(isError){
136 136
             return Error("编辑任务'" + jobName + "'失败,目标字符串存在违规");
137 137
         }
138
-        input.setUpdateBy(CurrentUser().getUser_name());
138
+        input.setUpdateBy(CurrentUser().getUserName());
139 139
         input.setUpdateTime(new Date());
140 140
         boolean result = sysjobService.update(input);
141 141
         if (result) {

+ 4 - 4
webapidemo-api/src/main/java/com/example/filter/AuthenticationInterceptor.java

@@ -74,10 +74,10 @@ public class AuthenticationInterceptor implements HandlerInterceptor {
74 74
                     Long userId = Long.parseLong(cls.get("UserId").toString());
75 75
                     if (userId > 0) {
76 76
                         //判断用户信息
77
-                        List<User> users = userService.getList().stream().filter(p -> p.getUser_id() == userId && Objects.equals(p.getStatus(), "0") && Objects.equals(p.getDel_flag(), "0")).collect(Collectors.toList());
77
+                        List<User> users = userService.getList().stream().filter(p -> p.getUserId() == userId && Objects.equals(p.getStatus(), "0") && Objects.equals(p.getDelFlag(), "0")).collect(Collectors.toList());
78 78
                         if (users != null && users.size() > 0) {
79 79
                             User user = users.get(0);
80
-                            List<Long> roleids = userRoleService.getList().stream().filter(p -> p.getUser_id() == userId).map(p -> p.getRole_id()).sorted().collect(Collectors.toList());
80
+                            List<Long> roleids = userRoleService.getList().stream().filter(p -> p.getUserId() == userId).map(p -> p.getRoleId()).sorted().collect(Collectors.toList());
81 81
                             if (user.isAdmin()) {
82 82
                                 isAuth = true;
83 83
                             } else {
@@ -88,9 +88,9 @@ public class AuthenticationInterceptor implements HandlerInterceptor {
88 88
                                             .replace("Controller", "");
89 89
                                     String methodName = handlerMethod.getMethod().getName();
90 90
                                     String permission = (className + "/" + methodName).toLowerCase();
91
-                                    List<Long> mids = menuService.getList().stream().filter(p -> Objects.equals(p.getPerms(), permission)).map(p -> p.getMenu_id()).collect(Collectors.toList());
91
+                                    List<Long> mids = menuService.getList().stream().filter(p -> Objects.equals(p.getPerms(), permission)).map(p -> p.getMenuId()).collect(Collectors.toList());
92 92
                                     if (mids != null && mids.size() > 0) {
93
-                                        Long n = roleMenuService.getList().stream().filter(p -> roleids.contains(p.getRole_id()) && mids.contains(p.getMenu_id())).count();
93
+                                        Long n = roleMenuService.getList().stream().filter(p -> roleids.contains(p.getRoleId()) && mids.contains(p.getMenuId())).count();
94 94
                                         if (n > 0) {
95 95
                                             isAuth = true;
96 96
                                         } else {

+ 3 - 0
webapidemo-entity/src/main/java/com/example/entity/database/system/RoleDept.java

@@ -1,5 +1,6 @@
1 1
 package com.example.entity.database.system;
2 2
 
3
+import com.baomidou.mybatisplus.annotation.TableField;
3 4
 import com.baomidou.mybatisplus.annotation.TableName;
4 5
 import io.swagger.annotations.ApiModel;
5 6
 import io.swagger.annotations.ApiModelProperty;
@@ -12,8 +13,10 @@ import lombok.Data;
12 13
 public class RoleDept {
13 14
     /** 角色ID */
14 15
     @ApiModelProperty("角色ID")
16
+    @TableField("role_id")
15 17
     private Long roleId;
16 18
     /** 部门ID */
17 19
     @ApiModelProperty("部门ID")
20
+    @TableField("dept_id")
18 21
     private Long deptId;
19 22
 }

+ 3 - 0
webapidemo-entity/src/main/java/com/example/entity/database/system/RoleMenu.java

@@ -1,5 +1,6 @@
1 1
 package com.example.entity.database.system;
2 2
 
3
+import com.baomidou.mybatisplus.annotation.TableField;
3 4
 import com.baomidou.mybatisplus.annotation.TableName;
4 5
 import io.swagger.annotations.ApiModel;
5 6
 import io.swagger.annotations.ApiModelProperty;
@@ -12,8 +13,10 @@ import lombok.Data;
12 13
 public class RoleMenu {
13 14
     /** 角色ID */
14 15
     @ApiModelProperty("角色ID")
16
+    @TableField("role_id")
15 17
     private Long roleId;
16 18
     /** 菜单ID */
17 19
     @ApiModelProperty("菜单ID")
20
+    @TableField("menu_id")
18 21
     private Long menuId;
19 22
 }

+ 3 - 0
webapidemo-entity/src/main/java/com/example/entity/database/system/UserPost.java

@@ -1,5 +1,6 @@
1 1
 package com.example.entity.database.system;
2 2
 
3
+import com.baomidou.mybatisplus.annotation.TableField;
3 4
 import com.baomidou.mybatisplus.annotation.TableName;
4 5
 import io.swagger.annotations.ApiModel;
5 6
 import io.swagger.annotations.ApiModelProperty;
@@ -12,8 +13,10 @@ import lombok.Data;
12 13
 public class UserPost {
13 14
     /** 用户ID */
14 15
     @ApiModelProperty("用户ID")
16
+    @TableField("user_id")
15 17
     private Long userId;
16 18
     /** 岗位ID */
17 19
     @ApiModelProperty("岗位ID")
20
+    @TableField("post_id")
18 21
     private Long postId;
19 22
 }

+ 3 - 0
webapidemo-entity/src/main/java/com/example/entity/database/system/UserRole.java

@@ -1,5 +1,6 @@
1 1
 package com.example.entity.database.system;
2 2
 
3
+import com.baomidou.mybatisplus.annotation.TableField;
3 4
 import com.baomidou.mybatisplus.annotation.TableName;
4 5
 import io.swagger.annotations.ApiModel;
5 6
 import io.swagger.annotations.ApiModelProperty;
@@ -12,8 +13,10 @@ import lombok.Data;
12 13
 public class UserRole {
13 14
     /** 用户ID */
14 15
     @ApiModelProperty("用户ID")
16
+    @TableField("user_id")
15 17
     private Long userId;
16 18
     /** 角色ID */
17 19
     @ApiModelProperty("角色ID")
20
+    @TableField("role_id")
18 21
     private Long roleId;
19 22
 }