package com.fs.his.service.impl;

import java.util.Collections;
import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fs.aiChat.domain.DoctorAiChatMsg;
import com.fs.common.utils.DateUtils;
import com.fs.his.mapper.DoctorAiChatMsgMapper;
import com.fs.his.service.IHisDoctorAiChatMsgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 聊天记录Service业务层处理
 *
 * @author fs
 * @date 2024-12-30
 */
@Service
public class DoctorAiChatMsgServiceImpl implements IHisDoctorAiChatMsgService {
    @Autowired
    private DoctorAiChatMsgMapper doctorAiChatMsgMapper;

    /**
     * 查询聊天记录
     *
     * @param msgId 聊天记录主键
     * @return 聊天记录
     */
    @Override
    public DoctorAiChatMsg selectDoctorAiChatMsgByMsgId(Long msgId)
    {
        return doctorAiChatMsgMapper.selectDoctorAiChatMsgByMsgId(msgId);
    }

    /**
     * 查询聊天记录列表
     *
     * @param doctorAiChatMsg 聊天记录
     * @return 聊天记录
     */
    @Override
    public List<DoctorAiChatMsg> selectDoctorAiChatMsgList(DoctorAiChatMsg doctorAiChatMsg)
    {
        return doctorAiChatMsgMapper.selectDoctorAiChatMsgList(doctorAiChatMsg);
    }

    /**
     * 新增聊天记录
     *
     * @param doctorAiChatMsg 聊天记录
     * @return 结果
     */
    @Override
    public int insertDoctorAiChatMsg(DoctorAiChatMsg doctorAiChatMsg)
    {
        doctorAiChatMsg.setCreateTime(DateUtils.getNowDate());
        return doctorAiChatMsgMapper.insertDoctorAiChatMsg(doctorAiChatMsg);
    }

    /**
     * 修改聊天记录
     *
     * @param doctorAiChatMsg 聊天记录
     * @return 结果
     */
    @Override
    public int updateDoctorAiChatMsg(DoctorAiChatMsg doctorAiChatMsg)
    {
        return doctorAiChatMsgMapper.updateDoctorAiChatMsg(doctorAiChatMsg);
    }

    /**
     * 批量删除聊天记录
     *
     * @param msgIds 需要删除的聊天记录主键
     * @return 结果
     */
    @Override
    public int deleteDoctorAiChatMsgByMsgIds(Long[] msgIds)
    {
        return doctorAiChatMsgMapper.deleteDoctorAiChatMsgByMsgIds(msgIds);
    }

    /**
     * 删除聊天记录信息
     *
     * @param msgId 聊天记录主键
     * @return 结果
     */
    @Override
    public int deleteDoctorAiChatMsgByMsgId(Long msgId)
    {
        return doctorAiChatMsgMapper.deleteDoctorAiChatMsgByMsgId(msgId);
    }

    @Override
    public List<DoctorAiChatMsg> selectChatMsgBySessionId(Long sessionId) {

        return Collections.emptyList();
    }
}
