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

import com.seer.teach.common.dto.mq.IntegerDTO;
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;

import java.util.HashMap;

/**
 *
 * <p>
 *
 * </p >
 *
 * @author Captain
 * @since 2025-10-08 13:36
 */
@Slf4j
@Component
public class ContinueSmartReadingOrTreasureChestsHandler implements ImLargeModuleHandler<IntegerDTO> {
    @Override
    public void handle(IntegerDTO messageBody, String device) {
        HashMap<Object, Object> result = new HashMap<>();
        result.put("type", messageBody.getData());
        ImUtils.pushSingleChatToDeviceWithAck(
                device,
                MessagePushStatusEnums.SUCCESS.getCode(),
                MessageType.MessageContentType.CONTINUE_SMART_READING_OR_TREASURE_CHESTS.getMsgContentType(),
                result
        );
        log.info("发送了继续阅读指令");
    }

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

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