tb
This commit is contained in:
@@ -123,3 +123,30 @@ func (a *API) GatewayUnionpub() (gatewayUnionpubResult []*GatewayUnionpubResult,
|
||||
}
|
||||
return gatewayUnionpubResult, err
|
||||
}
|
||||
|
||||
//长链转短链
|
||||
func (a *API) SpreadGet(url string) (result string, err error) {
|
||||
data, err := a.AccessAPI("taobao.tbk.spread.get", false, map[string]interface{}{
|
||||
"requests": "[{\"url\":\"" + url + "\"}]",
|
||||
})
|
||||
if err == nil {
|
||||
return data["results"].([]interface{})[0].(map[string]interface{})["content"].(string), err
|
||||
}
|
||||
return result, err
|
||||
}
|
||||
|
||||
type TpwdCreateResult struct {
|
||||
Model string `json:"model"`
|
||||
PasswordSimple string `json:"password_simple"`
|
||||
}
|
||||
|
||||
//淘口令生成
|
||||
func (a *API) TpwdCreate(url string) (tpwdCreateResult *TpwdCreateResult, err error) {
|
||||
result, err := a.AccessAPI("taobao.tbk.tpwd.create", false, map[string]interface{}{
|
||||
"url": url,
|
||||
})
|
||||
if err == nil {
|
||||
utils.Map2StructByJson(result["data"], &tpwdCreateResult, false)
|
||||
}
|
||||
return tpwdCreateResult, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user