52 lines
1.2 KiB
Go
52 lines
1.2 KiB
Go
|
package passport
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"github.com/spf13/cast"
|
||
|
_ "github.com/spf13/cast"
|
||
|
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||
|
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
||
|
)
|
||
|
|
||
|
type UpdateUserStateRequest struct {
|
||
|
*requests.RpcRequest
|
||
|
}
|
||
|
|
||
|
type UpdateUserStateResponse struct {
|
||
|
*responses.BaseResponse
|
||
|
Code int `json:"code"`
|
||
|
Msg string `json:"msg"`
|
||
|
Data struct {
|
||
|
State int `json:"state"`
|
||
|
} `json:"data"`
|
||
|
}
|
||
|
|
||
|
// CreateUpdateUserStateRequest 获取用户登录过的游戏大类
|
||
|
func CreateUpdateUserStateRequest(userName string, uid, state int) (req *UpdateUserStateRequest) {
|
||
|
ts, sign := GetSign()
|
||
|
|
||
|
req = &UpdateUserStateRequest{
|
||
|
RpcRequest: &requests.RpcRequest{},
|
||
|
}
|
||
|
req.InitWithApiInfo(HOST, VERSION, "/remote_login.php")
|
||
|
req.FormParams = map[string]string{
|
||
|
"act": "update",
|
||
|
"do": "update_user_state",
|
||
|
"user_name": userName,
|
||
|
"uid": cast.ToString(uid),
|
||
|
"state": cast.ToString(state),
|
||
|
"time": fmt.Sprintf("%v", ts),
|
||
|
"sign": sign,
|
||
|
}
|
||
|
|
||
|
req.Method = requests.POST
|
||
|
return
|
||
|
}
|
||
|
|
||
|
func CreateUpdateUserStateResponse() (response *UpdateUserStateResponse) {
|
||
|
response = &UpdateUserStateResponse{
|
||
|
BaseResponse: &responses.BaseResponse{},
|
||
|
}
|
||
|
return
|
||
|
}
|