From 40df3980b5e174b4a3b277d801786aea7dd0943b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Mon, 25 Jul 2022 10:42:09 +0800 Subject: [PATCH] 1 --- platformapi/limit_access_speed_test.go | 24 ++++++++++++++++++++++++ platformapi/q_bida/q_bida_client.go | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/platformapi/limit_access_speed_test.go b/platformapi/limit_access_speed_test.go index c0c5b024..0ff91f4c 100644 --- a/platformapi/limit_access_speed_test.go +++ b/platformapi/limit_access_speed_test.go @@ -1,7 +1,9 @@ package platformapi import ( + "encoding/json" "fmt" + "sort" "testing" "time" @@ -49,3 +51,25 @@ func TestLimitSpeed(t *testing.T) { }) time.Sleep(30 * time.Second) } + +func Test_store(b *testing.T) { + tempTagList := []int{1, 2, 3, 9, 5, 4} + sort.Slice(tempTagList, func(i, j int) bool { + if tempTagList[i] > tempTagList[j] { + return false + } + return true + }) + fmt.Println(tempTagList) +} + +func Test_string_byte(t *testing.T) { + //rankKey := map[string]string{"a": "刘磊", "b": "张雨绮%s", "c": "
下单时间:%s
"} + //data, _ := json.Marshal(rankKey) + + dd := `{"a": "刘磊", "b": "张雨绮%s", "c": "
下单时间:%s
"}` + var ee map[string]string + err := json.Unmarshal([]byte(dd), ee) + fmt.Println(err) + fmt.Println("dd:", ee) +} diff --git a/platformapi/q_bida/q_bida_client.go b/platformapi/q_bida/q_bida_client.go index f4fe9fc4..de1132d8 100644 --- a/platformapi/q_bida/q_bida_client.go +++ b/platformapi/q_bida/q_bida_client.go @@ -93,7 +93,7 @@ func (a *Api) CancelOrder(param *CancelOrderReq) error { if err := utils.Map2StructByJson(result, resultData, false); err != nil { return err } - if resultData.Code != 0 { + if resultData.Code != 0 && resultData.Msg != "success" { return errors.New(resultData.Msg) } return nil