|
|
@@ -104,6 +104,18 @@ public class UserCommentServiceImpl extends ServiceImpl<UserCommentMapper, UserC
|
|
|
this.updateById(userComment);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public String giveCancel(Integer id) {
|
|
|
+ UserComment userComment=queryEntity(id);
|
|
|
+ if(userComment.getGiveNum()>1){
|
|
|
+ userComment.setGiveNum(userComment.getGiveNum()-1);
|
|
|
+ this.updateById(userComment);
|
|
|
+ return "取消点赞成功";
|
|
|
+ }else{
|
|
|
+ return "点赞数量为0,无法取消点赞!";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public UserComment queryEntity(Integer id) {
|
|
|
UserComment userComment = this.getById(id);
|