feat优化字典数据错误判断写法

This commit is contained in:
zhangwenjian
2021-05-08 13:53:27 +08:00
committed by wenjianzhang
parent c6d94c03fb
commit c6a52134b3
69 changed files with 591 additions and 479 deletions
+26
View File
@@ -0,0 +1,26 @@
package models
import (
"go-admin/common/models"
)
type SysChinaAreaData struct {
models.Model
PId string `json:"p_id" gorm:"size:11;comment:上级编码"`
Name string `json:"name" gorm:"size:128;comment:名称"`
models.ControlBy
models.ModelTime
}
func (SysChinaAreaData) TableName() string {
return "sys_china_area_data"
}
func (e *SysChinaAreaData) Generate() models.ActiveRecord {
o := *e
return &o
}
func (e *SysChinaAreaData) GetId() interface{} {
return e.Id
}
+40
View File
@@ -0,0 +1,40 @@
package models
import (
"go-admin/common/models"
)
type SysFileDir struct {
models.Model
Label string `json:"label" gorm:"type:varchar(255);comment:目录名称"` // 目录名称
PId int `json:"p_id" gorm:"type:int(11);comment:上级目录"` // 上级目录
Sort string `json:"sort" gorm:"type:bigint(20);comment:排序"` // 排序
Path string `json:"path" gorm:"type:varchar(255);comment:路径"` // 路径
Children []SysFileDir `json:"children,omitempty" gorm:"-"` // 下级信息
models.ControlBy
models.ModelTime
}
//type SysFileDirL struct {
// models.Model
// Label string `json:"label" gorm:"type:varchar(255);comment:目录名称"` // 目录名称
// PId int `json:"pId" gorm:"type:int(11);comment:上级目录"` // 上级目录
// Sort string `json:"sort" gorm:"type:bigint(20);comment:排序"` // 排序
// Path string `json:"path" gorm:"type:varchar(255);comment:路径"` // 路径
// models.ControlBy
// models.ModelTime
// Children []SysFileDirL `json:"children,omitempty" gorm:"-"` // 下级信息
//}
func (SysFileDir) TableName() string { /**/
return "sys_file_dir"
}
func (e *SysFileDir) Generate() models.ActiveRecord {
o := *e
return &o
}
func (e *SysFileDir) GetId() interface{} {
return e.Id
}
+31
View File
@@ -0,0 +1,31 @@
package models
import (
"go-admin/common/models"
)
type SysFileInfo struct {
models.Model
Type string `json:"type" gorm:"size:255;comment:类型"` //
Name string `json:"name" gorm:"size:255;comment:名称"` //
Size string `json:"size" gorm:"size:11;comment:大小"` //
PId int `json:"p_id" gorm:"size:11;comment:目录"` //
Source string `json:"source" gorm:"size:255;comment:来源"` //
Url string `json:"url" gorm:"size:255;comment:地址"` //
FullUrl string `json:"full_url" gorm:"size:255;comment:全地址"` //
models.ControlBy
models.ModelTime
}
func (SysFileInfo) TableName() string {
return "sys_file_info"
}
func (e *SysFileInfo) Generate() models.ActiveRecord {
o := *e
return &o
}
func (e *SysFileInfo) GetId() interface{} {
return e.Id
}