Files
soul-yongping/soul-api/internal/model/person.go
2026-03-14 14:37:17 +08:00

35 lines
1.9 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 model
import "time"
// Person @提及人物配置ContentPage 用)
// token 为 32 位唯一密钥,文章 @ 时传入 token小程序点击时用 token 兑换 ckb_api_key
// 同时缓存与存客宝 API 获客计划相关的配置,便于管理端回显与二次编辑
type Person struct {
ID uint `gorm:"primaryKey;autoIncrement" json:"id"`
PersonID string `gorm:"column:person_id;size:50;uniqueIndex" json:"personId"`
Token string `gorm:"column:token;size:36;uniqueIndex" json:"token"` // 32 位唯一 token文章/小程序传此值
Name string `gorm:"column:name;size:100" json:"name"`
Label string `gorm:"column:label;size:200" json:"label"`
CkbApiKey string `gorm:"column:ckb_api_key;size:100;default:''" json:"ckbApiKey"` // 存客宝真实密钥,不对外暴露
// 存客宝计划 ID用于详情与跳转编辑
CkbPlanID int64 `gorm:"column:ckb_plan_id;default:0" json:"ckbPlanId"`
// 存客宝 API 获客配置缓存(与 PersonAddEditModal 对应)
Greeting string `gorm:"column:greeting;size:255;default:''" json:"greeting"`
Tips string `gorm:"column:tips;type:text" json:"tips"`
RemarkType string `gorm:"column:remark_type;size:50;default:''" json:"remarkType"`
RemarkFormat string `gorm:"column:remark_format;size:200;default:''" json:"remarkFormat"`
AddFriendInterval int `gorm:"column:add_friend_interval;default:1" json:"addFriendInterval"`
StartTime string `gorm:"column:start_time;size:10;default:'09:00'" json:"startTime"`
EndTime string `gorm:"column:end_time;size:10;default:'18:00'" json:"endTime"`
DeviceGroups string `gorm:"column:device_groups;size:255;default:''" json:"deviceGroups"` // 逗号分隔的设备ID列表
CreatedAt time.Time `gorm:"column:created_at" json:"createdAt"`
UpdatedAt time.Time `gorm:"column:updated_at" json:"updatedAt"`
}
func (Person) TableName() string { return "persons" }