This commit is contained in:
邹宗楠
2023-06-15 15:21:36 +08:00
parent d84fd34341
commit 9327c466a6
9 changed files with 92 additions and 55 deletions

View File

@@ -19,8 +19,8 @@ const (
ServerUrl4 = "http://qimen.api.taobao.com/top/router/qmtest" // 沙箱环境http
)
func NewTaoVegetable(appKey, appSecret, serverUrl string) API {
return API{client: topsdk.NewDefaultTopClient(appKey, appSecret, serverUrl, 2000, 2000)}
func NewTaoVegetable(appKey, appSecret, serverUrl string) *API {
return &API{client: topsdk.NewDefaultTopClient(appKey, appSecret, serverUrl, 2000, 2000)}
}
type API struct {
@@ -29,7 +29,19 @@ type API struct {
refreshToken string
}
func (a API) GetStoreToken(code, uuId string) (*StoreTokenInfo, error) {
func (a *API) GetVendorOrgCode() string {
return a.client.AppKey
}
func (a *API) SetToken(token string) {
a.token = token
}
func (a *API) SetRefreshToken(refreshToken string) {
a.refreshToken = refreshToken
}
func (a *API) GetStoreToken(code, uuId string) (*StoreTokenInfo, error) {
param := &request.TaobaoTopAuthTokenCreateRequest{
Code: &code,
}