添加const常量
This commit is contained in:
parent
b001bb9837
commit
a198b6e0cc
@ -1,5 +1,13 @@
|
|||||||
package didi_union
|
package didi_union
|
||||||
|
|
||||||
|
// 相关地址
|
||||||
|
const (
|
||||||
|
SiteDomain = "https://union.didi.cn" // SiteDomain 滴滴联盟域名
|
||||||
|
SiteUrl = "https://union.didi.cn/#/backhome" // SiteUrl 滴滴联盟后台地址
|
||||||
|
DocUrl = "https://union.didi.cn/#/helpCenter/commonProblem/f1466" // DocUrl 滴滴联盟文档地址
|
||||||
|
ApiDocUrl = "https://union.didi.cn/#/account/apiManage" // ApiDocUrl 滴滴联盟API文档地址
|
||||||
|
)
|
||||||
|
|
||||||
// OrderType 订单类型
|
// OrderType 订单类型
|
||||||
type OrderType string
|
type OrderType string
|
||||||
|
|
||||||
|
|||||||
@ -70,11 +70,13 @@ func (a *apiClientSuite) Test_ElemePromotionOfficialActivityGet() {
|
|||||||
func (a *apiClientSuite) Test_KbcpxPositiveOrderGet() {
|
func (a *apiClientSuite) Test_KbcpxPositiveOrderGet() {
|
||||||
req := &request.AlibabaAlscUnionKbcpxPositiveOrderGetRequest{
|
req := &request.AlibabaAlscUnionKbcpxPositiveOrderGetRequest{
|
||||||
DateType: pointer.Int64(1),
|
DateType: pointer.Int64(1),
|
||||||
Pid: pointer.String("alsc_23378482_4796002_15513017"),
|
//Pid: pointer.String("alsc_23378482_4796002_15513017"),
|
||||||
BizUnit: pointer.Int64(2),
|
BizUnit: pointer.Int64(2),
|
||||||
PageSize: pointer.Int64(10),
|
PageSize: pointer.Int64(20),
|
||||||
PageNumber: pointer.Int64(1),
|
PageNumber: pointer.Int64(1),
|
||||||
StartDate: pointer.String("2024-05-01 00:00:00"),
|
StartDate: pointer.String("2024-05-16 00:00:00"),
|
||||||
|
EndDate: pointer.String("2024-05-17 00:00:00"),
|
||||||
|
//OrderId: pointer.String("8036650073745353114"),
|
||||||
}
|
}
|
||||||
resp, err := a.api.KbcpxPositiveOrderGet(req)
|
resp, err := a.api.KbcpxPositiveOrderGet(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@ -1 +1,9 @@
|
|||||||
package eleme_union
|
package eleme_union
|
||||||
|
|
||||||
|
// 相关地址
|
||||||
|
const (
|
||||||
|
SiteDomain = "https://union.ele.me" // SiteDomain 域名
|
||||||
|
SiteUrl = "https://union.ele.me/index#/ele-login" // SiteUrl 后台地址
|
||||||
|
DocUrl = "https://www.yuque.com/jieqian-aa5ms/gpgci8" // DocUrl 文档地址
|
||||||
|
ApiDocUrl = "https://open.taobao.com/api.htm?docId=60449&docType=2&scopeId=24408" // ApiDocUrl api文档地址
|
||||||
|
)
|
||||||
|
|||||||
@ -1,6 +1,15 @@
|
|||||||
package meituan_csr
|
package meituan_csr
|
||||||
|
|
||||||
|
// 相关地址
|
||||||
const (
|
const (
|
||||||
Domain = "https://union.dianping.com"
|
SiteDomain = "https://union.dianping.com" // SiteDomain 域名
|
||||||
|
SiteUrl = "" // SiteUrl 后台地址
|
||||||
|
DocUrl = "" // DocUrl 文档地址
|
||||||
|
ApiDocUrl = "" // ApiDocUrl api文档地址
|
||||||
|
)
|
||||||
|
|
||||||
|
// 接口地址
|
||||||
|
const (
|
||||||
|
Domain = "https://union.dianping.com" // Domain 域名
|
||||||
GetLinkUrl = Domain + "/api/promotion/link"
|
GetLinkUrl = Domain + "/api/promotion/link"
|
||||||
)
|
)
|
||||||
|
|||||||
@ -64,7 +64,6 @@ func (a *meituanUnionApiImpl) GetLink(params GenerateLinkRequest) (*GenerateLink
|
|||||||
a.log.WithFields().Errorf("[meituanUnionApiImpl][GetLink] copy request error: %v", err)
|
a.log.WithFields().Errorf("[meituanUnionApiImpl][GetLink] copy request error: %v", err)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
request.Appkey = a.client.authConfig.AppKey
|
|
||||||
request.Sign = a.Sign(util.StructToMap(request))
|
request.Sign = a.Sign(util.StructToMap(request))
|
||||||
queryArgs := util.StructToMap(request)
|
queryArgs := util.StructToMap(request)
|
||||||
req := &client.HttpRequest{Headers: a.client.Headers, QueryArgs: queryArgs}
|
req := &client.HttpRequest{Headers: a.client.Headers, QueryArgs: queryArgs}
|
||||||
@ -82,7 +81,6 @@ func (a *meituanUnionApiImpl) MiniCode(params MiniCodeRequest) (*MimiCodeRespons
|
|||||||
a.log.WithFields().Errorf("[meituanUnionApiImpl][GetLink] copy request error: %v", err)
|
a.log.WithFields().Errorf("[meituanUnionApiImpl][GetLink] copy request error: %v", err)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
request.Appkey = a.client.authConfig.AppKey
|
|
||||||
request.Sign = a.Sign(util.StructToMap(request))
|
request.Sign = a.Sign(util.StructToMap(request))
|
||||||
queryArgs := util.StructToMap(request)
|
queryArgs := util.StructToMap(request)
|
||||||
req := &client.HttpRequest{Headers: a.client.Headers, QueryArgs: queryArgs}
|
req := &client.HttpRequest{Headers: a.client.Headers, QueryArgs: queryArgs}
|
||||||
@ -100,7 +98,6 @@ func (a *meituanUnionApiImpl) GetOrderBySinge(params GetOrderBySingeRequest) (*G
|
|||||||
a.log.WithFields().Errorf("[meituanUnionApiImpl][GetLink] copy request error: %v", err)
|
a.log.WithFields().Errorf("[meituanUnionApiImpl][GetLink] copy request error: %v", err)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
request.Appkey = a.client.authConfig.AppKey
|
|
||||||
request.Sign = a.Sign(util.StructToMap(request))
|
request.Sign = a.Sign(util.StructToMap(request))
|
||||||
queryArgs := util.StructToMap(request)
|
queryArgs := util.StructToMap(request)
|
||||||
req := &client.HttpRequest{Headers: a.client.Headers, QueryArgs: queryArgs}
|
req := &client.HttpRequest{Headers: a.client.Headers, QueryArgs: queryArgs}
|
||||||
@ -120,7 +117,6 @@ func (a *meituanUnionApiImpl) GetOrderByBatch(params GetOrderByBatchRequest) (*G
|
|||||||
a.log.WithFields().Errorf("[meituanUnionApiImpl][GetLink] copy request error: %v", err)
|
a.log.WithFields().Errorf("[meituanUnionApiImpl][GetLink] copy request error: %v", err)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
request.Appkey = a.client.authConfig.AppKey
|
|
||||||
request.Ts = int32(time.Now().Unix())
|
request.Ts = int32(time.Now().Unix())
|
||||||
request.Sign = a.Sign(util.StructToMap(request))
|
request.Sign = a.Sign(util.StructToMap(request))
|
||||||
queryArgs := util.StructToMap(request)
|
queryArgs := util.StructToMap(request)
|
||||||
|
|||||||
@ -39,6 +39,7 @@ func (a *apiClientSuite) Test_Sign() {
|
|||||||
func (a *apiClientSuite) Test_GetOrderBySinge() {
|
func (a *apiClientSuite) Test_GetOrderBySinge() {
|
||||||
req := GetOrderBySingeRequest{
|
req := GetOrderBySingeRequest{
|
||||||
ActId: 33,
|
ActId: 33,
|
||||||
|
OrderId: "3801047573041660994",
|
||||||
}
|
}
|
||||||
resp, err := a.api.GetOrderBySinge(req)
|
resp, err := a.api.GetOrderBySinge(req)
|
||||||
if !a.NoError(err) {
|
if !a.NoError(err) {
|
||||||
@ -54,7 +55,7 @@ func (a *apiClientSuite) Test_GetOrderByBatch() {
|
|||||||
Page: 1,
|
Page: 1,
|
||||||
Limit: 10,
|
Limit: 10,
|
||||||
StartTime: 1714147200,
|
StartTime: 1714147200,
|
||||||
//EndTime: 1714233600,
|
EndTime: 1714233500,
|
||||||
}
|
}
|
||||||
list, err := a.api.GetOrderByBatch(req)
|
list, err := a.api.GetOrderByBatch(req)
|
||||||
if !a.NoError(err) {
|
if !a.NoError(err) {
|
||||||
|
|||||||
@ -8,7 +8,6 @@ import (
|
|||||||
|
|
||||||
// AuthConfig api鉴权参数
|
// AuthConfig api鉴权参数
|
||||||
type AuthConfig struct {
|
type AuthConfig struct {
|
||||||
AppKey string // 应用key
|
|
||||||
SignKey string // 签名秘钥
|
SignKey string // 签名秘钥
|
||||||
NotifyKey string // 回调秘钥
|
NotifyKey string // 回调秘钥
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,16 @@
|
|||||||
package meituan_union
|
package meituan_union
|
||||||
|
|
||||||
|
// 相关地址
|
||||||
const (
|
const (
|
||||||
Domain = "https://openapi.meituan.com"
|
SiteDomain = "https://union.meituan.com" // Domain 后台域名
|
||||||
|
SiteUrl = "https://union.meituan.com/v2/overview" // SiteUrl 后台地址
|
||||||
|
DocUrl = "https://union.meituan.com/single/helpCenter?id=44" // DocUrl 文档地址
|
||||||
|
ApiDocUrl = "https://union.meituan.com/single/helpCenter?id=44" // ApiDocUrl api文档地址
|
||||||
|
)
|
||||||
|
|
||||||
|
// 接口地址
|
||||||
|
const (
|
||||||
|
Domain = "https://openapi.meituan.com" // Domain api域名
|
||||||
GetLinkUrl = Domain + "/api/generateLink"
|
GetLinkUrl = Domain + "/api/generateLink"
|
||||||
GetMiniCode = Domain + "/api/miniCode"
|
GetMiniCode = Domain + "/api/miniCode"
|
||||||
GetOrderSinge = Domain + "/api/order"
|
GetOrderSinge = Domain + "/api/order"
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package meituan_union
|
|||||||
|
|
||||||
// GenerateLinkRequest 生成推广链接请求 (内部)
|
// GenerateLinkRequest 生成推广链接请求 (内部)
|
||||||
type GenerateLinkRequest struct {
|
type GenerateLinkRequest struct {
|
||||||
|
AppKey string `json:"appKey"` // 必传,应用appKey
|
||||||
ActId int64 `json:"actId"` // 活动id
|
ActId int64 `json:"actId"` // 活动id
|
||||||
LinkType int64 `json:"linkType"` // 链接类型
|
LinkType int64 `json:"linkType"` // 链接类型
|
||||||
ShortLink int64 `json:"shortLink"` // 是否生成短链接
|
ShortLink int64 `json:"shortLink"` // 是否生成短链接
|
||||||
@ -10,6 +11,7 @@ type GenerateLinkRequest struct {
|
|||||||
|
|
||||||
// MiniCodeRequest 获取小程序码请求
|
// MiniCodeRequest 获取小程序码请求
|
||||||
type MiniCodeRequest struct {
|
type MiniCodeRequest struct {
|
||||||
|
AppKey string `json:"appKey"` // 必传,应用appKey
|
||||||
ActId int64 `json:"actId"`
|
ActId int64 `json:"actId"`
|
||||||
Sid string `json:"sid"`
|
Sid string `json:"sid"`
|
||||||
LinkType int64 `json:"linkType"`
|
LinkType int64 `json:"linkType"`
|
||||||
@ -17,6 +19,8 @@ type MiniCodeRequest struct {
|
|||||||
|
|
||||||
// GetOrderBySingeRequest 获取单个订单请求
|
// GetOrderBySingeRequest 获取单个订单请求
|
||||||
type GetOrderBySingeRequest struct {
|
type GetOrderBySingeRequest struct {
|
||||||
|
AppKey string `json:"appKey"` // 必传,应用appKey
|
||||||
|
BusinessLine int64 `json:"businessLine"` // 业务线
|
||||||
ActId int64 `json:"actId"`
|
ActId int64 `json:"actId"`
|
||||||
Full int64 `json:"full"`
|
Full int64 `json:"full"`
|
||||||
OrderId string `json:"orderId"`
|
OrderId string `json:"orderId"`
|
||||||
@ -24,9 +28,11 @@ type GetOrderBySingeRequest struct {
|
|||||||
|
|
||||||
// GetOrderByBatchRequest 批量获取订单请求
|
// GetOrderByBatchRequest 批量获取订单请求
|
||||||
type GetOrderByBatchRequest struct {
|
type GetOrderByBatchRequest struct {
|
||||||
|
AppKey string `json:"appKey"` // 必传,应用appKey
|
||||||
ActId int32 `json:"actId"` // 活动id
|
ActId int32 `json:"actId"` // 活动id
|
||||||
|
BusinessLine int64 `json:"businessLine"` // 业务线
|
||||||
StartTime int32 `json:"startTime"` // 开始时间戳
|
StartTime int32 `json:"startTime"` // 开始时间戳
|
||||||
EndTime int32 `json:"endTime"` // 结束时间戳
|
EndTime int32 `json:"endTime"` // 结束时间戳
|
||||||
Page int32 `json:"page"` // 页码
|
Page int32 `json:"page"` // 页码
|
||||||
Limit int32 `json:"limit"` // 每页数量
|
Limit int32 `json:"limit"` // 每页数量,最大值 100
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user