package com.dayou.message.handler;

import cn.hutool.core.bean.BeanUtil;
import com.dayou.entity.Message;
import com.dayou.mapper.MessageMapper;
import com.dayou.message.MessageServerCenter;
import com.dayou.message.bo.BusinessMessageBO;
import com.dayou.service.IMessageService;
import com.dayou.utils.LoginContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 类说明：
 *
 * @author: wucl
 * @since: 2023/6/30
 * created with IntelliJ IDEA.
 */
@Service
public class BusinessMessageHandler extends MessageServerCenter<BusinessMessageBO> {

    @Autowired
    private MessageMapper messageMapper;

    @Override
    public Boolean sendMessage(BusinessMessageBO messageBO) {
        Message message = BeanUtil.copyProperties(messageBO, Message.class);
        messageMapper.insert(message);
        return Boolean.TRUE;
    }
}
