PushController.java 1.1 KB

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