diff --git a/platformapi/jdeclpapi/jdeclpapi_test.go b/platformapi/jdeclpapi/jdeclpapi_test.go index cf5275f7..53bd25df 100644 --- a/platformapi/jdeclpapi/jdeclpapi_test.go +++ b/platformapi/jdeclpapi/jdeclpapi_test.go @@ -60,7 +60,7 @@ func TestCancelOrder(t *testing.T) { t.Log(utils.Format4Output(result, false)) } func TestQueryOrderStatus(t *testing.T) { - result, err := api.QueryOrderStatus("ESL96778449960134") + result, err := api.QueryOrderStatus("ESL96778814627393") if err != nil { t.Fatal(err) } diff --git a/platformapi/jdshopapi/callback.go b/platformapi/jdshopapi/callback.go index 3eebff90..3f0f07e1 100644 --- a/platformapi/jdshopapi/callback.go +++ b/platformapi/jdshopapi/callback.go @@ -32,6 +32,7 @@ type CallBackResult struct { ConsigneeInfo *CallBackConsigneeInfo `json:"consigneeInfo"` ItemInfoList []*CallBackItemInfoList `json:"itemInfoList"` VendorOrgCode string `json:"vendorOrgCode"` + BalanceUsed string `json:"balanceUsed"` } type CallBackConsigneeInfo struct { diff --git a/platformapi/jdshopapi/order.go b/platformapi/jdshopapi/order.go index 9a77dcac..04f6cb05 100644 --- a/platformapi/jdshopapi/order.go +++ b/platformapi/jdshopapi/order.go @@ -101,6 +101,7 @@ type GetOrderResult struct { ScDT string `json:"scDT"` SellerDiscount string `json:"sellerDiscount"` MenDianID string `json:"menDianId"` + BalanceUsed string `json:"balanceUsed"` } type OrderExt struct { @@ -119,7 +120,7 @@ func (a *API) GetOrder(orderID int64, isStatus bool) (getOrderResult *GetOrderRe params["optional_fields"] = `orderType,payType,orderTotalPrice,orderSellerPrice, orderPayment,freightPrice,orderState,orderStateRemark, orderStartTime,orderEndTime,orderRemark,consigneeInfo, - itemInfoList,pauseBizInfo,pin,idSopShipmenttype,scDT,sellerDiscount,menDianId,storeId` + itemInfoList,pauseBizInfo,pin,idSopShipmenttype,scDT,sellerDiscount,menDianId,storeId,balanceUsed` if isStatus { params["order_state"] = "WAIT_SELLER_STOCK_OUT,TRADE_CANCELED,PAUSE,WAIT_GOODS_RECEIVE_CONFIRM" } diff --git a/platformapi/jdshopapi/order_test.go b/platformapi/jdshopapi/order_test.go index 5861a16a..f06287fa 100644 --- a/platformapi/jdshopapi/order_test.go +++ b/platformapi/jdshopapi/order_test.go @@ -1,7 +1,6 @@ package jdshopapi import ( - "fmt" "testing" "git.rosy.net.cn/baseapi/utils" @@ -24,7 +23,11 @@ func TestGetDeliveryCompany(t *testing.T) { } func TestGetOrder(t *testing.T) { - fmt.Println(len("13153183146800000100")) + // result, err := api.GetOrder(orderID, isStatus) + // if err != nil { + // t.Fatal(err) + // } + // t.Log(utils.Format4Output(result, false)) } func TestVoucherInfoGet(t *testing.T) { diff --git a/platformapi/jdshopapi/store_page_test.go b/platformapi/jdshopapi/store_page_test.go index a88b3587..22d18f72 100644 --- a/platformapi/jdshopapi/store_page_test.go +++ b/platformapi/jdshopapi/store_page_test.go @@ -4,7 +4,6 @@ import ( "bytes" "crypto/aes" "crypto/cipher" - "crypto/sha1" "encoding/base64" "fmt" "math" @@ -219,31 +218,56 @@ func TestUpdateExpand(t *testing.T) { } func TestUploadImageNew(t *testing.T) { - // accountsMerge([][]string{[]string{ - // "John", "johnsmith@mail.com", "john00@mail.com", - // }, []string{ - // "John", "johnnybravo@mail.com", - // }, []string{ - // "John", "johnsmith@mail.com", "john_newyork@mail.com", - // }, []string{ - // "Mary", "mary@mail.com", - // }}) - //bfde9c3c5df188541d1d47f17e03f8a75a872fe4 - fmt.Println(qwe()) + fmt.Println(spiralOrder([][]int{[]int{1, 2, 3, 4}, []int{5, 6, 7, 8}, []int{9, 10, 11, 12}})) } -func qwe() int { - defer fmt.Println("1") - a := 2 - if a == 1 { - return 1 +//输入一个矩阵,按照从外向里以顺时针的顺序依次打印出每一个数字。 +func spiralOrder(matrix [][]int) []int { + var result []int + + l, h := len(matrix[0]), len(matrix) + left, right, top, bottom := 0, l-1, 0, h-1 + lmax, tmax := 0, 0 + if l%2 == 0 { + lmax = l / 2 + } else { + lmax = l/2 + 1 + } + if h%2 == 0 { + tmax = l / 2 + } else { + tmax = l/2 + 1 } - return 0 -} - -func encryptPassword(password, salt string) string { - return fmt.Sprintf("%x", sha1.Sum([]byte(password+salt))) + for left <= lmax && top+1 <= tmax { + for left1 := left; left1 <= right; left1++ { + result = append(result, matrix[top][left1]) + } + fmt.Println(result, 1) + if h > 1 { + for top1 := top + 1; top1 <= bottom; top1++ { + result = append(result, matrix[top1][right]) + } + fmt.Println(result, 2) + if right > 0 { + for right1 := right - 1; right1 >= left; right1-- { + result = append(result, matrix[bottom][right1]) + } + } + fmt.Println(result, 3) + if bottom > 0 { + for bottom1 := bottom - 1; bottom1 >= top+1; bottom1-- { + result = append(result, matrix[bottom1][left]) + } + } + fmt.Println(result, 4) + } + left++ + top++ + right-- + bottom-- + } + return result } func addToArrayForm(A []int, K int) (a []int) {