package com.lideeyunji.service.infra.api.impl;

import com.lideeyunji.tool.framework.websocket.core.sender.WebSocketMessageSender;
import com.lideeyunji.service.infra.api.IApiWebSocketSenderApi;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * WebSocket 发送器的 API 实现类
 *
 * @author 金灯剑客
 */
@Component
public class ApiWebSocketSenderApiImpl implements IApiWebSocketSenderApi {

    @Lazy
    @Resource
    private WebSocketMessageSender webSocketMessageSender;

    @Override
    public void send(Integer userType, Long userId, String messageType, String messageContent) {
        webSocketMessageSender.send(userType, userId, messageType, messageContent);
    }

    @Override
    public void send(Integer userType, String messageType, String messageContent) {
        webSocketMessageSender.send(userType, messageType, messageContent);
    }

    @Override
    public void send(String sessionId, String messageType, String messageContent) {
        webSocketMessageSender.send(sessionId, messageType, messageContent);
    }

}
