From cb6b85f727f89e5df6a45e0be7a921a48e28edea Mon Sep 17 00:00:00 2001 From: xuyang Date: Wed, 22 Jul 2026 17:02:25 +0800 Subject: [PATCH] =?UTF-8?q?refactor(chat):=20=E8=BF=9D=E8=A7=84=E5=B0=81?= =?UTF-8?q?=E7=A6=81=E4=B8=89=E6=8E=A5=E5=8F=A3=E4=B8=9A=E5=8A=A1=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=20gkey/sid=20=E6=94=B9=E8=A7=84=E8=8C=83=E5=90=8D=20g?= =?UTF-8?q?ame=5Fsign/server=5Fid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 统一根游戏标识=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(独立接口)不动 --- services/chat/batch_ban_account.go | 6 +++--- services/chat/role_ban_status.go | 6 +++--- services/chat/violation_chat_list.go | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/services/chat/batch_ban_account.go b/services/chat/batch_ban_account.go index 6d5420c..fe802f8 100644 --- a/services/chat/batch_ban_account.go +++ b/services/chat/batch_ban_account.go @@ -12,7 +12,7 @@ type BatchBanAccountRequest struct { 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 数组字符串,每项 {gkey,sid,uid,user_name,role_id,role_name,game_id},单次最多 200 条 + 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"` // 操作人(拼进备注留痕) @@ -20,8 +20,8 @@ type BatchBanAccountRequest struct { // BanAccountItem 待封角色(Items 的 JSON 元素) type BanAccountItem struct { - Gkey string `json:"gkey"` // 游戏标识 - Sid string `json:"sid"` // 区服 ID + 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 diff --git a/services/chat/role_ban_status.go b/services/chat/role_ban_status.go index cd2ab71..99619a2 100644 --- a/services/chat/role_ban_status.go +++ b/services/chat/role_ban_status.go @@ -12,13 +12,13 @@ type RoleBanStatusRequest struct { Gkey string `position:"Body" field:"gkey"` Time string `position:"Body" field:"time"` Sign string `position:"Body" field:"sign"` - Roles string `position:"Body" field:"roles"` // JSON 数组字符串,每项 {gkey,role_id},单次最多 500 条 + Roles string `position:"Body" field:"roles"` // JSON 数组字符串,每项 {game_sign,role_id},单次最多 500 条 } // RoleBanQuery 待查角色(Roles 的 JSON 元素) type RoleBanQuery struct { - Gkey string `json:"gkey"` // 游戏标识 - RoleId string `json:"role_id"` // 角色 ID + GameSign string `json:"game_sign"` // 根游戏标识 + RoleId string `json:"role_id"` // 角色 ID } // RoleBanStatusItem 单角色状态(1=正常 2=封禁/禁言) diff --git a/services/chat/violation_chat_list.go b/services/chat/violation_chat_list.go index 9d30de7..433a51f 100644 --- a/services/chat/violation_chat_list.go +++ b/services/chat/violation_chat_list.go @@ -26,8 +26,8 @@ type ViolationChatItem struct { Roleid string `json:"roleid"` // 角色 ID Uname string `json:"uname"` // 角色名 Content string `json:"content"` // 聊天内容 - Gkey string `json:"gkey"` // 游戏标识 - Sid string `json:"sid"` // 区服 + GameSign string `json:"game_sign"` // 根游戏标识 + ServerId string `json:"server_id"` // 区服 Type int64 `json:"type"` // 消息类型 ChatTime string `json:"chat_time"` // 聊天时间 Y-m-d H:i:s Imei string `json:"imei"` // 设备号