Documentation ¶
Index ¶
- Constants
- type ApiGenerateLinkResponse
- type ApiGenerateLinkResult
- type ApiGetQuaLitYsCoreBySidResponse
- type ApiGetQuaLitYsCoreBySidResult
- type ApiMiniCodeResponse
- type ApiMiniCodeResult
- type ApiMtUnionCategoryResponse
- type ApiMtUnionCategoryResult
- type ApiMtUnionCityResponse
- type ApiMtUnionCityResult
- type ApiMtUnionPoiResponse
- type ApiMtUnionPoiResult
- type ApiMtUnionSkuResponse
- type ApiMtUnionSkuResult
- type ApiOrderListResponse
- type ApiOrderListResult
- type ApiOrderResponse
- type ApiOrderResult
- type Client
- func (c *Client) ApiGenerateLink(ctx context.Context, notMustParams ...gorequest.Params) (*ApiGenerateLinkResult, error)
- func (c *Client) ApiGetQuaLitYsCoreBySid(ctx context.Context, notMustParams ...gorequest.Params) (*ApiGetQuaLitYsCoreBySidResult, error)
- func (c *Client) ApiMiniCode(ctx context.Context, notMustParams ...gorequest.Params) (*ApiMiniCodeResult, error)
- func (c *Client) ApiMtUnionCategory(ctx context.Context, notMustParams ...gorequest.Params) (*ApiMtUnionCategoryResult, error)
- func (c *Client) ApiMtUnionCity(ctx context.Context, notMustParams ...gorequest.Params) (*ApiMtUnionCityResult, error)
- func (c *Client) ApiMtUnionPoi(ctx context.Context, notMustParams ...gorequest.Params) (*ApiMtUnionPoiResult, error)
- func (c *Client) ApiMtUnionSku(ctx context.Context, notMustParams ...gorequest.Params) (*ApiMtUnionSkuResult, error)
- func (c *Client) ApiOrder(ctx context.Context, notMustParams ...gorequest.Params) (*ApiOrderResult, error)
- func (c *Client) ApiOrderList(ctx context.Context, notMustParams ...gorequest.Params) (*ApiOrderListResult, error)
- func (c *Client) GetAppKey() string
- func (c *Client) GetSecret() string
- func (c *Client) PoiArea(ctx context.Context, cityID int, notMustParams ...gorequest.Params) (*PoiAreaResult, error)
- func (c *Client) PoiCategory(ctx context.Context, cityID int, notMustParams ...gorequest.Params) (*PoiCategoryResult, error)
- func (c *Client) PoiCity(ctx context.Context, notMustParams ...gorequest.Params) (*PoiCityResult, error)
- func (c *Client) PoiDistrict(ctx context.Context, cityID int, notMustParams ...gorequest.Params) (*PoiDistrictResult, error)
- func (c *Client) ServeHttpOrderHttp(ctx context.Context, w http.ResponseWriter, r *http.Request) (validateJson ServeHttpOrderHttpRequest, err error)
- func (c *Client) SetAppKey(v string) *Client
- func (c *Client) SetClientIP(clientIP string) *Client
- func (c *Client) SetLogFun(logFun gorequest.LogFunc)
- func (c *Client) SetSecret(v string) *Client
- func (c *Client) SetTrace(trace bool)
- func (c *Client) TraceEndSpan()
- func (c *Client) TraceGetSpanID() (spanID string)
- func (c *Client) TraceGetTraceID() (traceID string)
- func (c *Client) TraceRecordError(err error, options ...trace.EventOption)
- func (c *Client) TraceSetAttributes(kv ...attribute.KeyValue)
- func (c *Client) TraceSetStatus(code codes.Code, description string)
- func (c *Client) TraceStartSpan(ctx context.Context, spanName string) context.Context
- type ClientConfig
- type PoiAreaResponse
- type PoiAreaResult
- type PoiCategoryResponse
- type PoiCategoryResult
- type PoiCityResponse
- type PoiCityResult
- type PoiDistrictResponse
- type PoiDistrictResult
- type ServeHttpOrderHttpRequest
- type ServeHttpOrderHttpResponse
Constants ¶
const (
LogTable = "meituan"
)
const (
Version = "1.0.32"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiGenerateLinkResponse ¶
type ApiGenerateLinkResult ¶
type ApiGenerateLinkResult struct { Result ApiGenerateLinkResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 }
type ApiGetQuaLitYsCoreBySidResponse ¶
type ApiGetQuaLitYsCoreBySidResponse struct { Status int `json:"status"` Des string `json:"des"` Data struct { DataList []struct { Appkey string `json:"appkey"` // appkey Sid string `json:"sid"` // 推广位sid Date string `json:"date"` // 质量分归属日期 QualityGrade string `json:"qualityGrade"` // 质量分 RepurchaseRate string `json:"repurchaseRate"` // sid维度的七日复购率 } `json:"dataList"` Total int `json:"total"` } `json:"data"` }
type ApiGetQuaLitYsCoreBySidResult ¶
type ApiGetQuaLitYsCoreBySidResult struct { Result ApiGetQuaLitYsCoreBySidResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 }
type ApiMiniCodeResponse ¶
type ApiMiniCodeResult ¶
type ApiMiniCodeResult struct { Result ApiMiniCodeResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 }
type ApiMtUnionCategoryResponse ¶ added in v1.0.22
type ApiMtUnionCategoryResult ¶ added in v1.0.22
type ApiMtUnionCategoryResult struct { Result ApiMtUnionCategoryResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 }
type ApiMtUnionCityResponse ¶ added in v1.0.22
type ApiMtUnionCityResult ¶ added in v1.0.22
type ApiMtUnionCityResult struct { Result ApiMtUnionCityResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 }
type ApiMtUnionPoiResponse ¶ added in v1.0.22
type ApiMtUnionPoiResponse struct { Code int `json:"code"` Msg string `json:"msg"` Data struct { DataList []struct { PoiViewId string `json:"poiViewId"` // POI门店ID PoiName string `json:"poiName"` // POI名称 PoiPicUrl string `json:"poiPicUrl"` // 店铺图URL PoiScore string `json:"poiScore"` // 店铺评分,满分5分 MonthSale string `json:"monthSale"` // 月售量 ShippingFee string `json:"shippingFee"` // 配送费金额,单位元 MinPrice string `json:"minPrice"` // 起送金额,单位元 Distance string `json:"distance"` // 门店距离,单位米 AvgDeliveryTime string `json:"avgDeliveryTime"` // 配送时长,单位分钟 ReduceShippingFee float64 `json:"reduceShippingFee"` // 满减配送费 PoiMarkTagUrl string `json:"poiMarkTagUrl"` // 角标信息 MerchantFullSale string `json:"merchantFullSale"` // 店铺满减,举例:38减25 MerchantDiscount string `json:"merchantDiscount"` // 店铺折扣,举例:3.4折起 NewCustomerDiscount string `json:"newCustomerDiscount"` // 新客立减,举例:新客减1 RebateCoupon string `json:"rebateCoupon"` // 返券,举例:返3元券 MerchantCoupon string `json:"merchantCoupon"` // 商家券,举例:领3元券 FullComplimentary string `json:"fullComplimentary"` // 满赠,举例:满68元得赠品 } `json:"dataList"` PageTraceId string `json:"pageTraceId"` // 分页查询参数,第二次查询传回 } `json:"data"` }
type ApiMtUnionPoiResult ¶ added in v1.0.22
type ApiMtUnionPoiResult struct { Result ApiMtUnionPoiResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 }
type ApiMtUnionSkuResponse ¶ added in v1.0.22
type ApiMtUnionSkuResponse struct { Code int `json:"code"` Msg string `json:"msg"` Data struct { DataList []struct { SkuId string `json:"skuId"` // sku编号 SkuName string `json:"skuName"` // sku名称 Price string `json:"price"` // 展示价格,单位分 Pic float64 `json:"pic"` // 商品主图 CategoryId float64 `json:"categoryId"` // 商品类目ID CategoryName string `json:"categoryName"` // 商品类目名称 SalesVolume float64 `json:"salesVolume"` // 当前sku销量 } `json:"dataList"` Total int64 `json:"total"` // 商品总数 } `json:"data"` }
type ApiMtUnionSkuResult ¶ added in v1.0.22
type ApiMtUnionSkuResult struct { Result ApiMtUnionSkuResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 }
type ApiOrderListResponse ¶
type ApiOrderListResponse struct { DataList []struct { ActId int `json:"actId,omitempty"` // 活动id,可以在联盟活动列表中查看获取 BusinessLine int `json:"businessLine,omitempty"` // 业务线 SubBusinessLine int `json:"subBusinessLine,omitempty"` // 子业务线 Orderid string `json:"orderid,omitempty"` // 订单id Paytime string `json:"paytime,omitempty"` // 订单支付时间,10位时间戳 Payprice string `json:"payprice,omitempty"` // 订单用户实际支付金额 Profit string `json:"profit,omitempty"` // 订单预估返佣金额 CpaProfit string `json:"cpaProfit,omitempty"` // 订单预估cpa总收益(优选、话费券) Sid string `json:"sid,omitempty"` // 订单对应的推广位sid Appkey string `json:"appkey,omitempty"` // 订单对应的appkey,外卖、话费、闪购、优选订单会返回该字段 Smstitle string `json:"smstitle,omitempty"` // 订单标题 ProductId string `json:"productId,omitempty"` // 商品ID ProductName string `json:"productName,omitempty"` // 商品名称 Refundprice string `json:"refundprice,omitempty"` // 订单实际退款金额,外卖、话费、闪购、优选、酒店订单若发生退款会返回该字段 Refundtime string `json:"refundtime,omitempty"` // 订单退款时间,10位时间戳,外卖、话费、闪购、优选、酒店订单若发生退款会返回该字段(退款时间为最近的一次退款) Refundprofit string `json:"refundprofit,omitempty"` // 订单需要扣除的返佣金额,外卖、话费、闪购、优选、酒店订单若发生退款会返回该字段 CpaRefundProfit string `json:"cpaRefundProfit,omitempty"` // 订单需要扣除的cpa返佣金额(优选、话费券) Status int `json:"status,omitempty"` // 订单状态,外卖、话费、闪购、优选、酒店订单会返回该字段 1 已付款 8 已完成 9 已退款或风控 TradeTypeList []int `json:"tradeTypeList,omitempty"` // 订单的奖励类型 3 首购奖励 5 留存奖励 2 cps 3 首购奖励 RiskOrder int `json:"riskOrder,omitempty"` // 0表示非风控订单,1表示风控订单 Extra string `json:"extra,omitempty"` TradeTypeBusinessTypeMapStr string `json:"tradeTypeBusinessTypeMapStr,omitempty"` } `json:"dataList"` Total int `json:"total"` // 查询条件命中的总数据条数,用于计算分页参数 }
type ApiOrderListResult ¶
type ApiOrderListResult struct { Result ApiOrderListResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 }
type ApiOrderResponse ¶
type ApiOrderResponse struct { Status int `json:"status"` Des string `json:"des"` Data struct { ActId int `json:"actId,omitempty"` // 活动id,可以在联盟活动列表中查看获取 BusinessLine int `json:"businessLine,omitempty"` // 业务线 SubBusinessLine int `json:"subBusinessLine,omitempty"` // 子业务线 Quantity int `json:"quantity,omitempty"` // 商品数量 OrderId string `json:"orderId,omitempty"` // 订单id Paytime string `json:"paytime,omitempty"` // 订单支付时间,10位时间戳 ModTime string `json:"modTime,omitempty"` // 订单信息修改时间,10位时间戳 Payprice string `json:"payprice,omitempty"` // 订单用户实际支付金额 Profit string `json:"profit,omitempty"` // 订单预估返佣金额 CpaProfit string `json:"cpaProfit,omitempty"` // 订单预估cpa总收益(优选、话费券) Sid string `json:"sid,omitempty"` // 订单对应的推广位sid Appkey string `json:"appkey,omitempty"` // 订单对应的appkey,外卖、话费、闪购、优选、酒店订单会返回该字段 Smstitle string `json:"smstitle,omitempty"` // 订单标题 Status int `json:"status,omitempty"` // 订单状态,外卖、话费、闪购、优选、酒店订单会返回该字段 1 已付款 8 已完成 9 已退款或风控 TradeTypeList []int `json:"tradeTypeList,omitempty"` // 订单的奖励类型 3 首购奖励 5 留存奖励 2 cps 3 首购奖励 RiskApiOrder int `json:"riskApiOrder,omitempty"` // 0表示非风控订单,1表示风控订单 Refundprofit string `json:"refundprofit,omitempty"` // 订单需要扣除的返佣金额,外卖、话费、闪购、优选、酒店订单若发生退款会返回该字段 CpaRefundProfit string `json:"cpaRefundProfit,omitempty"` // 订单需要扣除的cpa返佣金额(优选、话费券) RefundInfoList struct { Id string `json:"id,omitempty"` RefundPrice string `json:"refundPrice,omitempty"` RefundTime string `json:"refundTime,omitempty"` RefundType int `json:"refundType,omitempty"` } `json:"refundInfoList,omitempty"` // 退款列表 RefundProfitList struct { Id string `json:"id,omitempty"` RefundProfit string `json:"refundProfit,omitempty"` RefundFinishTime string `json:"refundFinishTime,omitempty"` Type int `json:"type,omitempty"` } `json:"refundProfitList,omitempty"` ConsumeProfitList struct { Id string `json:"id,omitempty"` ConsumeProfit string `json:"consumeProfit,omitempty"` ConsumeFinishTime string `json:"consumeFinishTime,omitempty"` Type string `json:"type,omitempty"` } `json:"consumeProfitList,omitempty"` CouponCode string `json:"coupon_code,omitempty"` // 券码 ProductId string `json:"productId,omitempty"` // 商品ID ProductName string `json:"productName,omitempty"` // 商品名称 } `json:"data"` }
type ApiOrderResult ¶
type ApiOrderResult struct { Result ApiOrderResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client 实例
func (*Client) ApiGenerateLink ¶
func (c *Client) ApiGenerateLink(ctx context.Context, notMustParams ...gorequest.Params) (*ApiGenerateLinkResult, error)
ApiGenerateLink 自助取链接口(新版) https://union.meituan.com/v2/apiDetail?id=25
func (*Client) ApiGetQuaLitYsCoreBySid ¶
func (c *Client) ApiGetQuaLitYsCoreBySid(ctx context.Context, notMustParams ...gorequest.Params) (*ApiGetQuaLitYsCoreBySidResult, error)
ApiGetQuaLitYsCoreBySid 优选sid质量分&复购率查询 https://union.meituan.com/v2/apiDetail?id=28
func (*Client) ApiMiniCode ¶
func (c *Client) ApiMiniCode(ctx context.Context, notMustParams ...gorequest.Params) (*ApiMiniCodeResult, error)
ApiMiniCode 小程序生成二维码(新版) https://union.meituan.com/v2/apiDetail?id=26
func (*Client) ApiMtUnionCategory ¶ added in v1.0.22
func (c *Client) ApiMtUnionCategory(ctx context.Context, notMustParams ...gorequest.Params) (*ApiMtUnionCategoryResult, error)
ApiMtUnionCategory 商品类目查询(新版) https://union.meituan.com/v2/apiDetail?id=30
func (*Client) ApiMtUnionCity ¶ added in v1.0.22
func (c *Client) ApiMtUnionCity(ctx context.Context, notMustParams ...gorequest.Params) (*ApiMtUnionCityResult, error)
ApiMtUnionCity 城市信息查询(新版) https://union.meituan.com/v2/apiDetail?id=29
func (*Client) ApiMtUnionPoi ¶ added in v1.0.22
func (c *Client) ApiMtUnionPoi(ctx context.Context, notMustParams ...gorequest.Params) (*ApiMtUnionPoiResult, error)
ApiMtUnionPoi 门店POI查询(新版) https://union.meituan.com/v2/apiDetail?id=32
func (*Client) ApiMtUnionSku ¶ added in v1.0.22
func (c *Client) ApiMtUnionSku(ctx context.Context, notMustParams ...gorequest.Params) (*ApiMtUnionSkuResult, error)
ApiMtUnionSku 商品列表查询(新版) https://union.meituan.com/v2/apiDetail?id=31
func (*Client) ApiOrder ¶
func (c *Client) ApiOrder(ctx context.Context, notMustParams ...gorequest.Params) (*ApiOrderResult, error)
ApiOrder 单订单查询接口(新版) https://union.meituan.com/v2/apiDetail?id=24
func (*Client) ApiOrderList ¶
func (c *Client) ApiOrderList(ctx context.Context, notMustParams ...gorequest.Params) (*ApiOrderListResult, error)
ApiOrderList 订单列表查询接口(新版) https://union.meituan.com/v2/apiDetail?id=23
func (*Client) PoiArea ¶
func (c *Client) PoiArea(ctx context.Context, cityID int, notMustParams ...gorequest.Params) (*PoiAreaResult, error)
PoiArea 基础数据 - 商圈接口 https://openapi.meituan.com/#api-0.%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE-GetHttpsOpenapiMeituanComPoiAreaCityid1
func (*Client) PoiCategory ¶
func (c *Client) PoiCategory(ctx context.Context, cityID int, notMustParams ...gorequest.Params) (*PoiCategoryResult, error)
PoiCategory 基础数据 - 品类接口 https://openapi.meituan.com/#api-0.%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE-GetHttpsOpenapiMeituanComPoiDistrictCityid1
func (*Client) PoiCity ¶
func (c *Client) PoiCity(ctx context.Context, notMustParams ...gorequest.Params) (*PoiCityResult, error)
PoiCity 基础数据 - 开放城市接口 https://openapi.meituan.com/#api-0.%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE-GetHttpsOpenapiMeituanComPoiCity
func (*Client) PoiDistrict ¶
func (c *Client) PoiDistrict(ctx context.Context, cityID int, notMustParams ...gorequest.Params) (*PoiDistrictResult, error)
PoiDistrict 基础数据 - 城市的行政区接口 https://openapi.meituan.com/#api-0.%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE-GetHttpsOpenapiMeituanComPoiDistrictCityid1
func (*Client) ServeHttpOrderHttp ¶ added in v1.0.25
func (c *Client) ServeHttpOrderHttp(ctx context.Context, w http.ResponseWriter, r *http.Request) (validateJson ServeHttpOrderHttpRequest, err error)
ServeHttpOrderHttp 订单回推接口(新版) https://union.meituan.com/v2/apiDetail?id=22
func (*Client) SetClientIP ¶ added in v1.0.25
SetClientIP 配置
func (*Client) TraceEndSpan ¶ added in v1.0.28
func (c *Client) TraceEndSpan()
TraceEndSpan 结束OpenTelemetry链路追踪状态
func (*Client) TraceGetSpanID ¶ added in v1.0.29
TraceGetSpanID 获取OpenTelemetry链路追踪SpanID
func (*Client) TraceGetTraceID ¶ added in v1.0.29
TraceGetTraceID 获取OpenTelemetry链路追踪TraceID
func (*Client) TraceRecordError ¶ added in v1.0.30
func (c *Client) TraceRecordError(err error, options ...trace.EventOption)
TraceRecordError 记录OpenTelemetry链路追踪错误
func (*Client) TraceSetAttributes ¶ added in v1.0.29
TraceSetAttributes 设置OpenTelemetry链路追踪属性
func (*Client) TraceSetStatus ¶ added in v1.0.29
TraceSetStatus 设置OpenTelemetry链路追踪状态
type ClientConfig ¶ added in v1.0.11
ClientConfig 实例配置
type PoiAreaResponse ¶
type PoiAreaResult ¶
type PoiAreaResult struct { Result PoiAreaResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 }
type PoiCategoryResponse ¶
type PoiCategoryResult ¶
type PoiCategoryResult struct { Result PoiCategoryResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 }
type PoiCityResponse ¶
type PoiCityResult ¶
type PoiCityResult struct { Result PoiCityResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 }
type PoiDistrictResponse ¶
type PoiDistrictResult ¶
type PoiDistrictResult struct { Result PoiDistrictResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 }
type ServeHttpOrderHttpRequest ¶ added in v1.0.25
type ServeHttpOrderHttpRequest struct { Smstitle string `json:"smstitle,omitempty"` // 订单标题 Quantity string `json:"quantity,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 }
ServeHttpOrderHttpRequest 请求参数
func (*ServeHttpOrderHttpRequest) Error ¶ added in v1.0.25
func (r *ServeHttpOrderHttpRequest) Error() ServeHttpOrderHttpResponse
Error 返回错误
func (*ServeHttpOrderHttpRequest) Success ¶ added in v1.0.25
func (r *ServeHttpOrderHttpRequest) Success() ServeHttpOrderHttpResponse
Success 返回正常
type ServeHttpOrderHttpResponse ¶ added in v1.0.25
type ServeHttpOrderHttpResponse struct { Errcode int `json:"errcode"` Errmsg string `json:"errmsg"` }
ServeHttpOrderHttpResponse 返回参数
Source Files ¶
- api.generate_link.go
- api.getqualityscorebysid.go
- api.mini_code.go
- api.mtunion.category.go
- api.mtunion.city.go
- api.mtunion.poi.go
- api.mtunion.sku.go
- api.order.go
- api.orderList.go
- client.config.go
- client.const.go
- client.go
- client.opentelemetry.go
- poi.area.go
- poi.category.go
- poi.city.go
- poi.district.go
- request.go
- service_http.order.go
- sign.go
- version.go