This commit is contained in:
wangjinlei
2023-12-01 10:58:52 +08:00
parent 71ef3c621f
commit 06427430bf

View File

@@ -81,17 +81,19 @@ public class BookTeachLikeAndCommentController {
* 本用户当前目录是否点赞
*/
@RequestMapping("/ifLike")
public boolean ifLike(int teachId) {
public R ifLike(int teachId) {
boolean flag ;
LambdaQueryWrapper<BookTeachLikeEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(BookTeachLikeEntity::getDelFlag,0);
wrapper.eq(BookTeachLikeEntity::getTeachId,teachId);
wrapper.eq(BookTeachLikeEntity::getUserId,ShiroUtils.getUId());
BookTeachLikeEntity likeEntity = likeService.getOne(wrapper);
if (likeEntity != null){
return true;
flag = true;
}else {
return false;
flag = false;
}
return R.ok().put("flag",flag);
}
/**
* 获取评论列表