PushController.java 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. package com.ym.controller;
  2. import com.ym.service.MessageService;
  3. import io.rong.models.push.BroadcastModel;
  4. import io.rong.models.push.PushModel;
  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("/push")
  15. public class PushController {
  16. @Autowired
  17. MessageService messageService;
  18. @RequestMapping(value = "/push", method = RequestMethod.POST)
  19. public Object push(@RequestBody PushModel pushModel) throws Exception {
  20. return messageService.pushPush(pushModel);
  21. }
  22. @RequestMapping(value = "/message", method = RequestMethod.POST)
  23. public Object message(@RequestBody BroadcastModel broadcastModel) throws Exception {
  24. return messageService.pushMessage(broadcastModel);
  25. }
  26. }