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.
49 lines
1.8 KiB
49 lines
1.8 KiB
package taobao
|
|
|
|
import (
|
|
"context"
|
|
"encoding/json"
|
|
"github.com/dtapps/go-library/utils/gorequest"
|
|
)
|
|
|
|
type TbkActivityInfoGetResponse struct {
|
|
TbkActivityInfoGetResponse struct {
|
|
Data struct {
|
|
WxQrcodeUrl string `json:"wx_qrcode_url"`
|
|
ClickUrl string `json:"click_url"`
|
|
ShortClickUrl string `json:"short_click_url"`
|
|
TerminalType string `json:"terminal_type"`
|
|
MaterialOssUrl string `json:"material_oss_url"`
|
|
PageName string `json:"page_name"`
|
|
PageStartTime string `json:"page_start_time"`
|
|
PageEndTime string `json:"page_end_time"`
|
|
WxMiniprogramPath string `json:"wx_miniprogram_path"`
|
|
} `json:"data"`
|
|
} `json:"tbk_activity_info_get_response"`
|
|
}
|
|
|
|
type TbkActivityInfoGetResult struct {
|
|
Result TbkActivityInfoGetResponse // 结果
|
|
Body []byte // 内容
|
|
Http gorequest.Response // 请求
|
|
Err error // 错误
|
|
}
|
|
|
|
func newTbkActivityInfoGetResult(result TbkActivityInfoGetResponse, body []byte, http gorequest.Response, err error) *TbkActivityInfoGetResult {
|
|
return &TbkActivityInfoGetResult{Result: result, Body: body, Http: http, Err: err}
|
|
}
|
|
|
|
// TbkActivityInfoGet 淘宝客-推广者-官方活动转链
|
|
// https://open.taobao.com/api.htm?spm=a219a.7386797.0.0.5a83669a7rURsF&source=search&docId=48340&docType=2
|
|
func (c *Client) TbkActivityInfoGet(ctx context.Context, notMustParams ...Params) *TbkActivityInfoGetResult {
|
|
// 参数
|
|
params := NewParamsWithType("taobao.tbk.activity.info.get", notMustParams...)
|
|
params.Set("adzone_id", c.GetAdzoneId())
|
|
// 请求
|
|
request, err := c.request(ctx, params)
|
|
// 定义
|
|
var response TbkActivityInfoGetResponse
|
|
err = json.Unmarshal(request.ResponseBody, &response)
|
|
return newTbkActivityInfoGetResult(response, request.ResponseBody, request, err)
|
|
}
|