Files
love-nav/src/main/java/com/lovenav/service/serviceImpl/CommentServiceImpl.java
2023-12-20 20:48:17 +08:00

22 lines
651 B
Java

package com.lovenav.service.serviceImpl;
import com.alibaba.fastjson2.JSONObject;
import com.lovenav.dao.CommentDao;
import com.lovenav.entity.Comment;
import com.lovenav.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class CommentServiceImpl implements CommentService {
private CommentDao commentDao;
// 点赞++
public String AddLikeCount(Comment comment){
comment.setLikeCount(comment.getLikeCount()+1);
commentDao.updateByPrimaryKeySelective(comment);
return JSONObject.toJSONString(comment);
}
}