SystemController.java 1.3 KB

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