添加eleme平台的api对接
This commit is contained in:
parent
001d22bbb7
commit
1f87727813
@ -5,14 +5,15 @@ import (
|
||||
|
||||
"gitee.com/chengdu-lenntc/third-platform-sdk/sdk/topsdk/defaultability/request"
|
||||
"gitee.com/chengdu-lenntc/third-platform-sdk/sdk/topsdk/defaultability/response"
|
||||
"gitee.com/chengdu-lenntc/third-platform-sdk/sdk/topsdk/util"
|
||||
sdkutil "gitee.com/chengdu-lenntc/third-platform-sdk/sdk/topsdk/util"
|
||||
"gitee.com/chengdu-lenntc/third-platform-sdk/util"
|
||||
)
|
||||
|
||||
// ElemeUnionApi 调用第三方平台的api
|
||||
// Api defines the interface of eleme_union api
|
||||
type ElemeUnionApi interface {
|
||||
// Sign 签名
|
||||
Sign(publicParam map[string]interface{}, data map[string]interface{}) string
|
||||
Sign(publicParam PublicParam, data map[string]interface{}) string
|
||||
// GetLink 获取推广链接
|
||||
GetLink(req *request.AlibabaAlscUnionKbItemPromotionShareCreateRequest) (*response.AlibabaAlscUnionKbItemPromotionShareCreateResponse, error)
|
||||
// GetOrders 获取推广订单
|
||||
@ -34,8 +35,8 @@ func newElemeUnionApiImpl(log logx.Logger, client *Client) ElemeUnionApi {
|
||||
// Sign 签名
|
||||
// @param publicParam 公共参数
|
||||
// @param data 业务参数
|
||||
func (a *elemeUnionApiImpl) Sign(publicParam map[string]interface{}, data map[string]interface{}) string {
|
||||
return util.GetSign(publicParam, data, a.client.authConfig.AppSecret)
|
||||
func (a *elemeUnionApiImpl) Sign(publicParam PublicParam, data map[string]interface{}) string {
|
||||
return sdkutil.GetSign(util.StructToMap(publicParam), data, a.client.authConfig.AppSecret)
|
||||
}
|
||||
|
||||
// GetLink 获取推广链接
|
||||
|
||||
@ -1 +1,12 @@
|
||||
package eleme_union
|
||||
|
||||
type PublicParam struct {
|
||||
Method string // 必传 API接口名称,具体参见各平台API接口文档,例:taobao.item.seller.get
|
||||
AppKey string // 必传 TOP分配给应用的AppKey。例:12345678
|
||||
Session string // 可选 用户授权成功后,平台颁发给应用的授权session,详细介绍请点击这里。当此API文档的标签上注明:“需要授权”,则此参数必传;“不需要授权”,则此参数不需要传。
|
||||
Timestamp string // 必传 时间戳,格式为yyyy-MM-dd HH:mm:ss,时区为GMT+8,例如:2016-01-01 12:00:00。淘宝API服务端允许客户端请求最大时间误差为10分钟。
|
||||
V string // 必传 API协议版本,可选值:2.0
|
||||
SignMethod string // 必传 签名的摘要算法,可选值为:hmac,md5,hmac-sha256。
|
||||
Format string // 否 返回内容响应格式。不传默认为xml格式,可选值:xml,json。
|
||||
Simplify bool // 否 是否采用精简JSON返回格式,仅当format=json时有效,可选值:false,true,不传为false。
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user