You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
meituan/service_http.order.go

62 lines
3.2 KiB

2 years ago
package meituan
import (
2 years ago
"context"
2 years ago
"github.com/gin-gonic/gin"
"net/http"
)
// ResponseServeHttpOrder 返回参数
type ResponseServeHttpOrder struct {
Smstitle string `json:"appId,omitempty"` // 订单标题
Quantity string `json:"CreateTime,omitempty"` // 订单数量
Orderid string `json:"orderid,omitempty"` // 订单id
Dealid string `json:"dealid,omitempty"` // 店铺id部分存在
Paytime string `json:"paytime,omitempty"` // 订单支付时间10位时间戳
ActId string `json:"actId,omitempty"` // 活动id可以在联盟活动列表中查看获取
BusinessLine string `json:"businessLine,omitempty"` // 详见业务线类型
SubBusinessLine string `json:"subBusinessLine,omitempty"` // 子业务线
Type string `json:"type,omitempty"` // 订单类型,枚举值同订单查询接口定义
Ordertime string `json:"ordertime,omitempty"` // 下单时间10位时间戳
Sid string `json:"sid,omitempty"` // 媒体推广位sid
Appkey string `json:"appkey,omitempty"` // 媒体名称,可在推广者备案-媒体管理中查询
Uid string `json:"uid,omitempty"` // 渠道id
Status string `json:"status,omitempty"` // 订单状态,枚举值同订单查询接口返回定义
Total string `json:"total,omitempty"` // 订单总金额
PayPrice string `json:"payPrice,omitempty"` // 订单实际支付金额
ModTime string `json:"modTime,omitempty"` // 订单修改时间
ProductId string `json:"productId,omitempty"` // 商品ID
ProductName string `json:"productName,omitempty"` // 商品名称
Direct string `json:"direct,omitempty"` // 订单实际支付金额
Ratio string `json:"ratio,omitempty"` // 订单返佣比例cps活动的订单会返回该字段
Sign string `json:"sign,omitempty"` // 订单签名字段,计算方法参见文档中签名(sign)生成逻辑
TradeTypeList string `json:"tradeTypeList,omitempty"` // 优选订单类型返回该字段
ConsumeType string `json:"consumeType,omitempty"` // 核销类型
RefundType string `json:"refundType,omitempty"` // 退款类型
EncryptionVoucherId string `json:"encryptionVoucherId,omitempty"` // 消费券加密券ID
}
// ServeHttpOrder 订单回推接口(新版)
// https://union.meituan.com/v2/apiDetail?id=22
2 years ago
func (c *Client) ServeHttpOrder(ctx context.Context, gCtx *gin.Context) (validateJson ResponseServeHttpOrder, err error) {
2 years ago
// 声明接收的变量
2 years ago
err = gCtx.ShouldBind(&validateJson)
2 years ago
return
}
// Success 数据正常
func (r *ResponseServeHttpOrder) Success(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{
"errcode": 0,
"errmsg": "ok",
})
}
// Error 数据错误
func (r *ResponseServeHttpOrder) Error(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{
"errcode": 1,
"errmsg": "err",
})
}