2018-11-28 16:51:42 +08:00
|
|
|
package com.gzzn.omms.msgexchangeapi.controller;
|
|
|
|
|
|
2018-11-28 20:32:19 +08:00
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
2018-11-28 16:51:42 +08:00
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
2018-11-28 20:32:19 +08:00
|
|
|
import com.gzzn.omms.msgexchangeapi.domain.primary.entity.Cminmsg;
|
2018-11-28 16:51:42 +08:00
|
|
|
import com.gzzn.omms.msgexchangeapi.dto.ResponseDto;
|
2018-11-28 20:32:19 +08:00
|
|
|
import com.gzzn.omms.msgexchangeapi.service.ICminmsgService;
|
2018-11-28 16:51:42 +08:00
|
|
|
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("/cminmsgs")
|
|
|
|
|
public class CminmsgsController {
|
2018-11-28 20:32:19 +08:00
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private ICminmsgService cminmsgService;
|
|
|
|
|
|
|
|
|
|
|
2018-11-28 16:51:42 +08:00
|
|
|
/***
|
|
|
|
|
* 发送消息到Cminmsgs数据库表
|
|
|
|
|
* @param msg
|
|
|
|
|
* @param topic
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
2018-11-28 20:32:19 +08:00
|
|
|
@PostMapping(value = "/send")
|
|
|
|
|
public ResponseDto send(@RequestBody String xmlmsg) {
|
|
|
|
|
|
|
|
|
|
Cminmsg minmsg = cminmsgService.sendXmlMsg(xmlmsg);
|
|
|
|
|
|
|
|
|
|
return ResponseDto.success(minmsg.getCminmsgsId());
|
2018-11-28 16:51:42 +08:00
|
|
|
}
|
|
|
|
|
}
|