ai_scheduler/internal/entitys/advicer_data.go

581 lines
23 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 entitys
import (
"ai_scheduler/internal/data/model"
"ai_scheduler/internal/data/mongo_model"
)
type WordAnaReq struct {
WordFileUrl string `json:"wordFileUrl"`
ProjectId int32 `json:"projectId"`
}
type AdvicerInitReq struct {
AdvicerID int32 `json:"advicerId"`
ProjectID int32 `json:"projectId"`
Name string `json:"name"` // 姓名
Birth string `json:"birth"` // 生日
Gender int32 `json:"gender"` // 1:男,2:女
WorkingYears int32 `json:"workingYears"` // 工作年限
JoinDate string `json:"joinDate"` // 入职时间
}
type AdvicerInfoReq struct {
AdvicerID int32 `json:"advicerId"`
}
type AdvicerListReq struct {
ProjectId int32 `json:"projectId"`
}
// AdvicerWxDeviceIdUpdateReq 更新销售的微信设备 ID
type AdvicerWxDeviceIdUpdateReq struct {
AdvicerId int32 `json:"advicerId" validate:"required" zh:"销售ID"`
WxDeviceId string `json:"wxDeviceId"`
}
// AdvicerWxIdUpdateReq 更新销售的登录微信 wxid
type AdvicerWxIdUpdateReq struct {
AdvicerId int32 `json:"advicerId" validate:"required" zh:"销售ID"`
WxId string `json:"wxId"`
}
// AdvicerHostingUpdateReq 更新销售的托管配置
type AdvicerHostingUpdateReq struct {
AdvicerId int32 `json:"advicerId" validate:"required" zh:"销售ID"`
HostingEnabled int32 `json:"hostingEnabled"` // 0=关闭 1=开启
HostingVersionId string `json:"hostingVersionId"` // 指定数字人版本ID,空=动态取最新
HostingSkillId string `json:"hostingSkillId"` // 指定聊天技巧ID,空=动态取最新
ReplyFilehelper *int32 `json:"replyFilehelper"` // 是否回复文件传输助手(nil=不更新;0=关闭;1=开启)
}
// ProjectWxTokenUpdateReq 更新项目的微信协议 Token
type ProjectWxTokenUpdateReq struct {
ProjectId int32 `json:"projectId" validate:"required" zh:"项目ID"`
WxToken string `json:"wxToken"`
}
type AdvicerVersionAddReq struct {
AdvicerID int32 `json:"advicerId"`
VersionDesc string `json:"versionDesc"`
Data map[string]interface{} `json:"data"` // 维度内容(扁平 JSON,key=维度名,直接入库)
}
type AdvicerVersionUpdateReq struct {
Id string `json:"id"`
AdvicerID int32 `json:"advicerId"`
VersionDesc string `json:"versionDesc"`
Data map[string]interface{} `json:"data"` // 维度内容(扁平 JSON,key=维度名,直接入库)
}
type AdvicerVersionListReq struct {
Id string `json:"id"`
AdvicerId int32 `json:"advicerId"`
VersionDesc string `json:"versionDesc"`
}
type AdvicerVersionDelReq struct {
Id string `json:"id"`
}
type AdvicerVersionInfoReq struct {
Id string `json:"id"`
}
// AdvicerVersionStyleGenerateReq AI 生成销售风格维度
type AdvicerVersionStyleGenerateReq struct {
AdvicerId int32 `json:"advicerId"`
SupId int32 `json:"supId"` // 可选,不传则用项目配置的模型
Desc string `json:"desc"` // 可选,用户对该销售的一句话描述,作为 AI 参考
}
type AdvicerTalkSkillAddReq struct {
ProjectId int32 `json:"projectId" bson:"projectId"`
Desc string `json:"desc" bson:"desc"`
Data map[string]interface{} `json:"data"` // 可视化编辑器数据(扁平 KV)
NeedsMining mongo_model.NeedsMining `json:"needsMining" bson:"needsMining"`
PainPointResponse mongo_model.PainPointResponse `json:"painPointResponse" bson:"painPointResponse"`
ValueBuilding mongo_model.ValueBuilding `json:"valueBuilding" bson:"valueBuilding"`
ClosingTechniques mongo_model.ClosingTechniques `json:"closingTechniques" bson:"closingTechniques"`
CommunicationRhythm mongo_model.CommunicationRhythm `json:"communicationRhythm" bson:"communicationRhythm"`
}
type AdvicerTalkSkillUpdateReq struct {
Id string `json:"id"`
ProjectId int32 `json:"projectId" bson:"projectId"`
Desc string `json:"desc" bson:"desc"`
Data map[string]interface{} `json:"data"` // 可视化编辑器数据(扁平 KV)
NeedsMining mongo_model.NeedsMining `json:"needsMining" bson:"needsMining"`
PainPointResponse mongo_model.PainPointResponse `json:"painPointResponse" bson:"painPointResponse"`
ValueBuilding mongo_model.ValueBuilding `json:"valueBuilding" bson:"valueBuilding"`
ClosingTechniques mongo_model.ClosingTechniques `json:"closingTechniques" bson:"closingTechniques"`
CommunicationRhythm mongo_model.CommunicationRhythm `json:"communicationRhythm" bson:"communicationRhythm"`
}
type AdvicerTalkSkillListReq struct {
Id string `json:"id"`
ProjectId int32 `json:"projectId" bson:"projectId"`
Desc string `json:"desc" bson:"desc"`
}
type AdvicerTalkSkillDelReq struct {
Id string `json:"id"`
}
type AdvicerTalkSkillInfoReq struct {
Id string `json:"id"`
}
// AdvicerSkillGenerateReq AI 生成聊天技巧
type AdvicerSkillGenerateReq struct {
ProjectId int32 `json:"projectId"`
SupId int32 `json:"supId"` // 可选,不传则用项目配置的模型
}
type AdvicerProjectBaseAddReq struct {
Name string `json:"name"`
ModelSupId int32 `json:"modelSupId"`
// IndustryId 来源行业模板ID(>0 时自动复制该行业模板的维度内容)
IndustryId int32 `json:"industryId"`
}
type AdvicerProjectBaseAddRes struct {
ProjectId int32 `json:"projectId"`
}
type AdvicerProjectBaseUpdateReq struct {
ProjectId int32 `json:"projectId"`
Name string `json:"name"`
ModelSupId int32 `json:"modelSupId"`
// IndustryId >0 时重新从该行业模板复制维度内容(覆盖现有模板字段)
IndustryId int32 `json:"industryId"`
// 以下为项目级模板字段(可选,传入非空值时更新)
Desc string `json:"desc"`
AdvicerDesc string `json:"advicer_desc"`
ClientDimension string `json:"client_dimension"`
ProjectDimension string `json:"project_dimension"`
AdvicerDimension string `json:"advicer_dimension"`
TalkSkillDimension string `json:"talk_skill_dimension"`
RuleDimension string `json:"rule_dimension"`
// WxToken 项目级微信协议 Token(可选,传入时更新)
WxToken string `json:"wxToken"`
}
// AdvicerProjectListReq 查询项目列表
type AdvicerProjectListReq struct {
Name string `json:"name"`
Page int `json:"page"`
PageSize int `json:"page_size"`
}
// AdvicerProjectTemplateCopyReq 重新应用行业模板(覆盖项目模板字段)
type AdvicerProjectTemplateCopyReq struct {
ProjectId int32 `json:"projectId"`
IndustryId int32 `json:"industryId"`
}
type AdvicerProjectAddReq struct {
ProjectId int32 `json:"projectId" bson:"projectId"`
ProjectInfo mongo_model.ProjectInfo `json:"projectInfo" bson:"projectInfo"`
RegionValue mongo_model.RegionValue `json:"regionValue" bson:"regionValue"`
CompetitionComparison mongo_model.CompetitionComparison `json:"competitionComparison" bson:"competitionComparison"`
CoreSellingPoints mongo_model.CoreSellingPoints `json:"coreSellingPoints" bson:"coreSellingPoints"`
SupportingFacilities mongo_model.SupportingFacilities `json:"supportingFacilities" bson:"supportingFacilities"`
DeveloperBacking mongo_model.DeveloperBacking `json:"developerBacking" bson:"developerBacking"`
}
type AdvicerrProjectUpdateReq struct {
Id string `json:"id"`
ProjectId int32 `json:"projectId" bson:"projectId"`
ProjectInfo mongo_model.ProjectInfo `json:"projectInfo" bson:"projectInfo"`
RegionValue mongo_model.RegionValue `json:"regionValue" bson:"regionValue"`
CompetitionComparison mongo_model.CompetitionComparison `json:"competitionComparison" bson:"competitionComparison"`
CoreSellingPoints mongo_model.CoreSellingPoints `json:"coreSellingPoints" bson:"coreSellingPoints"`
SupportingFacilities mongo_model.SupportingFacilities `json:"supportingFacilities" bson:"supportingFacilities"`
DeveloperBacking mongo_model.DeveloperBacking `json:"developerBacking" bson:"developerBacking"`
}
type AdvicerProjectInfoReq struct {
Id string `json:"id"`
ProjectId int32 `json:"projectId" bson:"projectId"`
}
type AdvicerProjectInfoRes struct {
Base model.AiAdviceProject
ConfigInfo mongo_model.AdvicerProjectMongo
ModelInfo model.AiAdviceModelSup
}
// AdvicerProjectDataSaveReq 保存项目资料(新表)
type AdvicerProjectDataSaveReq struct {
ProjectId int32 `json:"projectId"`
Data map[string]interface{} `json:"data"` // 栏目内容(扁平 JSON,key=栏目名,直接入库)
}
// AdvicerProjectDataGenerateReq AI 预设项目资料
type AdvicerProjectDataGenerateReq struct {
ProjectId int32 `json:"projectId"`
SupId int32 `json:"supId"` // 可选,不传则用项目配置的模型
}
type AdvicerClientAddReq struct {
ProjectId int32 `json:"projectId" bson:"projectId"`
AdvicerId int32 `json:"advicerId" bson:"advicerId"`
Wxid string `json:"wxid" bson:"wxid"` // 客户微信 wxid(可选,用于关联回调消息)
AiEnabled *bool `json:"aiEnabled" bson:"aiEnabled"` // 是否允许 AI 参与对话(不传默认开启)
PersonalInfo mongo_model.PersonalInfo `json:"personalInfo" bson:"personalInfo"`
PurchasePurpose mongo_model.PurchasePurpose `json:"purchasePurpose" bson:"purchasePurpose"`
CoreDemands mongo_model.CoreDemands `json:"coreDemands" bson:"coreDemands"`
Concerns []string `json:"concerns" bson:"concerns"`
DecisionProfile []string `json:"decisionProfile" bson:"decisionProfile"`
}
type AdvicerrClientUpdateReq struct {
Id string `json:"id"`
ProjectId int32 `json:"projectId" bson:"projectId"`
AdvicerId int32 `json:"advicerId" bson:"advicerId"`
AiEnabled *bool `json:"aiEnabled" bson:"aiEnabled"` // 是否允许 AI 参与对话(不传保持原值)
PersonalInfo mongo_model.PersonalInfo `json:"personalInfo" bson:"personalInfo"`
PurchasePurpose mongo_model.PurchasePurpose `json:"purchasePurpose" bson:"purchasePurpose"`
CoreDemands mongo_model.CoreDemands `json:"coreDemands" bson:"coreDemands"`
Concerns []string `json:"concerns" bson:"concerns"`
DecisionProfile []string `json:"decisionProfile" bson:"decisionProfile"`
}
type AdvicerClientListReq struct {
Id string `json:"id"`
ProjectId int32 `json:"projectId" bson:"projectId"`
AdvicerId int32 `json:"advicerId" bson:"advicerId"`
}
type AdvicerClientDelReq struct {
Id string `json:"id"`
}
type AdvicerClientInfoReq struct {
Id string `json:"id"`
}
type AdvicerChatRegistReq struct {
AdvicerVersionId string `json:"advicerVersionId"`
ClientId string `json:"clientId"`
TalkSkillId string `json:"talkSkillId"`
Mission string `json:"mission"`
AdvicerId int32 `json:"-"` // 内部填充,不由前端传入
}
type AdvicerChatRegistRes struct {
SessionId string `json:"sessionId"`
}
type AdvicerChatReq struct {
SessionId string `json:"sessionId"`
Content string `json:"content"`
}
type AdvicerChatRes struct {
Content int32 `json:"content"`
}
// AdvicerClientBindReq 客户绑定微信(绑定后回调消息可自动关联该客户)
type AdvicerClientBindReq struct {
Id string `json:"id"` // 客户记录 id(Mongo _id)
Wxid string `json:"wxid"` // 客户微信 wxid
AppId string `json:"appId"` // 登录实例 appId(可选)
}
// AdvicerWxCallbackReq 设置上游消息回调地址
type AdvicerWxCallbackReq struct {
AppId string `json:"appId"` // 登录实例 appId(可选)
CallbackUrl string `json:"callbackUrl"` // 回调地址(公网可访问,如 https://域名/api/v1/advicer/wx/callback)
}
// AdvicerActivityAddReq 新增产品活动
type AdvicerActivityAddReq struct {
ProjectId int32 `json:"projectId"`
AdvicerId int32 `json:"advicerId"`
Name string `json:"name"`
Content string `json:"content"`
StartAt string `json:"startAt"` // 开始时间(2006-01-02 15:04 或 2006-01-02 15:04:05)
EndAt string `json:"endAt"` // 结束时间
TargetLevels []string `json:"targetLevels"`
Status int `json:"status"` // 0草稿/1进行中/2停止
}
// AdvicerActivityUpdateReq 更新产品活动
type AdvicerActivityUpdateReq struct {
Id string `json:"id"`
ProjectId int32 `json:"projectId"`
AdvicerId int32 `json:"advicerId"`
Name string `json:"name"`
Content string `json:"content"`
StartAt string `json:"startAt"`
EndAt string `json:"endAt"`
TargetLevels []string `json:"targetLevels"`
Status int `json:"status"`
}
// AdvicerActivityListReq 活动列表查询
type AdvicerActivityListReq struct {
Id string `json:"id"`
ProjectId int32 `json:"projectId"`
AdvicerId int32 `json:"advicerId"`
Status *int32 `json:"status"` // 不传=全部,传 0/1/2 按状态过滤
Page int `json:"page"`
PageSize int `json:"page_size"`
}
// AdvicerActivityDelReq 删除活动
type AdvicerActivityDelReq struct {
Id string `json:"id"`
}
// AdvicerActivityInfoReq 活动详情
type AdvicerActivityInfoReq struct {
Id string `json:"id"`
}
// AdvicerWxMsgListReq 微信消息流水查询
type AdvicerWxMsgListReq struct {
AppId string `json:"appId"`
Wxid string `json:"wxid"`
Direction string `json:"direction"`
StartAt string `json:"startAt"`
EndAt string `json:"endAt"`
Page int `json:"page"`
PageSize int `json:"page_size"`
}
// AdvicerClientEvaluateReq 客户等级评估(手动触发)
type AdvicerClientEvaluateReq struct {
ClientId string `json:"clientId"` // 为空则评估全部客户
Force bool `json:"force"` // 忽略当日已评估限制,强制重新评估
}
// AdvicerClientLevelDetail 客户等级评估明细
type AdvicerClientLevelDetail struct {
ClientId string `json:"clientId"`
ClientName string `json:"clientName"`
Level string `json:"level"`
LevelDesc string `json:"levelDesc"`
Reason string `json:"reason"`
}
// AdvicerClientEvaluateRes 客户等级评估结果
type AdvicerClientEvaluateRes struct {
Total int `json:"total"`
Evaluated int `json:"evaluated"`
Details []AdvicerClientLevelDetail `json:"details"`
}
// ==================== 批次B:智能策略 / 主动对话 / 自我迭代 ====================
// AdvicerStrategyTestReq 策略干跑测试(不实际发送)
type AdvicerStrategyTestReq struct {
Wxid string `json:"wxid"` // 客户微信 wxid
Content string `json:"content"` // 模拟客户消息(空则分析最新未回复消息)
Send bool `json:"send"` // true=实际发送;默认 false 仅干跑预览
}
// AdvicerStrategyTestRes 策略决策结果
type AdvicerStrategyTestRes struct {
Level string `json:"level"` // 客户等级(regular/intent/sleeping/non)
LevelDesc string `json:"levelDesc"` // 等级中文描述
Action string `json:"action"` // 动作:reply/activity_push/regular_wait/skip/not_bound/ai_off/non_client
Reason string `json:"reason"` // 决策说明
Replies []string `json:"replies"` // 生成的消息(拆条后)
Sent bool `json:"sent"` // 是否已实际发送
}
// AdvicerIterateRunReq 手动触发画像迭代
type AdvicerIterateRunReq struct {
ClientId string `json:"clientId"` // 为空则处理全部客户
Force bool `json:"force"` // 忽略对话完成后闲置等待(手动触发立即迭代)
}
// AdvicerIterateRunRes 画像迭代结果
type AdvicerIterateRunRes struct {
Scanned int `json:"scanned"` // 扫描到的未分析消息数
Idle int `json:"idle"` // 对话未完成(未满闲置时长)而跳过
Updated int `json:"updated"` // 画像更新客户数
Details []string `json:"details"` // 明细(客户 + 更新说明)
}
// AdvicerProactiveRunReq 主动触达扫描(生日祝福/新活动推送)
type AdvicerProactiveRunReq struct {
ProjectId int32 `json:"projectId"`
AdvicerId int32 `json:"advicerId"`
Force bool `json:"force"` // 手动触发:忽略 AutoReply 开关与活跃时间窗口,并允许当天重复触达
DryRun bool `json:"dryRun"` // 只扫描不发送(仅列出将触达的客户)
}
// AdvicerProactiveRunRes 主动触达结果
type AdvicerProactiveRunRes struct {
Scanned int `json:"scanned"` // 扫描客户数
Birthday int `json:"birthday"` // 生日触达数
Activity int `json:"activity"` // 活动触达数
Skipped int `json:"skipped"` // 跳过数
Failed int `json:"failed"` // 失败数
Details []string `json:"details"`
}
// AdvicerProactiveSendReq 手动推送(指定客户 + 活动)
type AdvicerProactiveSendReq struct {
ClientId string `json:"clientId"`
ActivityId string `json:"activityId"` // 为空则用当前生效活动
Content string `json:"content"` // 自定义话术(空则 AI 生成)
}
// AdvicerActivityPushReq 活动立即推送(对该活动目标客户群逐人推送)
type AdvicerActivityPushReq struct {
Id string `json:"id"` // 活动 id
DryRun bool `json:"dryRun"` // 只扫描不发送
}
// AdvicerWxConversationListReq 会话列表查询
type AdvicerWxConversationListReq struct {
SelfWxid string `json:"selfWxid"` // 销售本人 wxid
Page int `json:"page"`
PageSize int `json:"page_size"`
}
// AdvicerWxConversationMsgsReq 会话消息记录查询
type AdvicerWxConversationMsgsReq struct {
SelfWxid string `json:"selfWxid"` // 销售本人 wxid
Wxid string `json:"wxid"`
Page int `json:"page"`
PageSize int `json:"page_size"`
}
// AdvicerWxMarkAsReadReq 标记会话消息已读
type AdvicerWxMarkAsReadReq struct {
SelfWxid string `json:"selfWxid"` // 销售本人 wxid
Wxid string `json:"wxid"`
}
// AdvicerWxConversationItem 会话列表条目
type AdvicerWxConversationItem struct {
Wxid string `json:"wxid"` // 对话方 wxid
LastMsg string `json:"lastMsg"` // 最后一条消息内容(截断)
LastMsgType string `json:"lastMsgType"` // 最后一条消息类型
LastMsgTime int64 `json:"lastMsgTime"` // 最后一条消息时间戳(Unix 秒)
LastDirection string `json:"lastDirection"` // 最后一条消息方向
UnreadCount int `json:"unreadCount"` // 未读消息数(客户发来的未读)
IsGroup bool `json:"isGroup"` // 是否群聊
}
// AdvicerProactiveLogListReq 主动触达记录查询
type AdvicerProactiveLogListReq struct {
ClientId string `json:"clientId"`
Wxid string `json:"wxid"`
Type string `json:"type"`
Page int `json:"page"`
PageSize int `json:"page_size"`
}
// ==================== 微信好友(ai_advice_customer) ====================
// AdvicerCustomerAddReq 新增微信好友
type AdvicerCustomerAddReq struct {
SelfWxid string `json:"selfWxid"`
UserName string `json:"userName"`
NickName string `json:"nickName"`
PyInitial string `json:"pyInitial"`
QuanPin string `json:"quanPin"`
Sex int8 `json:"sex"`
Remark string `json:"remark"`
RemarkPyInitial string `json:"remarkPyInitial"`
RemarkQuanPin string `json:"remarkQuanPin"`
Signature string `json:"signature"`
Alias string `json:"alias"`
SnsBgImg string `json:"snsBgImg"`
Country string `json:"country"`
BigHeadImgUrl string `json:"bigHeadImgUrl"`
SmallHeadImgUrl string `json:"smallHeadImgUrl"`
Description string `json:"description"`
CardImgUrl string `json:"cardImgUrl"`
LabelList string `json:"labelList"`
Province string `json:"province"`
City string `json:"city"`
PhoneNumList string `json:"phoneNumList"`
}
// AdvicerCustomerListReq 微信好友列表查询
type AdvicerCustomerListReq struct {
SelfWxid string `json:"selfWxid"`
LabelId string `json:"labelId"` // 按标签 ID 过滤(label_list 包含该 ID)
Page int `json:"page"`
PageSize int `json:"page_size"`
}
// AdvicerCustomerDelReq 删除微信好友
type AdvicerCustomerDelReq struct {
CustomerId int32 `json:"customerId"`
SelfWxid string `json:"selfWxid"`
}
// AdvicerCustomerDiffReq 好友差集查询
type AdvicerCustomerDiffReq struct {
SelfWxid string `json:"selfWxid"` // 销售本人 wxid
UserNames []string `json:"userNames"` // 前端获取的好友 userName 列表
}
// AdvicerCustomerDiffRes 好友差集响应
type AdvicerCustomerDiffRes struct {
List []model.AiAdviceCustomer `json:"list"` // 库中已有的好友记录
Diff []string `json:"diff"` // 库中不存在的好友 userName
Labels []model.AiAdviceLabel `json:"labels"` // 标签列表
}
// AdvicerCustomerBatchAddReq 批量新增微信好友
type AdvicerCustomerBatchAddReq struct {
List []AdvicerCustomerAddReq `json:"list"`
}
// AdvicerCustomerUpdateLabelsReq 更新好友标签列表(wx API + DB 一次完成)
type AdvicerCustomerUpdateLabelsReq struct {
ProjectId int32 `json:"projectId" validate:"required" zh:"项目ID"`
AppId string `json:"appId" zh:"设备ID"`
SelfWxid string `json:"selfWxid" validate:"required" zh:"销售wxid"`
UserName string `json:"userName" validate:"required" zh:"好友userName"`
LabelList string `json:"labelList"`
}
// AdvicerCustomerHostedListReq 查询托管客户列表
type AdvicerCustomerHostedListReq struct {
ProjectId int32 `json:"projectId" validate:"required" zh:"项目ID"`
}
// HostedCustomerItem 托管客户条目(包含客户信息 + 标签名 + 销售名)
type HostedCustomerItem struct {
model.AiAdviceCustomer
LabelNames string `json:"label_names"` // 托管标签名称(逗号分隔)
AdvicerName string `json:"advicer_name"` // 归属销售姓名
}
// ==================== 标签同步 ====================
// AdvicerLabelSyncReq 标签同步请求(前端从微信获取标签后提交)
type AdvicerLabelSyncReq struct {
SelfWxid string `json:"selfWxid"`
Labels []AdvicerLabelItemReq `json:"labels"`
}
// AdvicerLabelItemReq 单个标签项
type AdvicerLabelItemReq struct {
LabelId int `json:"labelId"`
LabelName string `json:"labelName"`
}
// AdvicerLabelListReq 标签列表查询
type AdvicerLabelListReq struct {
SelfWxid string `json:"selfWxid"`
}
// AdvicerLabelHostingReq 切换标签托管状态
type AdvicerLabelHostingReq struct {
SelfWxid string `json:"selfWxid" validate:"required" zh:"销售wxid"`
LabelId int `json:"labelId" validate:"required" zh:"标签ID"`
Hosting int8 `json:"hosting"` // 0=取消托管 1=开启托管
}