Documentation ¶
Index ¶
- Constants
- func CreateApiPageReg(creator *Creator)
- func CreateConfig(c *Creator)
- func CreateConfigPreload(creator *Creator)
- func CreateController(c *Creator)
- func CreateCrud(creator *Creator)
- func CreateEmptyController(c *Creator)
- func CreateEzModelConfig(creator *Creator)
- func CreateMigrate(creator *Creator)
- func CreateMod(creator *Creator)
- func CreateModel(creator *Creator)
- func CreateModelConfigFile(c *Creator)
- func CreateOrmConfigFile(c *Creator)
- func CreateVueAdminFile(creator *Creator)
- func GenerateConfig(c *Creator)
- func Init(c *Creator)
- func SetRoot(rt string)
- func SetTwig(tg *twig.Twig)
- type Art
- func (art *Art) CreateConfig()
- func (this *Art) SetCnName(v string) *Art
- func (this *Art) SetDefaultValue(v string) *Art
- func (this *Art) SetEntityType(v string) *Art
- func (this *Art) SetName(v string) *Art
- func (this *Art) SetNullable(v bool) *Art
- func (this *Art) SetOrm(v string) *Art
- func (this *Art) SetSrc(v string) *Art
- func (this *Art) SetType(v string) *Art
- type BaseRelation
- type BaseType
- func (this BaseType) GetConfig() BaseType
- func (this BaseType) GetEntityType() string
- func (this BaseType) GetName() string
- func (this BaseType) GetOrm() string
- func (this BaseType) GetSrc() string
- func (this BaseType) GetType() string
- func (this *BaseType) SetCnName(v string) *BaseType
- func (this *BaseType) SetDefaultValue(v string) *BaseType
- func (this *BaseType) SetDesc(v string) *BaseType
- func (this *BaseType) SetEntityType(v string) *BaseType
- func (this *BaseType) SetName(v string) *BaseType
- func (this *BaseType) SetNullable(v bool) *BaseType
- func (this *BaseType) SetOrm(v string) *BaseType
- func (this *BaseType) SetSrc(v string) *BaseType
- func (this *BaseType) SetType(v string) *BaseType
- type Bool
- func (f *Bool) CreateConfig()
- func (this *Bool) SetCnName(v string) *Bool
- func (this *Bool) SetDefaultValue(v string) *Bool
- func (this *Bool) SetEntityType(v string) *Bool
- func (this *Bool) SetName(v string) *Bool
- func (this *Bool) SetNullable(v bool) *Bool
- func (this *Bool) SetOrm(v string) *Bool
- func (this *Bool) SetSrc(v string) *Bool
- func (this *Bool) SetType(v string) *Bool
- type Creator
- func (c *Creator) AddArt(name string, label string) *Art
- func (c *Creator) AddBool(name string, label string) *Bool
- func (c *Creator) AddCode() *Text
- func (c *Creator) AddContent() *Art
- func (c *Creator) AddCreateAt() *DateTime
- func (c *Creator) AddCreateBy() *Int
- func (c *Creator) AddDateTime(name string, label string) *DateTime
- func (c *Creator) AddDelete() *Bool
- func (c *Creator) AddFile(name string, label string) *File
- func (c *Creator) AddFiles(name string, label string) *Files
- func (c *Creator) AddFloat(name string, label string) *Float
- func (c *Creator) AddInt(name string, label string) *Int
- func (c *Creator) AddJson(name string, label string) *Json
- func (c *Creator) AddLock() *Bool
- func (c *Creator) AddManyToMany(name string, label string, src string) *ManyToMany
- func (c *Creator) AddManyToOne(name string, label string, src string) *ManyToOne
- func (c *Creator) AddName() *Text
- func (c *Creator) AddOneToMany(name string, label string, src string) *OneToMany
- func (c *Creator) AddOneToOne(name string, label string, src string) *OneToOne
- func (c *Creator) AddOwner() *Int
- func (c *Creator) AddSort() *Int
- func (c *Creator) AddState() *Int
- func (c *Creator) AddText(name string, label string) *Text
- func (c *Creator) AddTitle() *Text
- func (c *Creator) AddUpdateAt() *DateTime
- func (c *Creator) Generate()
- func (c *Creator) GetTable() *Table
- func (c *Creator) IsTree() *Table
- func (c *Creator) LoadDependence() *Creator
- func (c *Creator) LoadStatus() *Creator
- func (c *Creator) LoadTree() *Creator
- func (c *Creator) SetCnName(cnName string) *Table
- func (c *Creator) SetName(name string) *Table
- func (c *Creator) SetPath(path string) *Table
- type DateTime
- func (f *DateTime) CreateConfig()
- func (this *DateTime) SetCnName(v string) *DateTime
- func (this *DateTime) SetDefaultValue(v string) *DateTime
- func (this *DateTime) SetEntityType(v string) *DateTime
- func (this *DateTime) SetIsAutoNow(is bool) *DateTime
- func (this *DateTime) SetIsAutoNowAdd(is bool) *DateTime
- func (this *DateTime) SetName(v string) *DateTime
- func (this *DateTime) SetNullable(v bool) *DateTime
- func (this *DateTime) SetOrm(v string) *DateTime
- func (this *DateTime) SetSrc(v string) *DateTime
- func (this *DateTime) SetType(v string) *DateTime
- type Field
- type FieldItem
- type File
- func (json *File) CreateConfig()
- func (this *File) SetCnName(v string) *File
- func (this *File) SetDefaultValue(v string) *File
- func (this *File) SetEntityType(v string) *File
- func (this *File) SetName(v string) *File
- func (this *File) SetNullable(v bool) *File
- func (this *File) SetOrm(v string) *File
- func (this *File) SetSrc(v string) *File
- func (this *File) SetType(v string) *File
- type Files
- func (json *Files) CreateConfig()
- func (this *Files) SetCnName(v string) *Files
- func (this *Files) SetDefaultValue(v string) *Files
- func (this *Files) SetEntityType(v string) *Files
- func (this *Files) SetName(v string) *Files
- func (this *Files) SetNullable(v bool) *Files
- func (this *Files) SetOrm(v string) *Files
- func (this *Files) SetSrc(v string) *Files
- func (this *Files) SetType(v string) *Files
- type Float
- func (f *Float) CreateConfig()
- func (this *Float) SetBase(v string) *Float
- func (this *Float) SetCnName(v string) *Float
- func (f *Float) SetDecimals(dec int) *Float
- func (this *Float) SetDefaultValue(v string) *Float
- func (f *Float) SetDigits(dig int) *Float
- func (this *Float) SetEntityType(v string) *Float
- func (this *Float) SetName(v string) *Float
- func (this *Float) SetNullable(v bool) *Float
- func (this *Float) SetOrm(v string) *Float
- func (this *Float) SetSrc(v string) *Float
- func (this *Float) SetType(v string) *Float
- type Int
- func (f *Int) CreateConfig()
- func (this *Int) SetBase(v string) *Int
- func (this *Int) SetCnName(v string) *Int
- func (this *Int) SetDefaultValue(v string) *Int
- func (this *Int) SetEntityType(v string) *Int
- func (this *Int) SetName(v string) *Int
- func (this *Int) SetNullable(v bool) *Int
- func (this *Int) SetOrm(v string) *Int
- func (this *Int) SetSrc(v string) *Int
- func (this *Int) SetType(v string) *Int
- type Json
- func (json *Json) CreateConfig()
- func (this *Json) SetCnName(v string) *Json
- func (this *Json) SetDefaultValue(v string) *Json
- func (this *Json) SetEntityType(v string) *Json
- func (this *Json) SetName(v string) *Json
- func (this *Json) SetNullable(v bool) *Json
- func (this *Json) SetOrm(v string) *Json
- func (this *Json) SetSrc(v string) *Json
- func (this *Json) SetType(v string) *Json
- type ManyToMany
- func (f *ManyToMany) CreateConfig()
- func (this *ManyToMany) SetCnName(v string) *ManyToMany
- func (this *ManyToMany) SetDefaultValue(v string) *ManyToMany
- func (this *ManyToMany) SetEntityType(v string) *ManyToMany
- func (this *ManyToMany) SetFk(v string) *ManyToMany
- func (f *ManyToMany) SetIsControl(ctrl bool) *ManyToMany
- func (this *ManyToMany) SetLinkTable(v string) *ManyToMany
- func (this *ManyToMany) SetName(v string) *ManyToMany
- func (this *ManyToMany) SetNullable(v bool) *ManyToMany
- func (this *ManyToMany) SetOrm(v string) *ManyToMany
- func (this *ManyToMany) SetRef(v string) *ManyToMany
- func (this *ManyToMany) SetSrc(v string) *ManyToMany
- func (this *ManyToMany) SetSrcDir(v string) *ManyToMany
- func (this *ManyToMany) SetType(v string) *ManyToMany
- type ManyToOne
- func (f *ManyToOne) CreateConfig()
- func (this *ManyToOne) SetCnName(v string) *ManyToOne
- func (this *ManyToOne) SetDefaultValue(v string) *ManyToOne
- func (this *ManyToOne) SetEntityType(v string) *ManyToOne
- func (this *ManyToOne) SetFk(v string) *ManyToOne
- func (this *ManyToOne) SetName(v string) *ManyToOne
- func (this *ManyToOne) SetNullable(v bool) *ManyToOne
- func (this *ManyToOne) SetOrm(v string) *ManyToOne
- func (this *ManyToOne) SetRef(v string) *ManyToOne
- func (this *ManyToOne) SetSrc(v string) *ManyToOne
- func (this *ManyToOne) SetSrcDir(v string) *ManyToOne
- func (this *ManyToOne) SetType(v string) *ManyToOne
- type OneToMany
- func (f *OneToMany) CreateConfig()
- func (this *OneToMany) SetCnName(v string) *OneToMany
- func (this *OneToMany) SetDefaultValue(v string) *OneToMany
- func (this *OneToMany) SetEntityType(v string) *OneToMany
- func (this *OneToMany) SetFk(v string) *OneToMany
- func (this *OneToMany) SetName(v string) *OneToMany
- func (this *OneToMany) SetNullable(v bool) *OneToMany
- func (this *OneToMany) SetOrm(v string) *OneToMany
- func (this *OneToMany) SetSrc(v string) *OneToMany
- func (this *OneToMany) SetSrcDir(v string) *OneToMany
- func (this *OneToMany) SetType(v string) *OneToMany
- type OneToOne
- func (f *OneToOne) CreateConfig()
- func (this *OneToOne) SetCnName(v string) *OneToOne
- func (this *OneToOne) SetDefaultValue(v string) *OneToOne
- func (this *OneToOne) SetEntityType(v string) *OneToOne
- func (this *OneToOne) SetFk(v string) *OneToOne
- func (f *OneToOne) SetIsControl(ctrl bool) *OneToOne
- func (this *OneToOne) SetName(v string) *OneToOne
- func (this *OneToOne) SetNullable(v bool) *OneToOne
- func (this *OneToOne) SetOrm(v string) *OneToOne
- func (this *OneToOne) SetRef(v string) *OneToOne
- func (this *OneToOne) SetSrc(v string) *OneToOne
- func (this *OneToOne) SetSrcDir(v string) *OneToOne
- func (this *OneToOne) SetType(v string) *OneToOne
- type OrmField
- type Table
- type Text
- func (text *Text) CreateConfig()
- func (this *Text) SetCnName(v string) *Text
- func (this *Text) SetDefaultValue(v string) *Text
- func (this *Text) SetEntityType(v string) *Text
- func (this *Text) SetLength(v int) *Text
- func (this *Text) SetName(v string) *Text
- func (this *Text) SetNullable(v bool) *Text
- func (this *Text) SetOrm(v string) *Text
- func (this *Text) SetSrc(v string) *Text
- func (this *Text) SetType(v string) *Text
Constants ¶
View Source
const ( F_TEXT = "string" F_INT = "int" F_BOOL = "bool" F_FLOAT = "float64" F_DATETIME = "time.Time" F_ARRAY = "array" F_M2O = "*" F_O2M = "[]*" F_O2O = "*" F_M2M = "[]*" F_ART = "string" F_JSON = "string" F_FILE = "orm.File" F_FILES = "orm.Files" )
Variables ¶
This section is empty.
Functions ¶
func CreateApiPageReg ¶
func CreateApiPageReg(creator *Creator)
func CreateConfig ¶
func CreateConfig(c *Creator)
func CreateConfigPreload ¶
func CreateConfigPreload(creator *Creator)
func CreateController ¶
func CreateController(c *Creator)
func CreateCrud ¶
func CreateCrud(creator *Creator)
func CreateEmptyController ¶
func CreateEmptyController(c *Creator)
func CreateEzModelConfig ¶
func CreateEzModelConfig(creator *Creator)
func CreateMigrate ¶
func CreateMigrate(creator *Creator)
func CreateModel ¶
func CreateModel(creator *Creator)
func CreateModelConfigFile ¶
func CreateModelConfigFile(c *Creator)
func CreateOrmConfigFile ¶
func CreateOrmConfigFile(c *Creator)
func CreateVueAdminFile ¶
func CreateVueAdminFile(creator *Creator)
func GenerateConfig ¶
func GenerateConfig(c *Creator)
Types ¶
type Art ¶
type Art struct {
BaseType
}
func (*Art) CreateConfig ¶
func (art *Art) CreateConfig()
func (*Art) SetDefaultValue ¶
func (*Art) SetEntityType ¶
func (*Art) SetNullable ¶
type BaseRelation ¶
type BaseType ¶
type BaseType struct { Name string Type string EntityType string CnName string Nullable bool DefaultValue string Orm string Src string Desc string }
func (BaseType) GetEntityType ¶
func (*BaseType) SetDefaultValue ¶
func (*BaseType) SetEntityType ¶
func (*BaseType) SetNullable ¶
type Bool ¶
type Bool struct {
BaseType
}
func (*Bool) CreateConfig ¶
func (f *Bool) CreateConfig()
func (*Bool) SetDefaultValue ¶
func (*Bool) SetEntityType ¶
func (*Bool) SetNullable ¶
type Creator ¶
type Creator struct { AppName string `json:"appName"` Table *Table `json:"table"` Fields []FieldItem `json:"fields"` Model string `json:"model"` //数据模型,特殊模型需要使用该字段,比如tree SafeDelete bool `json:"safeDelete"` }
func (*Creator) AddContent ¶
func (*Creator) AddCreateBy ¶
func (*Creator) AddManyToMany ¶
func (c *Creator) AddManyToMany(name string, label string, src string) *ManyToMany
func (*Creator) AddManyToOne ¶
func (*Creator) AddOneToMany ¶
func (*Creator) AddOneToOne ¶
func (*Creator) AddUpdateAt ¶
func (*Creator) LoadDependence ¶
func (*Creator) LoadStatus ¶
type DateTime ¶
type DateTime struct { BaseType IsAutoNow bool IsAutoNowAdd bool OrmParam string //auto_now; auto_now_add; }
func (*DateTime) CreateConfig ¶
func (f *DateTime) CreateConfig()
func (*DateTime) SetDefaultValue ¶
func (*DateTime) SetEntityType ¶
func (*DateTime) SetIsAutoNowAdd ¶
是否在初次创建时自动填充
func (*DateTime) SetNullable ¶
type Field ¶
type Field struct { CnName string `json:"cnName" groups:"app" orm:"null;description(字段名中文);on_delete(set_null);size(20);"` Name string `json:"name" groups:"app" orm:"null;description(字段名);on_delete(set_null);size(20);"` Type int `json:"type" groups:"app" orm:"null;description(数据类型);on_delete(set_null);rel(fk);"` Length string `json:"length" groups:"app" orm:"null;description(长度);on_delete(set_null);size(255);"` Nullable bool `json:"nullable" groups:"app" orm:"null;description(语序为空);on_delete(set_null);"` DataSrc string `json:"dataSrc" groups:"app" orm:"null;description(数据源);on_delete(set_null);size(64);"` DataSrControl bool `json:"dataSrControl" groups:"app" orm:"null;description(主控);on_delete(set_null);"` DefaultValue string `json:"defaultValue" groups:"app" orm:"null;description(默认值);on_delete(set_null);size(255);"` OrmParam string `json:"ormParam" groups:"app" orm:"null;description(orm参数);on_delete(set_null);size(255);"` }
type File ¶
type File struct {
BaseType
}
func (*File) CreateConfig ¶
func (json *File) CreateConfig()
func (*File) SetDefaultValue ¶
func (*File) SetEntityType ¶
func (*File) SetNullable ¶
type Files ¶
type Files struct {
BaseType
}
func (*Files) CreateConfig ¶
func (json *Files) CreateConfig()
func (*Files) SetDefaultValue ¶
func (*Files) SetEntityType ¶
func (*Files) SetNullable ¶
type Float ¶
type Float struct { BaseType Base string Digits int //数字位长度 Decimals int //小数位精度 OrmParam string //digits(12); decimals(4); }
func (*Float) CreateConfig ¶
func (f *Float) CreateConfig()
func (*Float) SetDefaultValue ¶
func (*Float) SetEntityType ¶
func (*Float) SetNullable ¶
type Int ¶
func (*Int) CreateConfig ¶
func (f *Int) CreateConfig()
func (*Int) SetDefaultValue ¶
func (*Int) SetEntityType ¶
func (*Int) SetNullable ¶
type Json ¶
type Json struct {
BaseType
}
func (*Json) CreateConfig ¶
func (json *Json) CreateConfig()
func (*Json) SetDefaultValue ¶
func (*Json) SetEntityType ¶
func (*Json) SetNullable ¶
type ManyToMany ¶
type ManyToMany struct { BaseRelation IsControl bool LinkTable string }
func (*ManyToMany) CreateConfig ¶
func (f *ManyToMany) CreateConfig()
func (*ManyToMany) SetCnName ¶
func (this *ManyToMany) SetCnName(v string) *ManyToMany
func (*ManyToMany) SetDefaultValue ¶
func (this *ManyToMany) SetDefaultValue(v string) *ManyToMany
func (*ManyToMany) SetEntityType ¶
func (this *ManyToMany) SetEntityType(v string) *ManyToMany
func (*ManyToMany) SetFk ¶
func (this *ManyToMany) SetFk(v string) *ManyToMany
func (*ManyToMany) SetIsControl ¶
func (f *ManyToMany) SetIsControl(ctrl bool) *ManyToMany
func (*ManyToMany) SetLinkTable ¶
func (this *ManyToMany) SetLinkTable(v string) *ManyToMany
func (*ManyToMany) SetName ¶
func (this *ManyToMany) SetName(v string) *ManyToMany
func (*ManyToMany) SetNullable ¶
func (this *ManyToMany) SetNullable(v bool) *ManyToMany
func (*ManyToMany) SetOrm ¶
func (this *ManyToMany) SetOrm(v string) *ManyToMany
func (*ManyToMany) SetRef ¶
func (this *ManyToMany) SetRef(v string) *ManyToMany
func (*ManyToMany) SetSrc ¶
func (this *ManyToMany) SetSrc(v string) *ManyToMany
func (*ManyToMany) SetSrcDir ¶
func (this *ManyToMany) SetSrcDir(v string) *ManyToMany
func (*ManyToMany) SetType ¶
func (this *ManyToMany) SetType(v string) *ManyToMany
type ManyToOne ¶
type ManyToOne struct {
BaseRelation
}
func (*ManyToOne) CreateConfig ¶
func (f *ManyToOne) CreateConfig()
func (*ManyToOne) SetDefaultValue ¶
func (*ManyToOne) SetEntityType ¶
func (*ManyToOne) SetNullable ¶
type OneToMany ¶
type OneToMany struct {
BaseRelation
}
func (*OneToMany) CreateConfig ¶
func (f *OneToMany) CreateConfig()
func (*OneToMany) SetDefaultValue ¶
func (*OneToMany) SetEntityType ¶
func (*OneToMany) SetNullable ¶
type OneToOne ¶
type OneToOne struct { BaseRelation IsControl bool }
func (*OneToOne) CreateConfig ¶
func (f *OneToOne) CreateConfig()
func (*OneToOne) SetDefaultValue ¶
func (*OneToOne) SetEntityType ¶
func (*OneToOne) SetIsControl ¶
func (*OneToOne) SetNullable ¶
type Table ¶
type Table struct { Name string `json:"name" groups:"app" orm:"null;description(数据表);on_delete(set_null);size(255);"` CnName string `json:"cnName" groups:"app" orm:"null;description(中文名称);on_delete(set_null);size(255);"` Path string `json:"path" groups:"app" orm:"null;description(实体路径);on_delete(set_null);size(255);"` Fields []FieldItem `json:"fields" groups:"app" orm:"null;description(字段集);on_delete(set_null);reverse(many);"` }
type Text ¶
func (*Text) CreateConfig ¶
func (text *Text) CreateConfig()
func (*Text) SetDefaultValue ¶
func (*Text) SetEntityType ¶
func (*Text) SetNullable ¶
Click to show internal directories.
Click to hide internal directories.