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
3dffb620
Commit
3dffb620
authored
Feb 06, 2020
by
段启岩
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/fix-issue#13'
parents
e100b93d
0e53ee43
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletions
+7
-1
src/main/java/cn/meteor/beyondclouds/modules/user/enums/UserErrorCode.java
+2
-1
src/main/java/cn/meteor/beyondclouds/modules/user/service/impl/UserBlacklistServiceImpl.java
+5
-0
No files found.
src/main/java/cn/meteor/beyondclouds/modules/user/enums/UserErrorCode.java
View file @
3dffb620
...
@@ -19,7 +19,8 @@ public enum UserErrorCode implements IErrorCode {
...
@@ -19,7 +19,8 @@ public enum UserErrorCode implements IErrorCode {
ALREADY_FOLLOWED
(
1006
,
"已关注过该用户"
),
ALREADY_FOLLOWED
(
1006
,
"已关注过该用户"
),
NON_FOLLOWED
(
1007
,
"没有关注过该用户"
),
NON_FOLLOWED
(
1007
,
"没有关注过该用户"
),
USER_ALREADY_BLACKED
(
1008
,
"用户已经被你拉进黑名单"
),
USER_ALREADY_BLACKED
(
1008
,
"用户已经被你拉进黑名单"
),
YOU_ALREADY_BLACKED
(
1009
,
"你已经被对方拉进黑名单"
);
YOU_ALREADY_BLACKED
(
1009
,
"你已经被对方拉进黑名单"
),
CAN_NOT_BLACKE_SELF
(
1010
,
"不能拉黑自己"
);
UserErrorCode
(
long
code
,
String
msg
)
{
UserErrorCode
(
long
code
,
String
msg
)
{
this
.
code
=
code
;
this
.
code
=
code
;
...
...
src/main/java/cn/meteor/beyondclouds/modules/user/service/impl/UserBlacklistServiceImpl.java
View file @
3dffb620
...
@@ -28,6 +28,11 @@ public class UserBlacklistServiceImpl extends ServiceImpl<UserBlacklistMapper, U
...
@@ -28,6 +28,11 @@ public class UserBlacklistServiceImpl extends ServiceImpl<UserBlacklistMapper, U
@Override
@Override
public
void
blacklist
(
String
blackedId
,
String
userId
)
throws
UserServiceException
{
public
void
blacklist
(
String
blackedId
,
String
userId
)
throws
UserServiceException
{
// 自己不能拉黑自己
if
(
userId
.
equals
(
blackedId
))
{
throw
new
UserServiceException
(
UserErrorCode
.
CAN_NOT_BLACKE_SELF
);
}
//查询 是否用户已被拉黑
QueryWrapper
<
UserBlacklist
>
myBlackListQueryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
UserBlacklist
>
myBlackListQueryWrapper
=
new
QueryWrapper
<>();
myBlackListQueryWrapper
.
eq
(
"user_id"
,
userId
);
myBlackListQueryWrapper
.
eq
(
"user_id"
,
userId
);
myBlackListQueryWrapper
.
eq
(
"blacked_id"
,
blackedId
);
myBlackListQueryWrapper
.
eq
(
"blacked_id"
,
blackedId
);
...
...
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