diff --git a/services/asdk/client.go b/services/asdk/client.go index ebdedef..e391662 100644 --- a/services/asdk/client.go +++ b/services/asdk/client.go @@ -2,11 +2,12 @@ package asdk import ( "fmt" + "time" + "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" ) const ( @@ -68,3 +69,10 @@ func (c *Client) GetLastLoginGame(req *LastLoginGameReq) (resp *LastLoginGameRes err = c.DoAction(req, resp) return } + +// Cancellation 销号 +func (c *Client) Cancellation(req *CancellationReq) (resp *CancellationResp, err error) { + resp = CreateCancellationResp() + err = c.DoAction(req, resp) + return +} diff --git a/services/asdk/inner_api.go b/services/asdk/inner_api.go index cbf5306..e6700ac 100644 --- a/services/asdk/inner_api.go +++ b/services/asdk/inner_api.go @@ -1,9 +1,11 @@ package asdk import ( + "strconv" + + "github.com/spf13/cast" "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests" "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses" - "strconv" ) type KickUserReq struct { @@ -43,3 +45,47 @@ func CreateKickUserResp() *KickUserResp { BaseResponse: &responses.BaseResponse{}, } } + +// 销号 + +type CancellationReq struct { + *requests.RpcRequest +} + +type CancellationResp struct { + *responses.BaseResponse + Code int `json:"code"` + Msg string `json:"msg"` + Data struct{} `json:"data"` + TraceId string `json:"trace_id"` +} +type CancellationParam struct { + UserName string // 玩家名 + Delay int64 // 冷静期时长 + Operator string // 玩家名 + Phone string // 手机号 + Remark string // 备注 +} + +func CreateCancellationReq(data CancellationParam) *CancellationReq { + req := &CancellationReq{ + &requests.RpcRequest{}, + } + + req.InitWithApiInfo(HOST, VERSION, "/api/kick") + req.Method = requests.GET + req.QueryParams = map[string]string{ + "user_name": data.UserName, + "delay": cast.ToString(data.Delay), + "operator": data.Operator, + "phone": data.Phone, + "remark": data.Remark, + } + return req +} + +func CreateCancellationResp() *CancellationResp { + return &CancellationResp{ + BaseResponse: &responses.BaseResponse{}, + } +}