diff --git a/platformapi/tiktok_shop/sdk-golang/api/shop_getStoreDetail/request/shop_getStoreDetail_request.go b/platformapi/tiktok_shop/sdk-golang/api/shop_getStoreDetail/request/shop_getStoreDetail_request.go index 2bf1c5b4..77837640 100644 --- a/platformapi/tiktok_shop/sdk-golang/api/shop_getStoreDetail/request/shop_getStoreDetail_request.go +++ b/platformapi/tiktok_shop/sdk-golang/api/shop_getStoreDetail/request/shop_getStoreDetail_request.go @@ -46,7 +46,8 @@ func (c *ShopGetStoreDetailRequest) GetParams() *ShopGetStoreDetailParam { type ShopGetStoreDetailParam struct { // 门店ID - StoreId int64 `json:"store_id"` + StoreId string `json:"store_id"` + //StoreId int64 `json:"store_id"` // 是否需要poi审核信息,注:只要审核状态的审核不要传true,需要详细的提交信息时传true IsNeedPoiAuditInfo bool `json:"is_need_poi_audit_info"` // 是否需要关联的抖店信息,注:只要shopId不要传true,需要关联店铺名称等信息时传true diff --git a/platformapi/tiktok_shop/sdk-golang/api/warehouse_getWarehouseByStore/response/warehouse_getWarehouseByStore_response.go b/platformapi/tiktok_shop/sdk-golang/api/warehouse_getWarehouseByStore/response/warehouse_getWarehouseByStore_response.go index 0fad0563..8961af06 100644 --- a/platformapi/tiktok_shop/sdk-golang/api/warehouse_getWarehouseByStore/response/warehouse_getWarehouseByStore_response.go +++ b/platformapi/tiktok_shop/sdk-golang/api/warehouse_getWarehouseByStore/response/warehouse_getWarehouseByStore_response.go @@ -43,18 +43,10 @@ type WarehouseInfoMapItem struct { UpdateTime int64 `json:"update_time"` // 创建时间 CreateTime int64 `json:"create_time"` - // 店铺id - ShopId int64 `json:"shop_id"` - // 仓类型 - WarehouseType int64 `json:"warehouse_type"` // 绑定的外部围栏ID列表 OutFenceIds []string `json:"out_fence_ids"` - Latitude float64 `json:"latitude"` - Longitude float64 `json:"longitude"` - Addresses []string `json:"addresses"` - StoreNames []string `json:"store_names"` } type WarehouseGetWarehouseByStoreData struct { // 仓信息map - WarehouseInfoMap map[int64][]WarehouseInfoMapItem `json:"warehouse_info_map"` + WarehouseInfoMap map[string]WarehouseInfoMapItem `json:"warehouse_info_map"` } diff --git a/platformapi/tiktok_shop/tiktok_api/afs_test.go b/platformapi/tiktok_shop/tiktok_api/afs_test.go index d5c0e1f6..3eda358f 100644 --- a/platformapi/tiktok_shop/tiktok_api/afs_test.go +++ b/platformapi/tiktok_shop/tiktok_api/afs_test.go @@ -1,11 +1,11 @@ package tiktok_api import ( + "crypto/md5" "fmt" "git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/jx-callback/globals" "testing" - "time" ) var token = `{"access_token":"2baa1126-bba0-4510-8ffa-6af55ba0bdbd","expires_in":1670828768,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"23b3eb4e-bb00-4b85-952d-de47801de80d","authority_id":""}` @@ -30,5 +30,12 @@ func TestGetSkuDetailLocalID(t *testing.T) { // func TestName(t *testing.T) { - fmt.Println(time.Now().Day()) + body := `[{ + "tag": "101", + "msg_id": "69793528590852580050:0:101:1670233754:1024588978:7136048270014416392", + "data": "{\"biz\":2,\"order_status\":2,\"order_type\":0,\"p_id\":5008525809582539796,\"pay_amount\":2640,\"pay_time\":1670233752,\"pay_type\":1,\"s_ids\":[5008525809582539796],\"shop_id\":57939570}" +}]` + signParam := a.appKey + body + a.appSecret + sign := fmt.Sprintf("%X", md5.Sum([]byte(signParam))) + fmt.Println(sign) } diff --git a/platformapi/tiktok_shop/tiktok_api/api_test.go b/platformapi/tiktok_shop/tiktok_api/api_test.go index 8f558da9..8361167c 100644 --- a/platformapi/tiktok_shop/tiktok_api/api_test.go +++ b/platformapi/tiktok_shop/tiktok_api/api_test.go @@ -21,7 +21,7 @@ func TestApi(t *testing.T) { } func TestQueryOrderDetail(t *testing.T) { - data, err := a.GetTiktokOrderDetail("4996895368866964710") + data, err := a.GetTiktokOrderDetail("5008526050099613284") globals.SugarLogger.Debugf("=====%s", utils.Format4Output(data, false)) globals.SugarLogger.Debugf("=====%s", err) } diff --git a/platformapi/tiktok_shop/tiktok_api/store.go b/platformapi/tiktok_shop/tiktok_api/store.go index b0a3485e..46b1c91f 100644 --- a/platformapi/tiktok_shop/tiktok_api/store.go +++ b/platformapi/tiktok_shop/tiktok_api/store.go @@ -394,7 +394,7 @@ func (a *API) StoreBindWarehouse(param *warehouse_bindStore_request.WarehouseBin } //获取门店绑定的仓库信息 -func (a *API) GetWarehouseByStore(storeID int64) (map[int64][]warehouse_getWarehouseByStore_response.WarehouseInfoMapItem, error) { +func (a *API) GetWarehouseByStore(storeID int64) (*warehouse_getWarehouseByStore_response.WarehouseGetWarehouseByStoreData, error) { request := warehouse_getWarehouseByStore_request.New() request.Param.StoreIds = append(request.Param.StoreIds, storeID) response, err := request.Execute(a.accessTokenObj) @@ -407,7 +407,7 @@ func (a *API) GetWarehouseByStore(storeID int64) (map[int64][]warehouse_getWareh if len(response.Data.WarehouseInfoMap) == 0 { return nil, errors.New(fmt.Sprintf("门店%d 暂时未绑定仓库,请进行绑定!", storeID)) } - return response.Data.WarehouseInfoMap, nil + return response.Data, nil } //创建电子围栏 diff --git a/platformapi/weixinapi/sns.go b/platformapi/weixinapi/sns.go index 09c4ba45..dd69fb92 100644 --- a/platformapi/weixinapi/sns.go +++ b/platformapi/weixinapi/sns.go @@ -172,20 +172,24 @@ func (a *API) SNSGetUserPhone(jsCode string) (string, error) { // 获取小程序短连接CBRetrieveToken func (a *API) MiniProgramSortLink() (string, error) { weChatToken := "" - if token := a.CBGetToken(); token == "" { + token := a.CBGetToken() + if token == "" { newToken, err := a.CBRetrieveToken() if err != nil { return "", err } weChatToken = newToken.AccessToken + } else { + weChatToken = token } parmaJson := map[string]interface{}{ "access_token": weChatToken, } bodyJson := map[string]interface{}{ - "access_token ": weChatToken, - "expire_type ": 0, + //"access_token ": weChatToken, + "expire_type ": 1, + "expire_time": 1, } body, _ := json.Marshal(bodyJson) result, err := a.AccessAPI("wxa/generate_urllink", parmaJson, string(body)) diff --git a/platformapi/weixinapi/weixinapi.go b/platformapi/weixinapi/weixinapi.go index ea559cae..568602fe 100644 --- a/platformapi/weixinapi/weixinapi.go +++ b/platformapi/weixinapi/weixinapi.go @@ -73,7 +73,7 @@ func isSNSAction(action string) bool { } func (a *API) AccessAPI(action string, params map[string]interface{}, body string) (retVal map[string]interface{}, err error) { - if params != nil && body != "" { + if params == nil && body == "" { panic("params and body can not all be empty") } params2 := make(map[string]interface{})