From e0985d04af1ee5b7eb5e25587eefb94d4ba3d35a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AD=90=E9=93=AD?= Date: Thu, 14 Nov 2024 19:25:13 +0800 Subject: [PATCH] test --- dctw/v1/api/card/card.go | 1 - dctw/v1/api/card/card_test.go | 13 ++++++++----- dctw/v1/api/direct/direct.go | 2 -- dctw/v1/api/direct/direct_test.go | 13 ++++++++----- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/dctw/v1/api/card/card.go b/dctw/v1/api/card/card.go index 80eece0..fbf1825 100644 --- a/dctw/v1/api/card/card.go +++ b/dctw/v1/api/card/card.go @@ -22,7 +22,6 @@ func (c *Card) Order(ctx context.Context, request *Order) (*OrderResp, error) { if err != nil { return nil, err } - fmt.Println("result:", string(result)) var response *OrderResp if err = json.Unmarshal(result, &response); err != nil { return nil, err diff --git a/dctw/v1/api/card/card_test.go b/dctw/v1/api/card/card_test.go index aabe51f..e6f53ae 100644 --- a/dctw/v1/api/card/card_test.go +++ b/dctw/v1/api/card/card_test.go @@ -10,11 +10,14 @@ import ( ) func TestCardOrder(t *testing.T) { - server, err := core.NewDctWServer(&core.DctWConfig{ - AppId: "1", - AppKey: "1e2bf7a04b8b1e6be5dc78d04e8639c9", - BaseUri: "http://test.openapi.1688sup.cn", - }) + server, err := core.NewDctWServer( + &core.DctWConfig{ + AppId: "1", + AppKey: "1e2bf7a04b8b1e6be5dc78d04e8639c9", + BaseUri: "http://test.openapi.1688sup.cn", + }, + core.WithDebug(true), + ) if err != nil { t.Fatal(err) } diff --git a/dctw/v1/api/direct/direct.go b/dctw/v1/api/direct/direct.go index 493faec..16a5211 100644 --- a/dctw/v1/api/direct/direct.go +++ b/dctw/v1/api/direct/direct.go @@ -3,7 +3,6 @@ package direct import ( "context" "encoding/json" - "fmt" "gitea.cdlsxd.cn/sdk/plugin/dctw/v1/api" "gitea.cdlsxd.cn/sdk/plugin/dctw/v1/core" "io/ioutil" @@ -22,7 +21,6 @@ func (c *Direct) Order(ctx context.Context, request *Order) (*OrderResp, error) if err != nil { return nil, err } - fmt.Printf("result: %s\n", string(result)) var response *OrderResp if err = json.Unmarshal(result, &response); err != nil { return nil, err diff --git a/dctw/v1/api/direct/direct_test.go b/dctw/v1/api/direct/direct_test.go index 22f7194..a715554 100644 --- a/dctw/v1/api/direct/direct_test.go +++ b/dctw/v1/api/direct/direct_test.go @@ -11,11 +11,14 @@ import ( ) func TestDirect_Order(t *testing.T) { - server, err := core.NewDctWServer(&core.DctWConfig{ - AppId: "1", - AppKey: "1e2bf7a04b8b1e6be5dc78d04e8639c9", - BaseUri: "http://test.openapi.1688sup.cn", - }) + server, err := core.NewDctWServer( + &core.DctWConfig{ + AppId: "1", + AppKey: "1e2bf7a04b8b1e6be5dc78d04e8639c9", + BaseUri: "http://test.openapi.1688sup.cn", + }, + core.WithDebug(true), + ) if err != nil { t.Fatal(err) }