package com.example.system.service.impl;

import com.example.system.mapper.CommentMapper;
import com.example.system.model.CommentTable;
import com.example.system.service.CommpentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommpentServiceimpl implements CommpentService {
    @Autowired
    private CommentMapper commentMapper;

    @Override//根据文章id获取所有的评论
    public List<CommentTable> getCommentById(Integer id) {
        return commentMapper.getCommentById(id);
    }

    @Override
    //根据评论id获取对应的评论
    public CommentTable getById(Long id) {
        return commentMapper.getById(id);
    }

    @Override
    //根据评论id删除评论
    public Boolean deleteById(Long id) {
        return 1 == commentMapper.deleteById(id);
    }
}
