28 lines
799 B
Go
28 lines
799 B
Go
package schema
|
|||
|
|
|
||
|
|
import (
|
||
|
|
"entgo.io/ent"
|
||
|
|
"entgo.io/ent/dialect/entsql"
|
||
|
|
"entgo.io/ent/schema"
|
||
|
|
"entgo.io/ent/schema/field"
|
||
|
|
)
|
||
|
|
|
||
|
|
// SysConfig 系统基础设置(key/value)。
|
||
|
|
// 系统管理员「基础设置」页维护,保存即生效(无需重启);敏感信息(JWT secret、
|
||
|
|
// WMS token、数据库密码)仍留在 etc/*.yaml,不进本表。
|
||
|
|
type SysConfig struct {
|
||
|
|
ent.Schema
|
||
|
|
}
|
||
|
|
|
||
|
|
func (SysConfig) Annotations() []schema.Annotation {
|
||
|
|
return []schema.Annotation{entsql.Annotation{Table: "sys_config"}}
|
||
|
|
}
|
||
|
|
|
||
|
|
func (SysConfig) Fields() []ent.Field {
|
||
|
|
return []ent.Field{
|
||
|
|
field.String("key").Unique().MaxLen(64).Comment("配置键,如 wms.base_url"),
|
||
|
|
field.String("value").MaxLen(512).Comment("配置值"),
|
||
|
|
field.String("remark").Optional().MaxLen(255).Comment("说明"),
|
||
|
|
}
|
||
|
|
}
|