diff --git a/platformapi/dadaapi/dadaapi_test.go b/platformapi/dadaapi/dadaapi_test.go index 0776fcb1..b1d34bc1 100644 --- a/platformapi/dadaapi/dadaapi_test.go +++ b/platformapi/dadaapi/dadaapi_test.go @@ -1,5 +1,7 @@ package dadaapi +import "go.uber.org/zap" + // //import ( // "net/http" @@ -11,11 +13,12 @@ package dadaapi // "go.uber.org/zap" //) // -//var ( -// dadaapi *API -// sugarLogger *zap.SugaredLogger -// testOrder *OperateOrderParams -//) +var ( + dadaapi *API + sugarLogger *zap.SugaredLogger + testOrder *OperateOrderParams +) + // //const ( // testShopNo = "11047059" diff --git a/platformapi/dadaapi/order_test.go b/platformapi/dadaapi/order_test.go index 6b48788d..d4676f4d 100644 --- a/platformapi/dadaapi/order_test.go +++ b/platformapi/dadaapi/order_test.go @@ -1,13 +1,14 @@ package dadaapi // -//import ( -// "fmt" -// "testing" -// -// "git.rosy.net.cn/baseapi" -// "git.rosy.net.cn/baseapi/utils" -//) +import ( + //"fmt" + "testing" + + //"git.rosy.net.cn/baseapi" + "git.rosy.net.cn/baseapi/utils" +) + // //func TestAddOrderAfterQuery(t *testing.T) { // // orderID := utils.GetUUID() @@ -65,13 +66,15 @@ package dadaapi // } //} // -//func TestQueryOrderInfo(t *testing.T) { -// result, err := dadaapi.QueryOrderInfo("80704840263399812") -// if err != nil { -// t.Fatal(err) -// } -// t.Log(utils.Format4Output(result, false)) -//} +func TestQueryOrderInfo(t *testing.T) { + dadaapi = New("dada154e2a41fd6cef3", "7f97d8f258b70b450f04e7ab274ed8f8", "6660", "http://callback.jxc4.com/dadadelivery/msg", true) + result, err := dadaapi.QueryOrderInfo("1454997324435816448") + if err != nil { + t.Fatal(err) + } + t.Log(utils.Format4Output(result, false)) +} + // //func TestAddTip(t *testing.T) { // err := dadaapi.AddTip("80704840263399812", 1.0, "530100", "") diff --git a/platformapi/mtwmapi/retail_test.go b/platformapi/mtwmapi/retail_test.go index 60faa73a..19b32a93 100644 --- a/platformapi/mtwmapi/retail_test.go +++ b/platformapi/mtwmapi/retail_test.go @@ -3,7 +3,6 @@ package mtwmapi import ( "errors" "fmt" - "git.rosy.net.cn/baseapi/utils/errlist" "git.rosy.net.cn/jx-callback/globals" "testing" @@ -11,7 +10,7 @@ import ( ) func TestRetailCatList(t *testing.T) { - result, err := api.RetailCatList("8061767") + result, err := api.RetailCatList("15478260") if err != nil { t.Fatal(err) } @@ -31,36 +30,37 @@ func TestRetailCatUpdate(t *testing.T) { } func TestRetailCatDelete(t *testing.T) { //var err error - errList := errlist.New() - errList1 := errlist.New() + //errList := errlist.New() + //errList1 := errlist.New() //info := []string{"11309161", "7379027", "14422863", "12405467", "12398353", "12422620", "12422751", "11437415", "2391979", "11037873", "11646173", "12286931", "11086818", "9000444", "13413407", "10874383", "11674367", "11824223", "11939392", "11810047", "12071134", "11799045", "12848707", "11596643", "14038247", "9676866", "15382980", "8967897", "11566485", "11774697", "11730687", "11798089", "11488932", "11651698", "11637939", "11831005", "11883106", "11011885", "11342761", "12131910", "12833849", "11209533", "12211457", "15874713", "11440630", "12665305", "11437682", "11440628", "9578183", "11796739", "11213162", "12665208", "13887316"} //str := []string{"token_gFkmTBCfctlpehYTENBNpw", "token_tnrjZftD5q4lU42KI3RPsQ", "token_ih9ZUCueA_dnrHBC6eBDew", "token_uJenwb2m6hWDe36e7hhAuw", "token_o2bWH171jXW8dIikHjFFog", "token_kfsqhhQ3kPXAwxUueglF_g", "token_h86ZqAP89I-Pe6vMACVLZQ", "token_uzWsBdnSIbv1KBQPoNRKRQ", "token_ucnSaUtKiUbonBnax5dDMQ", "token_o2-KGSi8lbh1ON4seUlEiQ", "token_v0gPiP4rH1vrS51GXgZJBg", "token_k0GWFzpjDtodAW5yFhVBgA", "token_oV2lXBnc1d8kc_JgWvtFxQ", "token_gl5GkKf9XKOO5ZNK-0JPRg", "token_suOF8ngaSTOcFcjNxvdHVA", "token_nf9QokI2udnECY2s1zBIeA", "token_nZjY3PlhFWlkHxdUDr9EsA", "token_kwq5HiBJI4vnavnmDyZBuA", "token_jhE-_ku5e7g6Ys4jWt5J0g", "token_lqAjjKmpEws1pKcspd1ETw", "token_mj31nyxnSIKFfxjViWpN4w", "token_kxjANA3lKNqfJrXApsZEEg", "token_kMttVFAYWLAcPAmZi3FNjg", "token_gd5aruWWQX2Iz8CXEg1Gaw", "token_j1HkNiZHh76aEGLqJT9Pfw", "token_muEkyBPPm6quxE2P2dlNQA", "token_uoHU5jcIZNx_QV0rZI1Now", "token_jj9M4B67tEr0DKgRiidDBQ", "token_gXpPtzRin_m9SEzohBJOFA", "token_rBIwyLoU2O6qfq2_VCdBQg", "token_qY6wArUbm8ypW1IoUc5Frw", "token_m5XZKS8TiL1ILCqy1flFjg", "token_n5xs7bSk96MekhNxWuJGPw", "token_oqbTOzEAZYvr4QgRIypA9w", "token_jmBHMy8LQi-TPa1fOsJJKQ", "token_nNzvPUZFeQ009kWinAhDiw", "token_q4EqYUsEXy726qXH1fdJeA", "token_o0aHQxC55_XjOLvWuYFFCQ", "token_k9vJhV8aAX2fN-39KZRGEA", "token_vdGAQ50zMvm_Ofqz1yJJwg", "token_r-XGhX8HFahkkDMelHxFbQ", "token_nHupX9FsP6nj6HWQm0RN2w", "token_hpNdSt3m1Hs-CKAiWZlMKw", "token_mQ16KE4knE2sdPP2r8ROSw", "token_uUrPsYavDU1ExUwEbuFG8Q", "token_oSSLl9h6zIt9hKz16e1N_g", "token_ifyMH0B_2YipwaBoBmdAdQ", "token_uryS4endUdFgySqEWo9Dwg", "token_kAFq-IIr_5KYQwo5wlhPcg", "token_shBMfRfZtOS1xaNn5MdI0Q", "token_sS0KoWshUu-WlGchoxBNcA"} //for _, v := range info { // for _, i := range str { - // err = New("5873", "41c479790a76f86326f89e8048964739", "", i).RetailCatDelete(v, "", "国产水果") - // if err != nil { - // errList.AddErr(err) - // } + err := api.RetailCatDelete("15478260", "185", "") //其他水果 柑桔柚类 + //15478260 16946099 + if err != nil { + fmt.Println(err) + } // } //} //t.Fatal(errList) - str := []string{"15989234", "8469854", "9516023", "7685622", "13556506", "6881602", "8434218", "8055319", "9631487", "10304189", "12750127", "7763622", "10487156", "7111786", "7511838", "8694015", "8100274", "7890912", "8100271", "16031461", "12663480", "3439955", "9590548", "14518241", "9212291", "12949643", "11655829", "8803440", "8050205", "13757398", "7772819", "9298493", "14095978", "8066561", "7821246", "7870435", "9325918", "9489313", "15804487", "7653889", "10102158", "13832612", "13743831", "13653630", "15979646", "9566644", "11465562", "7804232", "12875244", "11396295", "11182878", "7890904", "7996691", "13757046", "8040308", "13894384", "8763090", "8474922", "12008311", "12772984", "7563325", "13673909", "13162342", "9833367", "9771682", "9252885", "13734300", "9397807", "7943872", "10179676", "8061767", "9151041", "7948392", "7837683", "7935102", "12973182", "9129147", "7111559", "9654444", "16148524", "9297448", "16454737", "16585188", "9567799", "9590547", "8763431", "11396293", "12971487", "13921940", "12958628", "9715274", "7653898", "7113851", "15076639", "14644525", "14672706", "9487906", "13272804", "13213430", "12818354", "8050208", "6994255", "7763623", "9252879", "7763618", "9004652", "16450657", "15526789", "7714376", "16148616", "9151008", "9590307", "12524795", "7837684", "7511835", "8363515", "11562292", "7530884", "7557374", "11333598", "7685548", "7379563", "9853707", "12566851", "13330828", "12977266", "9437489", "7887935", "13660949", "8025715", "9633587", "7877455", "13809322", "13353206", "14468256", "12725201", "8803326", "9431036", "9710572", "7188488", "8363514", "9487905", "9516024", "8988371", "15214524", "7653888", "13770681", "13424255", "11738499", "7870443", "15979510", "8694012", "16044491", "7379569", "9612115", "9853705", "9542449", "7332291", "11766973", "13668986", "11562892", "11712781", "8050204", "7852741", "14171520", "8470035", "7664598", "7593577", "8025712", "7648349", "8990050", "6868992", "6983421", "7026375", "9654442", "7332292", "7185767", "8474908", "8987050", "13007792", "9654445", "9397243", "7607959", "12648301", "7890906", "8953695", "9647891", "13210057", "8055320", "13823372", "6699483", "9202387", "13324613", "13780950", "8763089", "16445016", "7821250", "16278451", "7852744", "14785116", "7030977", "2461794", "9375123", "9542447", "7772806", "9503274", "7989322", "8171018", "9397258", "8164522", "11396290", "13716256", "9019253", "13601255", "13858191", "6868972", "8694017", "9521557", "16604873", "12814626", "9853708", "13945239", "11333594", "13512024", "8066220", "14789574", "13353428", "7875212", "16254463", "14802321", "8929645", "8803442", "7530882", "8070474", "16483095", "9718411", "7354669", "11895033", "12997752", "12796944", "6741258", "9075939", "8066562", "12822608", "7174094", "9375119", "12703509", "13456669", "12769341", "8872485", "16333742", "7844668", "8990052", "9612116", "7701893", "8070484", "7996688", "6793969", "8065767", "7169084", "7972984", "11562286", "9842860", "7763619", "7890902", "2461720", "11333597", "11478220", "9384986", "7489955", "11396297", "14204334", "9100089", "8469851", "16054304", "11735671", "9525711", "7388603", "12952781", "14018705", "7712772", "8475286", "8694207", "7891337", "9437485", "12988539", "13825019", "13630927", "15504368", "7989318", "9566643", "8570799", "9019257", "9737861", "8675995", "7877458", "12852060", "15917190", "7550514", "9460313", "11398621", "8024652", "7877453", "6783595", "15835521", "9656178", "15682431", "9298491", "9431247", "16492464", "9253031", "13810759", "9375163", "9431033", "12956339", "9431037", "8025713", "13860782", "9853710", "8429062", "9252877", "8025717", "11459135", "13470500", "8034434", "12917046", "9252889", "7648326", "13197160", "7821249", "9567798", "7802805", "15929504", "16367375", "11436066", "13251656", "8068105", "7870451", "10555090", "9238635", "6783201", "7844669", "12877927", "13874475", "7875174", "8171015", "8050201", "8450516", "7772812", "8040302", "8985811", "12836722", "9431032", "7258626", "12453501", "6699700", "7596245", "9764018", "8072067", "8607309", "16295002", "12901767", "9631485", "16374352", "11095322", "10591298", "14837468", "11092185", "7870437", "8050207", "13429030", "2461723", "16082287", "9375118", "7747521", "13745138", "4627675", "15952037", "9252886", "8988370", "10305892", "9921154", "7615274", "8232658", "7500734", "8475269", "11712677", "8929652", "11508265", "7963093", "7357682", "7963098", "9174914", "7963090", "8987052", "13867411", "9151007", "10559124", "16313795", "8664927", "6737142", "11396613", "11532316", "13700662", "14525543", "8579297", "7026319", "8476072", "13877003", "7601728", "13878902", "7290541", "7794610", "12583746", "9789218", "13325479", "7550515", "13657154", "8694421", "7838449", "8061771", "8363516", "9151006", "8025714", "9487903", "13693544", "7804237", "8566853", "11396291", "9126516", "7838448", "9851999", "8286596", "9566641", "14443179", "16082282", "15916538", "13167828", "2464037", "4385509", "9853704", "8763092", "9855224", "10217790", "7972981", "11459129", "9850817", "8040298", "2461713", "15369458", "16108585", "9681273", "16206350", "14446003", "9202390", "9589466", "3345154", "8100279", "13280673", "13625083", "7875166", "12833761", "13262364", "12822452", "13872125", "7954969", "8985813", "13787479", "15804661", "9566642", "9001942", "13845682", "7890907", "14893266", "9431038", "8383987", "14864158", "7544156", "13805203", "8429464", "8868139", "13734815", "7665673", "9589010", "8024650", "8929644", "9019256", "13781414", "11458974", "9631488", "9274733", "13924565", "12723888", "13365704", "8286597", "7756297", "7996690", "7665672", "6783841", "16012279", "9001940", "9375124", "12767290", "7763627", "7829629", "12944552", "9633391", "7500735", "16019319", "12923719", "7640862", "11334719", "9521556", "9431042", "7890908", "9151044", "7870453", "13086341", "9625435", "15827581", "7837687", "7887937", "13625349", "9202393", "7511829", "7653890", "7989315", "6794526", "9098128", "11139396", "7954976", "7996682", "7863777", "9431040", "7076576", "7111696", "13519111", "13156468", "9375121", "7870448", "7935100", "12704348", "7829623", "13248863", "8664921", "11539395", "7587064", "8803332", "12663071", "7681459", "9526555", "13348409", "7989317", "8068889", "11535796", "7821247", "7887892", "9465148", "13701057", "7685624", "8868140", "7681460", "9375164", "15114632", "7020772", "8987235", "13409561", "12874689", "9325917", "9098133", "13693149", "8434219", "7980754", "7169838", "13890060", "9614733", "7852740", "7821245", "7111680", "7955041", "6828292", "12266625", "6878158", "8694203", "6871562", "9202386", "8171011", "9541081", "9460315", "7996685", "13860778", "8803445", "8581969", "13927501", "9626729", "11526196", "13866566", "8450542", "16574388", "7870442", "7379574", "7821254", "15874706", "9812000", "8566855", "7634034", "14221271", "13929673", "12705611", "12822507", "13885386", "13352005", "9255373", "16492497", "8990051", "12782967", "12567599", "8953749", "2461716", "15927708", "14944126", "12952578", "16590875", "16193110", "7772818", "8677147", "15853822", "13440405", "8763430", "13453097", "16049008", "12836404", "11562288", "8024656", "9593462", "8231036", "16126640", "7470644", "12663103", "9489615", "7712774", "8868124", "7532178", "8579296", "13742303", "13949391", "12701972", "7273959", "9631486", "7963094", "9460317", "9263026", "8694366", "9832140", "9589008", "9465172", "8570801", "13834857", "12978850", "16030020", "9589009", "9833777", "8579295", "7513210", "8664924", "12863393", "7963096", "8286599", "7486365", "16445082", "16543494", "16071804", "11611416", "14813696", "9173503", "6994221", "7111597", "8061770", "9253633", "7890911", "7436124", "8110893", "9375120", "16344221", "12755558", "14676334", "8061769", "13961789", "8868132", "16578436", "9566645", "6698202", "7470639", "7809575", "13856237", "9252883", "9019258", "7890905", "11140731", "8929762", "7518261", "15144140", "8929648", "12755555", "12903714", "9019255", "8763401", "7169088", "2461795", "7786317", "16611720", "8070479", "8171012", "13777632", "13693675", "7935098", "7772809", "8245117", "8055322", "7379565", "7332289", "2464145", "12809013", "8040305", "16322381", "11139681", "7875172", "11458978", "13949371", "7809572", "12375547", "12782317", "9718640", "8245116", "7883776", "7870440", "8040306", "13451826", "11396288", "13424273", "9273031", "13207596", "13481543", "7925048", "8665212", "14281445", "9815326", "7844673", "9100088", "7134740", "9001943", "9431034", "9842380", "7954977", "11764356", "7653895", "8953697", "12949744", "9567797", "16563956", "8072051", "13721626", "13734286", "8956096", "8066219", "7026352", "16575557", "7837686", "9487904", "11738830", "13735157", "8070916", "13365041", "7870447", "7875175", "7943873", "7691225", "8040297", "13770708", "9474803", "9721793", "8171013", "11337965", "10531823", "9465149", "10305682", "8470034", "7870446", "8763093", "15827578", "13480436", "8171024", "16031473", "12838886", "12852059", "16581034", "13767666", "13699239", "7111603", "7756299", "7706725", "9437474", "9732183", "13960020", "11918887", "7719667", "7877452", "8232659", "8100272", "9855199", "12364252", "7557366", "8607304", "12852062", "11895037", "7963091", "7634043", "6929996", "8579294", "8286600", "13809270", "8034439", "6976084", "11465560", "11562341", "7615276", "7607952", "15951700", "8872677", "13872273", "7963095", "12840066", "12949636", "9923051", "11552428", "8024654", "9263745", "7794611", "13986537", "16454849", "6975987", "7443262", "7653899", "8050193", "14799080", "7935105", "6699461", "16579957", "7550513", "11459134", "16071685", "12975661", "13352655", "8474909", "6741392", "13359961", "7877456", "9663329", "8763088", "12670042", "4366765", "7954973", "8040309", "7756296", "13141893", "9624199", "7870444", "8985814", "13262158", "4462977", "8050194", "7685568", "12954902", "9612113", "14881541", "9266332", "8469853", "11918886", "13445608", "8665210", "7559890", "7685534", "9437478", "14860083", "7500737", "13440385", "11713570", "16081447", "16022200", "6976606", "13157978", "7174130", "13403669", "15988255", "9252881", "16027287", "10071426", "8664919", "9541080", "13685406", "9855198", "7511834", "6741144", "13734298", "8664923", "9736869", "7105609", "9577658", "9612112", "7535672", "7070710", "7943868", "9876552", "9842876", "12941218", "11918888"} - var errStr1 string - var errStr2 string - for _, v := range str { - if err := api.RetailCatDelete(v, "" /*utils.GetUpperUUID()*/, "热销"); err != nil { - errList.AddErr(err) - errStr1 += v + "," - } - if err1 := api.RetailCatDelete(v, "" /*utils.GetUpperUUID()*/, "底料"); err1 != nil { - errList1.AddErr(err1) - errStr2 += v + "," - } - } - fmt.Sprintf("热销:%s", errStr1) - fmt.Sprintf("底料:%s", errStr2) - t.Fatal(errList.GetErrListAsOne()) - t.Fatal(errList1.GetErrListAsOne()) + //str := []string{"15989234", "8469854", "9516023", "7685622", "13556506", "6881602", "8434218", "8055319", "9631487", "10304189", "12750127", "7763622", "10487156", "7111786", "7511838", "8694015", "8100274", "7890912", "8100271", "16031461", "12663480", "3439955", "9590548", "14518241", "9212291", "12949643", "11655829", "8803440", "8050205", "13757398", "7772819", "9298493", "14095978", "8066561", "7821246", "7870435", "9325918", "9489313", "15804487", "7653889", "10102158", "13832612", "13743831", "13653630", "15979646", "9566644", "11465562", "7804232", "12875244", "11396295", "11182878", "7890904", "7996691", "13757046", "8040308", "13894384", "8763090", "8474922", "12008311", "12772984", "7563325", "13673909", "13162342", "9833367", "9771682", "9252885", "13734300", "9397807", "7943872", "10179676", "8061767", "9151041", "7948392", "7837683", "7935102", "12973182", "9129147", "7111559", "9654444", "16148524", "9297448", "16454737", "16585188", "9567799", "9590547", "8763431", "11396293", "12971487", "13921940", "12958628", "9715274", "7653898", "7113851", "15076639", "14644525", "14672706", "9487906", "13272804", "13213430", "12818354", "8050208", "6994255", "7763623", "9252879", "7763618", "9004652", "16450657", "15526789", "7714376", "16148616", "9151008", "9590307", "12524795", "7837684", "7511835", "8363515", "11562292", "7530884", "7557374", "11333598", "7685548", "7379563", "9853707", "12566851", "13330828", "12977266", "9437489", "7887935", "13660949", "8025715", "9633587", "7877455", "13809322", "13353206", "14468256", "12725201", "8803326", "9431036", "9710572", "7188488", "8363514", "9487905", "9516024", "8988371", "15214524", "7653888", "13770681", "13424255", "11738499", "7870443", "15979510", "8694012", "16044491", "7379569", "9612115", "9853705", "9542449", "7332291", "11766973", "13668986", "11562892", "11712781", "8050204", "7852741", "14171520", "8470035", "7664598", "7593577", "8025712", "7648349", "8990050", "6868992", "6983421", "7026375", "9654442", "7332292", "7185767", "8474908", "8987050", "13007792", "9654445", "9397243", "7607959", "12648301", "7890906", "8953695", "9647891", "13210057", "8055320", "13823372", "6699483", "9202387", "13324613", "13780950", "8763089", "16445016", "7821250", "16278451", "7852744", "14785116", "7030977", "2461794", "9375123", "9542447", "7772806", "9503274", "7989322", "8171018", "9397258", "8164522", "11396290", "13716256", "9019253", "13601255", "13858191", "6868972", "8694017", "9521557", "16604873", "12814626", "9853708", "13945239", "11333594", "13512024", "8066220", "14789574", "13353428", "7875212", "16254463", "14802321", "8929645", "8803442", "7530882", "8070474", "16483095", "9718411", "7354669", "11895033", "12997752", "12796944", "6741258", "9075939", "8066562", "12822608", "7174094", "9375119", "12703509", "13456669", "12769341", "8872485", "16333742", "7844668", "8990052", "9612116", "7701893", "8070484", "7996688", "6793969", "8065767", "7169084", "7972984", "11562286", "9842860", "7763619", "7890902", "2461720", "11333597", "11478220", "9384986", "7489955", "11396297", "14204334", "9100089", "8469851", "16054304", "11735671", "9525711", "7388603", "12952781", "14018705", "7712772", "8475286", "8694207", "7891337", "9437485", "12988539", "13825019", "13630927", "15504368", "7989318", "9566643", "8570799", "9019257", "9737861", "8675995", "7877458", "12852060", "15917190", "7550514", "9460313", "11398621", "8024652", "7877453", "6783595", "15835521", "9656178", "15682431", "9298491", "9431247", "16492464", "9253031", "13810759", "9375163", "9431033", "12956339", "9431037", "8025713", "13860782", "9853710", "8429062", "9252877", "8025717", "11459135", "13470500", "8034434", "12917046", "9252889", "7648326", "13197160", "7821249", "9567798", "7802805", "15929504", "16367375", "11436066", "13251656", "8068105", "7870451", "10555090", "9238635", "6783201", "7844669", "12877927", "13874475", "7875174", "8171015", "8050201", "8450516", "7772812", "8040302", "8985811", "12836722", "9431032", "7258626", "12453501", "6699700", "7596245", "9764018", "8072067", "8607309", "16295002", "12901767", "9631485", "16374352", "11095322", "10591298", "14837468", "11092185", "7870437", "8050207", "13429030", "2461723", "16082287", "9375118", "7747521", "13745138", "4627675", "15952037", "9252886", "8988370", "10305892", "9921154", "7615274", "8232658", "7500734", "8475269", "11712677", "8929652", "11508265", "7963093", "7357682", "7963098", "9174914", "7963090", "8987052", "13867411", "9151007", "10559124", "16313795", "8664927", "6737142", "11396613", "11532316", "13700662", "14525543", "8579297", "7026319", "8476072", "13877003", "7601728", "13878902", "7290541", "7794610", "12583746", "9789218", "13325479", "7550515", "13657154", "8694421", "7838449", "8061771", "8363516", "9151006", "8025714", "9487903", "13693544", "7804237", "8566853", "11396291", "9126516", "7838448", "9851999", "8286596", "9566641", "14443179", "16082282", "15916538", "13167828", "2464037", "4385509", "9853704", "8763092", "9855224", "10217790", "7972981", "11459129", "9850817", "8040298", "2461713", "15369458", "16108585", "9681273", "16206350", "14446003", "9202390", "9589466", "3345154", "8100279", "13280673", "13625083", "7875166", "12833761", "13262364", "12822452", "13872125", "7954969", "8985813", "13787479", "15804661", "9566642", "9001942", "13845682", "7890907", "14893266", "9431038", "8383987", "14864158", "7544156", "13805203", "8429464", "8868139", "13734815", "7665673", "9589010", "8024650", "8929644", "9019256", "13781414", "11458974", "9631488", "9274733", "13924565", "12723888", "13365704", "8286597", "7756297", "7996690", "7665672", "6783841", "16012279", "9001940", "9375124", "12767290", "7763627", "7829629", "12944552", "9633391", "7500735", "16019319", "12923719", "7640862", "11334719", "9521556", "9431042", "7890908", "9151044", "7870453", "13086341", "9625435", "15827581", "7837687", "7887937", "13625349", "9202393", "7511829", "7653890", "7989315", "6794526", "9098128", "11139396", "7954976", "7996682", "7863777", "9431040", "7076576", "7111696", "13519111", "13156468", "9375121", "7870448", "7935100", "12704348", "7829623", "13248863", "8664921", "11539395", "7587064", "8803332", "12663071", "7681459", "9526555", "13348409", "7989317", "8068889", "11535796", "7821247", "7887892", "9465148", "13701057", "7685624", "8868140", "7681460", "9375164", "15114632", "7020772", "8987235", "13409561", "12874689", "9325917", "9098133", "13693149", "8434219", "7980754", "7169838", "13890060", "9614733", "7852740", "7821245", "7111680", "7955041", "6828292", "12266625", "6878158", "8694203", "6871562", "9202386", "8171011", "9541081", "9460315", "7996685", "13860778", "8803445", "8581969", "13927501", "9626729", "11526196", "13866566", "8450542", "16574388", "7870442", "7379574", "7821254", "15874706", "9812000", "8566855", "7634034", "14221271", "13929673", "12705611", "12822507", "13885386", "13352005", "9255373", "16492497", "8990051", "12782967", "12567599", "8953749", "2461716", "15927708", "14944126", "12952578", "16590875", "16193110", "7772818", "8677147", "15853822", "13440405", "8763430", "13453097", "16049008", "12836404", "11562288", "8024656", "9593462", "8231036", "16126640", "7470644", "12663103", "9489615", "7712774", "8868124", "7532178", "8579296", "13742303", "13949391", "12701972", "7273959", "9631486", "7963094", "9460317", "9263026", "8694366", "9832140", "9589008", "9465172", "8570801", "13834857", "12978850", "16030020", "9589009", "9833777", "8579295", "7513210", "8664924", "12863393", "7963096", "8286599", "7486365", "16445082", "16543494", "16071804", "11611416", "14813696", "9173503", "6994221", "7111597", "8061770", "9253633", "7890911", "7436124", "8110893", "9375120", "16344221", "12755558", "14676334", "8061769", "13961789", "8868132", "16578436", "9566645", "6698202", "7470639", "7809575", "13856237", "9252883", "9019258", "7890905", "11140731", "8929762", "7518261", "15144140", "8929648", "12755555", "12903714", "9019255", "8763401", "7169088", "2461795", "7786317", "16611720", "8070479", "8171012", "13777632", "13693675", "7935098", "7772809", "8245117", "8055322", "7379565", "7332289", "2464145", "12809013", "8040305", "16322381", "11139681", "7875172", "11458978", "13949371", "7809572", "12375547", "12782317", "9718640", "8245116", "7883776", "7870440", "8040306", "13451826", "11396288", "13424273", "9273031", "13207596", "13481543", "7925048", "8665212", "14281445", "9815326", "7844673", "9100088", "7134740", "9001943", "9431034", "9842380", "7954977", "11764356", "7653895", "8953697", "12949744", "9567797", "16563956", "8072051", "13721626", "13734286", "8956096", "8066219", "7026352", "16575557", "7837686", "9487904", "11738830", "13735157", "8070916", "13365041", "7870447", "7875175", "7943873", "7691225", "8040297", "13770708", "9474803", "9721793", "8171013", "11337965", "10531823", "9465149", "10305682", "8470034", "7870446", "8763093", "15827578", "13480436", "8171024", "16031473", "12838886", "12852059", "16581034", "13767666", "13699239", "7111603", "7756299", "7706725", "9437474", "9732183", "13960020", "11918887", "7719667", "7877452", "8232659", "8100272", "9855199", "12364252", "7557366", "8607304", "12852062", "11895037", "7963091", "7634043", "6929996", "8579294", "8286600", "13809270", "8034439", "6976084", "11465560", "11562341", "7615276", "7607952", "15951700", "8872677", "13872273", "7963095", "12840066", "12949636", "9923051", "11552428", "8024654", "9263745", "7794611", "13986537", "16454849", "6975987", "7443262", "7653899", "8050193", "14799080", "7935105", "6699461", "16579957", "7550513", "11459134", "16071685", "12975661", "13352655", "8474909", "6741392", "13359961", "7877456", "9663329", "8763088", "12670042", "4366765", "7954973", "8040309", "7756296", "13141893", "9624199", "7870444", "8985814", "13262158", "4462977", "8050194", "7685568", "12954902", "9612113", "14881541", "9266332", "8469853", "11918886", "13445608", "8665210", "7559890", "7685534", "9437478", "14860083", "7500737", "13440385", "11713570", "16081447", "16022200", "6976606", "13157978", "7174130", "13403669", "15988255", "9252881", "16027287", "10071426", "8664919", "9541080", "13685406", "9855198", "7511834", "6741144", "13734298", "8664923", "9736869", "7105609", "9577658", "9612112", "7535672", "7070710", "7943868", "9876552", "9842876", "12941218", "11918888"} + //var errStr1 string + //var errStr2 string + //for _, v := range str { + // if err := api.RetailCatDelete(v, "" /*utils.GetUpperUUID()*/, "热销"); err != nil { + // errList.AddErr(err) + // errStr1 += v + "," + // } + // if err1 := api.RetailCatDelete(v, "" /*utils.GetUpperUUID()*/, "底料"); err1 != nil { + // errList1.AddErr(err1) + // errStr2 += v + "," + // } + //} + //fmt.Sprintf("热销:%s", errStr1) + //fmt.Sprintf("底料:%s", errStr2) + //t.Fatal(errList.GetErrListAsOne()) + //t.Fatal(errList1.GetErrListAsOne()) } func TestRetailList(t *testing.T) { diff --git a/platformapi/tiktok_shop/tiktok_api/afs_test.go b/platformapi/tiktok_shop/tiktok_api/afs_test.go index ccacf74d..4442e251 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":"e1c4333c-6e5e-4db8-83d3-173923e0815f","expires_in":1677450559,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"89d62aee-5bb3-433c-9514-e435172a3263","authority_id":""}` +var token = `{"access_token":"f1ee4188-d49a-4eaf-9cb8-7d754a23d19e","expires_in":1678053416,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"08ce6c28-37b4-4c3e-9942-7d078c551bc2","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/api_test.go b/platformapi/tiktok_shop/tiktok_api/api_test.go index edd03e57..3e08c8a1 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("5012575500183489614") + data, err := a.GetTiktokOrderDetail("5039319444977829100") 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 4963efb7..1a2cef8c 100644 --- a/platformapi/tiktok_shop/tiktok_api/store.go +++ b/platformapi/tiktok_shop/tiktok_api/store.go @@ -146,6 +146,18 @@ func (a *API) UnsuspendStore(param *shop_unsuspendStore_request.ShopUnsuspendSto } return response.Data, nil } +func (a *API) UnsuspendStore2(storeID int64) (*shop_unsuspendStore_response.ShopUnsuspendStoreData, error) { + request := shop_unsuspendStore_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 +} type VendorAndStoreId struct { StoreId string `json:"store_id"` //京西本地ID diff --git a/platformapi/tiktok_shop/tiktok_api/store_test.go b/platformapi/tiktok_shop/tiktok_api/store_test.go index fe64966f..487213c1 100644 --- a/platformapi/tiktok_shop/tiktok_api/store_test.go +++ b/platformapi/tiktok_shop/tiktok_api/store_test.go @@ -13,7 +13,6 @@ import ( shop_getStoreFreight_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_getStoreFreight/response" shop_getStoreList_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_getStoreList/request" shop_storeSuspend_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_storeSuspend/request" - shop_unsuspendStore_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_unsuspendStore/request" trade_createTradeLimitTemplate_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/trade_createTradeLimitTemplate/request" warehouse_bindFences_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/warehouse_bindFences/request" warehouse_bindFencesByStore_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/warehouse_bindFencesByStore/request" @@ -32,6 +31,8 @@ import ( "time" ) +//var token = `{"access_token":"f1ee4188-d49a-4eaf-9cb8-7d754a23d19e","expires_in":1678053416,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"08ce6c28-37b4-4c3e-9942-7d078c551bc2","authority_id":""}` + //创建店铺 func TestCreateStore(t *testing.T) { accesstoken := `{"access_token":"c4afc5bc-7ddf-4244-b35a-0c393f3dca32","expires_in":1666862533,"scope":"SCOPE","shop_id":"57939570","shop_name":"京西菜市速食","refresh_token":"5a4f9dfe-306b-4bca-8b35-2ae9afc0245e","authority_id":""}` @@ -239,8 +240,6 @@ func TestStoreSuspend(t *testing.T) { 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 { @@ -254,14 +253,21 @@ func TestStoreSuspend2(t *testing.T) { } 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":""}` - a := New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", accesstoken) - param := &shop_unsuspendStore_request.ShopUnsuspendStoreParam{ - StoreId: 65312663, + storeIDs := []int64{64251611, 64251610, 64251609, 64251608, 64251607, 64251606, 64251605, 64251604, 64251603, 64251602, 64251601, 64251600, 64251599, 81386642, 79727258, 78699463, 78118788, 76879546, 76877797, 76877419, 76877129, 76876821, 76875172, 64270373, 64270337, 64270333, 64270318, 64270314, 64270245, 64270236, 64270198, 64270183, 64270052, 64270050, 64270027, 64269963, 64269927} + //param := &shop_unsuspendStore_request.ShopUnsuspendStoreParam{ + // StoreId: 65312663, + //} + // 64251628,64251627,64251626,64251621,64251618,64251615, 64251613,64251612,64251609,64251602,64251601,64270314,64270245,64270236 + //64270198,64270052,64269963,64269927 + errList := errlist.New() + for _, v := range storeIDs { + _, err := a.UnsuspendStore2(v) + if err != nil { + errList.AddErr(fmt.Errorf("id:%d err:%v", v, err)) + } } - resp, err := a.UnsuspendStore(param) - fmt.Println(resp) - fmt.Println(err) + //resp, err := a.UnsuspendStore(param) + fmt.Println(errList.GetErrListAsOne()) } func TestUpdateStore(t *testing.T) {