Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
e8380f77
Commit
e8380f77
authored
Sep 21, 2023
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
校验重复关注
parent
5706a66a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/FollowFansRecordServiceImpl.java
...java/com/wwdz/ch/wx/impl/FollowFansRecordServiceImpl.java
+13
-0
No files found.
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/FollowFansRecordServiceImpl.java
View file @
e8380f77
...
...
@@ -54,6 +54,11 @@ public class FollowFansRecordServiceImpl implements FollowFansRecordService {
if
(
dto
.
getFollowerId
()
==
null
||
dto
.
getFansId
()
==
null
)
{
return
Result
.
failed
(
ResultCode
.
PARAM_ERROR
);
}
//校验是否已有关注记录
if
(
isFollowed
(
dto
))
{
return
Result
.
failed
(
"已经关注,无需重复操作"
);
}
Date
now
=
new
Date
();
FollowFansRecord
followFansRecord
=
new
FollowFansRecord
();
EntityMapper
.
copyAttribute
(
dto
,
followFansRecord
);
...
...
@@ -271,4 +276,12 @@ public class FollowFansRecordServiceImpl implements FollowFansRecordService {
}
return
Result
.
failed
();
}
public
boolean
isFollowed
(
FollowFansRecordRequestDto
dto
)
{
FollowFansRecord
followFansRecord
=
followFansRecordDao
.
findOne
(
dto
);
if
(
followFansRecord
==
null
)
{
return
false
;
}
return
true
;
}
}
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