Files
customer-server/model/dto/speechcraft_dto.go
2026-03-14 10:02:49 +08:00

102 lines
5.0 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 dto - 话术DTO
// 功能:话术的增删改查、绑定/解绑客服账号的请求响应结构体
package dto
import (
"customer-server/model/entity"
"gitea.com/red-future/common/beans"
"github.com/gogf/gf/v2/frame/g"
)
// AddSpeechcraftReq 添加话术
type AddSpeechcraftReq struct {
g.Meta `path:"/add" method:"post" tags:"话术管理" summary:"添加话术" dc:"创建新的客服话术模板"` // 路由: POST /speechcraft/add
Tag string `json:"tag" v:"required"` // 标签
Content string `json:"content" v:"required"` // 内容
Direction string `json:"direction"` // 咨询方向(气血、减肥、护肤等)
AccountName string `json:"accountName,omitempty"` // 客服账号名称可选用于绕过gateway时查询tenantId
TenantId interface{} `json:"tenantId,omitempty"` // 租户ID可选不传则使用默认值1
// 状态机字段
Stage int `json:"stage"` // 触发阶段0=初始)
Status string `json:"status"` // 触发行为click/keyword/空=任意)
Keywords []string `json:"keywords"` // 触发关键字(空=任意)
NextStage int `json:"nextStage"` // 下一阶段(-1=结束)
Platform string `json:"platform"` // 平台xiaohongshu
}
type AddSpeechcraftRes struct {
Id string `json:"id"`
}
// UpdateSpeechcraftReq 更新话术
type UpdateSpeechcraftReq struct {
g.Meta `path:"/update" method:"post" tags:"话术管理" summary:"更新话术" dc:"更新话术模板内容"` // 路由: POST /speechcraft/update
Id string `json:"id" v:"required"` // ID
Tag string `json:"tag"` // 标签
Content string `json:"content"` // 内容
// 状态机字段
Stage *int `json:"stage"` // 触发阶段
Status *string `json:"status"` // 触发行为
Keywords []string `json:"keywords"` // 触发关键字
NextStage *int `json:"nextStage"` // 下一阶段
Platform *string `json:"platform"` // 平台
}
// DeleteSpeechcraftReq 删除话术
type DeleteSpeechcraftReq struct {
g.Meta `path:"/delete" method:"post" tags:"话术管理" summary:"删除话术" dc:"删除指定话术模板"` // 路由: POST /speechcraft/delete
Id string `json:"id" v:"required"` // ID
}
// GetSpeechcraftReq 获取单个话术
type GetSpeechcraftReq struct {
g.Meta `path:"/one" method:"get" tags:"话术管理" summary:"获取话术详情" dc:"根据ID获取单个话术模板"` // 路由: GET /speechcraft/one
Id string `json:"id" v:"required"` // ID
}
// ListSpeechcraftReq 获取话术列表
type ListSpeechcraftReq struct {
g.Meta `path:"/list" method:"get" tags:"话术管理" summary:"获取话术列表" dc:"分页查询话术模板,支持按标签、内容筛选"` // 路由: GET /speechcraft/list
beans.Page
Tag string `json:"tag"` // 筛选:标签
Content string `json:"content"` // 筛选:内容
Stage *int `json:"stage"` // 筛选:阶段
Platform string `json:"platform"` // 筛选:平台
}
type ListSpeechcraftRes struct {
List []*entity.Speechcraft `json:"list"`
Total int `json:"total"`
}
// BindSpeechcraftReq 绑定话术到客服账号请求
type BindSpeechcraftReq struct {
g.Meta `path:"/bind" method:"post" tags:"话术管理" summary:"绑定话术" dc:"将话术绑定到客服账号"`
SpeechcraftId string `json:"speechcraftId" v:"required#话术ID不能为空"`
AccountNames []string `json:"accountNames" v:"required#客服账号名称列表不能为空"`
}
// BindSpeechcraftRes 绑定话术响应
type BindSpeechcraftRes struct {
SuccessCount int `json:"successCount"` // 成功绑定数量
AlreadyBound []string `json:"alreadyBound"` // 已绑定的客服账号ID
NotFound []string `json:"notFound"` // 不存在的客服账号ID
Message string `json:"message"` // 提示信息
}
// UnbindSpeechcraftReq 解绑话术请求
type UnbindSpeechcraftReq struct {
g.Meta `path:"/unbind" method:"post" tags:"话术管理" summary:"解绑话术" dc:"将话术从客服账号解绑"`
SpeechcraftId string `json:"speechcraftId" v:"required#话术ID不能为空"`
AccountName string `json:"accountName" v:"required#客服账号名称不能为空"`
}
// UnbindSpeechcraftRes 解绑话术响应
type UnbindSpeechcraftRes struct {
Success bool `json:"success"`
Message string `json:"message"`
}