1
This commit is contained in:
13
model/dto/archive_dto.go
Normal file
13
model/dto/archive_dto.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package dto
|
||||
|
||||
import "github.com/gogf/gf/v2/frame/g"
|
||||
|
||||
// ArchiveRunReq 手动触发归档请求
|
||||
type ArchiveRunReq struct {
|
||||
g.Meta `path:"/run" method:"post" tags:"归档管理" summary:"手动触发归档" dc:"立即执行月度归档任务"`
|
||||
}
|
||||
|
||||
// ArchiveRunRes 手动触发归档响应
|
||||
type ArchiveRunRes struct {
|
||||
Message string `json:"message"` // 执行结果消息
|
||||
}
|
||||
107
model/dto/customer_service_account_dto.go
Normal file
107
model/dto/customer_service_account_dto.go
Normal file
@@ -0,0 +1,107 @@
|
||||
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"`
|
||||
}
|
||||
74
model/dto/data_dto.go
Normal file
74
model/dto/data_dto.go
Normal file
@@ -0,0 +1,74 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"customer-server/model/entity"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// AddDataReq 添加数据
|
||||
type AddDataReq struct {
|
||||
g.Meta `path:"/add" method:"post" tags:"数据管理" summary:"添加数据" dc:"记录客服与客户的交互数据"` // 路由: POST /data/add
|
||||
CustomerId string `json:"customerId" v:"required"` // 客户ID
|
||||
AccountName string `json:"accountName" v:"required"` // 客服账号名称
|
||||
CustomerServicePlatform string `json:"customerServicePlatform" v:"required"` // 客服平台
|
||||
CustomerServiceName string `json:"customerServiceName" v:"required"` // 客服名称
|
||||
IsInbound bool `json:"isInbound"` // 是否进线
|
||||
IsActive bool `json:"isActive"` // 是否活跃
|
||||
IsServed bool `json:"isServed"` // 是否接待
|
||||
HasSentContactCard bool `json:"hasSentContactCard"` // 是否发联系卡
|
||||
HasSentNameCard bool `json:"hasSentNameCard"` // 是否发名片
|
||||
HasLeftContactInfo bool `json:"hasLeftContactInfo"` // 是否留资
|
||||
SessionStartTime int64 `json:"sessionStartTime"` // 会话开始时间
|
||||
MessageTime int64 `json:"messageTime"` // 消息时间
|
||||
}
|
||||
|
||||
type AddDataRes struct {
|
||||
Id string `json:"id"`
|
||||
}
|
||||
|
||||
// UpdateDataReq 更新数据
|
||||
type UpdateDataReq struct {
|
||||
g.Meta `path:"/update" method:"post" tags:"数据管理" summary:"更新数据" dc:"更新客服交互数据"` // 路由: POST /data/update
|
||||
Id string `json:"id" v:"required"` // ID
|
||||
CustomerId string `json:"customerId"`
|
||||
AccountName string `json:"accountName"`
|
||||
CustomerServicePlatform string `json:"customerServicePlatform"`
|
||||
CustomerServiceName string `json:"customerServiceName"`
|
||||
IsInbound *bool `json:"isInbound"` // 使用指针以区分 false 和未传值
|
||||
IsActive *bool `json:"isActive"`
|
||||
IsServed *bool `json:"isServed"`
|
||||
HasSentContactCard *bool `json:"hasSentContactCard"`
|
||||
HasSentNameCard *bool `json:"hasSentNameCard"`
|
||||
HasLeftContactInfo *bool `json:"hasLeftContactInfo"`
|
||||
SessionStartTime int64 `json:"sessionStartTime"`
|
||||
MessageTime int64 `json:"messageTime"`
|
||||
}
|
||||
|
||||
// // DeleteDataReq 删除数据
|
||||
// type DeleteDataReq struct {
|
||||
// g.Meta `path:"/delete" method:"post" tags:"数据管理" summary:"删除数据" dc:"删除指定数据记录"` // 路由: POST /data/delete
|
||||
// Id string `json:"id" v:"required"` // ID
|
||||
// }
|
||||
|
||||
// GetDataReq 获取单个数据
|
||||
type GetDataReq struct {
|
||||
g.Meta `path:"/one" method:"get" tags:"数据管理" summary:"获取数据详情" dc:"根据ID获取单条数据记录"` // 路由: GET /data/one
|
||||
Id string `json:"id" v:"required"` // ID
|
||||
}
|
||||
|
||||
// ListDataReq 获取数据列表
|
||||
type ListDataReq struct {
|
||||
g.Meta `path:"/list" method:"get" tags:"数据管理" summary:"获取数据列表" dc:"分页查询交互数据,支持按客户、客服、时间筛选"` // 路由: GET /data/list
|
||||
beans.Page
|
||||
CustomerId string `json:"customerId" p:"customerId" dc:"筛选:客户ID"` // 筛选:客户ID
|
||||
AccountName *string `json:"accountName" dc:"客服账号名称"` // 筛选:客服ID
|
||||
StartDate string `json:"startDate" p:"startDate" dc:"筛选:开始日期(YYYY-MM-DD)"` // 筛选:开始日期
|
||||
EndDate string `json:"endDate" p:"endDate" dc:"筛选:结束日期(YYYY-MM-DD)"` // 筛选:结束日期
|
||||
}
|
||||
|
||||
type ListDataRes struct {
|
||||
List []*entity.Data `json:"list"`
|
||||
Total int `json:"total"`
|
||||
}
|
||||
73
model/dto/data_statistics_dto.go
Normal file
73
model/dto/data_statistics_dto.go
Normal file
@@ -0,0 +1,73 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"customer-server/model/entity"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// AddDataStatisticsReq 添加数据统计
|
||||
type AddDataStatisticsReq struct {
|
||||
g.Meta `path:"/add" method:"post" tags:"数据统计" summary:"添加统计数据" dc:"记录每日客服的汇总统计数据"` // 路由: POST /data/statistics/add
|
||||
Date string `json:"date" v:"required|date-format:2006-01-02"` // 日期,格式:YYYY-MM-DD
|
||||
AccountName string `json:"accountName" v:"required"` // 客服账号名称
|
||||
CustomerServiceName string `json:"customerServiceName" v:"required"` // 客服名称
|
||||
CustomerServicePlatform string `json:"customerServicePlatform" v:"required"` // 客服平台
|
||||
InboundCount int `json:"inboundCount"` // 进线数
|
||||
ActiveCount int `json:"activeCount"` // 开口数
|
||||
ServedCount int `json:"servedCount"` // 接待数
|
||||
ContactCardSentCount int `json:"contactCardSentCount"` // 发名片数
|
||||
NameCardSentCount int `json:"nameCardSentCount"` // 发留资卡数
|
||||
LeftContactInfoCount int `json:"leftContactInfoCount"` // 留资数
|
||||
ResponseRate30s float64 `json:"responseRate30s"` // 30s响应率
|
||||
ResponseRate60s float64 `json:"responseRate60s"` // 60s响应率
|
||||
ResponseRate360s float64 `json:"responseRate360s"` // 3分钟响应率
|
||||
}
|
||||
|
||||
type AddDataStatisticsRes struct {
|
||||
Id string `json:"id"`
|
||||
}
|
||||
|
||||
// UpdateDataStatisticsReq 更新数据统计
|
||||
type UpdateDataStatisticsReq struct {
|
||||
g.Meta `path:"/update" method:"post" tags:"数据统计" summary:"更新统计数据" dc:"更新每日统计数据"` // 路由: POST /data/statistics/update
|
||||
Id string `json:"id" v:"required"`
|
||||
Date string `json:"date" v:"date-format:2006-01-02"`
|
||||
AccountName string `json:"accountName"`
|
||||
CustomerServiceName string `json:"customerServiceName"`
|
||||
CustomerServicePlatform string `json:"customerServicePlatform"`
|
||||
InboundCount *int `json:"inboundCount"`
|
||||
ActiveCount *int `json:"activeCount"`
|
||||
ServedCount *int `json:"servedCount"`
|
||||
ContactCardSentCount *int `json:"contactCardSentCount"`
|
||||
NameCardSentCount *int `json:"nameCardSentCount"`
|
||||
LeftContactInfoCount *int `json:"leftContactInfoCount"`
|
||||
ResponseRate30s *float64 `json:"responseRate30s"`
|
||||
ResponseRate60s *float64 `json:"responseRate60s"`
|
||||
ResponseRate360s *float64 `json:"responseRate360s"`
|
||||
}
|
||||
|
||||
// ListDataStatisticsReq 获取数据统计列表
|
||||
type ListDataStatisticsReq struct {
|
||||
g.Meta `path:"/list" method:"get" tags:"数据统计" summary:"获取统计列表" dc:"分页查询统计数据,支持按平台、日期范围筛选"` // 路由: GET /data/statistics/list
|
||||
beans.Page
|
||||
// 同时写json和p ,同时支持get的 query解析和post的json解析
|
||||
CustomerServicePlatform string `json:"customerServicePlatform" p:"customerServicePlatform" dc:"筛选:客服平台"` // 筛选:客服平台
|
||||
StartDate string `json:"startDate" p:"startDate" dc:"筛选:开始日期(YYYY-MM-DD)"` // 筛选:开始日期
|
||||
EndDate string `json:"endDate" p:"endDate" dc:"筛选:结束日期(YYYY-MM-DD)"` // 筛选:结束日期
|
||||
}
|
||||
|
||||
type ListDataStatisticsRes struct {
|
||||
List []*entity.DataStatistics `json:"list"`
|
||||
Total int `json:"total"`
|
||||
}
|
||||
|
||||
// ExportDataStatisticsReq 导出请求复用列表请求(忽略分页参数)
|
||||
type ExportDataStatisticsReq struct {
|
||||
g.Meta `path:"/export" method:"get" tags:"数据统计" summary:"导出统计数据" dc:"导出数据统计为ZIP文件(包含TXT)"` // 路由: GET /data/statistics/export
|
||||
// 同时写json和p,同时支持get的query解析和post的json解析
|
||||
CustomerServicePlatform string `json:"customerServicePlatform" p:"customerServicePlatform" dc:"筛选:客服平台"` // 筛选:客服平台
|
||||
StartDate string `json:"startDate" p:"startDate" dc:"筛选:开始日期(YYYY-MM-DD)"` // 筛选:开始日期
|
||||
EndDate string `json:"endDate" p:"endDate" dc:"筛选:结束日期(YYYY-MM-DD)"` // 筛选:结束日期
|
||||
}
|
||||
102
model/dto/product_dto.go
Normal file
102
model/dto/product_dto.go
Normal file
@@ -0,0 +1,102 @@
|
||||
// Package dto - 产品DTO
|
||||
// 功能:产品的增删改查、导入/导出、绑定/解绑客服账号的请求响应结构体
|
||||
package dto
|
||||
|
||||
import (
|
||||
"customer-server/model/entity"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// AddProductReq 添加产品
|
||||
type AddProductReq struct {
|
||||
g.Meta `path:"/add" method:"post" tags:"产品管理" summary:"添加产品" dc:"创建新的产品信息"` // 路由: POST /product/add
|
||||
Name string `json:"name" v:"required"` // 产品名称
|
||||
Description string `json:"description"` // 产品详情
|
||||
}
|
||||
|
||||
type AddProductRes struct {
|
||||
Id string `json:"id"`
|
||||
}
|
||||
|
||||
// UpdateProductReq 更新产品
|
||||
type UpdateProductReq struct {
|
||||
g.Meta `path:"/update" method:"post" tags:"产品管理" summary:"更新产品" dc:"更新产品信息"` // 路由: POST /product/update
|
||||
Id string `json:"id" v:"required"` // ID
|
||||
Name string `json:"name"` // 产品名称
|
||||
Description string `json:"description"` // 产品详情
|
||||
}
|
||||
|
||||
// DeleteProductReq 删除产品
|
||||
type DeleteProductReq struct {
|
||||
g.Meta `path:"/delete" method:"post" tags:"产品管理" summary:"删除产品" dc:"删除指定产品"` // 路由: POST /product/delete
|
||||
Id string `json:"id" v:"required"` // ID
|
||||
}
|
||||
|
||||
// GetProductReq 获取单个产品
|
||||
type GetProductReq struct {
|
||||
g.Meta `path:"/one" method:"get" tags:"产品管理" summary:"获取产品详情" dc:"根据ID获取单个产品信息"` // 路由: GET /product/one
|
||||
Id string `p:"id" v:"required"` // ID
|
||||
}
|
||||
|
||||
// ListProductReq 获取产品列表
|
||||
type ListProductReq struct {
|
||||
g.Meta `path:"/list" method:"get" tags:"产品管理" summary:"获取产品列表" dc:"分页查询产品列表,支持按名称筛选"` // 路由: GET /product/list
|
||||
beans.Page
|
||||
Name string `p:"name"` // 筛选:产品名称
|
||||
}
|
||||
|
||||
type ListProductRes struct {
|
||||
List []*entity.Product `json:"list"`
|
||||
Total int `json:"total"`
|
||||
}
|
||||
|
||||
// ExportProductReq 导出产品
|
||||
type ExportProductReq struct {
|
||||
g.Meta `path:"/export" method:"get" tags:"产品管理" summary:"导出产品" dc:"导出产品为TXT格式的ZIP压缩包,支持按名称筛选" produces:"application/zip"` // 路由: GET /product/export
|
||||
Name string `p:"name" dc:"筛选:产品名称(支持模糊查询,为空则导出所有)"` // 筛选:产品名称
|
||||
}
|
||||
|
||||
type ExportProductRes struct {
|
||||
// 实际返回的是文件流,这个结构体只是为了 Swagger 文档
|
||||
}
|
||||
|
||||
// ImportProductReq 导入产品
|
||||
type ImportProductReq struct {
|
||||
g.Meta `path:"/import" method:"post" tags:"产品管理" summary:"导入产品" dc:"上传ZIP文件批量导入产品(TXT格式)" consumes:"multipart/form-data"` // 路由: POST /product/import
|
||||
File string `json:"file" type:"file" dc:"上传的ZIP文件" v:"required"` // ZIP文件
|
||||
}
|
||||
|
||||
type ImportProductRes struct {
|
||||
SuccessCount int `json:"successCount"` // 成功导入数量
|
||||
FailCount int `json:"failCount"` // 失败数量
|
||||
FailReasons []string `json:"failReasons"` // 失败原因列表
|
||||
}
|
||||
|
||||
// BindProductReq 绑定产品到客服账号请求
|
||||
type BindProductReq struct {
|
||||
g.Meta `path:"/bind" method:"post" tags:"产品管理" summary:"绑定产品" dc:"将产品绑定到客服账号"`
|
||||
ProductId string `json:"productId" v:"required#产品ID不能为空"`
|
||||
AccountNames []string `json:"accountNames" v:"required" dc:"客服账号名称列表"`
|
||||
}
|
||||
|
||||
// BindProductRes 绑定产品响应
|
||||
type BindProductRes struct {
|
||||
SuccessCount int `json:"successCount"` // 成功绑定数量
|
||||
FailedIds []string `json:"failedIds"` // 失败的客服账号ID列表
|
||||
Message string `json:"message"` // 提示信息
|
||||
}
|
||||
|
||||
// UnbindProductReq 解绑产品请求
|
||||
type UnbindProductReq struct {
|
||||
g.Meta `path:"/unbind" method:"post" tags:"产品管理" summary:"解绑产品" dc:"将产品从客服账号解绑"`
|
||||
ProductId string `json:"productId" v:"required#产品ID不能为空"`
|
||||
AccountName string `json:"accountName" v:"required" dc:"客服账号名称"`
|
||||
}
|
||||
|
||||
// UnbindProductRes 解绑产品响应
|
||||
type UnbindProductRes struct {
|
||||
Success bool `json:"success"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
19
model/dto/ragflow_chat_dto.go
Normal file
19
model/dto/ragflow_chat_dto.go
Normal file
@@ -0,0 +1,19 @@
|
||||
// Package dto - RAGFlow对话配置DTO
|
||||
// 功能:定义更新对话配置提示词的请求响应结构体
|
||||
package dto
|
||||
|
||||
// UpdateChatPromptReq 更新对话配置提示词请求
|
||||
type UpdateChatPromptReq struct {
|
||||
ChatId string `json:"chatId" v:"required#对话配置ID不能为空"`
|
||||
Prompt string `json:"prompt" v:"required#提示词不能为空"`
|
||||
SimilarityThreshold float64 `json:"similarityThreshold"` // 相似度阈值(0.0-1.0,默认0.2)
|
||||
KeywordsSimilarityWeight float64 `json:"keywordsSimilarityWeight"` // 关键词权重(0.0-1.0,默认0.7)
|
||||
TopN int `json:"topN"` // 返回chunk数量(默认8)
|
||||
EmptyResponse string `json:"emptyResponse"` // 无匹配时回复
|
||||
}
|
||||
|
||||
// UpdateChatPromptRes 更新对话配置提示词响应
|
||||
type UpdateChatPromptRes struct {
|
||||
Success bool `json:"success"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
41
model/dto/ragflow_config_dto.go
Normal file
41
model/dto/ragflow_config_dto.go
Normal file
@@ -0,0 +1,41 @@
|
||||
package dto
|
||||
|
||||
import "github.com/gogf/gf/v2/frame/g"
|
||||
|
||||
// GetRAGFlowConfigReq 获取RAGFlow配置请求
|
||||
type GetRAGFlowConfigReq struct {
|
||||
g.Meta `path:"/get" method:"get" tags:"RAGFlow配置" summary:"获取RAGFlow配置"`
|
||||
AccountName string `json:"accountName" v:"required" dc:"客服账号名称"`
|
||||
}
|
||||
|
||||
// GetRAGFlowConfigRes 获取RAGFlow配置响应
|
||||
type GetRAGFlowConfigRes struct {
|
||||
AccountName string `json:"accountName"`
|
||||
Platform string `json:"platform"`
|
||||
DatasetId string `json:"datasetId"`
|
||||
DatasetName string `json:"datasetName"`
|
||||
ChatId string `json:"chatId"`
|
||||
Prompt string `json:"prompt"`
|
||||
DocumentIds []string `json:"documentIds"`
|
||||
SimilarityThreshold float64 `json:"similarityThreshold"`
|
||||
KeywordsSimilarityWeight float64 `json:"keywordsSimilarityWeight"`
|
||||
TopN int `json:"topN"`
|
||||
EmptyResponse string `json:"emptyResponse"`
|
||||
}
|
||||
|
||||
// UpdatePromptReq 更新提示词请求
|
||||
type UpdatePromptReq struct {
|
||||
g.Meta `path:"/updatePrompt" method:"post" tags:"RAGFlow配置" summary:"更新提示词"`
|
||||
AccountName string `json:"accountName" v:"required" dc:"客服账号名称"`
|
||||
Prompt string `json:"prompt" v:"required" dc:"提示词内容"`
|
||||
SimilarityThreshold *float64 `json:"similarityThreshold" dc:"相似度阈值"`
|
||||
KeywordsSimilarityWeight *float64 `json:"keywordsSimilarityWeight" dc:"关键词权重"`
|
||||
TopN *int `json:"topN" dc:"返回chunk数量"`
|
||||
EmptyResponse *string `json:"emptyResponse" dc:"无匹配时回复"`
|
||||
}
|
||||
|
||||
// UpdatePromptRes 更新提示词响应
|
||||
type UpdatePromptRes struct {
|
||||
Success bool `json:"success"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
29
model/dto/ragflow_sync_dto.go
Normal file
29
model/dto/ragflow_sync_dto.go
Normal file
@@ -0,0 +1,29 @@
|
||||
// Package dto - RAGFlow同步相关DTO
|
||||
// 功能:定义RAGFlow同步、重试消息的请求响应结构体
|
||||
package dto
|
||||
|
||||
// SyncToRAGFlowReq 同步到RAGFlow请求
|
||||
type SyncToRAGFlowReq struct {
|
||||
SpeechcraftIds []string `json:"speechcraftIds" v:"required#话术ID列表不能为空"` // 话术ID列表
|
||||
ProductIds []string `json:"productIds"` // 产品ID列表(可选)
|
||||
ForceSync bool `json:"forceSync"` // 是否强制重新同步(已同步的也重新上传)
|
||||
}
|
||||
|
||||
// SyncToRAGFlowRes 同步到RAGFlow响应
|
||||
type SyncToRAGFlowRes struct {
|
||||
TotalCount int `json:"totalCount"` // 总数
|
||||
SuccessCount int `json:"successCount"` // 成功数量
|
||||
FailedCount int `json:"failedCount"` // 失败数量
|
||||
FailedIds []string `json:"failedIds"` // 失败的ID列表
|
||||
Message string `json:"message"` // 提示信息
|
||||
}
|
||||
|
||||
// RAGFlowSyncRetryMsg RAGFlow同步重试消息(RabbitMQ)
|
||||
// 说明:租户级知识库,dataset_id从租户配置中获取
|
||||
type RAGFlowSyncRetryMsg struct {
|
||||
Type string `json:"type"` // speechcraft or product
|
||||
Id string `json:"id"` // 话术/产品ID
|
||||
AccountName string `json:"accountName"` // 客服账号名称
|
||||
TenantId string `json:"tenantId"` // 租户ID(用于查询知识库)
|
||||
RetryCount int `json:"retryCount"` // 当前重试次数
|
||||
}
|
||||
101
model/dto/speechcraft_dto.go
Normal file
101
model/dto/speechcraft_dto.go
Normal file
@@ -0,0 +1,101 @@
|
||||
// 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"`
|
||||
}
|
||||
51
model/dto/webhook_dto.go
Normal file
51
model/dto/webhook_dto.go
Normal file
@@ -0,0 +1,51 @@
|
||||
package dto
|
||||
|
||||
import "github.com/gogf/gf/v2/frame/g"
|
||||
|
||||
// WebhookReceiveReq 接收平台消息请求
|
||||
type WebhookReceiveReq struct {
|
||||
g.Meta `path:"/:platform" method:"post" tags:"Webhook" summary:"接收平台消息" dc:"接收小红书/抖音等平台推送的用户消息"`
|
||||
Platform string `p:"platform" v:"required#平台标识不能为空" dc:"平台标识(xiaohongshu/douyin/kuaishou)"`
|
||||
UserId string `json:"userId" v:"required#用户ID不能为空" dc:"平台用户ID"`
|
||||
AccountId string `json:"accountId" dc:"客服账号ID"`
|
||||
Content string `json:"content" v:"required#消息内容不能为空" dc:"消息内容"`
|
||||
MsgId string `json:"msgId" dc:"平台消息ID(用于去重)"`
|
||||
Timestamp int64 `json:"timestamp" dc:"消息时间戳"`
|
||||
}
|
||||
|
||||
type WebhookReceiveRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
MsgId string `json:"msg_id,omitempty" dc:"消息ID"`
|
||||
}
|
||||
|
||||
// WebhookCallbackReq 平台回调验证请求(部分平台需要)
|
||||
type WebhookCallbackReq struct {
|
||||
g.Meta `path:"/:platform/verify" method:"get" tags:"Webhook" summary:"回调验证" dc:"平台回调验证(部分平台接入时需要)"`
|
||||
Platform string `p:"platform" dc:"平台标识"`
|
||||
Signature string `p:"signature" dc:"签名"`
|
||||
Timestamp string `p:"timestamp" dc:"时间戳"`
|
||||
Nonce string `p:"nonce" dc:"随机数"`
|
||||
Echostr string `p:"echostr" dc:"回显字符串"`
|
||||
}
|
||||
|
||||
type WebhookCallbackRes struct {
|
||||
g.Meta `mime:"text/plain"`
|
||||
}
|
||||
|
||||
// ConversationListReq 对话记录查询请求
|
||||
type ConversationListReq struct {
|
||||
g.Meta `path:"/history" method:"get" tags:"Webhook" summary:"查询对话记录" dc:"查询用户历史对话记录"`
|
||||
UserId string `p:"user_id" v:"required#用户ID不能为空" dc:"用户ID"`
|
||||
Limit int64 `p:"limit" d:"20" dc:"返回数量(默认20)"`
|
||||
}
|
||||
|
||||
type ConversationListRes struct {
|
||||
List []*ConversationItem `json:"list" dc:"对话记录列表"`
|
||||
}
|
||||
|
||||
type ConversationItem struct {
|
||||
Question string `json:"question" dc:"用户问题"`
|
||||
Answer string `json:"answer" dc:"AI回复"`
|
||||
MsgTime string `json:"msgTime" dc:"消息时间"`
|
||||
SessionId string `json:"sessionId" dc:"会话ID"`
|
||||
}
|
||||
58
model/dto/websocket_dto.go
Normal file
58
model/dto/websocket_dto.go
Normal file
@@ -0,0 +1,58 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"gitea.com/red-future/common/beans"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// WebSocketConnectReq WebSocket 连接请求
|
||||
type WebSocketConnectReq struct {
|
||||
g.Meta `path:"/connect" method:"get" tags:"WebSocket" summary:"WebSocket连接" dc:"建立WebSocket连接,用于实时消息推送"`
|
||||
UserId string `p:"user_id" v:"required#用户ID不能为空" dc:"用户ID"`
|
||||
Platform string `p:"platform" d:"xiaohongshu" dc:"平台(xiaohongshu/douyin/kuaishou)"`
|
||||
}
|
||||
|
||||
type WebSocketConnectRes = beans.ResponseEmpty
|
||||
|
||||
// WebSocketSendReq 发送消息请求
|
||||
type WebSocketSendReq struct {
|
||||
g.Meta `path:"/send" method:"post" tags:"WebSocket" summary:"发送消息" dc:"发送消息到Redis Stream,message服务会消费并处理"`
|
||||
UserId string `json:"userId" v:"required#用户ID不能为空" dc:"用户ID"`
|
||||
Content string `json:"content" v:"required#消息内容不能为空" dc:"消息内容"`
|
||||
}
|
||||
|
||||
type WebSocketSendRes struct {
|
||||
MessageId string `json:"messageId" dc:"消息ID"`
|
||||
}
|
||||
|
||||
// WebSocketBroadcastReq 广播消息请求
|
||||
type WebSocketBroadcastReq struct {
|
||||
g.Meta `path:"/broadcast" method:"post" tags:"WebSocket" summary:"广播消息" dc:"向所有WebSocket连接广播消息(测试用)"`
|
||||
Content string `json:"content" v:"required#消息内容不能为空" dc:"消息内容"`
|
||||
}
|
||||
|
||||
type WebSocketBroadcastRes = beans.ResponseEmpty
|
||||
|
||||
// WebSocketOnlineReq 获取在线用户请求
|
||||
type WebSocketOnlineReq struct {
|
||||
g.Meta `path:"/online" method:"get" tags:"WebSocket" summary:"获取在线用户" dc:"获取当前所有WebSocket在线用户"`
|
||||
}
|
||||
|
||||
type WebSocketOnlineRes struct {
|
||||
Count int `json:"count" dc:"在线用户数"`
|
||||
Users []WebSocketOnlineUserRes `json:"users" dc:"在线用户列表"`
|
||||
}
|
||||
|
||||
type WebSocketOnlineUserRes struct {
|
||||
UserId string `json:"userId" dc:"用户ID"`
|
||||
Platform string `json:"platform" dc:"平台"`
|
||||
CreatedAt int64 `json:"createdAt" dc:"连接时间戳"`
|
||||
}
|
||||
|
||||
// WebSocketPushMsg WebSocket 推送消息结构
|
||||
type WebSocketPushMsg struct {
|
||||
Type string `json:"type"` // 消息类型: ack, error, broadcast, answer
|
||||
MessageId string `json:"message_id,omitempty"` // 消息ID(ack 时返回)
|
||||
Message string `json:"message,omitempty"` // 提示消息
|
||||
Content string `json:"content,omitempty"` // 内容(broadcast/answer 时返回)
|
||||
}
|
||||
427
model/dto/xiaohongshu_dto.go
Normal file
427
model/dto/xiaohongshu_dto.go
Normal file
@@ -0,0 +1,427 @@
|
||||
package dto
|
||||
|
||||
// ==================== 通用响应结构 ====================
|
||||
|
||||
type XhsCommonRes struct {
|
||||
Code int `json:"code"`
|
||||
Msg string `json:"msg"`
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
// ==================== 绑定/解绑账户通知(接收) ====================
|
||||
|
||||
type XhsBindAccountReq struct {
|
||||
Content string `json:"content" v:"required"` // 加密后内容
|
||||
}
|
||||
|
||||
type XhsBindAccountDecrypted struct {
|
||||
UserId string `json:"user_id"`
|
||||
NickName string `json:"nick_name"`
|
||||
AppId int64 `json:"app_id"`
|
||||
Token string `json:"token"`
|
||||
}
|
||||
|
||||
type XhsUnbindAccountReq struct {
|
||||
Content string `json:"content" v:"required"` // 加密后内容
|
||||
}
|
||||
|
||||
type XhsUnbindAccountDecrypted struct {
|
||||
UserId string `json:"user_id"`
|
||||
AppId int64 `json:"app_id"`
|
||||
AccountCode string `json:"account_code"`
|
||||
}
|
||||
|
||||
type XhsBindKosUserReq struct {
|
||||
Content string `json:"content" v:"required"` // 加密后内容
|
||||
}
|
||||
|
||||
// KOS账户绑定事件
|
||||
type XhsBindKosUserDecrypted struct {
|
||||
UserId string `json:"user_id"`
|
||||
AuthStatus int `json:"auth_status"` // 2-已生效,4-已取消
|
||||
KosNickName string `json:"kos_nick_name"`
|
||||
KosUserId string `json:"kos_user_id"`
|
||||
KosAvatarImg string `json:"kos_avatar_img"`
|
||||
}
|
||||
|
||||
// ==================== 查询KOS授权绑定列表(发送) ====================
|
||||
|
||||
type XhsQueryBindUsersReq struct {
|
||||
UserId string `json:"user_id" v:"required"`
|
||||
PageNum int `json:"page_num" v:"required"`
|
||||
PageSize int `json:"page_size" v:"required"`
|
||||
}
|
||||
|
||||
type XhsQueryBindUsersRes struct {
|
||||
Code int `json:"code"`
|
||||
Msg string `json:"msg"`
|
||||
Success bool `json:"success"`
|
||||
Data struct {
|
||||
Total int64 `json:"total"`
|
||||
KosUserList []struct {
|
||||
UserId string `json:"user_id"`
|
||||
NickName string `json:"nick_name"`
|
||||
AvatarImg string `json:"avatar_img"`
|
||||
} `json:"kos_user_list"`
|
||||
} `json:"data"`
|
||||
}
|
||||
|
||||
// ==================== 发送消息接口(发送) ====================
|
||||
|
||||
type XhsSendMessageReq struct {
|
||||
UserId string `json:"user_id" v:"required"`
|
||||
RequestId string `json:"request_id" v:"required"`
|
||||
MessageType string `json:"message_type" v:"required"` // TEXT/IMAGE/VIDEO/CARD/REVOKE
|
||||
FromUserId string `json:"from_user_id" v:"required"`
|
||||
ToUserId string `json:"to_user_id" v:"required"`
|
||||
ThirdAccountId string `json:"third_account_id" v:"required"`
|
||||
Timestamp int64 `json:"timestamp" v:"required"`
|
||||
Content string `json:"content" v:"required"` // 加密后内容
|
||||
}
|
||||
|
||||
type XhsSendMessageRes struct {
|
||||
Code int `json:"code"`
|
||||
Msg string `json:"msg"`
|
||||
Success bool `json:"success"`
|
||||
Data struct {
|
||||
RequestId string `json:"request_id"`
|
||||
MessageId string `json:"message_id"`
|
||||
} `json:"data"`
|
||||
}
|
||||
|
||||
// 消息内容解密后结构
|
||||
type XhsTextContent struct {
|
||||
Text string `json:"text"`
|
||||
}
|
||||
|
||||
type XhsImageContent struct {
|
||||
Link string `json:"link"`
|
||||
Size struct {
|
||||
Width int `json:"width"`
|
||||
Height int `json:"height"`
|
||||
} `json:"size"`
|
||||
}
|
||||
|
||||
type XhsVideoContent struct {
|
||||
Duration int64 `json:"duration"`
|
||||
VideoSize int64 `json:"video_size"`
|
||||
Cover string `json:"cover"`
|
||||
Link string `json:"link"`
|
||||
Size struct {
|
||||
Width int `json:"width"`
|
||||
Height int `json:"height"`
|
||||
} `json:"size"`
|
||||
}
|
||||
|
||||
// 通用卡片内容(用于switch分支解析)
|
||||
type XhsCardContent struct {
|
||||
Id string `json:"id"`
|
||||
ContentType string `json:"content_type"`
|
||||
}
|
||||
|
||||
type XhsCardNoteContent struct {
|
||||
NoteId string `json:"note_id"`
|
||||
ContentType string `json:"content_type"` // note
|
||||
}
|
||||
|
||||
type XhsCardPageContent struct {
|
||||
PageId string `json:"page_id"`
|
||||
ContentType string `json:"content_type"` // common
|
||||
}
|
||||
|
||||
type XhsCardCommentContent struct {
|
||||
CommentId string `json:"comment_id"`
|
||||
Content string `json:"content"`
|
||||
ContentType string `json:"content_type"` // purchaseComments
|
||||
}
|
||||
|
||||
type XhsCardSocialContent struct {
|
||||
Id string `json:"id"`
|
||||
ContentType string `json:"content_type"` // social_card
|
||||
}
|
||||
|
||||
type XhsCardLeadContent struct {
|
||||
Id string `json:"id"`
|
||||
ContentType string `json:"content_type"` // lead_card
|
||||
}
|
||||
|
||||
type XhsCardTradeContent struct {
|
||||
Id string `json:"id"`
|
||||
ContentType string `json:"content_type"` // tradeBusinessCard
|
||||
}
|
||||
|
||||
type XhsRevokeContent struct {
|
||||
MessageId string `json:"message_id"`
|
||||
}
|
||||
|
||||
// ==================== 接收消息接口(接收Webhook) ====================
|
||||
|
||||
type XhsReceiveMessageReq struct {
|
||||
MessageId string `json:"message_id" v:"required"`
|
||||
MessageType string `json:"message_type" v:"required"` // TEXT/IMAGE/VIDEO/CARD/HINT/REVOKE/SMILES
|
||||
MessageSource int `json:"message_source" v:"required"` // 1-C2B用户,2-C2B系统,3-B2C系统
|
||||
FromUserId string `json:"from_user_id" v:"required"`
|
||||
ToUserId string `json:"to_user_id" v:"required"`
|
||||
Timestamp int64 `json:"timestamp" v:"required"`
|
||||
Content string `json:"content" v:"required"` // 加密后内容
|
||||
UserInfo []XhsReceiveMessageUser `json:"user_info"`
|
||||
}
|
||||
|
||||
type XhsReceiveMessageUser struct {
|
||||
UserId string `json:"user_id"`
|
||||
Nickname string `json:"nickname"`
|
||||
HeaderImage string `json:"header_image"`
|
||||
}
|
||||
|
||||
// 接收消息-卡片内容(笔记)
|
||||
type XhsReceiveCardNoteContent struct {
|
||||
Title string `json:"title"`
|
||||
Cover string `json:"cover"`
|
||||
Link string `json:"link"`
|
||||
ContentType string `json:"content_type"` // note
|
||||
UserInfo struct {
|
||||
Nickname string `json:"nickname"`
|
||||
HeaderImage string `json:"header_image"`
|
||||
} `json:"user_info"`
|
||||
}
|
||||
|
||||
// 接收消息-卡片内容(落地页)
|
||||
type XhsReceiveCardPageContent struct {
|
||||
Title string `json:"title"`
|
||||
Cover string `json:"cover"`
|
||||
Link string `json:"link"`
|
||||
Desc string `json:"desc"`
|
||||
ContentType string `json:"content_type"` // common
|
||||
}
|
||||
|
||||
// 接收消息-卡片内容(名片)
|
||||
type XhsReceiveCardSocialContent struct {
|
||||
Id string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Name string `json:"name"`
|
||||
Image string `json:"image"`
|
||||
ContentType string `json:"content_type"` // social_card
|
||||
}
|
||||
|
||||
// 接收消息-卡片内容(留资卡)
|
||||
type XhsReceiveCardLeadContent struct {
|
||||
Id string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Name string `json:"name"`
|
||||
Image string `json:"image"`
|
||||
ContentType string `json:"content_type"` // lead_card
|
||||
}
|
||||
|
||||
// 接收消息-卡片内容(交易卡)
|
||||
type XhsReceiveCardTradeContent struct {
|
||||
Id string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
SubTitle string `json:"sub_title"`
|
||||
Image string `json:"image"`
|
||||
LinkPlatform string `json:"link_platform"` // wx_mini/ctrip/meituan
|
||||
ContentType string `json:"content_type"` // tradeBusinessCard
|
||||
}
|
||||
|
||||
// 接收消息-HINT内容
|
||||
type XhsReceiveHintContent struct {
|
||||
Text string `json:"text"`
|
||||
}
|
||||
|
||||
// ==================== 查询物料接口(发送) ====================
|
||||
|
||||
// 查询落地页列表
|
||||
type XhsQueryPageListReq struct {
|
||||
UserId string `json:"user_id" v:"required"`
|
||||
PageNum int `json:"page_num" v:"required"`
|
||||
PageSize int `json:"page_size" v:"required"`
|
||||
}
|
||||
|
||||
type XhsQueryPageListRes struct {
|
||||
Code int `json:"code"`
|
||||
Msg string `json:"msg"`
|
||||
Success bool `json:"success"`
|
||||
Data struct {
|
||||
Total int64 `json:"total"`
|
||||
List []struct {
|
||||
Title string `json:"title"`
|
||||
CreateTime int64 `json:"create_time"`
|
||||
PageId string `json:"page_id"`
|
||||
PageDesc string `json:"page_desc"`
|
||||
PageUrl string `json:"page_url"`
|
||||
Cover string `json:"cover"`
|
||||
} `json:"list"`
|
||||
} `json:"data"`
|
||||
}
|
||||
|
||||
// 查询名片/留资卡/交易卡列表
|
||||
type XhsQueryMaterialListReq struct {
|
||||
UserId string `json:"user_id" v:"required"`
|
||||
PageNum int `json:"page_num" v:"required"`
|
||||
PageSize int `json:"page_size" v:"required"`
|
||||
Type int `json:"type" v:"required"` // 4-名片 5-留资卡 7-交易卡
|
||||
}
|
||||
|
||||
type XhsQueryMaterialListRes struct {
|
||||
Code int `json:"code"`
|
||||
Msg string `json:"msg"`
|
||||
Success bool `json:"success"`
|
||||
Data struct {
|
||||
Total int64 `json:"total"`
|
||||
List []struct {
|
||||
Id string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Title string `json:"title"`
|
||||
Image string `json:"image"`
|
||||
Ext struct {
|
||||
SocialCardExt *struct {
|
||||
CardType int `json:"card_type"` // 1-微信、2-钉钉、3-电话、4-企微 5-留资卡
|
||||
} `json:"social_card_ext,omitempty"`
|
||||
TradeCardExt *struct {
|
||||
SubTitle string `json:"sub_title"`
|
||||
LinkPlatform string `json:"link_platform"` // ctrip/meituan/wx_mini
|
||||
} `json:"trade_card_ext,omitempty"`
|
||||
} `json:"ext"`
|
||||
} `json:"list"`
|
||||
} `json:"data"`
|
||||
}
|
||||
|
||||
// 查询笔记列表
|
||||
type XhsQueryNoteListReq struct {
|
||||
UserId string `json:"user_id" v:"required"`
|
||||
NoteId string `json:"note_id,omitempty"`
|
||||
PageNum int `json:"page_num" v:"required"`
|
||||
PageSize int `json:"page_size" v:"required"`
|
||||
}
|
||||
|
||||
type XhsQueryNoteListRes struct {
|
||||
Code int `json:"code"`
|
||||
Msg string `json:"msg"`
|
||||
Success bool `json:"success"`
|
||||
Data struct {
|
||||
Total int64 `json:"total"`
|
||||
List []struct {
|
||||
NoteId string `json:"note_id"`
|
||||
PublishTime int64 `json:"publish_time"`
|
||||
Link string `json:"link"`
|
||||
Title string `json:"title"`
|
||||
Cover string `json:"cover"`
|
||||
UserInfo struct {
|
||||
Nickname string `json:"nickname"`
|
||||
HeaderImage string `json:"header_image"`
|
||||
} `json:"user_info"`
|
||||
} `json:"list"`
|
||||
} `json:"data"`
|
||||
}
|
||||
|
||||
// 查询意向评论列表
|
||||
type XhsQueryCommentListReq struct {
|
||||
UserId string `json:"user_id" v:"required"`
|
||||
PageNum int `json:"page_num" v:"required"`
|
||||
PageSize int `json:"page_size" v:"required"`
|
||||
BeginTime string `json:"begin_time,omitempty"`
|
||||
EndTime string `json:"end_time,omitempty"`
|
||||
}
|
||||
|
||||
type XhsQueryCommentListRes struct {
|
||||
Code int `json:"code"`
|
||||
Msg string `json:"msg"`
|
||||
Success bool `json:"success"`
|
||||
Data struct {
|
||||
Total int64 `json:"total"`
|
||||
List []struct {
|
||||
NoteId string `json:"note_id"`
|
||||
Cover string `json:"cover"`
|
||||
NoteTitle string `json:"note_title"`
|
||||
NoteAuthorUserId string `json:"note_author_user_id"`
|
||||
CommentContent string `json:"comment_content"`
|
||||
CommentTime int64 `json:"comment_time"`
|
||||
CommentUserName string `json:"comment_user_name"`
|
||||
CommentUserId string `json:"comment_user_id"`
|
||||
CommentId string `json:"comment_id"`
|
||||
UniqId string `json:"uniq_id"`
|
||||
ReplyState int `json:"reply_state"`
|
||||
ReplyThirdAccountId string `json:"reply_third_account_id"`
|
||||
} `json:"list"`
|
||||
} `json:"data"`
|
||||
}
|
||||
|
||||
// ==================== 意向评论推送(接收Webhook) ====================
|
||||
|
||||
type XhsIntentCommentPushReq struct {
|
||||
NoteId string `json:"note_id"`
|
||||
Cover string `json:"cover"`
|
||||
NoteTitle string `json:"note_title"`
|
||||
NoteAuthorUserId string `json:"note_author_user_id"`
|
||||
CommentContent string `json:"comment_content"`
|
||||
CommentTime int64 `json:"comment_time"`
|
||||
CommentUserName string `json:"comment_user_name"`
|
||||
CommentUserId string `json:"comment_user_id"`
|
||||
CommentId string `json:"comment_id"`
|
||||
UniqId string `json:"uniq_id"`
|
||||
ReplyState int `json:"reply_state"`
|
||||
ReplyThirdAccountId string `json:"reply_third_account_id"`
|
||||
}
|
||||
|
||||
// ==================== 留资数据回传(发送) ====================
|
||||
|
||||
type XhsBackLeadResultReq struct {
|
||||
UserId string `json:"user_id" v:"required"`
|
||||
RequestId string `json:"request_id" v:"required"`
|
||||
BrandUserId string `json:"brand_user_id" v:"required"`
|
||||
CUserId string `json:"c_user_id" v:"required"`
|
||||
ThirdBackSource string `json:"third_back_source" v:"required"`
|
||||
Timestamp int64 `json:"timestamp" v:"required"`
|
||||
Content string `json:"content" v:"required"` // 加密后内容
|
||||
}
|
||||
|
||||
type XhsBackLeadResultDecrypted struct {
|
||||
PhoneNum string `json:"phone_num"`
|
||||
Wechat string `json:"wechat"`
|
||||
Remark string `json:"remark"`
|
||||
Area string `json:"area"`
|
||||
City string `json:"city"`
|
||||
CustomerServiceName string `json:"customer_service_name"`
|
||||
Time int64 `json:"time"`
|
||||
ExtList []struct {
|
||||
Key string `json:"key"`
|
||||
Name string `json:"name"`
|
||||
Value string `json:"value"`
|
||||
} `json:"extList"`
|
||||
}
|
||||
|
||||
type XhsBackLeadResultRes struct {
|
||||
Code int `json:"code"`
|
||||
Msg string `json:"msg"`
|
||||
Success bool `json:"success"`
|
||||
Data struct {
|
||||
RequestId string `json:"request_id"`
|
||||
} `json:"data"`
|
||||
}
|
||||
|
||||
// ==================== 留资和广告归因数据推送(接收Webhook) ====================
|
||||
|
||||
type XhsPushLeadReq struct {
|
||||
UserId string `json:"user_id"`
|
||||
BrandUserId string `json:"brand_user_id"`
|
||||
KosUserId string `json:"kos_user_id"`
|
||||
ConvTime string `json:"conv_time"`
|
||||
AdvertiserName string `json:"advertiser_name"`
|
||||
AdvertiserId string `json:"advertiser_id"`
|
||||
CampaignName string `json:"campaign_name"`
|
||||
CampaignId string `json:"campaign_id"`
|
||||
CreativityName string `json:"creativity_name"`
|
||||
CreativityId string `json:"creativity_id"`
|
||||
LeadsTag string `json:"leads_tag"`
|
||||
Area string `json:"area"`
|
||||
PhoneNum string `json:"phone_num"`
|
||||
Wechat string `json:"wechat"`
|
||||
Remark string `json:"remark"`
|
||||
PushType int `json:"push_type"` // 1-进线 2-开口 3-留资 4-留资归因
|
||||
WechatCopy int `json:"wechat_copy"`
|
||||
LinkId string `json:"link_id"`
|
||||
LinkName string `json:"link_name"`
|
||||
CustomerChannel string `json:"customer_channel"`
|
||||
MsgAppOpen int `json:"msg_app_open"`
|
||||
WechatType int `json:"wechat_type"` // 1-文本 2-图片链接
|
||||
DecryptUserId string `json:"decrypt_user_id"`
|
||||
}
|
||||
Reference in New Issue
Block a user