58 lines
1.7 KiB
Go
58 lines
1.7 KiB
Go
package chat
|
||
|
||
import (
|
||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk"
|
||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||
)
|
||
|
||
const (
|
||
VERSION = "2026-07-17"
|
||
)
|
||
|
||
// HOST chat 服务主机键,解析为 chat.gaore.com(sdk 自动补 .gaore.com 后缀)。
|
||
var HOST = requests.Host{
|
||
Default: "chat",
|
||
}
|
||
|
||
type Client struct {
|
||
sdk.Client
|
||
}
|
||
|
||
func NewClient() (client *Client, err error) {
|
||
client = new(Client)
|
||
err = client.Init()
|
||
return
|
||
}
|
||
|
||
// QueryChatRecords 查询聊天记录(ES 原样返回,不做二次装配)。
|
||
// 对应 chat 服务 POST /api/internal/chatRecords。
|
||
func (c *Client) QueryChatRecords(req *QueryChatRecordsRequest) (resp *QueryChatRecordsResponse, err error) {
|
||
resp = CreateQueryChatRecordsResponse()
|
||
err = c.DoAction(req, resp)
|
||
return
|
||
}
|
||
|
||
// ViolationChatList 违规聊天列表(仅 decision=BLOCK,分页)。
|
||
// 对应 chat 服务 POST /api/open/violationChatList。
|
||
func (c *Client) ViolationChatList(req *ViolationChatListRequest) (resp *ViolationChatListResponse, err error) {
|
||
resp = CreateViolationChatListResponse()
|
||
err = c.DoAction(req, resp)
|
||
return
|
||
}
|
||
|
||
// BatchBanAccount 批量封用户(逐条返回结果)。
|
||
// 对应 chat 服务 POST /api/open/batchBanAccount。
|
||
func (c *Client) BatchBanAccount(req *BatchBanAccountRequest) (resp *BatchBanAccountResponse, err error) {
|
||
resp = CreateBatchBanAccountResponse()
|
||
err = c.DoAction(req, resp)
|
||
return
|
||
}
|
||
|
||
// RoleBanStatus 角色封号/禁言状态查询(1=正常 2=封禁/禁言)。
|
||
// 对应 chat 服务 POST /api/open/roleBanStatus。
|
||
func (c *Client) RoleBanStatus(req *RoleBanStatusRequest) (resp *RoleBanStatusResponse, err error) {
|
||
resp = CreateRoleBanStatusResponse()
|
||
err = c.DoAction(req, resp)
|
||
return
|
||
}
|