From 2bfc9a22c0e27f512a6241e46192378af310fb1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Fri, 12 Jan 2024 10:23:38 +0800 Subject: [PATCH 1/3] 1 --- platformapi/mtwmapi/mtwmapi_test.go | 4 ++-- platformapi/mtwmapi/retail_test.go | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/platformapi/mtwmapi/mtwmapi_test.go b/platformapi/mtwmapi/mtwmapi_test.go index 6babd852..107fbc1f 100644 --- a/platformapi/mtwmapi/mtwmapi_test.go +++ b/platformapi/mtwmapi/mtwmapi_test.go @@ -20,13 +20,13 @@ func init() { baseapi.Init(sugarLogger) // 菜市 - //api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "") + api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "") // 果园 //api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "") //商超 - api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_u368I2OxTY4ys4wWuVVMOQ") //token_n4TwqCntWWuvQwAawzxC0w + //api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_u368I2OxTY4ys4wWuVVMOQ") //token_n4TwqCntWWuvQwAawzxC0w cookieStr := ` acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1; ` diff --git a/platformapi/mtwmapi/retail_test.go b/platformapi/mtwmapi/retail_test.go index 2019975b..aabef185 100644 --- a/platformapi/mtwmapi/retail_test.go +++ b/platformapi/mtwmapi/retail_test.go @@ -5,6 +5,7 @@ import ( "fmt" "git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/jx-callback/globals" + "math" "strings" "testing" "time" @@ -222,6 +223,22 @@ func TestErrList(t *testing.T) { fmt.Println(data) } +// TestUpdateSkuBoxFee 修改打包费 +func TestUpdateSkuBoxFee(t *testing.T) { + api.RetailBatchInitData(utils.GetUUID(), "2461720", []map[string]interface{}{ + map[string]interface{}{ + "app_spu_code": "22509", + "skus": []map[string]interface{}{ + { + "sku_id": "22509", + "ladder_box_num": "0", + "ladder_box_price": "0", + }, + }, + }, + }) +} + func TestRetailBatchInitData(t *testing.T) { failedFoods, err := api.RetailBatchInitData(utils.GetUUID(), "19284062", []map[string]interface{}{ map[string]interface{}{ @@ -465,3 +482,7 @@ func TestSplit(t *testing.T) { fmt.Println("len-======", len(cc)) globals.SugarLogger.Debugf("cc %s", utils.Format4Output(cc, false)) } + +func Test22222(t *testing.T) { + fmt.Println(math.Ceil(float64(100) / float64(50))) +} From 2fd23aff1fee8f30529cea06d1a5c44e1fa29b81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Fri, 12 Jan 2024 16:58:34 +0800 Subject: [PATCH 2/3] 1 --- platformapi/aliupcapi/aliupcapi_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/platformapi/aliupcapi/aliupcapi_test.go b/platformapi/aliupcapi/aliupcapi_test.go index 9aee8907..84438f3c 100644 --- a/platformapi/aliupcapi/aliupcapi_test.go +++ b/platformapi/aliupcapi/aliupcapi_test.go @@ -1,6 +1,7 @@ package aliupcapi import ( + "fmt" "testing" "git.rosy.net.cn/baseapi" @@ -28,3 +29,9 @@ func TestGetAliUpcInfo(t *testing.T) { t.Log(utils.Format4Output(result, false)) } } + +func TestName11111(t *testing.T) { + syncFlag := 0 + syncFlag |= 8 + fmt.Println(syncFlag) +} From 2182c1ce93837b60f322d5bd7aed9e70be4fb3f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Tue, 16 Jan 2024 16:24:32 +0800 Subject: [PATCH 3/3] 1 --- platformapi/jdapi/fake_jdapi_test.go | 42 +++++++++++++------ platformapi/jdapi/jdapi_test.go | 6 +-- platformapi/jxprintapi/jxprintapi_test.go | 13 +++--- .../tiktok_api/settl_bill_detail_test.go | 22 ---------- platformapi/uuptapi/uupt_test.go | 2 +- platformapi/yilianyunapi/yilianyunapi.go | 14 +++++-- platformapi/yilianyunapi/yilianyunapi_test.go | 19 ++++++--- 7 files changed, 61 insertions(+), 57 deletions(-) diff --git a/platformapi/jdapi/fake_jdapi_test.go b/platformapi/jdapi/fake_jdapi_test.go index 80531607..964f5623 100644 --- a/platformapi/jdapi/fake_jdapi_test.go +++ b/platformapi/jdapi/fake_jdapi_test.go @@ -1,6 +1,7 @@ package jdapi import ( + "fmt" "testing" "time" @@ -39,21 +40,27 @@ func TestFakeBatchUpdateCurrentQtys(t *testing.T) { } func TestFakeBatchUpdateVendibility(t *testing.T) { - api := NewFakeJD("ndslkv9asl@djf_n7askdjfk$", "http://test.jxc4.com/qqqq") + //api := NewFakeJD("ndslkv9asl@djf_n7askdjfk$", "http://test.jxc4.com/qqqq") + var aa = []int64{ + 6043401, 6043402, 31934, 6044166, 32096, 32097, 6043030, 6043666, 31935, 6042990, 31486, 6043513, 31587, 6044531, 30407, 6043871, 31905, 6042939, 31449, 6042341, 6043516, 6043983, 6042318, 31445, 31446, 31173, 31162, 6043615, 6042608, 6044642, 6044533, 6042554, 6042513, 6044855, 6045460, 31403, 6045218, 6043090, 31402, 6044680, 6043693, 30010, 31374, 30827, 30826, 30828, 6044690, 32405, 6044655, 6043645, 6042855, 6042485, 6044478, 6044886, 6045043, 31246, 31245, 31244, 31388, 31389, 31572, 31404, 31563, 6043092, 6044928, 6045158, 6044926, 6045161, 6045157, 30701, 30698, 32046, 6043356, 32025, 6042574, 6043387, 6043388, 6042562, 6043511, 6042331, 6043510, 31904, 6045527, 31226, 6042339, 6043556, 6043283, 6045366, 30447, 6044380, 6042186, 6045365, 6044288, 32075, 30356, 6044412, 6039424, 31235, 30355, 32076, 31437, 31444, 31561, 32136, 6042333, 6042590, 6042795, 6042609, 6042462, 6042280, 6042416, 6043435, 6042610, 6043558, 6044747, 6044502, 6044503, 6044659, 6043533, 6044487, 6044486, 6044746, 6044504, 6044771, 6044770, 6044656, 6045451, 6045459, 6043442, 31990, 6044726, 6043438, 31615, 6042547, 6043074, 6045069, 6045068, 6044681, 6043509, 31225, 6044411, 6045281, 31236, 31230, 31229, 30357, 6042232, 6044217, 6043565, 31104, 30672, 31106, 30673, 31105, 31208, 32071, 31178, 32070, 31233, 31277, 6044423, 31234, 31278, 30617, 6042498, 6043309, 6042495, 6042630, 6042494, 31936, 6043593, 6042204, 6042205, 6044419, 6043512, 30816, 30817, 30815, 6044936, 6044935, 31138, 6043607, 31137, 6043515, 6043608, 31139, 31133, 6045239, 6045523, 6045524, 32140, 6042049, 6039407, 6043576, 6042803, 6042804, 6043489, 6042983, 6043490, 6044577, 6045397, 6045154, 6045398, 32175, 32176, 6042833, 6043692, 32241, 6042839, 6043660, 6043646, 6043642, 6043641, 6043659, 6043661, 6043637, 6043717, 6043825, 6043834, 6043827, 6044593, 6044631, 6044608, 6044697, 6043575, 6044604, 6044605, 31242, 31824, 6044717, 31243, 6044576, 6043287, 31107, 6042499, 6042591, 6045396, 6045335, 31533, 6042717, 6043282, 30647, 32121, 32009, 31330, 31525, 31440, 6043555, 31168, 6042755, 31094, 32035, 30530, 30752, 6044623, 30930, 6042693, 30962, 6042752, 6042958, 31041, 6042622, 6042456, 6042196, 30646, 30721, 31355, 6043276, 31025, 30650, 6042459, 30314, 31331, 6043171, 6044385, 31288, 32008, 30433, 6042449, 6043554, 30529, 6042550, 31165, 31256, 6044713, 6044964, 6045153, 6044816, 6044735, 6044512, 6044821, 6044994, 6044811, 6044731, 6044822, 6044824, 6044817, 6044725, 6044815, 6044675, 6044722, 6044728, 6044818, 6044727, 6044729, 6044650, 6044724, 6044513, 6044823, 6044530, 6044676, 6044798, 6044730, 6045005, 6045025, 6045020, 6045230, 6045071, 6045228, 6044859, 6044931, 6044715, 6044825, 6045142, 6045127, 6044806, 6044805, 31270, 6042751, 31864, 31042, 31568, 6043553, 30364, 32003, 6042552, 31026, 6044472, 6042947, 6043536, 6039434, 30993, 6042503, 31472, 31767, 31451, 30456, 31470, 31592, 6042275, 30579, 32034, 6043897, 6044181, 6043672, 6045052, 6042471, 32039, 6042398, 6044687, 6044942, 6044810, 6044797, 6045128, 6045021, 6044777, 6044968, 6045013, 6044941, 6045011, 6045042, 6044820, 6044616, 6044758, 6044814, 6043455, 30014, 30045, 30263, 32005, 6044384, 6043896, 31974, 6044539, 6039421, 6039493, 6039414, 6043444, 6042011, 30690, 6043061, 6042231, 6039491, 31257, 30808, 6039403, 30751, 30691, 30868, 30929, 6044490, 6042124, 31287, 6043313, 6043133, 6042195, 6042430, 6042623, 6043594, 6043331, 30667, 31040, 30574, 30960, 31332, 6039409, 6043026, 31457, 6043547, 30577, 6043093, 31267, 6043135, 31593, 31885, 30312, 6042445, 30363, 6044312, 6042446, 30255, 6043446, 31005, 31152, 31627, 31993, 32212, 6044511, 6044924, 6045014, 6044946, 6045087, 6044966, 6045048, 6044808, 6044760, 6045027, 6044776, 6044759, 6044812, 6044940, 6045012, 6044514, 6044716, 6044813, 6045041, 6044807, 6044819, 6044689, 6044827, 6044699, 6044719, 6044670, 6044705, 6044698, 6044991, 6044672, 6044732, 6045072, 6044714, 6045143, 6044804, 6045152, 6044828, 6044310, 30748, 30872, 6042405, 30869, 6043616, 31350, 31474, 6042453, 30688, 6041955, 6042203, 31448, 6043535, 30295, 6043408, 6039480, 6043081, 30139, 31991, 31959, 6045155, 6042081, 6044387, 30313, 30315, 6042013, 6044311, 6039492, 6044453, 6043274, 31283, 30432, 6042199, 32391, 6042165, 6043052, 30784, 6043448, 30809, 6043675, 30645, 6043443, 6043436, 6042381, 31588, 30961, 31439, 6042423, 31590, 6039495, 6043610, 30327, 6039477, 6043330, 6043519, 30317, 30148, 30720, 6042959, 6042316, 6044309, 6044116, 6042434, 31867, 6043226, 31024, 6042426, 6043611, 6043193, 6043172, 31468, 6039420, 30528, 6045000, 6042433, 30301, 6042420, 30140, 30080, 6042056, 31284, 6042235, 31266, 30783, 31436, 6042202, 6043570, 30316, 6042768, 6044386, 6039413, 6039423, 31901, 6042769, 30649, 30497, 6044090, 30867, 32291, 30871, 6043518, 31000, 30496, 31298, 31265, 31020, 30495, 30382, 31021, 31019, 6044832, 6044089, 6042330, 32161, 6043945, 6042961, 30334, 30344, 32271, 30346, 6042483, 6042701, 6042697, 6042914, 6042995, 6042071, 6042696, 30338, 32269, 6042482, 6042699, 6042486, 6042593, 6042731, 6043582, 30343, 6042532, 6042966, 6042312, 6043016, 6043588, 6043503, 6043893, 6043589, 6044211, 6044469, 6044683, 6044644, 6044617, 6044860, 6044887, 6044927, 6044888, 6045049, 6045163, 6044643, 6045156, 6045319, 6045227, 6045164, 6045162, 6045462, 6042595, 6045323, 31049, 6044875, 6044660, 6044674, 6043978, 6044059, 31046, 6043290, 6044951, 6044743, 32270, 32277, 6042950, 6042996, 6042796, 6042949, 6043929, 6043946, 6043137, 6043947, 6044661, 6044669, 6044641, 6044665, 6044652, 6044039, 6044664, 6044741, 6044649, 6044667, 6044693, 6044691, 6044701, 6044666, 6044673, 6044692, 6044740, 6044651, 6043680, 6039507, 6043491, + } - retVal, err := api.FakeBatchUpdateVendibility("", "", "11943257", []*StockVendibility{ - &StockVendibility{ - OutSkuId: "2029937911", - DoSale: true, - }, - }, "test") - t.Log(utils.Format4Output(retVal, false)) - if err != nil { - t.Error(err) - } - if false { - t.Log(utils.Format4Output(retVal, false)) + for _, v := range aa { + /*retVal, err :=*/ api.FakeBatchUpdateVendibility("", "", "12535376", []*StockVendibility{ + &StockVendibility{ + OutSkuId: utils.Int64ToStr(v), + DoSale: false, + }, + }, "test") } + + //t.Log(utils.Format4Output(retVal, false)) + //if err != nil { + // t.Error(err) + //} + //if false { + // t.Log(utils.Format4Output(retVal, false)) + //} } func TestFakeUpdateVendorStationPrice(t *testing.T) { @@ -103,3 +110,12 @@ func TestFakeCreatePromotionSingle(t *testing.T) { t.Fatal(err) } } + +func TestAaa(t *testing.T) { + aa := []int64{1, 2, 3, 4, 5} + bb := make([]int64, 0, len(aa)) + for _, v := range aa { + bb = append(bb, v) + } + fmt.Println(bb) +} diff --git a/platformapi/jdapi/jdapi_test.go b/platformapi/jdapi/jdapi_test.go index e4196167..23d73ff0 100644 --- a/platformapi/jdapi/jdapi_test.go +++ b/platformapi/jdapi/jdapi_test.go @@ -29,9 +29,9 @@ func init() { // 天天果园 //api = New("c45e6510-00ba-4be2-977e-bcb9c9792cc7", "5d5577a2506f41b8b4ec520ba83490f5", "0b01b9eeb15b41dab1c3d05d95c17a26") // 京东果园 320406 - api = New("c454ef86-2213-4860-9a31-f2ef7e883386", "1dba76d40cac446ca500c0391a0b6c9d", "a88d031a1e7b462cb1579f12e97fe7f4") - // 果切 - //api = New("3ef42248-1247-4efa-8624-43cd3a3b97ae", "5d5577a2506f41b8b4ec520ba83490f5", "0b01b9eeb15b41dab1c3d05d95c17a26") + //api = New("c454ef86-2213-4860-9a31-f2ef7e883386", "1dba76d40cac446ca500c0391a0b6c9d", "a88d031a1e7b462cb1579f12e97fe7f4") + // 果切 379599 + api = New("ad4061a1-6a5c-43f9-bf51-b1232fd9499d", "f2ed33075faf4773a47e065acd79532b", "aed14cbbecac4456843570e90c5f46ec") // 京东超市 359459 //api = New("21ff22c5-0716-4c05-9468-8e4dde2b1cd6", "21b627c23ea04c69b64b48d0b361213e", "51cd27a748e64c829b4b7f83f4844610") diff --git a/platformapi/jxprintapi/jxprintapi_test.go b/platformapi/jxprintapi/jxprintapi_test.go index 85600bf4..7c0a7447 100644 --- a/platformapi/jxprintapi/jxprintapi_test.go +++ b/platformapi/jxprintapi/jxprintapi_test.go @@ -89,7 +89,7 @@ func TestDoPrint(t *testing.T) { "appId": "1000", "businessType": "1", "buyerComment": "(缺货时电话与我联系)", - "consigneeAddress": "胜浦街道苏州市吴中区新胜路1号", + "consigneeAddress": "脉冲品质汽美车衣•改色•贴膜(沪太店)@#上海市上海市静安区彭浦镇绿苑小区", "consigneeMobile": "18468578703,380", "consigneeName": "刘*****", "eBaiOrderNo": "好菜鲜生", @@ -114,22 +114,19 @@ func TestDoPrint(t *testing.T) { t.Log(result) } -func Test222(t *testing.T) { - //url := `http://api.jxc4.com/openapi/CallOpenAPI` - -} - func TestName23(t *testing.T) { url := "https://www.jxc4.com/v2/store/sku/UpdateStoresSkus" - var storeList = []int64{103191, 100501, 100517, 100524, 669154, 100525, 667119, 669155, 100529, 100543, 100546, 669307, 668188, 668552, 100549, 667131, 667134, 100654, 667135, 667145, 667150, 667154, 667156, 668600, 102968, 668833, 100741, 667166, 669163, 667171, 100754, 667173, 668992, 102974, 667175, 100767, 102976, 668726, 100782, 667184, 667194, 669170, 667200, 100837, 667201, 667202, 100853, 668574, 667210, 669240, 667211, 668401, 667212, 668138, 667215, 667216, 100922, 667219, 100935, 667220, 667221, 668907, 667230, 668916, 668564, 100982, 102919, 103030, 668815, 667236, 667239, 101031, 669010, 102982, 667252, 669206, 667255, 667261, 101088, 667262, 668778, 101097, 667264, 667553, 101107, 667270, 667271, 667272, 668670, 669195, 667279, 668554, 668422, 101687, 669029, 103093, 667290, 667291, 668569, 101732, 103113, 103116, 667300, 101754, 667301, 667995, 101755, 103135, 101780, 101842, 667306, 668055, 101896, 103160, 669104, 103161, 101902, 103164, 103132, 102108, 103165, 101942, 103168, 668793, 103170, 668602, 668935, 101960, 103177, 667324, 668812, 668787, 668813, 668824, 103181, 668825, 102012, 668831, 667333, 668662, 667336, 668716, 668837, 103190, 668750, 102047, 667340, 668755, 668756, 667355, 667356, 102089, 103361, 102150, 103414, 667386, 103416, 667388, 668643, 667389, 102181, 667395, 103454, 667400, 102241, 666672, 102255, 669208, 102262, 102267, 666718, 102275, 666729, 667431, 103154, 666735, 667433, 666739, 667435, 666744, 669156, 102307, 666747, 667466, 667508, 666760, 667469, 668033, 666761, 668754, 666770, 668765, 666771, 666774, 666775, 668832, 666776, 667498, 668639, 666779, 667513, 668836, 666785, 668039, 669279, 668863, 668290, 102417, 666787, 668864, 666788, 668865, 668896, 666792, 666795, 669067, 666798, 666803, 666821, 667482, 668808, 666844, 666846, 668841, 666855, 666856, 668858, 666862, 102599, 100280, 102613, 666869, 666870, 668830, 668871, 668883, 666872, 666875, 668594, 102670, 666876, 666885, 666887, 668829, 668572, 666889, 102704, 666898, 666900, 668792, 102709, 666906, 100022, 102711, 100024, 666908, 100041, 666912, 102723, 666913, 666916, 102656, 667225, 102735, 666920, 100118, 666922, 666929, 669185, 666940, 669188, 666945, 100140, 666948, 100141, 666950, 668555, 666952, 666954, 100150, 666955, 666962, 100162, 669178, 668636, 668556, 100184, 668557, 666973, 666974, 100204, 102792, 100210, 666977, 666984, 669194, 100224, 666988, 666990, 666995, 100267, 666996, 668693, 667003, 669157, 667010, 669165, 102852, 667014, 668796, 668990, 668852, 667018, 668417, 667019, 667027, 668558, 667028, 668559, 100329, 102882, 668311, 100334, 100351, 667051, 668807, 667056, 668802, 667071, 667099, 667073, 667075, 669073, 667083, 667084, 100458, 102926, 667096, 669059, 668567, 669236, 100477, 102928, 102929, 667110, 669227, 669134, 667444, 669041, 667120, 667121, 102935, 667122, 100548, 102937, 667125, 668725, 668719, 100600, 667130, 100601, 102952, 668191, 668580, 102953, 100658, 668617, 100664, 102955, 100670, 102956, 100681, 102958, 668781, 100699, 102962, 669086, 669084, 100712, 102963, 667157, 669115, 668541, 100714, 667158, 669112, 100720, 667159, 668549, 668646, 100743, 102971, 668718, 102973, 100766, 669043, 667182, 668893, 102978, 668889, 100802, 102980, 668668, 669056, 100829, 102981, 669111, 102985, 669119, 100840, 102991, 667208, 102992, 669105, 100881, 100883, 102995, 100887, 667214, 668429, 668943, 102997, 669013, 668938, 669201, 669202, 669197, 103003, 668614, 103004, 668983, 103009, 667229, 668632, 100946, 103018, 668967, 667231, 100987, 100988, 667235, 669144, 101000, 103031, 669131, 103032, 101012, 103033, 667242, 101013, 103035, 667243, 669064, 103036, 101032, 103037, 101036, 103048, 668623, 101062, 101078, 103055, 668681, 103062, 103069, 667266, 669081, 668686, 669007, 669046, 103075, 101111, 103082, 101112, 103083, 667278, 668767, 668529, 103084, 668766, 669257, 668958, 668542, 101176, 103088, 667281, 669214, 669193, 101666, 103089, 669020, 667284, 668986, 668490, 101712, 103098, 669123, 101722, 103103, 103111, 667292, 667296, 101736, 667299, 668728, 101750, 668727, 102557, 103119, 667302, 101763, 667303, 669032, 103143, 103145, 667305, 101887, 103151, 101897, 667308, 668939, 667312, 668859, 101916, 667313, 669172, 669262, 101945, 667315, 668995, 101948, 667317, 668860, 103171, 668570, 101979, 103178, 667328, 668971, 101983, 103179, 667329, 101997, 667331, 103183, 667332, 102014, 103184, 668887, 102016, 103189, 102022, 667338, 668663, 668886, 669092, 102063, 667349, 102068, 103197, 667352, 102074, 103198, 668635, 669161, 102075, 103200, 668633, 103201, 667357, 668624, 669143, 668701, 102101, 103205, 668700, 668593, 102126, 667374, 669130, 668547, 669148, 102147, 103408, 667375, 669149, 668961, 102160, 669117, 102167, 103417, 102180, 667394, 103433, 102186, 669283, 102206, 667405, 102223, 666667, 667410, 667412, 102245, 666677, 667413, 669065, 669137, 668906, 668759, 667414, 668697, 667420, 668957, 669050, 102264, 667421, 667423, 668910, 667429, 102278, 666733, 668599, 102280, 669121, 102300, 666740, 667439, 102304, 667441, 666746, 667446, 668682, 102353, 666751, 667453, 669103, 669189, 102354, 666755, 669094, 669093, 102355, 669022, 102357, 667471, 669141, 102358, 667473, 667476, 669275, 669132, 102371, 667485, 669127, 102373, 667487, 102374, 102377, 669263, 669186, 102379, 666782, 667510, 101724, 668891, 666783, 668880, 102416, 666786, 669235, 668601, 669162, 102433, 666790, 102436, 669099, 102443, 669008, 666799, 103459, 666800, 669153, 102479, 669108, 102480, 666807, 669114, 102481, 666816, 669110, 102482, 666820, 669107, 102483, 102490, 666828, 668895, 669100, 102498, 666834, 102519, 666839, 102533, 666840, 669233, 103015, 666852, 669124, 668090, 102595, 668922, 666864, 666868, 102624, 668882, 102630, 102637, 668795, 668838, 668200, 102642, 102534, 102671, 666879, 669176, 669000, 102676, 666888, 668850, 668868, 668772, 668853, 666891, 669175, 102705, 669139, 668304, 102706, 668944, 669191, 669133, 666907, 102713, 100032, 102718, 666909, 669074, 102720, 669006, 669035, 100056, 100065, 102726, 102731, 668675, 669192, 668352, 102733, 666918, 666919, 100116, 102736, 100121, 102742, 666927, 100123, 102744, 100126, 102749, 669055, 100129, 102750, 669221, 100130, 102752, 666942, 100132, 102756, 666944, 100135, 102759, 669025, 669147, 668954, 102767, 668306, 100144, 102771, 669184, 668620, 100145, 102772, 102776, 100157, 102778, 668904, 102782, 666963, 668900, 669213, 100167, 102784, 100175, 102785, 666967, 102788, 666972, 100190, 102789, 669169, 100193, 102790, 666975, 668705, 102794, 669096, 102795, 100215, 666983, 667437, 668694, 100217, 102808, 668930, 669042, 100221, 666987, 669083, 668658, 102812, 669085, 100225, 102818, 669082, 100230, 102821, 666993, 100234, 102823, 668665, 668659, 102824, 100273, 102826, 100274, 102836, 667006, 669113, 100278, 102844, 100279, 667011, 668095, 100290, 102853, 102856, 100296, 102857, 102858, 668568, 668642, 668950, 102865, 667033, 668914, 100325, 102875, 667034, 669142, 100326, 102876, 669151, 102877, 667037, 669024, 669207, 667044, 669054, 102883, 667046, 100336, 102888, 100350, 102890, 667050, 669196, 102891, 100361, 102893, 100366, 102895, 667057, 668360, 669036, 100369, 102899, 667066, 100396, 667067, 669072, 668773, 100409, 102902, 668653, 100433, 668652, 100444, 102907, 668503, 100449, 102908, 102911, 100455, 102920, 667085, 102921, 667086, 669198, 100463, 102923, 667091, 100470, 668631, 102924, 667093, 668650, 102925, 667094, 667101, 667128, 667304, 667293, 666932, 103022, 100471, 668548, 102763, 667234, 666915, 668717, 101042, 668667, 668625, 668751, 669044, 668777, 666752, 668748, 668776, 666966, 668786, 102996, 667307, 102901, 668612, 668996, 668521, 100920, 668760, 667370, 101110, 102987, 668826, 668997, 666976, 667532, 102932, 102092, 667363, 667116, 668966, 669027, 668855, 668898, 668955, 668993, 103194, 669293, 669177, 669278, 669063, 669173, 669120, 669109, 668963, 669095, 668842, 669205, 669052, 669146, 669097, 669223, 668915, 102915, 101956, 667452, 101134, 667237, 667139, 669031} + var storeList = []int64{ + 100206, 100324, 100328, 100451, 100476, 101099, 102411, 102424, 102473, 102594, 102686, 102691, 102807, 102809, 102906, 102931, 103050, 103425, 666678, 666709, 668184, 668620, 668951, 668984, 669012, 669136, 669145, 669159, + } for _, v := range storeList { payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeIDs\"\r\n\r\n[" + utils.Int64ToStr(v) + "]\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"payload\"\r\n\r\n[{\"nameID\":9564,\"unitPrice\":2600}]\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"causeFlag\"\r\n\r\n16\r\n-----011000010111000001101001--\r\n\r\n") req, _ := http.NewRequest("PUT", url, payload) - req.Header.Add("token", "TOKEN.V2.2452A93EEB9111EC9B06525400E86DC0.20240105-151800.localpass.8E9FF0EAAB9A11EE9EC5525400E86DC0.[18981810340]") + req.Header.Add("token", "TOKEN.V2.2452A93EEB9111EC9B06525400E86DC0.20240109-135510.localpass.A5DBAB2FAEB311EEB77C525400E86DC0.[18981810340]") req.Header.Add("content-type", "multipart/form-data; boundary=---011000010111000001101001") _, err := http.DefaultClient.Do(req) diff --git a/platformapi/tiktok_shop/tiktok_api/settl_bill_detail_test.go b/platformapi/tiktok_shop/tiktok_api/settl_bill_detail_test.go index 2353fc4d..9129a218 100644 --- a/platformapi/tiktok_shop/tiktok_api/settl_bill_detail_test.go +++ b/platformapi/tiktok_shop/tiktok_api/settl_bill_detail_test.go @@ -3,8 +3,6 @@ package tiktok_api import ( "fmt" order_getSettleBillDetailV3_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/order_getSettleBillDetailV3/request" - "io/ioutil" - "net/http" "strings" "testing" ) @@ -31,26 +29,6 @@ func TestBillDetail(t *testing.T) { } -func TestLen(t *testing.T) { - url := "https://www.jxc4.com/v2/store/sku/UpdateStoresSkus" - - param := `` - payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeIDs\"\r\n\r\n[" + param + "]\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"payload\"\r\n\r\n[{\"nameID\":8461,\"unitPrice\":2600},{\"nameID\":9325,\"unitPrice\":1800},{\"nameID\":15045,\"unitPrice\":500},{\"nameID\":15026,\"unitPrice\":450},{\"nameID\":15007,\"unitPrice\":220},{\"nameID\":15019,\"unitPrice\":700},{\"nameID\":8075561,\"unitPrice\":350},{\"nameID\":10247,\"unitPrice\":600},{\"nameID\":15055,\"unitPrice\":900},{\"nameID\":11044,\"unitPrice\":580},{\"nameID\":15021,\"unitPrice\":300},{\"nameID\":15042,\"unitPrice\":650},{\"nameID\":11479,\"unitPrice\":2600},{\"nameID\":8779,\"unitPrice\":1200},{\"nameID\":15066,\"unitPrice\":700},{\"nameID\":8077377,\"unitPrice\":2200},{\"nameID\":14984,\"unitPrice\":800},{\"nameID\":14993,\"unitPrice\":500},{\"nameID\":15095,\"unitPrice\":750},{\"nameID\":9105,\"unitPrice\":1100},{\"nameID\":15005,\"unitPrice\":300},{\"nameID\":15107,\"unitPrice\":500},{\"nameID\":15029,\"unitPrice\":520},{\"nameID\":15027,\"unitPrice\":1100}]\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"causeFlag\"\r\n\r\n16\r\n-----011000010111000001101001--\r\n\r\n") - - req, _ := http.NewRequest("PUT", url, payload) - - req.Header.Add("token", "TOKEN.V2.2452A93EEB9111EC9B06525400E86DC0.20231208-110713.localpass.E252DAB0957611EE96A5525400E86DC0.[18981810340]") - req.Header.Add("content-type", "multipart/form-data; boundary=---011000010111000001101001") - - res, _ := http.DefaultClient.Do(req) - - defer res.Body.Close() - body, _ := ioutil.ReadAll(res.Body) - - fmt.Println(res) - fmt.Println(string(body)) -} - func TestName(t *testing.T) { a := 1 a = a | 1 diff --git a/platformapi/uuptapi/uupt_test.go b/platformapi/uuptapi/uupt_test.go index 74e33899..20b84d49 100644 --- a/platformapi/uuptapi/uupt_test.go +++ b/platformapi/uuptapi/uupt_test.go @@ -99,7 +99,7 @@ func TestGetOrderDetail(t *testing.T) { //取消订单 func TestCancelOrder(t *testing.T) { - err := api.CancelOrder("23013118111004700001004861", "测试取消") + err := api.CancelOrder("24011415121024100001986825", "测试取消") fmt.Println(err) } diff --git a/platformapi/yilianyunapi/yilianyunapi.go b/platformapi/yilianyunapi/yilianyunapi.go index f2f5a107..795562ac 100644 --- a/platformapi/yilianyunapi/yilianyunapi.go +++ b/platformapi/yilianyunapi/yilianyunapi.go @@ -237,12 +237,18 @@ func (a *API) GetPrintStatusWithToken(machineCode, token string) (state int, err return a.getPrintStatus(machineCode, token) } -func (a *API) GetPrinterToken(machineCode, qrKey string) (tokenInfo *TokenInfo, err error) { - result, err := a.AccessAPI(scanCodemodelApiPath, map[string]interface{}{ +func (a *API) GetPrinterToken(machineCode, qrKey, msign string) (tokenInfo *TokenInfo, err error) { + parameter := map[string]interface{}{ "machine_code": machineCode, - "qr_key": qrKey, "scope": "all", - }, "") + } + if qrKey != "" { + parameter["qr_key"] = qrKey + } else if msign != "" { + parameter["msign"] = msign + } + + result, err := a.AccessAPI(scanCodemodelApiPath, parameter, "") if err == nil { err = utils.Map2StructByJson(result, &tokenInfo, false) } diff --git a/platformapi/yilianyunapi/yilianyunapi_test.go b/platformapi/yilianyunapi/yilianyunapi_test.go index d041eabb..b62797fb 100644 --- a/platformapi/yilianyunapi/yilianyunapi_test.go +++ b/platformapi/yilianyunapi/yilianyunapi_test.go @@ -1,7 +1,9 @@ package yilianyunapi import ( + "fmt" "testing" + "time" "git.rosy.net.cn/baseapi" "git.rosy.net.cn/baseapi/utils" @@ -20,11 +22,11 @@ func init() { baseapi.Init(sugarLogger) // 自有应用 - api = New("1039586024", "4885d07c2997b661102e4b6099c0bf3b") - api.SetToken("07e5895c70114395a285ae20119d83b1") + //api = New("1039586024", "4885d07c2997b661102e4b6099c0bf3b") + //api.SetToken("283f27f7dfbe4379b2db9b8f11e61b9c") // 开放应用 - //api = New("1098307169", "d5eedb40c99e6691b1ca2ba82a363d6a") + api = New("1098307169", "d5eedb40c99e6691b1ca2ba82a363d6a") } func handleError(t *testing.T, err error) { @@ -54,13 +56,14 @@ func TestDeletePrinter(t *testing.T) { func TestPrintMsg(t *testing.T) { // 4004606481 - err := api.PrintMsg("4004615546", utils.GetUUID(), "饿百取货码") + err := api.PrintMsg("4004797135", utils.GetUUID(), "饿百取货码") handleError(t, err) } func TestPrintMsgWithToken(t *testing.T) { // 4004606481 - err := api.PrintMsgWithToken("4004600675", utils.GetUUID(), "饿百取货码", "b1a36aa8de5647d2b08af49db11a9c9d") + //err := api.PrintMsgWithToken("4004555254", utils.GetUUID(), "饿百取货码", "0a8255eeb42445f7b8db42b1fc60ce87") + err := api.PrintMsgWithToken("4004797135", utils.GetUUID(), "饿百取货码", "179770218366") handleError(t, err) } @@ -77,7 +80,7 @@ func TestGetPrintStatusWithToken(t *testing.T) { } func TestGetPrinterToken(t *testing.T) { - TokenInfo, err := api.GetPrinterToken("1039586024", "4885d07c2997b661102e4b6099c0bf3b") + TokenInfo, err := api.GetPrinterToken("4004797135", "179770218366", "") handleError(t, err) baseapi.SugarLogger.Debug(TokenInfo) } @@ -104,6 +107,10 @@ func TestGetOrderPagingList(t *testing.T) { t.Log(utils.Format4Output(result, true)) } +func TestName(t *testing.T) { + fmt.Println(time.Now().Add(time.Duration(2592000) * time.Second).Unix()) +} + func TestSetSound(t *testing.T) { err := api.SetSound("4004617180", "2") handleError(t, err)