7
0

Compare commits

..

No commits in common. "ff2a0f917a7e99ddb14e70e1ba5d44d5f1668a70" and "1f82a534c32844127db2c9c6b81eb66cd3f8bcf5" have entirely different histories.

6 changed files with 3 additions and 111 deletions

View File

@ -172,8 +172,3 @@ func CreateDemoTestResponse() *DemoTestResponse {
} }
``` ```
终端调试打开方式, 需要在系统环境变量上加入(三选一):
```
DEBUG=sdk,signer,request
```

View File

@ -91,7 +91,7 @@ type AcsRequest interface {
GetStringToSign() string GetStringToSign() string
GetBodyReader() io.Reader GetBodyReader() io.Reader
AddHeaderParam(key, value string) addHeaderParam(key, value string)
addQueryParam(key, value string) addQueryParam(key, value string)
addFormParam(key, value string) addFormParam(key, value string)
} }
@ -217,7 +217,7 @@ func (request *baseRequest) SetStringToSign(stringToSign string) {
request.stringToSign = stringToSign request.stringToSign = stringToSign
} }
func (request *baseRequest) AddHeaderParam(key, val string) { func (request *baseRequest) addHeaderParam(key, val string) {
request.Headers[key] = val request.Headers[key] = val
} }
@ -300,7 +300,7 @@ func addParam(request AcsRequest, position, key, value string) (err error) {
if len(value) > 0 { if len(value) > 0 {
switch position { switch position {
case Header: case Header:
request.AddHeaderParam(key, value) request.addHeaderParam(key, value)
case Query: case Query:
request.addQueryParam(key, value) request.addQueryParam(key, value)
case Body: case Body:

View File

@ -1,44 +0,0 @@
package www
import (
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
)
const (
VERSION = "2020-09-24"
)
var HOST requests.Host = requests.Host{
Default: "apisdk.9ooo.cn",
Func: func(s string) string {
var a = map[string]string{
requests.RELEASE: "apisdk.9ooo.cn",
requests.PRE: "apisdk.9ooo.cn",
requests.TEST: "apisdk.9ooo.cn",
}
return a[s]
},
}
type Client struct {
sdk.Client
}
func NewClientWithAccessKey(accesskey, secrect, source string) (client *Client, err error) {
client = &Client{}
err = client.InitWithAccessKey(accesskey, secrect, source)
return
}
func NewClientWithAliAppcode(accesskey, secrect string, env ...string) (client *Client, err error) {
client = &Client{}
err = client.InitWithAliAppcode(accesskey, secrect, env...)
return
}
func (c *Client) GetUserInfo(req *GetPwdRequest) (response *GetPwdResponse, err error) {
response = CreateGetPwdResponse()
err = c.DoAction(req, response)
return
}

View File

@ -1,21 +0,0 @@
package www
import (
"fmt"
"testing"
)
func TestClient_GetUserInfo(t *testing.T) {
c, err := NewClientWithAliAppcode("203874304", "9e5489a82dd641729186cdad166d81a3")
if err != nil {
t.Error(err)
}
req := CreateGetPwdRequest()
req.UserName = "ttom666"
resp, _ := c.GetUserInfo(req)
fmt.Println(resp.GetHttpContentString())
fmt.Println(resp.GetHttpHeaders())
}

View File

@ -1,37 +0,0 @@
package www
import (
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
)
type GetPwdRequest struct {
*requests.RpcRequest
UserName string `position:"Query" field:"user_name" default:"-" `
}
type GetPwdResponse struct {
*responses.BaseResponse
Ret int `json:"ret"`
Msg string `json:"msg"`
Data struct {
UserName string `json:"user_name"`
UserPwd string `json:"user_pwd"`
} `json:"data"`
}
func CreateGetPwdRequest() (req *GetPwdRequest) {
req = &GetPwdRequest{
RpcRequest: &requests.RpcRequest{},
}
req.InitWithApiInfo(HOST, VERSION, "/api/limit/getPwd.php")
req.Method = requests.GET
return
}
func CreateGetPwdResponse() (response *GetPwdResponse) {
response = &GetPwdResponse{
BaseResponse: &responses.BaseResponse{},
}
return
}

View File

@ -1 +0,0 @@
package www