1
This commit is contained in:
@@ -1,7 +1,9 @@
|
|||||||
package platformapi
|
package platformapi
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -49,3 +51,25 @@ func TestLimitSpeed(t *testing.T) {
|
|||||||
})
|
})
|
||||||
time.Sleep(30 * time.Second)
|
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)
|
||||||
|
}
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ func (a *Api) CancelOrder(param *CancelOrderReq) error {
|
|||||||
if err := utils.Map2StructByJson(result, resultData, false); err != nil {
|
if err := utils.Map2StructByJson(result, resultData, false); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if resultData.Code != 0 {
|
if resultData.Code != 0 && resultData.Msg != "success" {
|
||||||
return errors.New(resultData.Msg)
|
return errors.New(resultData.Msg)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user