package com.fs.chat.service.impl;

import com.fs.chat.domain.ChatMsgLogs;
import com.fs.chat.mapper.ChatMsgLogsMapper;
import com.fs.chat.param.ChatMsgLogsListCParam;
import com.fs.chat.service.IChatMsgLogsService;
import com.fs.chat.vo.ChatMsgLogsListCVO;
import com.fs.chat.vo.ChatMsgLogsVO;
import com.fs.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 消息操作日志Service业务层处理
 *
 * @author fs
 * @date 2024-05-10
 */
@Service
public class ChatMsgLogsServiceImpl implements IChatMsgLogsService
{
    @Autowired
    private ChatMsgLogsMapper chatMsgLogsMapper;

    /**
     * 查询消息操作日志
     *
     * @param logsId 消息操作日志主键
     * @return 消息操作日志
     */
    @Override
    public ChatMsgLogs selectChatMsgLogsByLogsId(Long logsId)
    {
        return chatMsgLogsMapper.selectChatMsgLogsByLogsId(logsId);
    }

    /**
     * 查询消息操作日志列表
     *
     * @param chatMsgLogs 消息操作日志
     * @return 消息操作日志
     */
    @Override
    public List<ChatMsgLogs> selectChatMsgLogsList(ChatMsgLogs chatMsgLogs)
    {
        return chatMsgLogsMapper.selectChatMsgLogsList(chatMsgLogs);
    }

    /**
     * 新增消息操作日志
     *
     * @param chatMsgLogs 消息操作日志
     * @return 结果
     */
    @Override
    public int insertChatMsgLogs(ChatMsgLogs chatMsgLogs)
    {
        chatMsgLogs.setCreateTime(DateUtils.getNowDate());
        return chatMsgLogsMapper.insertChatMsgLogs(chatMsgLogs);
    }

    /**
     * 修改消息操作日志
     *
     * @param chatMsgLogs 消息操作日志
     * @return 结果
     */
    @Override
    public int updateChatMsgLogs(ChatMsgLogs chatMsgLogs)
    {
        return chatMsgLogsMapper.updateChatMsgLogs(chatMsgLogs);
    }

    /**
     * 批量删除消息操作日志
     *
     * @param logsIds 需要删除的消息操作日志主键
     * @return 结果
     */
    @Override
    public int deleteChatMsgLogsByLogsIds(Long[] logsIds)
    {
        return chatMsgLogsMapper.deleteChatMsgLogsByLogsIds(logsIds);
    }

    /**
     * 删除消息操作日志信息
     *
     * @param logsId 消息操作日志主键
     * @return 结果
     */
    @Override
    public int deleteChatMsgLogsByLogsId(Long logsId)
    {
        return chatMsgLogsMapper.deleteChatMsgLogsByLogsId(logsId);
    }

    @Override
    public List<ChatMsgLogsVO> selectChatMsgLogsListCVO(ChatMsgLogs chatMsgLogs) {
        return chatMsgLogsMapper.selectChatMsgLogsListCVO(chatMsgLogs);
    }

    @Override
    public List<ChatMsgLogsListCVO> selectChatMsgLogsListVO(ChatMsgLogsListCParam chatMsgLogs) {
        return chatMsgLogsMapper.selectChatLogsMsgListCVO(chatMsgLogs);
    }
}
