From 82d2f9a6745a9bc0b4fb32b92c68cd6aab554da5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Fri, 24 Mar 2023 16:54:46 +0800 Subject: [PATCH] 1 --- platformapi/ebaiapi/order_test.go | 83 ++++++++++++++++++- platformapi/jdapi/store.go | 2 + .../tiktok_shop/tiktok_api/afs_test.go | 2 +- .../tiktok_shop/tiktok_api/sku_delete_test.go | 14 +++- 4 files changed, 98 insertions(+), 3 deletions(-) diff --git a/platformapi/ebaiapi/order_test.go b/platformapi/ebaiapi/order_test.go index 4210deb4..fae362c6 100644 --- a/platformapi/ebaiapi/order_test.go +++ b/platformapi/ebaiapi/order_test.go @@ -1,13 +1,14 @@ package ebaiapi import ( + "fmt" "testing" "git.rosy.net.cn/baseapi/utils" ) func TestOrderGet(t *testing.T) { - result, err := api.OrderGet("4013840036319612596") + result, err := api.OrderGet("4040400104793805400") if err != nil { t.Fatal(err) } else { @@ -165,3 +166,83 @@ func TestAggrent(t *testing.T) { t.Fatal(err) } } + +func TestForAA(t *testing.T) { + + var a = []int64{6044969, + 6043622, + 6044971, + 6042562, + 31728, + 31729, + 32143, + 32142, + 6043605, + 6043604, + 6042743, + 30226, + 30225, + 6043959, + 6043960, + 6042349, + 6042296, + 31882, + 31871, + 6042704, + 6039499, + 30415, + 30414, + 32364, + 32363, + 6043603, + 6043602, + 30224, + 30223, + 6042284, + 30215, + 30214, + 6039424, + 31235, + 30368, + 30370, + 30369, + 30183, + 30182, + 6042733, + 6042737, + 30237, + 30236, + 6042287, + 30213, + 6042288, + 30233, + 30207, + 30206, + 30190, + 30189, + 6042167, + 6042166, + 30413} + + var cc = "" + for _, v := range a { + if v != 30413 { + cc += utils.Int64ToStr(v) + "," + } + cc += utils.Int64ToStr(v) + } + fmt.Println(cc) +} + +func TestOnline(t *testing.T) { + fmt.Println(0&(2|4|32) != 0) + fmt.Println(MergeStoreStatus(-2, 1)) +} + +// 合并得到最终的门店状态 +func MergeStoreStatus(status int, vendorStatus int) int { + if status < vendorStatus { + return status + } + return vendorStatus +} diff --git a/platformapi/jdapi/store.go b/platformapi/jdapi/store.go index cdd46407..bf9f6c65 100644 --- a/platformapi/jdapi/store.go +++ b/platformapi/jdapi/store.go @@ -4,6 +4,7 @@ package jdapi import ( "encoding/json" "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/globals" ) const ( @@ -337,6 +338,7 @@ func (a *API) GetStoreInfoByStationNo2(storeNo string) (storeDetail *StoreDetail // } func (a *API) UpdateStoreInfo4Open2(updateParams *OpStoreParams, modifyCloseStatus bool) (err error) { + globals.SugarLogger.Debugf("====UpdateStoreInfo4Open2 : %s", utils.Format4Output(updateParams, false)) updateParams.Operator = utils.GetAPIOperator(updateParams.Operator) mapData := utils.Struct2MapByJson(updateParams) if !modifyCloseStatus { diff --git a/platformapi/tiktok_shop/tiktok_api/afs_test.go b/platformapi/tiktok_shop/tiktok_api/afs_test.go index a707d100..243cfe48 100644 --- a/platformapi/tiktok_shop/tiktok_api/afs_test.go +++ b/platformapi/tiktok_shop/tiktok_api/afs_test.go @@ -18,7 +18,7 @@ import ( // "authority_id": "" //}` -var token = `{"access_token":"c2e78f4f-fb23-4729-b9b1-8330209df50b","expires_in":1679259342,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"83548fb9-d9ea-4665-bd8c-4dbb949338de","authority_id":""}` +var token = `{"access_token":"2edc427e-9ab8-430b-a502-6802f1dee387","expires_in":1679861437,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"dda56ad5-521b-4b87-9d74-bd6df13df1aa","authority_id":""}` //var token = `{"access_token":"e3173e9f-266f-4d87-88e7-e7cd837bc9d9","expires_in":1672882632,"scope":"SCOPE","shop_id":68023619,"shop_name":"京西到家","refresh_token":"5070aae2-493f-46bd-b5d6-6ea0cd64729f","authority_id":""}` diff --git a/platformapi/tiktok_shop/tiktok_api/sku_delete_test.go b/platformapi/tiktok_shop/tiktok_api/sku_delete_test.go index f0760be6..7d5796eb 100644 --- a/platformapi/tiktok_shop/tiktok_api/sku_delete_test.go +++ b/platformapi/tiktok_shop/tiktok_api/sku_delete_test.go @@ -7,10 +7,22 @@ import ( "testing" ) +func TestN2ame(t *testing.T) { + polay := make(map[string]interface{}, 0) + polay["a"] = "" + polay["b"] = "1" + + fmt.Println(polay["a"].(string)) + fmt.Println(polay["b"].(string)) + fmt.Println(polay["c"].(string)) +} + func TestGetRecommendCategory(t *testing.T) { img, _, err := GetTiktokImgListTest(a, "668707", "", "", "http://img20.360buyimg.com/vc/jfs/t1/8979/39/8591/236012/5c0e45f3E1537c120/a66aafc95cf66977.jpg", "http://img20.360buyimg.com/vc/jfs/t1/23027/3/955/82830/5c0e45f3E0855eeae/ae65ee9555a29579.jpg") fmt.Println(err) - a.GetRecommendCategory(strings.Split(img, "|")) + data, err := a.GetRecommendCategory(strings.Split(img, "|")) + fmt.Println(data) + fmt.Println(err) } // GetTiktokImgList 获取抖音图片链接