Compare commits
No commits in common. "607dbc87c6d972e906f5672544e1c9cfba578b19" and "b282de0a2f0df87b7d7a3a80efc90199fde0b18d" have entirely different histories.
607dbc87c6
...
b282de0a2f
@ -34,21 +34,3 @@ func (client *Client) GetUserInfo(req *GetUserInfoRequest) (resp *GetUserInfoRes
|
|||||||
err = client.DoAction(req, resp)
|
err = client.DoAction(req, resp)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (client *Client) GetCsUserRoleList(req *GetUserRoleListRequest) (resp *GetUserRoleListResponse, err error) {
|
|
||||||
resp = CreateGetUserRoleListResponse()
|
|
||||||
err = client.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (client *Client) GetUserServerList(req *GetUserServerListRequest) (resp *GetUserServerListResponse, err error) {
|
|
||||||
resp = CreateGetUserServerListResponse()
|
|
||||||
err = client.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (client *Client) SendSmsCode(req *SendSmsRequest) (resp *SendSmsResponse, err error) {
|
|
||||||
resp = CreateSendSmsResponse()
|
|
||||||
err = client.DoAction(req, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
@ -41,65 +41,3 @@ func TestGetUserInfo(t *testing.T) {
|
|||||||
|
|
||||||
fmt.Printf(fmt.Sprintf("%v", info))
|
fmt.Printf(fmt.Sprintf("%v", info))
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取玩家角色列表
|
|
||||||
func TestGetUserRoleList(t *testing.T) {
|
|
||||||
client, newErr := NewClient()
|
|
||||||
if newErr != nil {
|
|
||||||
panic(newErr)
|
|
||||||
}
|
|
||||||
req := CreateGetUserRoleListRequest(int64(63610626), int64(2850))
|
|
||||||
info, err := client.GetCsUserRoleList(req)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if info.Code != 0 {
|
|
||||||
t.Error("获取玩家角色列表失败")
|
|
||||||
fmt.Printf(fmt.Sprintf("%v", info))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
fmt.Printf(fmt.Sprintf("%v", info))
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取玩家区服列表
|
|
||||||
func TestGetUserServerList(t *testing.T) {
|
|
||||||
client, newErr := NewClient()
|
|
||||||
if newErr != nil {
|
|
||||||
panic(newErr)
|
|
||||||
}
|
|
||||||
req := CreateGetUserServerListRequest(int64(63610626), int64(2850))
|
|
||||||
info, err := client.GetUserServerList(req)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if info.Code != 0 {
|
|
||||||
t.Error("获取玩家区服列表失败")
|
|
||||||
fmt.Printf(fmt.Sprintf("%v", info))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
fmt.Printf(fmt.Sprintf("%v", info))
|
|
||||||
}
|
|
||||||
|
|
||||||
// 给玩家发送短信
|
|
||||||
func TestSendSms(t *testing.T) {
|
|
||||||
client, newErr := NewClient()
|
|
||||||
if newErr != nil {
|
|
||||||
panic(newErr)
|
|
||||||
}
|
|
||||||
req := CreateSendSmsRequest(SendSmsReq{
|
|
||||||
Phone: "13725263463",
|
|
||||||
})
|
|
||||||
info, err := client.SendSmsCode(req)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if info.Code != 0 {
|
|
||||||
t.Error("给玩家发送短信失败")
|
|
||||||
fmt.Printf(fmt.Sprintf("%v", info))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
fmt.Printf(fmt.Sprintf("%v", info))
|
|
||||||
}
|
|
||||||
|
@ -47,109 +47,3 @@ func CreateGetUserInfoResponse() (response *GetUserInfoResponse) {
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// UserRoleInfo 玩家角色信息
|
|
||||||
type UserRoleInfo struct {
|
|
||||||
Uid int64 `json:"uid"`
|
|
||||||
RoleName string `json:"role_name"`
|
|
||||||
RoleId string `json:"role_id"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetUserRoleListRequest struct {
|
|
||||||
*requests.JsonRequest
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetUserRoleListResponse struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
Data []UserRoleInfo `json:"data"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateGetUserRoleListRequest(uId int64, gameId int64) (req *GetUserRoleListRequest) {
|
|
||||||
req = &GetUserRoleListRequest{
|
|
||||||
JsonRequest: &requests.JsonRequest{},
|
|
||||||
}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/v1/user/role_list")
|
|
||||||
|
|
||||||
req.JsonParams["uid"] = uId
|
|
||||||
req.JsonParams["game_id"] = gameId
|
|
||||||
|
|
||||||
req.Method = requests.POST
|
|
||||||
return
|
|
||||||
}
|
|
||||||
func CreateGetUserRoleListResponse() (response *GetUserRoleListResponse) {
|
|
||||||
response = &GetUserRoleListResponse{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// UserServerInfo 玩家区服信息
|
|
||||||
type UserServerInfo struct {
|
|
||||||
ServerName string `json:"server_name"`
|
|
||||||
}
|
|
||||||
type GetUserServerListRequest struct {
|
|
||||||
*requests.JsonRequest
|
|
||||||
}
|
|
||||||
type GetUserServerListResponse struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
Data []UserServerInfo `json:"data"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateGetUserServerListRequest(uId int64, gameId int64) (req *GetUserServerListRequest) {
|
|
||||||
req = &GetUserServerListRequest{
|
|
||||||
JsonRequest: &requests.JsonRequest{},
|
|
||||||
}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/v1/user/server_list")
|
|
||||||
|
|
||||||
req.JsonParams["uid"] = uId
|
|
||||||
req.JsonParams["game_id"] = gameId
|
|
||||||
|
|
||||||
req.Method = requests.POST
|
|
||||||
return
|
|
||||||
}
|
|
||||||
func CreateGetUserServerListResponse() (response *GetUserServerListResponse) {
|
|
||||||
response = &GetUserServerListResponse{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
type SendSmsReq struct {
|
|
||||||
Phone string `json:"phone"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// SendSmsResp 发送短信返回
|
|
||||||
type SendSmsResp struct {
|
|
||||||
// 短信发送时间戳,工单模块 有效期5分钟
|
|
||||||
SendCodeTime int64 `json:"send_code_time"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type SendSmsRequest struct {
|
|
||||||
*requests.JsonRequest
|
|
||||||
}
|
|
||||||
type SendSmsResponse struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
Data SendSmsResp `json:"data"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateSendSmsRequest(param SendSmsReq) (req *SendSmsRequest) {
|
|
||||||
req = &SendSmsRequest{
|
|
||||||
JsonRequest: &requests.JsonRequest{},
|
|
||||||
}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/v1/user/send_sms")
|
|
||||||
req.JsonParams["phone"] = param.Phone
|
|
||||||
req.Method = requests.POST
|
|
||||||
return
|
|
||||||
}
|
|
||||||
func CreateSendSmsResponse() (response *SendSmsResponse) {
|
|
||||||
response = &SendSmsResponse{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user