Files
bl/modules/dict/model/dict_info.go
昔念 cc5a2aaf46 feat(talk): 优化采集逻辑并移除冗余字典服务调用
- 移除了 talk.go 中对 dict 模块的依赖,直接使用配置中的 ItemID
- 修改了 talkconfig.go 中的 ItemID 类型为 uint32,提升一致性
- 调整 talk.go 和 talkconfig.go 的缓存获取方式,增强性能
- 更新了 pet_fusion_material_service.go 中字典服务调用方法
- 修复 talk 模型中 TalkID 字段的唯一索引问题
- 日志记录由 Error 改为 Info,避免误导性
2025-12-09 00:09:51 +08:00

41 lines
1.0 KiB
Go

package model
import (
"blazing/cool"
)
const TableNameDictInfo = "dict_info"
// DictInfo mapped from table <dict_info>
type DictInfo struct {
*cool.Model
TypeID int32 `gorm:"column:typeId;type:int;not null" json:"typeId"` // 类型ID
Name string `gorm:"column:name;type:varchar(255);not null" json:"name"` // 名称
ordernum int32 `gorm:"column:ordernum;type:int;not null" json:"ordernum"` // 排序
Remark *string `gorm:"column:remark;type:varchar(255)" json:"remark"` // 备注
Value int32 `gorm:"column:value;type:int;not null" json:"value"`
ParentID *int32 `gorm:"column:parentId;type:int" json:"parentId"` // 父ID
}
// TableName DictInfo's table name
func (*DictInfo) TableName() string {
return TableNameDictInfo
}
// GroupName DictInfo's table group
func (*DictInfo) GroupName() string {
return "default"
}
// NewDictInfo create a new DictInfo
func NewDictInfo() *DictInfo {
return &DictInfo{
Model: cool.NewModel(),
}
}
// init 创建表
func init() {
cool.CreateTable(&DictInfo{})
}