package com.education.business.message.mq;

import com.education.business.message.param.ExamCorrectMessage;
import com.education.common.enums.PlatformTypeEnum;
import com.education.common.enums.SocketMessageTypeEnum;
import com.education.model.dto.SocketMessageCommand;
import org.springframework.stereotype.Component;

/**
 * @author zjt
 * @version 1.0.7
 * @Description
 * @createTime 2025/2/25 11:33
 */
@Component
public class WebSocketExamCorrectMessageListener extends WenSocketMessageListener<ExamCorrectMessage> {

    @Override
    SocketMessageCommand getSocketMessageCommand(ExamCorrectMessage examCorrectMessage) {
        SocketMessageCommand socketMessageCommand = new SocketMessageCommand();
        socketMessageCommand.setUserId(examCorrectMessage.getUserId());
        socketMessageCommand.setPlatform(PlatformTypeEnum.WEB_FRONT.getCode());
        socketMessageCommand.setMessageType(getSocketMessageTypeEnum().getCode());
        return socketMessageCommand;
    }

    @Override
    SocketMessageTypeEnum getSocketMessageTypeEnum() {
        return SocketMessageTypeEnum.EXAM_CORRECT;
    }
}
