package com.seer.teach.netty.im.handler.mq.impl.largemodule;

import com.seer.teach.common.dto.mq.im.AiChatResp;
import com.seer.teach.common.enums.im.LargeModuleTopTagEnum;
import com.seer.teach.common.enums.MessagePushStatusEnums;
import com.seer.teach.netty.common.proto.MessageType;
import com.seer.teach.netty.im.handler.mq.ImLargeModuleHandler;
import com.seer.teach.netty.im.utils.ImUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * <p>
 * 推送音频数据至Tv端
 * </p>
 *
 * @author Captain
 * @since 2025-07-17 22:13
 */
@Slf4j
@Component
public class ReceiveVoiceMessagesHandler implements ImLargeModuleHandler<AiChatResp> {
    @Override
    public void handle(AiChatResp messageBody, String device) {
        ImUtils.pushSingleChatToDeviceWithAck(device, MessagePushStatusEnums.SUCCESS.getCode(), MessageType.MessageContentType.RECEIVE_VOICE_MESSAGES.getMsgContentType(), messageBody);
    }

    @Override
    public Class<AiChatResp> getType() {
        return AiChatResp.class;
    }

    @Override
    public String getTag() {
        return LargeModuleTopTagEnum.RECEIVE_VOICE_MESSAGES.getTag();
    }
}
