package org.dromara.elevator.controller.message;

import lombok.RequiredArgsConstructor;
import org.dromara.elevator.constant.RespConstant;
import org.dromara.elevator.domain.message.RealMsgReq;
import org.dromara.elevator.service.message.RealMsgService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 实时消息推送
 *
 * @author ym
 * @version 1.0.0
 * @date 2024-08-21 16:15
 */
@RestController
@RequestMapping("/v5.0/api")
@RequiredArgsConstructor
public class RealMsgController {

    private final RealMsgService realMsgService;

    /**
     * 实时消息推送
     *
     * @param req
     * @return
     */
    @PostMapping("/msg.do")
    public String realMsg(@RequestBody RealMsgReq req) {
        realMsgService.realMsg(req);
        return RespConstant.MSG_OK;
    }

}
