1
This commit is contained in:
@@ -50,9 +50,9 @@ type TokenCreateParam struct {
|
||||
// 授权类型 ;【工具型应用:authorization_code 自用型应用:authorization_self】
|
||||
GrantType string `json:"grant_type"`
|
||||
// 判断测试店铺标识 ,非必传,若新增测试店铺传1,若不是则不必传
|
||||
TestShop string `json:"test_shop"`
|
||||
// 店铺ID
|
||||
ShopId string `json:"shop_id"`
|
||||
//TestShop string `json:"test_shop"`
|
||||
//// 店铺ID
|
||||
//ShopId string `json:"shop_id"`
|
||||
// 授权id,用于替换shopId
|
||||
AuthId string `json:"auth_id"`
|
||||
// 授权主体类型
|
||||
|
||||
@@ -17,7 +17,7 @@ func TestAfsOrder(t *testing.T) {
|
||||
|
||||
// 同意/拒绝售后单
|
||||
func TestAggreOrNotAggreAfs(t *testing.T) {
|
||||
a.AfterSaleOperate(int32(121), "7159500278360752416", "退货转退款", 0)
|
||||
a.AfterSaleOperate(int32(201), "4994452108005135590", "1", 0)
|
||||
fmt.Println("11", 8|16|32|1)
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ func TestSendGoods(t *testing.T) {
|
||||
|
||||
// 创建物流token
|
||||
func TestCreateExpss(t *testing.T) {
|
||||
a := NewExpress("7152420904331429407", "cc7ba367-2394-4cbb-81c6-26f0e929d1c6", "")
|
||||
a := NewExpress("7153997323561879075", "3517d3ea-b96b-4379-a7a4-2d9389e8ffeb", "")
|
||||
a.CreateToken()
|
||||
}
|
||||
|
||||
|
||||
@@ -47,8 +47,9 @@ func NewExpress(appKey, appSecret, accessToken string) *APIExpress {
|
||||
return api
|
||||
}
|
||||
return &APIExpress{
|
||||
appKey: appKey,
|
||||
appSecret: appSecret,
|
||||
appKey: appKey,
|
||||
appSecret: appSecret,
|
||||
accessTokenObj: new(doudian_sdk.AccessToken),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,16 +69,19 @@ func (a *APIExpress) CreateToken() (*token_create_response.TokenCreateData, erro
|
||||
return nil, errors.New(response.SubMsg)
|
||||
}
|
||||
|
||||
a.accessToken = response.Data.AccessToken
|
||||
a.expiresIn = time.Now().Unix() + response.Data.ExpiresIn
|
||||
a.refreshToken = response.Data.RefreshToken
|
||||
|
||||
a.accessTokenObj.CreateTokenData = doudian_sdk.CreateTokenData{
|
||||
AccessToken: response.Data.AccessToken,
|
||||
ExpiresIn: time.Now().Unix() + response.Data.ExpiresIn,
|
||||
ExpiresIn: response.Data.ExpiresIn,
|
||||
Scope: response.Data.Scope,
|
||||
ShopId: response.Data.ShopId,
|
||||
ShopName: response.Data.ShopName,
|
||||
RefreshToken: response.Data.RefreshToken,
|
||||
AuthorityId: response.Data.AuthorityId,
|
||||
}
|
||||
|
||||
return response.Data, nil
|
||||
}
|
||||
|
||||
@@ -141,6 +145,7 @@ func (a *APIExpress) OrderStatusAndPsInfo(param map[string]interface{}) error {
|
||||
psInfo.TraceMsgs = traceMsgs
|
||||
request.Param = psInfo
|
||||
|
||||
globals.SugarLogger.Debugf("OrderStatusAndPsInfo=========:%s", utils.Format4Output(request.Param, false))
|
||||
if a.accessTokenObj == nil || a.accessTokenObj.CreateTokenData.AccessToken == "" {
|
||||
a.CreateToken()
|
||||
} else if a.accessTokenObj.CreateTokenData.ExpiresIn < time.Now().Unix() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package tiktok_api
|
||||
|
||||
const RequestSuccessCode = 10000
|
||||
const TiktokExpressCode = "chengduruoxi"
|
||||
const TiktokExpressCode = "chengdouruoxi"
|
||||
|
||||
const (
|
||||
CallbackSuccessCode = 0
|
||||
|
||||
@@ -111,8 +111,6 @@ func (a *API) CreateStoreCommodity(skuParam *product_addV2_request.ProductAddV2P
|
||||
request.Param = skuParam
|
||||
|
||||
result, err := request.Execute(a.accessTokenObj)
|
||||
globals.SugarLogger.Debugf("创建子商品,创建主商品=========%s", utils.Format4Output(result, false))
|
||||
globals.SugarLogger.Debugf("创建子商品,创建主商品=========%s", err)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -44,9 +44,6 @@ func TestGetCatePropertyV2(t *testing.T) {
|
||||
|
||||
// 新增总部商品
|
||||
func TestCreateStoreCommodity(t *testing.T) {
|
||||
accesstoken := `{"access_token":"60f530b2-9ab6-4723-b487-c094918f0d21","expires_in":1666257163,"scope":"SCOPE","shop_id":"","shop_name":"小时达开放平台对接专用店","refresh_token":"1220666a-5e88-458c-a8c0-06d949fbbd3f","authority_id":""}`
|
||||
|
||||
a := New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", accesstoken)
|
||||
param := &product_addV2_request.ProductAddV2Param{
|
||||
//ProductType: 0,
|
||||
CategoryLeafId: 29146,
|
||||
|
||||
Reference in New Issue
Block a user