6
0
gaore-common-sdk-go/services/chat/batch_ban_account.go
xuyang cb6b85f727 refactor(chat): 违规封禁三接口业务字段 gkey/sid 改规范名 game_sign/server_id
统一根游戏标识=game_sign、区服id=server_id(对齐DMS命名):
- BanAccountItem/ViolationChatItem: Gkey/Sid → GameSign/ServerId(json game_sign/server_id)
- RoleBanQuery: Gkey → GameSign
- 签名调用方字段 Request.Gkey(field:gkey,值=center-api)不动;chat_records(独立接口)不动
2026-07-22 17:02:25 +08:00

66 lines
2.4 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package chat
import (
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
)
// BatchBanAccountRequest 批量封用户(逐条返回结果,部分失败不影响其余)。
// 对应 chat 服务 POST /api/open/batchBanAccount验签走 form 参数 gkey/time/sign。
type BatchBanAccountRequest struct {
*requests.RpcRequest
Gkey string `position:"Body" field:"gkey"`
Time string `position:"Body" field:"time"`
Sign string `position:"Body" field:"sign"`
Items string `position:"Body" field:"items"` // JSON 数组字符串,每项 {game_sign,server_id,uid,user_name,role_id,role_name,game_id},单次最多 200 条
Banduration int64 `position:"Body" field:"banduration"` // 封禁时长(分钟),必须 >0
Banremark string `position:"Body" field:"banremark"` // 封禁备注(写入 gr_block 留痕)
OpAdmin string `position:"Body" field:"op_admin"` // 操作人(拼进备注留痕)
}
// BanAccountItem 待封角色Items 的 JSON 元素)
type BanAccountItem struct {
GameSign string `json:"game_sign"` // 根游戏标识
ServerId string `json:"server_id"` // 区服 ID
Uid int64 `json:"uid"` // 高热用户 ID
UserName string `json:"user_name"` // 高热账号
RoleId string `json:"role_id"` // 角色 ID
RoleName string `json:"role_name"` // 角色名
GameId int64 `json:"game_id"` // 子游戏 ID
}
// BanAccountResult 单条封禁结果
type BanAccountResult struct {
Uid int64 `json:"uid"`
RoleId string `json:"role_id"`
Success bool `json:"success"`
Message string `json:"message"`
}
type BatchBanAccountResponse struct {
*responses.BaseResponse
Code int `json:"code"`
Msg string `json:"msg"`
Data struct {
Results []BanAccountResult `json:"results"`
} `json:"data"`
}
// CreateBatchBanAccountRequest 组装请求并完成 open 签名key 由调用方配置传入)。
func CreateBatchBanAccountRequest(gkey, key string) (req *BatchBanAccountRequest) {
req = &BatchBanAccountRequest{
RpcRequest: &requests.RpcRequest{},
}
req.InitWithApiInfo(HOST, VERSION, "/api/open/batchBanAccount")
req.Method = requests.POST
req.Gkey, req.Time, req.Sign = signOpenApi(gkey, key)
return
}
func CreateBatchBanAccountResponse() (response *BatchBanAccountResponse) {
response = &BatchBanAccountResponse{
BaseResponse: &responses.BaseResponse{},
}
return
}