package com.geekbbs.service;

import java.util.List;

import com.geekbbs.dao.CommentDAO;
import com.geekbbs.model.Comment;

public class CommentServiceImpl implements CommentService {

	private CommentDAO commentDAO;

	@Override
	public void addComment(String author, int articleId, String comment) {
		// TODO Auto-generated method stub
		commentDAO.createComment(comment, author, articleId);
	}

	@Override
	public List<Comment> getCommentsByArticleId(String articleId) {
		// TODO Auto-generated method stub
		List<Comment> comments = commentDAO.getCommentsByArticleId(articleId);
		return comments;
	}

	public CommentDAO getCommentDAO() {
		return commentDAO;
	}

	public void setCommentDAO(CommentDAO commentDAO) {
		this.commentDAO = commentDAO;
	}

}
