ai_scheduler/internal/data/mongo_model/advicer_proactive_log.go

39 lines
1.5 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 mongo_model
import "time"
// 主动触达类型
const (
ProactiveTypeBirthday = "birthday" // 生日祝福
ProactiveTypeActivity = "activity" // 活动推送
)
// 主动触达状态
const (
ProactiveStatusSent = "sent" // 已发送
ProactiveStatusFailed = "failed" // 发送失败
)
// AdvicerProactiveLogMongo AI 主动触达记录(生日祝福/活动推送,用于去重与频率控制)
type AdvicerProactiveLogMongo struct {
ProjectId int32 `json:"projectId" bson:"projectId"` // 所属项目
AdvicerId int32 `json:"advicerId" bson:"advicerId"` // 所属销售
ClientId string `json:"clientId" bson:"clientId"` // 客户记录 _id(Hex)
Wxid string `json:"wxid" bson:"wxid"` // 客户微信 wxid
Type string `json:"type" bson:"type"` // 类型:birthday/activity
RefId string `json:"refId" bson:"refId"` // 去重键:生日=年度(2026),活动=活动 _id
Content string `json:"content" bson:"content"` // 实际发送内容
Status string `json:"status" bson:"status"` // 状态:sent/failed
ErrMsg string `json:"errMsg" bson:"errMsg"` // 失败原因
SendAt time.Time `json:"sendAt" bson:"sendAt"` // 发送时间
CreateAt time.Time `json:"createAt" bson:"createAt"` // 创建时间
}
func NewAdvicerProactiveLogMongo() *AdvicerProactiveLogMongo {
return &AdvicerProactiveLogMongo{}
}
func (a *AdvicerProactiveLogMongo) MongoTableName() string {
return "advicer_proactive_log"
}