This commit is contained in:
苏尹岚
2021-02-20 16:24:21 +08:00
parent 59af8ea51a
commit e3ff21f49e
5 changed files with 55 additions and 26 deletions

View File

@@ -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)
}

View File

@@ -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 {

View File

@@ -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"
}

View File

@@ -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) {

View File

@@ -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) {