From baa0a28f7f4ed1ee984b039dece2b85ee056015c Mon Sep 17 00:00:00 2001 From: nikkiing <1031497516@qq.com> Date: Wed, 22 Mar 2023 16:27:52 +0800 Subject: [PATCH] Transport --- transport/v1/http/transport.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/transport/v1/http/transport.go b/transport/v1/http/transport.go index 0cc93de..cd28b6f 100644 --- a/transport/v1/http/transport.go +++ b/transport/v1/http/transport.go @@ -10,7 +10,14 @@ type Transport struct { apiKey string // apiKey } -func NewTransport(env enum.Env, sm4Key, apiKey string) *Transport { +func NewTransport(env enum.Env, args ...string) *Transport { + var sm4Key, apiKey string + if len(args) > 1 { + sm4Key = args[0] + } + if len(args) > 2 { + apiKey = args[1] + } return &Transport{ env: env, sm4Key: sm4Key,