package com.ym.controller; import com.ym.mec.common.controller.BaseController; import com.ym.service.MessageService; import io.rong.models.message.BroadcastMessage; import io.rong.models.message.SystemMessage; import io.rong.models.message.TemplateMessage; 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 extends BaseController { @Autowired MessageService messageService; @RequestMapping(value = "/send", method = RequestMethod.POST) public Object send(@RequestBody SystemMessage systemMessage) throws Exception { return succeed(messageService.systemSend(systemMessage)); } @RequestMapping(value = "/broadcast", method = RequestMethod.POST) public Object broadcast(@RequestBody BroadcastMessage broadcastMessage) throws Exception { return succeed(messageService.systemBroadcast(broadcastMessage)); } @RequestMapping(value = "/sendTemplate", method = RequestMethod.POST) public Object sendTemplate(@RequestBody TemplateMessage templateMessage) throws Exception { return succeed(messageService.systemSendTemplate(templateMessage)); } }