SystemController.java 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package com.ym.controller;
  2. import com.ym.service.MessageService;
  3. import io.rong.models.message.BroadcastMessage;
  4. import io.rong.models.message.SystemMessage;
  5. import io.rong.models.message.TemplateMessage;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.web.bind.annotation.RequestBody;
  8. import org.springframework.web.bind.annotation.RequestMapping;
  9. import org.springframework.web.bind.annotation.RequestMethod;
  10. import org.springframework.web.bind.annotation.RestController;
  11. /**
  12. * Created by weiqinxiao on 2019/2/25.
  13. */
  14. @RestController
  15. @RequestMapping("/system")
  16. public class SystemController {
  17. @Autowired
  18. MessageService messageService;
  19. @RequestMapping(value = "/send", method = RequestMethod.POST)
  20. public Object send(@RequestBody SystemMessage systemMessage) throws Exception {
  21. return messageService.systemSend(systemMessage);
  22. }
  23. @RequestMapping(value = "/broadcast", method = RequestMethod.POST)
  24. public Object broadcast(@RequestBody BroadcastMessage broadcastMessage) throws Exception {
  25. return messageService.systemBroadcast(broadcastMessage);
  26. }
  27. @RequestMapping(value = "/sendTemplate", method = RequestMethod.POST)
  28. public Object sendTemplate(@RequestBody TemplateMessage templateMessage) throws Exception {
  29. return messageService.systemSendTemplate(templateMessage);
  30. }
  31. }