This commit is contained in:
李子铭 2024-11-14 19:25:13 +08:00
parent c9c91d9146
commit e0985d04af
4 changed files with 16 additions and 13 deletions

View File

@ -22,7 +22,6 @@ func (c *Card) Order(ctx context.Context, request *Order) (*OrderResp, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
fmt.Println("result:", string(result))
var response *OrderResp var response *OrderResp
if err = json.Unmarshal(result, &response); err != nil { if err = json.Unmarshal(result, &response); err != nil {
return nil, err return nil, err

View File

@ -10,11 +10,14 @@ import (
) )
func TestCardOrder(t *testing.T) { func TestCardOrder(t *testing.T) {
server, err := core.NewDctWServer(&core.DctWConfig{ server, err := core.NewDctWServer(
AppId: "1", &core.DctWConfig{
AppKey: "1e2bf7a04b8b1e6be5dc78d04e8639c9", AppId: "1",
BaseUri: "http://test.openapi.1688sup.cn", AppKey: "1e2bf7a04b8b1e6be5dc78d04e8639c9",
}) BaseUri: "http://test.openapi.1688sup.cn",
},
core.WithDebug(true),
)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }

View File

@ -3,7 +3,6 @@ package direct
import ( import (
"context" "context"
"encoding/json" "encoding/json"
"fmt"
"gitea.cdlsxd.cn/sdk/plugin/dctw/v1/api" "gitea.cdlsxd.cn/sdk/plugin/dctw/v1/api"
"gitea.cdlsxd.cn/sdk/plugin/dctw/v1/core" "gitea.cdlsxd.cn/sdk/plugin/dctw/v1/core"
"io/ioutil" "io/ioutil"
@ -22,7 +21,6 @@ func (c *Direct) Order(ctx context.Context, request *Order) (*OrderResp, error)
if err != nil { if err != nil {
return nil, err return nil, err
} }
fmt.Printf("result: %s\n", string(result))
var response *OrderResp var response *OrderResp
if err = json.Unmarshal(result, &response); err != nil { if err = json.Unmarshal(result, &response); err != nil {
return nil, err return nil, err

View File

@ -11,11 +11,14 @@ import (
) )
func TestDirect_Order(t *testing.T) { func TestDirect_Order(t *testing.T) {
server, err := core.NewDctWServer(&core.DctWConfig{ server, err := core.NewDctWServer(
AppId: "1", &core.DctWConfig{
AppKey: "1e2bf7a04b8b1e6be5dc78d04e8639c9", AppId: "1",
BaseUri: "http://test.openapi.1688sup.cn", AppKey: "1e2bf7a04b8b1e6be5dc78d04e8639c9",
}) BaseUri: "http://test.openapi.1688sup.cn",
},
core.WithDebug(true),
)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }