package cn.sikey.websocket.dal.mysql;

import cn.sikey.websocket.dal.dataobject.MessageSendDO;
import cn.sikey.websocket.message.MessageId;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;

/**
 * 消息发送
 *
 * @author nelson
 */
@Mapper
public interface MessageSendMapper extends BaseMapper<MessageSendDO> {

    default void saveMessageSend(MessageSendDO messageSendDO) {
        insert(messageSendDO);
    }

    default MessageSendDO findById(MessageId messageId) {
        QueryWrapper<MessageSendDO> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("msg_id", messageId);
        return selectOne(queryWrapper);
    }
}


