diff --git a/platformapi/tiktok_shop/tiktok_api/store.go b/platformapi/tiktok_shop/tiktok_api/store.go index 1ab5d634..4963efb7 100644 --- a/platformapi/tiktok_shop/tiktok_api/store.go +++ b/platformapi/tiktok_shop/tiktok_api/store.go @@ -120,6 +120,19 @@ func (a *API) StoreSuspend(param *shop_storeSuspend_request.ShopStoreSuspendPara return response.Data, nil } +func (a *API) StoreSuspend2(storeID int64) (*shop_storeSuspend_response.ShopStoreSuspendData, error) { + request := shop_storeSuspend_request.New() + request.Param.StoreId = storeID + response, err := request.Execute(a.accessTokenObj) + if err != nil { + return nil, err + } + if response.Code != RequestSuccessCode { + return nil, errors.New(response.SubMsg) + } + return response.Data, nil +} + //门店恢复营业 func (a *API) UnsuspendStore(param *shop_unsuspendStore_request.ShopUnsuspendStoreParam) (*shop_unsuspendStore_response.ShopUnsuspendStoreData, error) { request := shop_unsuspendStore_request.New() diff --git a/platformapi/tiktok_shop/tiktok_api/store_test.go b/platformapi/tiktok_shop/tiktok_api/store_test.go index f73ae605..fe64966f 100644 --- a/platformapi/tiktok_shop/tiktok_api/store_test.go +++ b/platformapi/tiktok_shop/tiktok_api/store_test.go @@ -23,6 +23,7 @@ import ( warehouse_createFence_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/warehouse_createFence/request" warehouse_setFence_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/warehouse_setFence/request" "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/baseapi/utils/errlist" "git.rosy.net.cn/jx-callback/globals" "math/rand" "strconv" @@ -228,15 +229,29 @@ func TestJNTM(t *testing.T) { } func TestStoreSuspend(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":""}` + accesstoken := `{"access_token":"e1c4333c-6e5e-4db8-83d3-173923e0815f","expires_in":1677450559,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"89d62aee-5bb3-433c-9514-e435172a3263","authority_id":""}` a := New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", accesstoken) param := &shop_storeSuspend_request.ShopStoreSuspendParam{ - StoreId: 65312663, + StoreId: 84670563, } resp, err := a.StoreSuspend(param) fmt.Println(resp) fmt.Println(err) } +func TestStoreSuspend2(t *testing.T) { + accesstoken := `{"access_token":"e1c4333c-6e5e-4db8-83d3-173923e0815f","expires_in":1677450559,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"89d62aee-5bb3-433c-9514-e435172a3263","authority_id":""}` + a := New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", accesstoken) + ids := []int64{84670563, 83334636, 82657789, 81479935, 81479628, 81386642, 79360024, 85670943, 78377701, 85671173, 85672027, 85671727, 85671454, 85672244, 85672146, 85671854, 70870393, 69395217, 75324142, 64270013, 64363086, 64270120, 64251601, 64270241, 64270181, 64270014, 64270291, 64270237, 64269931, 64270151, 64269951, 63177145, 66502882, 64270326, 64270164, 64270232, 64270048, 64270141, 64270138, 64270184, 64251209, 64270222, 64270367, 64270185, 64269944, 64270211, 64270380, 64270250, 64270266, 64270329, 64270004, 64270147, 64252803, 64270020, 64270114, 63182200, 64270030, 64270045, 64269980, 64270161, 64270082, 64270106, 64269961, 64270348, 64270322, 64270056, 64270217, 64269940, 64270162, 64269972, 63508263, 64270037, 64270197, 64270158, 64269953, 64270207, 64270154, 64269964, 64270016, 64270255, 64270068, 64270227, 64270231, 64270101, 64270319, 64270281, 64269927, 64270075, 64270065, 64270293, 64270299, 64270096, 64270159, 64270274, 64270189, 64270379, 64270084, 63178597, 64270343, 64270064, 71199369, 64269968, 64270340, 64270244, 64270002, 64270229, 64270341, 63485316, 64270155, 64270067, 64270225, 64270376, 64270171, 64270021, 64270374, 64269993, 64270220, 64270196, 64251627, 64270191, 64270097, 64251613, 64270195, 64270349, 64270243, 64270077, 64270307, 64269996, 64270167, 64270290, 64270271, 64270265, 64270066, 64270058, 64270262, 64251604, 64252800, 64270226, 64270256, 64269997, 64270297, 64270103, 64251603, 64251631, 64251608, 64270035, 64270204, 64270107, 64269967, 64270166, 64270306, 64270124, 64269991, 64270044, 64270011, 64270062, 64269956, 64270157, 64270270, 64270134, 64270139, 64270214, 64270025, 64270175, 64269969, 64269975, 64251618, 64270313, 64270100, 64270264, 64269981, 64270258, 64270235, 64270129, 64270130, 64270287, 64269941, 64270230, 64270150, 64252797, 64252791, 64252804, 64270092, 64270245, 64270373, 64251626, 64251632, 64251611, 64251625, 64252801, 64269932, 64270357, 64270201, 64270212, 64270117, 64270378, 64270123, 64270208, 64251600, 64270143, 64270273, 64251609, 64270026, 64270311, 64270173, 64269930, 64270090, 64270186, 64269959, 64270251, 64251622, 64269994, 64270350, 64270018, 64270028, 64270007, 64270105, 64270170, 64270257, 64270302, 64270115, 64270321, 64270382, 64269948, 64270003, 64270215, 64251624, 64270001, 64270087, 64251616, 64269954, 64251599, 64251628, 64269962, 64270200, 64251614, 64270187, 64270339, 64270132, 64270041, 64270355, 64199719, 64270277, 64270055, 64270034, 64270098, 63468251, 64270177, 64269939, 64270358, 64270038, 64200094, 64270073, 64270133, 64270118, 64270363, 64270289, 64269934, 64270254, 64270069, 64270128, 64270116, 64270342, 64270352, 64270259, 64270375, 64270219, 64269947, 64270126, 64270052, 64270366, 64270261, 64270327, 64270053, 64270146, 64270110, 64270247, 64270057, 64270253, 64199878, 64270036, 64251606, 64270046, 64269922, 64270308, 64270221, 64270080, 64270095, 64270078, 64270071, 64251615, 64251607, 64269950, 64252794, 64251623, 64270298, 64270278, 64270142, 64270275, 64270331, 64269966, 64251634, 64270039, 64269985, 63507300, 63503468, 64270121, 64270193, 64270239, 64270347, 64269990, 64270051, 64270015, 64270345, 64270188, 64251610, 64270104, 64270320, 64270303, 64270163, 64270029, 64270233, 64270017, 64270360, 64270300, 64270125, 64269971, 64270074, 64269973, 64270240, 64251629, 64270272, 64251619, 64270137, 64270346, 64270267, 63172646, 64269929, 64270351, 64270183, 64270314, 64270285, 64270178, 64270364, 64270286, 64270361, 64140100, 64269974, 64270172, 64270368, 64175830, 64270109, 64270362, 64270276, 64270022, 64270369, 64270089, 64251602, 64270202, 64270205, 64270182, 64269987, 63509364, 64270176, 64269960, 64176100, 64270043, 64138148, 64269965, 64270168, 64269988, 64270324, 64252787, 64270263, 64252789, 64270268, 64270315, 64270180, 64200572, 64252785, 64252795, 63177531, 64270318, 64270377, 64269999, 64270010, 64270169, 64270008, 64270042, 64269938, 64270288, 64270059, 64269986, 64270174, 63467326, 64269977, 64269957, 63177967, 64270252, 64270111, 64270325, 64270005, 64252788, 64270031, 64270145, 64270194, 64270335, 64270081, 64269945, 64270316, 64270060, 64270294, 64270088, 64270224, 64270112, 63182898, 64270094, 64270238, 64270296, 64269970, 64269928, 64269955, 64270102, 64270122, 64270047, 64270072, 64270283, 64270337, 64270024, 64270210, 64270284, 64270317, 64252782, 64269958, 64270086, 64270127, 64252799, 64270301, 64270050, 64269984, 64270199, 64270365, 64270236, 64270027, 64269963, 64251612, 64270260, 64251617, 64270223, 63467912, 64252783, 64270006, 64270338, 64270203, 64251605, 64251633, 64270108, 64251630, 64270179, 64251620, 64270009, 64270206, 64269942, 64251621, 64270309, 63509510, 64270249, 64270083, 64270190, 63508531, 64269936, 64270246, 64270310, 64270354, 64269983, 64269995, 64175570, 64252796, 64269978, 64270330, 64270063, 64270631, 64270359, 64270213, 64270085, 64137635, 64270099, 64270269, 64270372, 64270079, 64270000, 64270234, 63509810, 64270040, 64269982, 64269952, 64270209, 64269943, 63325222, 64269933, 64138874, 64270148, 64270356, 64252793, 64270093, 64270336, 64270153, 64270049, 64270119, 64269925, 64270140, 64270353, 64270280, 64270295, 64270192, 64270381, 64270323, 64270312, 64174147, 63507093, 64270152, 64270160, 64269923, 64269989, 64270131, 64270328, 64270333, 64270144, 64270113, 64269926, 64269998, 64198428, 64270032, 64270165, 64270023, 64270156, 64269949, 64270370, 64269924, 64270228, 64270305, 64270248, 64269979, 64269992, 64270019, 64270282, 64270292, 64270070, 64270054, 64270033, 64270149, 64270135, 64270061, 63457010, 64252802, 64252784, 64252790, 64252792, 64252798, 64252786, 64270242, 64270012, 64270076, 64270304, 64270216, 64270136, 64270334, 64269935, 64270344, 64269946, 64269937, 64269976, 64270198, 64134486, 64270091} + errList := errlist.New() + for _, v := range ids { + resp, err := a.StoreSuspend2(v) + if err != nil { + errList.AddErr(fmt.Errorf(",%d", v)) + } + fmt.Println(resp) + } + fmt.Println(errList.GetErrListAsOne()) +} func TestUnsuspendStore(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":""}` diff --git a/platformapi/uuptapi/uupt_test.go b/platformapi/uuptapi/uupt_test.go index b149e870..2fd8331d 100644 --- a/platformapi/uuptapi/uupt_test.go +++ b/platformapi/uuptapi/uupt_test.go @@ -83,8 +83,13 @@ func TestAddOrder(t *testing.T) { //获取订单详情 func TestGetOrderDetail(t *testing.T) { - detail, err := api.GetOrderDetail("23022111551032700006604805") + detail, err := api.GetOrderDetail("23022310041019000003804258") fmt.Println(utils.Format4Output(detail, false)) + orderPrice := utils.Str2Float64(detail.OrderPrice) + priceOff := utils.Str2Float64(detail.PriceOff) + price := orderPrice - priceOff + temp := int64(price * 100) + fmt.Println(temp) fmt.Println(err) }