Documentation ¶
Index ¶
- Constants
- func CreateController(c *Creator)
- func CreateCrud(creator *Creator)
- func CreateDocument(creator *Creator)
- func CreateEmptyController(c *Creator)
- func CreateNestedDocument(creator *Creator) string
- func CreateVueAdminFile(creator *Creator)
- func Init(c *Creator)
- func ReadTpl(fileName string) string
- func SetRoot(rt string)
- func SetTwig(tg *twig.Twig)
- type Creator
- func (c *Creator) Add(name string, label string) *Field
- func (c *Creator) AddDocument(name string, cnName string, function func(subDoc *Creator) *Creator) *Creator
- func (c *Creator) Generate()
- func (c *Creator) GetTable() *Table
- func (c *Creator) SetCnName(cnName string) *Table
- func (c *Creator) SetName(name string) *Table
- func (c *Creator) SetPath(path string) *Table
- type Field
- func (this *Field) CreateConfig() *Field
- func (this *Field) GetCnName() string
- func (this *Field) GetConfig() *Field
- func (this *Field) GetName() string
- func (this *Field) GetReName() string
- func (this *Field) GetSrc() string
- func (this *Field) GetType() string
- func (this *Field) IsArrayFloat() *Field
- func (this *Field) IsArrayInt() *Field
- func (this *Field) IsArrayMap() *Field
- func (this *Field) IsArrayString() *Field
- func (this *Field) IsBool() *Field
- func (this *Field) IsFloat() *Field
- func (this *Field) IsInt() *Field
- func (this *Field) IsMap() *Field
- func (this *Field) IsO20() *Field
- func (this *Field) IsO2M() *Field
- func (this *Field) IsString() *Field
- func (this *Field) IsTime() *Field
- func (this *Field) SetCnName(v string) *Field
- func (this *Field) SetName(v string) *Field
- func (this *Field) SetReName(v string) *Field
- func (this *Field) SetSrc(v string) *Field
- func (this *Field) SetType(v string) *Field
- type OrmField
- type Table
Constants ¶
View Source
const ( F_STRING = "string" F_INT = "int64" F_BOOL = "bool" F_FLOAT = "float64" F_TIME = "time.Time" F_A_INT = "[]int64" F_A_FLOAT = "[]float64" F_A_STRING = "[]string" F_O2M = "[]*" F_O2O = "*" F_MAP = "bson.M" F_A_MAP = "[]bson.M" )
Variables ¶
This section is empty.
Functions ¶
func CreateController ¶
func CreateController(c *Creator)
func CreateCrud ¶
func CreateCrud(creator *Creator)
func CreateDocument ¶
func CreateDocument(creator *Creator)
func CreateEmptyController ¶
func CreateEmptyController(c *Creator)
func CreateNestedDocument ¶
func CreateVueAdminFile ¶
func CreateVueAdminFile(creator *Creator)
Types ¶
type Creator ¶
type Creator struct { AppName string `json:"appName"` Table *Table `json:"table"` Fields []*Field `json:"fields"` RelationTables []*Creator `json:"relationTables"` }
func (*Creator) AddDocument ¶
type Field ¶
func (*Field) CreateConfig ¶
func (*Field) IsArrayFloat ¶
func (*Field) IsArrayInt ¶
func (*Field) IsArrayMap ¶
func (*Field) IsArrayString ¶
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 []*Field `json:"fields" groups:"app" orm:"null;description(字段集);on_delete(set_null);reverse(many);"` }
Click to show internal directories.
Click to hide internal directories.