Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
beyond-clouds
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
4
Issues
4
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
段启岩
beyond-clouds
Commits
b0a50a16
Commit
b0a50a16
authored
Feb 16, 2020
by
段启岩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加封号操作
parent
5f7d02ea
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
5 deletions
+31
-5
src/main/java/cn/meteor/beyondclouds/modules/user/entity/User.java
+3
-0
src/main/java/cn/meteor/beyondclouds/modules/user/enums/UserErrorCode.java
+2
-1
src/main/java/cn/meteor/beyondclouds/modules/user/enums/UserStatus.java
+19
-0
src/main/java/cn/meteor/beyondclouds/modules/user/service/impl/AuthenticationServiceImpl.java
+7
-4
No files found.
src/main/java/cn/meteor/beyondclouds/modules/user/entity/User.java
View file @
b0a50a16
...
...
@@ -60,6 +60,9 @@ public class User implements Serializable {
@ApiModelProperty
(
value
=
"本阶段昵称修改次数"
)
private
Integer
nickModifyCount
;
@ApiModelProperty
(
value
=
"用户状态"
)
private
Integer
status
;
private
Date
createTime
;
private
Date
updateTime
;
...
...
src/main/java/cn/meteor/beyondclouds/modules/user/enums/UserErrorCode.java
View file @
b0a50a16
...
...
@@ -29,7 +29,8 @@ public enum UserErrorCode implements IErrorCode {
NON_LOCAL_AUTH_INFO
(
10016
,
"该手机未注册"
),
USER_NOT_EXISTS
(
10017
,
"要查看的用户不存在"
),
USER_NICK_NAME_USED
(
10018
,
"该昵称已存在"
),
NICK_MODIFY_UPPER_LIMIT
(
10019
,
"本月昵称修改次数已达上限"
);
NICK_MODIFY_UPPER_LIMIT
(
10019
,
"本月昵称修改次数已达上限"
),
USER_DISABLED
(
10020
,
"您已被封号,请联系管理员解封"
);
UserErrorCode
(
long
code
,
String
msg
)
{
this
.
code
=
code
;
...
...
src/main/java/cn/meteor/beyondclouds/modules/user/enums/UserStatus.java
0 → 100644
View file @
b0a50a16
package
cn
.
meteor
.
beyondclouds
.
modules
.
user
.
enums
;
import
lombok.Getter
;
/**
* @author meteor
*/
@Getter
public
enum
UserStatus
{
NORMAL
(
0
),
DISABLED
(
1
)
;
private
Integer
status
;
UserStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
}
src/main/java/cn/meteor/beyondclouds/modules/user/service/impl/AuthenticationServiceImpl.java
View file @
b0a50a16
...
...
@@ -9,12 +9,10 @@ import cn.meteor.beyondclouds.core.redis.RedisKey;
import
cn.meteor.beyondclouds.modules.queue.service.IMessageQueueService
;
import
cn.meteor.beyondclouds.modules.user.dto.AuthenticationResultDTO
;
import
cn.meteor.beyondclouds.modules.user.dto.UserAuthDTO
;
import
cn.meteor.beyondclouds.modules.user.entity.User
;
import
cn.meteor.beyondclouds.modules.user.entity.UserAuthApp
;
import
cn.meteor.beyondclouds.modules.user.entity.UserAuthLocal
;
import
cn.meteor.beyondclouds.modules.user.enums.AuthStatus
;
import
cn.meteor.beyondclouds.modules.user.enums.AuthType
;
import
cn.meteor.beyondclouds.modules.user.enums.AuthenticationErrorCode
;
import
cn.meteor.beyondclouds.modules.user.enums.UserErrorCode
;
import
cn.meteor.beyondclouds.modules.user.enums.*
;
import
cn.meteor.beyondclouds.modules.user.exception.AuthenticationServiceException
;
import
cn.meteor.beyondclouds.modules.user.exception.UserServiceException
;
import
cn.meteor.beyondclouds.modules.user.service.IAuthenticationService
;
...
...
@@ -77,6 +75,11 @@ public class AuthenticationServiceImpl implements IAuthenticationService {
throw
new
AuthenticationServiceException
(
AuthenticationErrorCode
.
USER_NOT_FOUND
);
}
User
user
=
userService
.
getById
(
userAuthLocal
.
getUserId
());
if
(
UserStatus
.
DISABLED
.
getStatus
().
equals
(
user
.
getStatus
()))
{
throw
new
AuthenticationServiceException
(
UserErrorCode
.
USER_DISABLED
);
}
//2. 判断账号状态
if
(
null
==
userAuthLocal
.
getStatus
())
{
throw
new
AuthenticationServiceException
(
AuthenticationErrorCode
.
USER_AUTH_DISABLED
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment