other: 配置导表优化

This commit is contained in:
kercylan98
2023-07-17 16:06:36 +08:00
parent 91b2b52fc8
commit 130869af4e
7 changed files with 113 additions and 49 deletions
+5 -4
View File
@@ -26,13 +26,13 @@ type Loader struct {
// LoadStruct 加载结构
func (slf *Loader) LoadStruct(config Config) *TmplStruct {
var tmpl = &TmplStruct{
Name: str.FirstUpper(config.GetConfigName()),
Desc: config.GetDescription(),
Name: str.FirstUpper(config.GetConfigName()),
Desc: config.GetDescription(),
IndexCount: config.GetIndexCount(),
}
indexCount := config.GetIndexCount()
for i, field := range config.GetFields() {
f := tmpl.addField(tmpl.Name, str.FirstUpper(field.Name), field.Desc, field.Type, slf.fields)
if i < indexCount {
if i < tmpl.IndexCount {
f.isIndex = true
}
}
@@ -167,6 +167,7 @@ type DataInfo struct {
// DataField 配置数据字段
type DataField struct {
Index int // 字段索引
Name string // 字段名称
Desc string // 字段描述
Type string // 字段类型