45 lines
1.1 KiB
Go
45 lines
1.1 KiB
Go
|
|
package web
|
|||
|
|
|
|||
|
|
import (
|
|||
|
|
"fmt"
|
|||
|
|
|
|||
|
|
"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"
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
// forceOutSignKey 老综合后台业务层计算 sign 用的固定盐
|
|||
|
|
const forceOutSignKey = "user_session_20220505"
|
|||
|
|
|
|||
|
|
type ForceOutReq struct {
|
|||
|
|
*requests.RpcRequest
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
type ForceOutResp struct {
|
|||
|
|
*responses.BaseResponse
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// CreateForceOutReq 创建官网强制下线请求
|
|||
|
|
// POST web.gaore.com/web/users/force_out,sign=md5(user_name+time+"user_session_20220505")
|
|||
|
|
func CreateForceOutReq(userName string, ts int64) *ForceOutReq {
|
|||
|
|
sign := utils.Md5(fmt.Sprintf("%s%d%s", userName, ts, forceOutSignKey))
|
|||
|
|
|
|||
|
|
req := &ForceOutReq{
|
|||
|
|
RpcRequest: &requests.RpcRequest{},
|
|||
|
|
}
|
|||
|
|
req.InitWithApiInfo(HOST, VERSION, "/web/users/force_out")
|
|||
|
|
req.FormParams = map[string]string{
|
|||
|
|
"user_name": userName,
|
|||
|
|
"time": fmt.Sprintf("%d", ts),
|
|||
|
|
"sign": sign,
|
|||
|
|
}
|
|||
|
|
req.Method = requests.POST
|
|||
|
|
return req
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
func CreateForceOutResp() *ForceOutResp {
|
|||
|
|
return &ForceOutResp{
|
|||
|
|
BaseResponse: &responses.BaseResponse{},
|
|||
|
|
}
|
|||
|
|
}
|