1234567891011121314151617181920212223242526272829303132 |
- package com.ym.controller;
- import com.ym.mec.common.controller.BaseController;
- import com.ym.service.MessageService;
- import io.rong.models.push.BroadcastModel;
- import io.rong.models.push.PushModel;
- 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("/push")
- public class PushController extends BaseController {
- @Autowired
- MessageService messageService;
- @RequestMapping(value = "/push", method = RequestMethod.POST)
- public Object push(@RequestBody PushModel pushModel) throws Exception {
- return succeed(messageService.pushPush(pushModel));
- }
- @RequestMapping(value = "/message", method = RequestMethod.POST)
- public Object message(@RequestBody BroadcastModel broadcastModel) throws Exception {
- return succeed(messageService.pushMessage(broadcastModel));
- }
- }
|