| 123456789101112131415161718192021222324252627282930313233343536373839 |
- package quote
- import (
- "mtp20access/model/common/response"
- "mtp20access/model/quote/request"
- "mtp20access/service/quote"
- "github.com/gin-gonic/gin"
- )
- func Quote(c *gin.Context) {
- if err := quote.QuoteConn(c); err != nil {
- response.FailWithMessage(err.Error(), c)
- // return
- }
- // response.OkWithMessage("连接成功", c)
- }
- // SendMsgToMQ 订阅商品实时行情请求
- // @Summary 实时行情
- // @Security ApiKeyAuth
- // @accept application/json
- // @Produce application/json
- // @Param data body []request.QuoteSubscribeReq true "入参"
- // @Success 200 {object} response.Response{msg=string} "出参"
- // @Router /Quote/QuoteSubscribe [post]
- // @Tags 实时行情
- func QuoteSubscribe(c *gin.Context) {
- var req []request.QuoteSubscribeReq
- if err := c.ShouldBindJSON(&req); err != nil {
- response.FailWithMessage("入参不正确", c)
- return
- }
- if err := quote.QuoteSubscribe(c, req); err != nil {
- response.FailWithMessage(err.Error(), c)
- }
- }
|