1 Star 0 Fork 0

danlansky/go-library

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Ability376.go 1.08 KB
一键复制 编辑 原始数据 按行查看 历史
zhangminghua 提交于 2024-08-20 14:32 . feat:基础工具包
package ability376
import (
"errors"
"gitee.com/danlansky/go-library/union/topsdk"
"gitee.com/danlansky/go-library/union/topsdk/ability376/request"
"gitee.com/danlansky/go-library/union/topsdk/ability376/response"
"gitee.com/danlansky/go-library/union/topsdk/util"
"log"
)
type Ability376 struct {
Client *topsdk.TopClient
}
func NewAbility376(client *topsdk.TopClient) *Ability376 {
return &Ability376{client}
}
/*
淘宝客-公用-长链转短链
*/
func (ability *Ability376) TaobaoTbkSpreadGet(req *request.TaobaoTbkSpreadGetRequest) (*response.TaobaoTbkSpreadGetResponse, error) {
if ability.Client == nil {
return nil, errors.New("Ability376 topClient is nil")
}
var jsonStr, err = ability.Client.Execute("taobao.tbk.spread.get", req.ToMap(), req.ToFileMap())
var respStruct = response.TaobaoTbkSpreadGetResponse{}
if err != nil {
log.Println("taobaoTbkSpreadGet error", err)
return &respStruct, err
}
err = util.HandleJsonResponse(jsonStr, &respStruct)
if respStruct.Body == "" || len(respStruct.Body) == 0 {
respStruct.Body = jsonStr
}
return &respStruct, err
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/danlansky/go-library.git
git@gitee.com:danlansky/go-library.git
danlansky
go-library
go-library
v1.0.0

搜索帮助

0d507c66 1850385 C8b1a773 1850385