This commit is contained in:
邹宗楠
2022-07-25 10:42:09 +08:00
parent 115dfc580d
commit 40df3980b5
2 changed files with 25 additions and 1 deletions

View File

@@ -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": "<center>下单时间:%s</center>"}
//data, _ := json.Marshal(rankKey)
dd := `{"a": "刘磊", "b": "张雨绮%s", "c": "<center>下单时间:%s</center>"}`
var ee map[string]string
err := json.Unmarshal([]byte(dd), ee)
fmt.Println(err)
fmt.Println("dd:", ee)
}

View File

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