- 录单列表新增「平台」「操作人」两列,录单表单与编辑弹窗新增同名字段下拉 - 新增 cs_manual_entry_options 表与 4 个接口(读取/新增/重命名/删除),页面右上角弹窗维护平台与操作人 - 迁移 000087:cs_manual_entries 增加 platform/operator 列与索引,注册 cs_manual_entry:option_manage 权限并授予 ops/super_admin - 记录保存名称快照,删除选项不影响历史记录;同类型重名返回 409,跨类型同名允许 - 顶部关键词查询支持命中平台/操作人 - 新增单测:选项 CRUD 边界与录单平台/操作人读写
40 lines
1.9 KiB
Go
40 lines
1.9 KiB
Go
package model
|
|
|
|
import "time"
|
|
|
|
// CSManualEntry 客服手动录单记录。
|
|
// 客服在后台手动登记一个编号(如 202610120013),该编号与其登录账号绑定,
|
|
// 记录平台、操作人、登记时间等,供后续查询与按客服统计今日录单量。
|
|
// platform / operator 存名称快照:后台删掉选项也不影响历史记录展示。
|
|
type CSManualEntry struct {
|
|
ID uint64 `gorm:"primaryKey" json:"id"`
|
|
EntryNo string `gorm:"size:64;not null;uniqueIndex" json:"entry_no"`
|
|
Platform string `gorm:"size:64;not null;default:'';index" json:"platform"`
|
|
Operator string `gorm:"size:64;not null;default:'';index" json:"operator"`
|
|
AdminID uint64 `gorm:"not null;index" json:"admin_id"`
|
|
AdminName string `gorm:"size:64;not null;default:''" json:"admin_name"`
|
|
AdminUsername string `gorm:"size:64;not null;default:''" json:"admin_username"`
|
|
Remark string `gorm:"size:255;not null;default:''" json:"remark"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
func (CSManualEntry) TableName() string {
|
|
return "cs_manual_entries"
|
|
}
|
|
|
|
// CSManualEntryOption 客服手动录单的可选项配置(平台 / 操作人)。
|
|
// 仅作为录单表单的下拉数据源,记录里保存的是名称快照。
|
|
type CSManualEntryOption struct {
|
|
ID uint64 `gorm:"primaryKey" json:"id"`
|
|
Type string `gorm:"size:16;not null;uniqueIndex:uk_cs_manual_entry_options_type_name,priority:1" json:"type"`
|
|
Name string `gorm:"size:64;not null;uniqueIndex:uk_cs_manual_entry_options_type_name,priority:2" json:"name"`
|
|
SortOrder int `gorm:"not null;default:0" json:"sort_order"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
func (CSManualEntryOption) TableName() string {
|
|
return "cs_manual_entry_options"
|
|
}
|