package com.pannk.controller;

import com.pannk.service.SendMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by wolf on 20-11-17.
 */
@RestController
public class MessageSendController {

    @Autowired
    private SendMessageService sendMessageService;

    /**
     * 直连消息
     *
     * @param content
     * @return
     */
    @GetMapping("/sendDirect")
    public String sendDirectMsg(String content) {
        sendMessageService.sendDirectMsg(content);
        return content;
    }

    /**
     * 主题消息
     *
     * @param content
     * @return
     */
    @GetMapping("/sendTopic")
    public String sendTopicMsg(String content) {
        sendMessageService.sendTopicMsg(content);
        return content;
    }

    /**
     * 广播消息
     *
     * @param content
     * @return
     */
    @GetMapping("/sendFanout")
    public String sendFanoutMsg(String content) {
        sendMessageService.sendFanoutMsg(content);
        return content;
    }

}
