|
|
@ -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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if c.Debug{
|
|
|
|
fmt.Println(temp)
|
|
|
|
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 {
|
|
|
|