package com.ruoyi.model.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.model.mapper.AppletCommentMapper;
import com.ruoyi.model.domain.AppletComment;
import com.ruoyi.model.service.IAppletCommentService;

/**
 * 用户评价Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-28
 */
@Service
public class AppletCommentServiceImpl implements IAppletCommentService 
{
    @Autowired
    private AppletCommentMapper appletCommentMapper;

    /**
     * 查询用户评价
     * 
     * @param id 用户评价主键
     * @return 用户评价
     */
    @Override
    public AppletComment selectAppletCommentById(Long id)
    {
        return appletCommentMapper.selectAppletCommentById(id);
    }

    /**
     * 查询用户评价列表
     * 
     * @param appletComment 用户评价
     * @return 用户评价
     */
    @Override
    public List<AppletComment> selectAppletCommentList(AppletComment appletComment)
    {
        return appletCommentMapper.selectAppletCommentList(appletComment);
    }

    /**
     * 新增用户评价
     * 
     * @param appletComment 用户评价
     * @return 结果
     */
    @Override
    public int insertAppletComment(AppletComment appletComment)
    {
        appletComment.setCreateTime(DateUtils.getNowDate());
        return appletCommentMapper.insertAppletComment(appletComment);
    }

    /**
     * 修改用户评价
     * 
     * @param appletComment 用户评价
     * @return 结果
     */
    @Override
    public int updateAppletComment(AppletComment appletComment)
    {
        appletComment.setUpdateTime(DateUtils.getNowDate());
        return appletCommentMapper.updateAppletComment(appletComment);
    }

    /**
     * 批量删除用户评价
     * 
     * @param ids 需要删除的用户评价主键
     * @return 结果
     */
    @Override
    public int deleteAppletCommentByIds(Long[] ids)
    {
        return appletCommentMapper.deleteAppletCommentByIds(ids);
    }

    /**
     * 删除用户评价信息
     * 
     * @param id 用户评价主键
     * @return 结果
     */
    @Override
    public int deleteAppletCommentById(Long id)
    {
        return appletCommentMapper.deleteAppletCommentById(id);
    }
}
