Compare commits
No commits in common. "41056c6039ebeca02bea0dd671bc1dc3ab7ff417" and "1744de3d86ae8f10f3f55bf82bdffa4a69e8ef91" have entirely different histories.
41056c6039
...
1744de3d86
@ -1,34 +0,0 @@
|
||||
package asdk
|
||||
|
||||
import (
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
||||
)
|
||||
|
||||
type AuthReq struct {
|
||||
*requests.RpcRequest
|
||||
}
|
||||
|
||||
type AuthResp struct {
|
||||
*responses.BaseResponse
|
||||
Code int `json:"code"`
|
||||
Msg string `json:"msg"`
|
||||
Data struct {
|
||||
Uid int64 `json:"uid"`
|
||||
UserName string `json:"user_name"`
|
||||
} `json:"data"`
|
||||
TraceId string `json:"trace_id"`
|
||||
}
|
||||
|
||||
func CreateAuthReq(token string) *AuthReq {
|
||||
req := &AuthReq{
|
||||
RpcRequest: &requests.RpcRequest{},
|
||||
}
|
||||
|
||||
req.InitWithApiInfo(HOST, VERSION, "/api/auth")
|
||||
req.Method = requests.POST
|
||||
req.FormParams = map[string]string{
|
||||
"token": token,
|
||||
}
|
||||
return req
|
||||
}
|
||||
@ -4,7 +4,6 @@ import (
|
||||
"fmt"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/utils"
|
||||
"time"
|
||||
)
|
||||
@ -46,11 +45,3 @@ func (c *Client) CreateKickUserReq(req *KickUserReq) (resp *KickUserResp, err er
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (c *Client) Auth(req *AuthReq) (resp *AuthResp, err error) {
|
||||
resp = &AuthResp{
|
||||
BaseResponse: &responses.BaseResponse{},
|
||||
}
|
||||
err = c.DoAction(req, resp)
|
||||
return
|
||||
}
|
||||
|
||||
@ -24,15 +24,3 @@ func TestKickUser(t *testing.T) {
|
||||
}
|
||||
fmt.Println(resp.Code, resp.Msg, resp.Data)
|
||||
}
|
||||
|
||||
func TestAuth(t *testing.T) {
|
||||
client, err := NewClient()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
resp, err := client.Auth(CreateAuthReq("t1w6rnlqxlYeSM3wAqVRljKDGVSTr9th"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Log(resp)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user