From 3ed374e74aa610e859860a48da0b0b75ade6f683 Mon Sep 17 00:00:00 2001 From: suyl <770236076@qq.com> Date: Wed, 9 Jun 2021 18:53:50 +0800 Subject: [PATCH] aa --- platformapi/jdapi/jdapi_test.go | 3 +- platformapi/jdapi/order_test.go | 10 +-- platformapi/jdapi/store_page_test.go | 4 +- platformapi/jdapi/store_sku_test.go | 15 ++-- platformapi/jdshopapi/store_page_test.go | 23 +++-- platformapi/mtwmapi/act_test.go | 93 +++++++++++++++++--- platformapi/mtwmapi/mtwmapi_test.go | 4 +- platformapi/mtwmapi/order_test.go | 4 +- platformapi/tonglianpayapi/tonglianpayapi.go | 11 +-- 9 files changed, 121 insertions(+), 46 deletions(-) diff --git a/platformapi/jdapi/jdapi_test.go b/platformapi/jdapi/jdapi_test.go index 4a5bee8f..03a902ed 100644 --- a/platformapi/jdapi/jdapi_test.go +++ b/platformapi/jdapi/jdapi_test.go @@ -34,8 +34,7 @@ func init() { //api.SetJdCookie(cookieValue) // api.SetCookie("user", "GXBMZPW62YXDDG4NE5JDLJJJHWWGJFKML56GHPDEUP6E65UMM4MQ2OB3RYHSEGXGEP5RT55TQZ3PJEXQVYJSNEBNZVY76BZPTRJTZTTZEEJRFHJ4JM5NZ6XI3TEG3X54QBIFC4C5WZUMEN6XHATZBIGB4XKWNNCAAVX4SNS5EIQTQBALUVFPM52OJ3X6L4MONINJDVRVL2UGV6BUPHOMBUWCNPP3AAKAQAXGI3DJA6LUXWO32ILD6E5QHFYGLC6SFRTUQPAUJJXGSGIIZBICUOPVZ7HJW4XPEJFBZU5TAEXOOWKXSK6RWKS6ABQGWC5SHKC73UFVR3WYW3XI5UUIUVWHXTFH6VNYCS4BV5Q") api.SetCookieWithStr(` - lsp-store1.jddj.com=OPJQMA7B3FTKCAUGO7FHCH5NMBGAWGGXYRNLEHYYZNGNPNIBCAM4IOEPG3NT3RIA44G5C3535Q5LGG4F4SR4AZVLGYKYTKFJJKEAOXENVBL5VXNILRP3GLNVVWA26XZ3VGSYOHA72RICMVZS3G53DTEH3JWVXCZBKYQN5CW57OZAUUGW26BM5GBMDUKCPJGLYBMEIVPIGG6PY2HOZTQL5PWKCSDJLG7AKSLKUQ422BVJDNQ36DIA74FV7RFQMMQPNJ5YQMCG2M72IH43LZDVSAYZWKUGAVD7VFRMEYTOXYHWCYVDXJ6HYFIPWIN3ULLXDDLN2ICON4GRK; __jdv=1736810%7Cdirect%7C-%7Cnone%7C-; __jdc=1736810; UM_distinctid=17963b0bd563dd-07a5da6a9457e6-47744d16-1fa400-17963b0bd574f; store_deviceid=5c03d9a2607b4d89a899d964b3cc7b7b; store_session=%231620889060485; __jda=1736810.991809771.1620875198.1620953065.1620955942.3; josl-privilege1.jddj.com=OPJQMA7B3FTKCAUGO7FHCH5NMBGAWGGXYRNLEHYYZNGNPNIBCAM4IOEPG3NT3RIA44G5C3535Q5LGG4F4SR4AZVLGYKYTKFJJKEAOXENVBL5VXNILRP3GLNVVWA26XZ3VGSYOHA72RICMVZS3G53DTEH3KCP2S44LDPAQLCCQRBXNOZZ3MSXCT6RAOIZAWD2XXTAXVQWCRSUSEKDGDA7T27TSAZUPLV5Q6RZ7VU22BVJDNQ36DIA74FV7RFQMMQPJMDLDWPCCJGWNWD7GUK3Q7QPN77A3TE4L4MQLHRHXTZZYW6FZ7JKQYCUP6UWFQTCN27A6YLCUO5HZJQKHQKIKPPS3ES7MYKEAGATHJA; o2o-stock1.jddj.com=OPJQMA7B3FTKCAUGO7FHCH5NMBGAWGGXYRNLEHYYZNGNPNIBCAM4IOEPG3NT3RIA44G5C3535Q5LGG4F4SR4AZVLGYKYTKFJJKEAOXENVBL5VXNILRP3GLNVVWA26XZ3VGSYOHA72RICMVZS3G53DTEH3J3DK5GN5WQ2HUVIG5B7GRG2KDVHCT6RAOIZAWD2XXTAXVQWCRSUTOL67ITT6KBBWG7PVAD3KPTVSYAMIOV7EVR4JGDPUMIPCVZVKBP5E4RJGGER5KFUQWJBFZJVCAXQUQ; o2o-pms1.jddj.com=OPJQMA7B3FTKCAUGO7FHCH5NMBGAWGGXYRNLEHYYZNGNPNIBCAM4IOEPG3NT3RIA44G5C3535Q5LGG4F4SR4AZVLGYKYTKFJJKEAOXENVBL5VXNILRP3GLNVVWA26XZ3VGSYOHA72RICMVZS3G53DTEH3KNCT3PCUJ347L7JVCMFK7EGZXPXCT6RAOIZAWD2XXTAXVQWCRSUSNFJZ2IWCY44V26MTVLDNCXQMZQMIOV7EVR4JGDPUMIPCVZVKBP5E4RJGGER5KFUQWJBFZJVCAXQUQ - + user_email=jd_jxcs1223; lsp-store1.jddj.com=OPJQMA7B3FTKCAUGO7FHCH5NMBGAWGGXYRNLEHYYZNGNPNIBCAM4IOEPG3NT3RIA44G5C3535Q5LGG4F4SR4AZVLGYKYTKFJJKEAOXENVBL5VXNILRP3GLNVVWA26XZ3VGSYOHA72RICMVZS3G53DTEH3IW4E75TESEWTLRSIRJY7FNSYSI5WZ4XWQDVV4PV3ZVLFHE3PCLMACPFRWY4RSS2JEKOV4UE6UWLQHSSVYL7Y3BULPKRXGEGEUZ4AXL75DDUKMJKNYU4OV6SICN2OAQPBB4ANKYUYK6KOCYNU7MPQZRGZ7A3RCFZCSP5UJH6H2OTKVR4EGOCXYTZO2DXT6UDKHMIWF7PCFTVIYAVZV6TUYE43JONRCTQBY2PDBQYCB4ONJOEWAF6KFL3GJ3XH26R6E; __jda=1736810.1798730514.1623120276.1623120276.1623120276.1; __jdb=1736810.1.1798730514%7C1.1623120276; __jdv=1736810%7Cdirect%7C-%7Cnone%7C-; __jdc=1736810; UM_distinctid=179e981ec8517b-00b41f870f4ea8-5b1e341a-1fa400-179e981ec862fc; josl-privilege1.jddj.com=OPJQMA7B3FTKCAUGO7FHCH5NMBGAWGGXYRNLEHYYZNGNPNIBCAM4IOEPG3NT3RIA44G5C3535Q5LGG4F4SR4AZVLGYKYTKFJJKEAOXENVBL5VXNILRP3GLNVVWA26XZ3VGSYOHA72RICMVZS3G53DTEH3IZEWY6OPWKC2VDB35RUYZNRHU2NWZ4XWQDVV4PV3ZVLFHE3PCLMBCKN37VTMTCRBLW4O6Y7WPLRH7SSVYL7Y3BULPKRXGEGEUZ4AXL7PFRYSKXTJC4DMVDFZGVZRZSYFTS2NHDUVTNCIWKXZIBXNQYVDA5XQBVLCTBLZJYLBWT5R6DGE3H4C4L7R23TYZA5JMSPJU7HE6MGAWXAMIJ7H54ZWWGP56KATLF26DHPBFC7H6AGN62RYAH3GOOTQMZPFOOK3A5M4RSJGLYDIG2YB3HH35HA; o2o-stock1.jddj.com=OPJQMA7B3FTKCAUGO7FHCH5NMBGAWGGXYRNLEHYYZNGNPNIBCAM4IOEPG3NT3RIA44G5C3535Q5LGG4F4SR4AZVLGYKYTKFJJKEAOXENVBL5VXNILRP3GLNVVWA26XZ3VGSYOHA72RICMVZS3G53DTEH3KQ3WQGC55ESYXPBS6ILUSCUK42NWZ4XWQDVV4PV3ZVLFHE3PCLMBLVZUJXTZCIDNU6MLPP4QF3XBXAMIOV7EVR4JGDPUMIPCVZVKBP5E4RJGGER5KFUQWJBFZJVCAXQUQ; o2o-pms1.jddj.com=OPJQMA7B3FTKCAUGO7FHCH5NMBGAWGGXYRNLEHYYZNGNPNIBCAM4IOEPG3NT3RIA44G5C3535Q5LGG4F4SR4AZVLGYKYTKFJJKEAOXENVBL5VXNILRP3GLNVVWA26XZ3VGSYOHA72RICMVZS3G53DTEH3KIUOTIFY2QI5CVIA5EBQUVQLHR5WZ4XWQDVV4PV3ZVLFHE3PCLMBTFESYD7DRZ6DIQ5T4DQFJ3PS7YMIOV7EVR4JGDPUMIPCVZVKBP5E4RJGGER5KFUQWJBFZJVCAXQUQ `) } diff --git a/platformapi/jdapi/order_test.go b/platformapi/jdapi/order_test.go index 23020acd..bd971009 100644 --- a/platformapi/jdapi/order_test.go +++ b/platformapi/jdapi/order_test.go @@ -7,7 +7,7 @@ import ( ) func TestQuerySingleOrder(t *testing.T) { - retVal, err := api.QuerySingleOrder("2111729701001462") + retVal, err := api.QuerySingleOrder("2113480902000652") t.Log(utils.Format4Output(retVal, false)) if err != nil { t.Error(err) @@ -15,10 +15,10 @@ func TestQuerySingleOrder(t *testing.T) { if false { t.Log(utils.Format4Output(retVal, false)) } - retVal, err = api.QuerySingleOrder("999999") - if err == nil { - t.Error("应该找不到这个订单!") - } + //retVal, err = api.QuerySingleOrder("999999") + //if err == nil { + // t.Error("应该找不到这个订单!") + //} } func TestOrderQuery(t *testing.T) { diff --git a/platformapi/jdapi/store_page_test.go b/platformapi/jdapi/store_page_test.go index ad0946b3..66c0e572 100644 --- a/platformapi/jdapi/store_page_test.go +++ b/platformapi/jdapi/store_page_test.go @@ -30,8 +30,8 @@ func TestGetRealMobileNumber4Order(t *testing.T) { } func TestGetStoreOrderInfo(t *testing.T) { - orderId := "2109362566000132" - orderInfo, err := api.GetStoreOrderInfo(orderId, "11917237") + orderId := "2113752262000061" + orderInfo, err := api.GetStoreOrderInfo(orderId, "11930291") if err != nil { t.Fatal(err) } diff --git a/platformapi/jdapi/store_sku_test.go b/platformapi/jdapi/store_sku_test.go index 30974f1b..064b11dd 100644 --- a/platformapi/jdapi/store_sku_test.go +++ b/platformapi/jdapi/store_sku_test.go @@ -3,7 +3,6 @@ package jdapi import ( "testing" - "git.rosy.net.cn/baseapi" "git.rosy.net.cn/baseapi/utils" ) @@ -13,7 +12,7 @@ const ( ) func TestGetStationInfoList(t *testing.T) { - result, err := api.GetStationInfoList("12005640", []int64{2023417515}) + result, err := api.GetStationInfoList("11927116", []int64{2023435572}) if err != nil { t.Fatal(err) } @@ -67,7 +66,8 @@ func TestBatchUpdateVendibility(t *testing.T) { if err != nil { t.Fatal(err) } - baseapi.SugarLogger.Debug(utils.Format4Output(result, false)) + t.Log(utils.Format4Output(result, false)) + //baseapi.SugarLogger.Debug(utils.Format4Output(result, false)) } func TestUpdateVendibility(t *testing.T) { @@ -81,7 +81,8 @@ func TestUpdateVendibility(t *testing.T) { if err != nil { t.Fatal(err) } - baseapi.SugarLogger.Debug(utils.Format4Output(result, false)) + t.Log(utils.Format4Output(result, false)) + //baseapi.SugarLogger.Debug(utils.Format4Output(result, false)) } func TestUpdateVendorStationPrice(t *testing.T) { @@ -98,7 +99,8 @@ func TestUpdateVendorStationPrice(t *testing.T) { if err != nil { t.Fatal(err) } - baseapi.SugarLogger.Debug(utils.Format4Output(result, false)) + t.Log(utils.Format4Output(result, false)) + //baseapi.SugarLogger.Debug(utils.Format4Output(result, false)) } func TestBatchUpdateCurrentQtys(t *testing.T) { @@ -115,5 +117,6 @@ func TestBatchUpdateCurrentQtys(t *testing.T) { if err != nil { t.Fatal(err) } - baseapi.SugarLogger.Debug(utils.Format4Output(result, false)) + t.Log(utils.Format4Output(result, false)) + //baseapi.SugarLogger.Debug(utils.Format4Output(result, false)) } diff --git a/platformapi/jdshopapi/store_page_test.go b/platformapi/jdshopapi/store_page_test.go index 824f3ae1..fe8e9a96 100644 --- a/platformapi/jdshopapi/store_page_test.go +++ b/platformapi/jdshopapi/store_page_test.go @@ -730,16 +730,15 @@ func TestStoreProductSearch(t *testing.T) { } func TestUpdateStatus(t *testing.T) { - //err := api.UpdateStatus(1000069298, JdsStoreStatusOnline) - //if err != nil { - // t.Fatal(err) - //} - //t.Log(utils.Format4Output(result, false)) - data, err := utils.AESCBCEncpryt([]byte("{aasda:123}"), []byte("jingxicaishirosy"), []byte("jingxicaishirosy")) - sEnc := base64.StdEncoding.EncodeToString(data) - fmt.Println("1111", sEnc, err) - - data2, _ := base64.StdEncoding.DecodeString(sEnc) - aa, _ := utils.AESCBCDecpryt(data2, []byte("jingxicaishirosy"), []byte("jingxicaishirosy")) - fmt.Println(string(aa)) + s := []int{3, 5, 2} + for i := 0; i < len(s)-1; i++ { + for j := 0; j < len(s)-i-1; j++ { + if s[j] < s[j+1] { + temp := s[j] + s[j] = s[j+1] + s[j+1] = temp + } + } + } + fmt.Println(s) } diff --git a/platformapi/mtwmapi/act_test.go b/platformapi/mtwmapi/act_test.go index b8717a69..90af8216 100644 --- a/platformapi/mtwmapi/act_test.go +++ b/platformapi/mtwmapi/act_test.go @@ -64,16 +64,89 @@ func TestFulllDiscountShippingFeeList(t *testing.T) { } func TestRetailDiscountBatchSave(t *testing.T) { - result, err := api.RetailDiscountBatchSave(testPoiCode, RetailActTypeDirectDown, []*RetailDiscountActData{&RetailDiscountActData{ - AppFoodCode: "1140", - UserType: UserTypeAll, - StartTime: time.Now().Unix(), - EndTime: time.Now().Add(24 * time.Hour).Unix(), - OrderLimit: 1, - DayLimit: 1, - SettingType: SettingTypeAsDiscount, - DiscountCoefficient: 0.97, - }}) + result, _, err := api.RetailDiscountBatchSave2("7845503", 0, []*RetailDiscountActData{ + &RetailDiscountActData{ + AppFoodCode: "6039423", + StartTime: time.Now().Unix(), + EndTime: time.Now().Add(24 * time.Hour).Unix(), + OrderLimit: 1, + DayLimit: -1, + SettingType: SettingTypeAsDiscount, + DiscountCoefficient: 9.5, + }, + &RetailDiscountActData{ + AppFoodCode: "6043140", + StartTime: time.Now().Unix(), + EndTime: time.Now().Add(24 * time.Hour).Unix(), + OrderLimit: 1, + DayLimit: -1, + SettingType: SettingTypeAsDiscount, + DiscountCoefficient: 9.5, + }, + &RetailDiscountActData{ + AppFoodCode: "31765", + StartTime: time.Now().Unix(), + EndTime: time.Now().Add(24 * time.Hour).Unix(), + OrderLimit: 1, + DayLimit: -1, + SettingType: SettingTypeAsDiscount, + DiscountCoefficient: 9.5, + }, + &RetailDiscountActData{ + AppFoodCode: "31239", + StartTime: time.Now().Unix(), + EndTime: time.Now().Add(24 * time.Hour).Unix(), + OrderLimit: 1, + DayLimit: -1, + SettingType: SettingTypeAsDiscount, + DiscountCoefficient: 9.5, + }, + &RetailDiscountActData{ + AppFoodCode: "6042282", + StartTime: time.Now().Unix(), + EndTime: time.Now().Add(24 * time.Hour).Unix(), + OrderLimit: 1, + DayLimit: -1, + SettingType: SettingTypeAsDiscount, + DiscountCoefficient: 9.5, + }, + &RetailDiscountActData{ + AppFoodCode: "31901", + StartTime: time.Now().Unix(), + EndTime: time.Now().Add(24 * time.Hour).Unix(), + OrderLimit: 1, + DayLimit: -1, + SettingType: SettingTypeAsDiscount, + DiscountCoefficient: 9.5, + }, + &RetailDiscountActData{ + AppFoodCode: "6043147", + StartTime: time.Now().Unix(), + EndTime: time.Now().Add(24 * time.Hour).Unix(), + OrderLimit: 1, + DayLimit: -1, + SettingType: SettingTypeAsDiscount, + DiscountCoefficient: 9.5, + }, + &RetailDiscountActData{ + AppFoodCode: "30645", + StartTime: time.Now().Unix(), + EndTime: time.Now().Add(24 * time.Hour).Unix(), + OrderLimit: 1, + DayLimit: -1, + SettingType: SettingTypeAsDiscount, + DiscountCoefficient: 9.5, + }, + &RetailDiscountActData{ + AppFoodCode: "30729", + StartTime: time.Now().Unix(), + EndTime: time.Now().Add(24 * time.Hour).Unix(), + OrderLimit: 1, + DayLimit: -1, + SettingType: SettingTypeAsDiscount, + DiscountCoefficient: 9.5, + }, + }) if err != nil { t.Fatal(err) } diff --git a/platformapi/mtwmapi/mtwmapi_test.go b/platformapi/mtwmapi/mtwmapi_test.go index 561254c5..8f549a51 100644 --- a/platformapi/mtwmapi/mtwmapi_test.go +++ b/platformapi/mtwmapi/mtwmapi_test.go @@ -19,10 +19,10 @@ func init() { baseapi.Init(sugarLogger) // 菜市 - api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "") + //api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "") // 果园 - //api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "") + api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "") //商超 // api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_tE0txRtx7CRuPIOjh2BH4w") //token_nH_IlcWQKAkZBqklwItNRw diff --git a/platformapi/mtwmapi/order_test.go b/platformapi/mtwmapi/order_test.go index 25900e68..d3bb17b3 100644 --- a/platformapi/mtwmapi/order_test.go +++ b/platformapi/mtwmapi/order_test.go @@ -17,7 +17,7 @@ func TestOrderViewStatus(t *testing.T) { } func TestOrderGetOrderDetail(t *testing.T) { - result, err := api.OrderGetOrderDetail(70707103086675718, false) + result, err := api.OrderGetOrderDetail(104784113865527330, false) if err != nil { t.Fatal(err) } @@ -28,7 +28,7 @@ func TestOrderGetOrderDetail(t *testing.T) { } func TestOrderGetOrderDetail2(t *testing.T) { - result, err := api.OrderGetOrderDetail2(96314852096189186, false) + result, err := api.OrderGetOrderDetail2(104784113865527330, false) if err != nil { t.Fatal(err) } diff --git a/platformapi/tonglianpayapi/tonglianpayapi.go b/platformapi/tonglianpayapi/tonglianpayapi.go index 248129db..3a247751 100644 --- a/platformapi/tonglianpayapi/tonglianpayapi.go +++ b/platformapi/tonglianpayapi/tonglianpayapi.go @@ -18,11 +18,12 @@ const ( sepcAction = "unitorder/pay" sepcAction2 = "h5unionpay/unionorder" - sigKey = "sign" - PayTypeWxXcx = "W06" - PayTypeZfbApp = "A03" - PayTypeZfbJS = "A02" - PayTypeH5 = "H5" + sigKey = "sign" + PayTypeWxXcx = "W06" + PayTypeZfbApp = "A03" + PayTypeZfbQrcode = "A01" + PayTypeZfbJS = "A02" + PayTypeH5 = "H5" ResponseCodeSuccess = "SUCCESS" ResponseCodeFail = "FAIL"