87 lines
1.9 KiB
Go
87 lines
1.9 KiB
Go
package cs
|
|
|
|
import (
|
|
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
|
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
|
)
|
|
|
|
/**
|
|
* 获取玩家(用户)相关信息
|
|
*/
|
|
|
|
// UserInfo 用户信息
|
|
type UserInfo struct {
|
|
UserName string `json:"user_name"`
|
|
Uid int64 `json:"uid"`
|
|
Telephone string `json:"telephone"`
|
|
}
|
|
|
|
type GetUserInfoRequest struct {
|
|
*requests.RpcRequest
|
|
}
|
|
|
|
type GetUserInfoResponse struct {
|
|
*responses.BaseResponse
|
|
Code int `json:"code"`
|
|
Msg string `json:"msg"`
|
|
Data UserInfo `json:"data"`
|
|
}
|
|
|
|
func CreateGetUserInfoRequest(userName string) (req *GetUserInfoRequest) {
|
|
req = &GetUserInfoRequest{
|
|
RpcRequest: &requests.RpcRequest{},
|
|
}
|
|
req.InitWithApiInfo(HOST, VERSION, "/v1/user/info")
|
|
|
|
req.FormParams = map[string]string{
|
|
"user_name": userName,
|
|
}
|
|
|
|
req.Method = requests.POST
|
|
return
|
|
}
|
|
|
|
func CreateGetUserInfoResponse() (response *GetUserInfoResponse) {
|
|
response = &GetUserInfoResponse{
|
|
BaseResponse: &responses.BaseResponse{},
|
|
}
|
|
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
|
|
}
|