package com.bohuikeji.frame.module.admin.service.impl;

import com.bohuikeji.frame.module.admin.component.MqTool;
import com.bohuikeji.frame.module.admin.entity.socket.Smsg;
import com.bohuikeji.frame.module.admin.listener.SocketMsgListener;
import com.bohuikeji.frame.module.admin.service.IRanchSocketService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * Socket收发服务
 * @author Admin
 */
@Service
@RequiredArgsConstructor
public  class RanchSocketServiceImpl implements IRanchSocketService {
    final MqTool mqTool;

    /**
     * 发送消息
     */
    @Override
    public void sendMsg(Smsg smsg) {
        mqTool.sendMsgToAll(smsg, SocketMsgListener.class);
    }
}
