Files
customer-server/model/dto/customer_service_account_dto.go

108 lines
7.1 KiB
Go
Raw Normal View History

2026-03-14 10:02:49 +08:00
package dto
import (
"customer-server/model/entity"
"gitea.com/red-future/common/beans"
"github.com/gogf/gf/v2/frame/g"
)
// AddCustomerServiceAccountReq 添加客服账号
type AddCustomerServiceAccountReq struct {
g.Meta `path:"/add" method:"post" tags:"客服账号管理" summary:"添加客服账号" dc:"创建新的客服账号"` // 路由: POST /customerserviceaccount/add
AccountName string `json:"accountName" v:"required" dc:"客服账号名称" example:"cs_xhs_qixue"`
Platform string `json:"platform" v:"required" dc:"客服平台" example:"小红书"`
Prompt *string `json:"prompt" dc:"可选:自定义提示词"`
Greeting *string `json:"greeting" dc:"可选:开场白"`
SelfIdentity *string `json:"selfIdentity" dc:"可选AI身份描述"`
SpeechcraftIds []string `json:"speechcraftIds" dc:"绑定的话术ID列表为空则绑定该租户下所有话术"`
TenantId interface{} `json:"tenantId" dc:"租户ID可选不传则使用session中的租户ID"`
}
type AddCustomerServiceAccountRes struct {
Id string `json:"id" dc:"新创建的客服账号ID"`
}
// UpdateCustomerServiceAccountReq 更新客服账号
type UpdateCustomerServiceAccountReq struct {
g.Meta `path:"/update" method:"post" tags:"客服账号管理" summary:"更新客服账号" dc:"更新客服账号信息"` // 路由: POST /customerserviceaccount/update
Id string `json:"id" v:"required" dc:"客服账号ID"`
AccountName string `json:"accountName" dc:"客服账号名称"`
Platform string `json:"platform" dc:"客服平台"`
Prompt *string `json:"prompt" dc:"自定义提示词(可选)"`
Greeting *string `json:"greeting" dc:"开场白(可选)"`
SelfIdentity *string `json:"selfIdentity" dc:"AI身份描述可选"`
}
// ToggleCustomerServiceAccountStatusReq 切换客服账号状态(启用/禁用)
type ToggleCustomerServiceAccountStatusReq struct {
g.Meta `path:"/toggleStatus" method:"post" tags:"客服账号管理" summary:"切换客服账号状态" dc:"根据当前状态在启用/禁用之间切换客服账号"` // 路由: POST /customerserviceaccount/toggleStatus
Id string `json:"id" v:"required" dc:"客服账号ID"`
}
// GetCustomerServiceAccountReq 获取客服账号详情
type GetCustomerServiceAccountReq struct {
g.Meta `path:"/one" method:"get" tags:"客服账号管理" summary:"获取客服账号详情" dc:"根据ID获取单个客服账号信息"` // 路由: GET /customerserviceaccount/one
Id string `json:"id" v:"required" dc:"客服账号ID"`
}
// ListCustomerServiceAccountReq 获取客服账号列表
type ListCustomerServiceAccountReq struct {
g.Meta `path:"/list" method:"get" tags:"客服账号管理" summary:"获取客服账号列表" dc:"分页查询客服账号列表,支持多条件筛选"` // 路由: GET /customerserviceaccount/list
beans.Page
AccountName string `json:"accountName" dc:"客服账号名称"`
IsDisabled *bool `json:"isDisabled" dc:"筛选是否禁用true-禁用false-启用)"`
Platform string `json:"platform" dc:"筛选:平台"`
}
// RecreateRAGFlowConfigReq 重新创建RAGFlow配置
type RecreateRAGFlowConfigReq struct {
g.Meta `path:"/recreateRAGFlow" method:"post" tags:"客服账号管理" summary:"重新创建RAGFlow配置" dc:"为已存在的客服账号重新创建RAGFlow知识库和Chat配置"` // 路由: POST /customerserviceaccount/recreateRAGFlow
AccountName string `json:"accountName" v:"required" dc:"客服账号名称" example:"cs_xhs_qixue"`
Platform string `json:"platform" v:"required" dc:"客服平台" example:"xiaohongshu"`
}
// UpdateGreetingReq 更新开场白
type UpdateGreetingReq struct {
g.Meta `path:"/updateGreeting" method:"post" tags:"客服账号管理" summary:"更新开场白" dc:"更新客服账号的WebSocket连接开场白"` // 路由: POST /customerserviceaccount/updateGreeting
AccountName string `json:"accountName" v:"required" dc:"客服账号名称" example:"cs_xhs_qixue"`
Greeting string `json:"greeting" v:"required" dc:"开场白内容" example:"亲爱的,欢迎光临!🌸\n如果你有月经不调或气血不足的问题随时可以问我哦"`
}
type ListCustomerServiceAccountRes struct {
List []*entity.CustomerServiceAccount `json:"list" dc:"客服账号列表"`
Total int `json:"total" dc:"总记录数"`
}
// DeleteCustomerServiceAccountReq 删除客服账号
type DeleteCustomerServiceAccountReq struct {
g.Meta `path:"/delete" method:"post" tags:"客服账号管理" summary:"删除客服账号" dc:"软删除客服账号同时删除RAGFlow Chat实例"`
Id string `json:"id" v:"required" dc:"客服账号ID"`
}
type DeleteCustomerServiceAccountRes struct {
Success bool `json:"success" dc:"是否成功"`
Message string `json:"message" dc:"提示信息"`
}
// GetAccessibleSpeechcraftsReq 获取客服账号可访问的话术列表
type GetAccessibleSpeechcraftsReq struct {
g.Meta `path:"/speechcrafts/:accountName" method:"get" tags:"客服账号管理" summary:"获取可访问话术" dc:"获取客服账号可访问的话术列表(动态权限)"`
AccountName string `json:"accountName" v:"required" dc:"客服账号名称"`
}
type GetAccessibleSpeechcraftsRes struct {
Speechcrafts []SpeechcraftItem `json:"speechcrafts" dc:"话术列表"`
TotalCount int `json:"totalCount" dc:"总数"`
Permission string `json:"permission" dc:"权限类型dynamic=所有话术specified=指定话术"`
}
type SpeechcraftItem struct {
Id string `json:"id"`
Tag string `json:"tag"`
Content string `json:"content"`
Direction string `json:"direction"`
Platform string `json:"platform"`
Keywords []string `json:"keywords"`
}