| 12345678910111213141516171819202122232425262728293031323334 |
- package mq
- import (
- "mtp20access/global"
- "mtp20access/model/common/response"
- "mtp20access/model/mq/request"
- "mtp20access/service/mq"
- "github.com/gin-gonic/gin"
- "go.uber.org/zap"
- )
- // SendMsgToMQ 发送总线业务请求
- // @Summary 总线业务
- // @Security ApiKeyAuth
- // @accept application/json
- // @Produce application/json
- // @Param data body request.MQBodyReq true "入参"
- // @Success 200 {object} response.Response{data=response.MQBodyRsp,msg=string} "出参"
- // @Router /MQ/SendMsgToMQ [post]
- // @Tags 总线业务
- func SendMsgToMQ(c *gin.Context) {
- req := request.MQBodyReq{}
- if err := c.ShouldBindJSON(&req); err != nil {
- response.FailWithMessage("入参不正确", c)
- return
- } else {
- global.M2A_LOG.Info("[C->S]", zap.Any("req", req.FunCodeReq), zap.Any("data", req.Data))
- }
- if err := mq.SendMQ(c, &req); err != nil {
- response.FailWithMessage(err.Error(), c)
- }
- }
|