package com.ym.controller; import com.ym.service.MessageService; import io.rong.models.Result; import io.rong.models.message.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; /** * Created by weiqinxiao on 2019/2/25. */ @RestController @RequestMapping("/system") public class SystemController { @Autowired MessageService messageService; @RequestMapping(value = "/send", method = RequestMethod.POST) public Result send(@RequestBody SystemMessage systemMessage) throws Exception { return messageService.systemSend(systemMessage); } @RequestMapping(value = "/broadcast", method = RequestMethod.POST) public Result broadcast(@RequestBody BroadcastMessage broadcastMessage) throws Exception { return messageService.systemBroadcast(broadcastMessage); } @RequestMapping(value = "/sendTemplate", method = RequestMethod.POST) public Result sendTemplate(@RequestBody TemplateMessage templateMessage) throws Exception { return messageService.systemSendTemplate(templateMessage); } }