package com.cmvr.framework.websocket.handler;

import com.cmvr.framework.websocket.annotation.WSMessageType;
import com.cmvr.framework.websocket.enums.WSMessageTypeEnum;
import com.cmvr.framework.websocket.manager.ChannelSubscriptionManager;
import com.cmvr.framework.websocket.message.WSChannelSubscriptionMessage;
import com.cmvr.framework.websocket.service.GrpcClientService;
import org.springframework.stereotype.Component;

@Component
@WSMessageType(value = WSMessageTypeEnum.CHANNEL_SUBSCRIPTION, messageClass = WSChannelSubscriptionMessage.class)
public class SimpleChannelSubscribeHandler extends BaseChannelSubscribeHandler {

    public SimpleChannelSubscribeHandler(ChannelSubscriptionManager channelSubscriptionManager, GrpcClientService grpcClientService) {
        super(channelSubscriptionManager, grpcClientService);
    }

    // 简单频道不需要grpc调用
    @Override
    protected boolean isNeedGrpc(String channel) {
        return false;
    }

    // 不会执行到，随便返回
    @Override
    protected String[] parseGrpcParam(String channel) {
        return new String[0];
    }
}
