package com.remy.order.service.impl;

import com.remy.order.dao.CommentDAO;
import com.remy.order.entity.Comment;
import com.remy.order.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentServiceImpl implements CommentService {

    @Autowired
    CommentDAO commentDAO;

    @Override
    public List<Comment> findAll() {
        return commentDAO.findAll();
    }

    @Override
    public Comment save(Comment comment) {
        return commentDAO.save(comment);
    }


    @Override
    public Comment findCommentByOrderNo(String orderNo) {
        return commentDAO.findCommentByOrderNo(orderNo);
    }

    @Override
    public List<Comment> findByCondition(Comment comment) {
        return commentDAO.findAll(Example.of(comment));
    }
}
