entity

package
v0.0.0-...-a92999b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encode

func Encode(data interface{}) []byte

Types

type Api

type Api struct {
	Name string
	Path string
	Func []string
}

func (Api) String

func (a Api) String() string

type Class

type Class struct {
	Type        string // c ctrl d:dao,e entity
	Name        string
	ParentClass []string
	Fields      []GoField
	Func        []*Func
}

func (*Class) AddField

func (c *Class) AddField(fields ...GoField)

func (*Class) AddFunc

func (c *Class) AddFunc(name, parameter, ret, body string) *Class

func (*Class) AddParent

func (c *Class) AddParent(name ...string)

func (*Class) String

func (c *Class) String() string

type ClassList

type ClassList []*Class

func (ClassList) String

func (list ClassList) String() string

type Columns

type Columns struct {
	Title       string `json:"title"`
	DataIndex   string `json:"data_index"`
	Key         string `json:"key"`
	ScopedSlots string `json:"scoped_slots"`
}

type Dom

type Dom struct {
	Comment  []*ast.Comment
	Name     string
	Fields   []Field
	FilePath string
}

type Field

type Field struct {
	Field       string // 字段名
	Type        FieldType
	Tag         Tag
	TopComment  []*ast.Comment // 头部注释
	LineComment []*ast.Comment // 行注释
}

type FieldType

type FieldType string

type File

type File struct {
	Pkg    string
	Class  ClassList
	Import []string
	Func   []*Func
}

func (*File) AddClass

func (f *File) AddClass(name string) *Class

SetClass 设置struct

func (*File) Func2String

func (f *File) Func2String() string

Func2String

func (*File) Import2String

func (f *File) Import2String() string

Import2String

func (*File) NewFunc

func (f *File) NewFunc(class, name, parameter, ret, body string) *Func

NewFunc

func (*File) Pkg2String

func (f *File) Pkg2String() string

Pkg2String

type Func

type Func struct {
	Class     string
	Name      string
	Parameter string
	Ret       string
	Body      []string
}

func (*Func) AddBody

func (f *Func) AddBody(body ...string)

AddBody func 添加内容

func (*Func) String

func (f *Func) String() string

type GoField

type GoField struct {
	Name string
	Type string
	Tag  string
}

func NewField

func NewField(name, Type, Tag string) GoField

type Import

type Import struct {
	Components []string
	Path       string
}

func (Import) String

func (i Import) String() string

type InfoPage

type InfoPage struct {
	Name    string
	NameEn  string
	Imports []Import
	Fields  []VField
}

func (InfoPage) String

func (i InfoPage) String() string

type Router

type Router struct {
	Path               string                 `json:"path,omitempty"`
	Component          string                 `json:"component,omitempty"`
	Redirect           string                 `json:"redirect,omitempty"`
	Name               string                 `json:"name,omitempty"`
	Hidden             bool                   `json:"hidden,omitempty"`
	HideChildrenInMenu bool                   `json:"hideChildrenInMenu,omitempty"`
	Meta               map[string]interface{} `json:"meta,omitempty"`
	Children           []*Router              ` json:"children,omitempty"`
}

func (*Router) AddChildren

func (r *Router) AddChildren(router *Router) *Router

func (*Router) String

func (r *Router) String() string

type RouterIndex

type RouterIndex struct {
	Imports []Import
	Router  []string
}

func (RouterIndex) String

func (r RouterIndex) String() string

type TablePage

type TablePage struct {
	Name    string
	NameEn  string
	Imports []Import
	Searchs []VField
	Columns []VField
}

func (TablePage) String

func (t TablePage) String() string

type Tag

type Tag string

func (Tag) Lookup

func (tag Tag) Lookup(key string) (value string, ok bool)

type VField

type VField struct {
	Field       string
	Name        string
	Type        string //text num file context
	Validate    Validate
	Placeholder string
}

type Validate

type Validate struct {
	Type string // vue验证,regular
	Val  string
	Msg  string // 错误提示
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL