58 lines
2.2 KiB
Go
58 lines
2.2 KiB
Go
|
|
package game
|
|||
|
|
|
|||
|
|
import (
|
|||
|
|
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
|||
|
|
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
// GetKfUrlReq 获取客服页面链接请求
|
|||
|
|
//
|
|||
|
|
// 该接口为纯透传:game.gaore.com 只负责补 timestamp、算 sign、拼 URL,
|
|||
|
|
// 业务参数(根游戏 ID、uid 等)由调用方自行准备。
|
|||
|
|
//
|
|||
|
|
// 字段类型说明:除必填且恒非零的 GameId 外,其余字段一律用 string。
|
|||
|
|
// 原因是 addParam 仅在 len(value) > 0 时下发参数,string 空值会被自动跳过;
|
|||
|
|
// 若用 int64,零值会被格式化成 "0" 照样下发,既产生 role_id=0 之类噪声,
|
|||
|
|
// 也会让游客场景错误地带上 uid=0。
|
|||
|
|
type GetKfUrlReq struct {
|
|||
|
|
*requests.JsonRequest
|
|||
|
|
GameId int64 `position:"Json" field:"game_id"` // 根游戏 ID,必填
|
|||
|
|
Uid string `position:"Json" field:"uid"` // 贪玩账号 uid;游客留空,不下传
|
|||
|
|
UserName string `position:"Json" field:"username"` // 贪玩账号名
|
|||
|
|
MainGameId string `position:"Json" field:"main_game_id"` // 主包游戏 ID
|
|||
|
|
SubGameId string `position:"Json" field:"sub_game_id"` // 子包游戏 ID
|
|||
|
|
ServerId string `position:"Json" field:"server_id"` // 区服 ID
|
|||
|
|
ServerName string `position:"Json" field:"server_name"` // 区服名称
|
|||
|
|
RoleId string `position:"Json" field:"role_id"` // 角色 ID
|
|||
|
|
RoleName string `position:"Json" field:"role_name"` // 角色名称
|
|||
|
|
From string `position:"Json" field:"from"` // 来源:pc / h5 / ios / android / mini_program
|
|||
|
|
Navbar string `position:"Json" field:"navbar"` // 传 "1" 显示返回按钮,默认不显示
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// GetKfUrlRespData 客服链接,有效期 12 小时,调用方不得缓存
|
|||
|
|
type GetKfUrlRespData struct {
|
|||
|
|
KfUrl string `json:"kf_url"`
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
type GetKfUrlResp struct {
|
|||
|
|
*responses.BaseResponse
|
|||
|
|
Code int `json:"code"`
|
|||
|
|
Msg string `json:"msg"`
|
|||
|
|
Data GetKfUrlRespData `json:"data"`
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
func CreateGetKfUrlReq() *GetKfUrlReq {
|
|||
|
|
req := &GetKfUrlReq{
|
|||
|
|
JsonRequest: &requests.JsonRequest{},
|
|||
|
|
}
|
|||
|
|
req.InitWithApiInfo(HOST, VERSION, "/api/game/getKfUrl")
|
|||
|
|
req.Method = requests.POST
|
|||
|
|
return req
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
func CreateGetKfUrlResp() *GetKfUrlResp {
|
|||
|
|
return &GetKfUrlResp{
|
|||
|
|
BaseResponse: &responses.BaseResponse{},
|
|||
|
|
}
|
|||
|
|
}
|