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.
51 lines
2.0 KiB
51 lines
2.0 KiB
3 years ago
|
package jd
|
||
|
|
||
2 years ago
|
import (
|
||
|
"encoding/json"
|
||
2 years ago
|
"go.dtapp.net/library/gorequest"
|
||
2 years ago
|
)
|
||
3 years ago
|
|
||
|
type UnionOpenPromotionCommonGetResultResponse struct {
|
||
3 years ago
|
JdUnionOpenPromotionCommonGetResponce struct {
|
||
|
Code string `json:"code"`
|
||
|
GetResult string `json:"getResult"`
|
||
|
} `json:"jd_union_open_promotion_common_get_responce"`
|
||
|
}
|
||
|
|
||
|
type UnionOpenPromotionCommonGetGetResult struct {
|
||
|
Code int `json:"code"`
|
||
|
Data struct {
|
||
|
ClickURL string `json:"clickURL"`
|
||
|
JCommand string `json:"jCommand"`
|
||
|
} `json:"data"`
|
||
|
Message string `json:"message"`
|
||
|
RequestId string `json:"requestId"`
|
||
|
}
|
||
|
|
||
3 years ago
|
type UnionOpenPromotionCommonGetResult struct {
|
||
|
Responce UnionOpenPromotionCommonGetResultResponse // 结果
|
||
|
Result UnionOpenPromotionCommonGetGetResult // 结果
|
||
3 years ago
|
Body []byte // 内容
|
||
2 years ago
|
Http gorequest.Response // 请求
|
||
3 years ago
|
Err error // 错误
|
||
|
}
|
||
|
|
||
2 years ago
|
func NewUnionOpenPromotionCommonGetResult(responce UnionOpenPromotionCommonGetResultResponse, result UnionOpenPromotionCommonGetGetResult, body []byte, http gorequest.Response, err error) *UnionOpenPromotionCommonGetResult {
|
||
|
return &UnionOpenPromotionCommonGetResult{Responce: responce, Result: result, Body: body, Http: http, Err: err}
|
||
3 years ago
|
}
|
||
|
|
||
2 years ago
|
// UnionOpenPromotionCommonGet 网站/APP获取推广链接接口
|
||
3 years ago
|
// https://union.jd.com/openplatform/api/v2?apiName=jd.union.open.promotion.common.get
|
||
3 years ago
|
func (app *App) UnionOpenPromotionCommonGet(notMustParams ...Params) *UnionOpenPromotionCommonGetResult {
|
||
3 years ago
|
// 参数
|
||
|
params := NewParamsWithType("jd.union.open.promotion.common.get", notMustParams...)
|
||
|
// 请求
|
||
2 years ago
|
request, err := app.request(params)
|
||
3 years ago
|
// 定义
|
||
|
var responce UnionOpenPromotionCommonGetResultResponse
|
||
|
var result UnionOpenPromotionCommonGetGetResult
|
||
2 years ago
|
err = json.Unmarshal(request.ResponseBody, &responce)
|
||
3 years ago
|
err = json.Unmarshal([]byte(responce.JdUnionOpenPromotionCommonGetResponce.GetResult), &result)
|
||
2 years ago
|
return NewUnionOpenPromotionCommonGetResult(responce, result, request.ResponseBody, request, err)
|
||
3 years ago
|
}
|