Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
caselibrary
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
hqzhdj
caselibrary
Commits
45a18051
Commit
45a18051
authored
Feb 14, 2025
by
阳浪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
收藏
parent
6649922a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
0 deletions
+34
-0
library-api/src/main/java/com/yizhi/library/application/feign/StudyCaseClient.java
+9
-0
library/src/main/java/com/yizhi/library/application/controller/StudyCaseController.java
+6
-0
library/src/main/java/com/yizhi/library/application/service/IFavoriteService.java
+7
-0
library/src/main/java/com/yizhi/library/application/service/impl/FavoriteServiceImpl.java
+12
-0
No files found.
library-api/src/main/java/com/yizhi/library/application/feign/StudyCaseClient.java
View file @
45a18051
...
...
@@ -30,6 +30,15 @@ public interface StudyCaseClient {
boolean
admireStudentCase
(
@RequestParam
(
"studentCaseId"
)
Long
studentCaseId
);
/**
* 学习案例是否收藏
*
* @param studentCaseId
* @return
*/
@GetMapping
(
"/studentCase/study/favoriteStudentCase"
)
boolean
favoriteStudentCase
(
@RequestParam
(
"studentCaseId"
)
Long
studentCaseId
);
/**
* 学习案例取消点赞
*
* @param studentCaseId
...
...
library/src/main/java/com/yizhi/library/application/controller/StudyCaseController.java
View file @
45a18051
...
...
@@ -43,6 +43,12 @@ public class StudyCaseController implements StudyCaseClient {
}
@Override
@GetMapping
(
"/favoriteStudentCase"
)
public
boolean
favoriteStudentCase
(
Long
studentCaseId
)
{
return
favoriteService
.
favoriteStudentCase
(
studentCaseId
);
}
@Override
@GetMapping
(
"/cancelAdmire"
)
public
boolean
cancelAdmireStudentCase
(
Long
studentCaseId
)
{
return
admireRecordeService
.
cancelAdmireStudentCase
(
studentCaseId
);
...
...
library/src/main/java/com/yizhi/library/application/service/IFavoriteService.java
View file @
45a18051
...
...
@@ -26,4 +26,11 @@ public interface IFavoriteService extends IService<Favorite> {
* @return
*/
boolean
cancelFavorite
(
Long
studentCaseId
);
/**
* 学习案例是否收藏
* @param studentCaseId
* @return
*/
boolean
favoriteStudentCase
(
Long
studentCaseId
);
}
library/src/main/java/com/yizhi/library/application/service/impl/FavoriteServiceImpl.java
View file @
45a18051
...
...
@@ -64,4 +64,16 @@ public class FavoriteServiceImpl extends ServiceImpl<FavoriteMapper, Favorite> i
return
this
.
delete
(
new
EntityWrapper
<>(
favorite
));
}
@Override
public
boolean
favoriteStudentCase
(
Long
studentCaseId
){
RequestContext
res
=
ContextHolder
.
get
();
Favorite
favorite
=
new
Favorite
();
favorite
.
setBizId
(
studentCaseId
);
favorite
.
setAccountId
(
res
.
getAccountId
());
favorite
.
setState
(
1
);
int
count
=
this
.
selectCount
(
new
EntityWrapper
<>(
favorite
));
return
count
>
0
;
}
}
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