feat: client debug

master v1.0.14
大虾 3 years ago
parent 4884358680
commit 5621cede80

@ -77,14 +77,16 @@ type Client struct {
AppSecret string AppSecret string
AccessKey string AccessKey string
OpName string OpName string
Debug bool
} }
func NewClient(appKey string, AppSecret string, AccessKey string, OpName string) *Client { func NewClient(appKey, AppSecret, AccessKey, OpName string, debug bool) *Client {
return &Client{ return &Client{
AppKey: appKey, AppKey: appKey,
AppSecret: AppSecret, AppSecret: AppSecret,
AccessKey: AccessKey, AccessKey: AccessKey,
OpName: OpName, OpName: OpName,
Debug: debug,
} }
} }
@ -124,7 +126,9 @@ func (c *Client) Exec(r Requester) (interface{}, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
fmt.Println(temp) if c.Debug{
fmt.Println(temp)
}
result := temp[r.GetRespName()] result := temp[r.GetRespName()]
response := r.GetRespObj() response := r.GetRespObj()
if err = mapstructure.Decode(result, &response); err != nil { if err = mapstructure.Decode(result, &response); err != nil {

Loading…
Cancel
Save