package com.seer.teach.netty.im.handler.im.singlechat;

import com.seer.teach.netty.common.annotation.ImMessageContentType;
import com.seer.teach.netty.common.proto.MessageProtobuf;
import com.seer.teach.netty.im.handler.im.ImMessageContentHandler;
import com.seer.teach.teacher.api.SseServiceApi;
import io.netty.channel.ChannelHandlerContext;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

@Service
@Slf4j
@Component
@ImMessageContentType(146)
@RequiredArgsConstructor
public class EnterHomeVoiceDescriptionHandlerImpl implements ImMessageContentHandler {

    private final SseServiceApi sseServiceApi;

    @Override
    public void handle(ChannelHandlerContext ctx, MessageProtobuf.Msg msg) {
        log.info("收到设备 ：{},开机问候指令",msg.getHead().getDevice());
        sseServiceApi.dailyWelcome(msg.getHead().getDevice());
    }

}
