Documentation
¶
Index ¶
- Constants
- type DataOrigin
- type ElOption
- type Engine
- func (e *Engine) AddField(filed ...Field) *Engine
- func (e *Engine) AddMiddleware(m ...gin.HandlerFunc) *Engine
- func (e *Engine) Register()
- func (e *Engine) RegisterDeleteHandler(relativePath string, handlerFunc gin.HandlerFunc) *Engine
- func (e *Engine) RegisterGetHandler(relativePath string, handlerFunc gin.HandlerFunc) *Engine
- func (e *Engine) RegisterPatchHandler(relativePath string, handlerFunc gin.HandlerFunc) *Engine
- func (e *Engine) RegisterPostHandler(relativePath string, handlerFunc gin.HandlerFunc) *Engine
- type Field
- type Options
Constants ¶
View Source
const ( WhereEQ uint8 = iota + 1 // = WhereLike // LIKE WhereIn // IN WhereGt // > WhereLt // < WhereGe // >= WhereLe // <= WhereTst // > AND < WhereEst // >= AND < WhereTse // > AND <= WhereEse // >= AND <= WhereFs // FIND_IN_SET )
数据筛选自动sql条件
View Source
const ( ElementComponentInput uint8 = iota + 1 // input ElementComponentDatePicker ElementComponentDateRangePicker ElementComponentDateTimePicker ElementComponentDateTimeRangePicker ElementComponentSelect ElementComponentCascader )
Element 组件
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataOrigin ¶
type DataOrigin interface {
Page(req request.CRUDRequest) (data []map[string]interface{}, count int64, pageSize int64, err error)
GetById(req request.CRUDRequest) (data map[string]interface{}, err error)
UpdateById(req request.CRUDRequest) (id interface{}, err error)
Create(req request.CRUDRequest) (id interface{}, err error)
Delete(req request.CRUDRequest) (id interface{}, err error)
}
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
实体
func (*Engine) AddMiddleware ¶
func (e *Engine) AddMiddleware(m ...gin.HandlerFunc) *Engine
func (*Engine) RegisterDeleteHandler ¶
func (e *Engine) RegisterDeleteHandler(relativePath string, handlerFunc gin.HandlerFunc) *Engine
func (*Engine) RegisterGetHandler ¶
func (e *Engine) RegisterGetHandler(relativePath string, handlerFunc gin.HandlerFunc) *Engine
func (*Engine) RegisterPatchHandler ¶
func (e *Engine) RegisterPatchHandler(relativePath string, handlerFunc gin.HandlerFunc) *Engine
func (*Engine) RegisterPostHandler ¶
func (e *Engine) RegisterPostHandler(relativePath string, handlerFunc gin.HandlerFunc) *Engine
type Field ¶
type Field struct {
Name string // 展示名
Column string // 字段名
Type string // 字段类型
ElOption ElOption // 对应前端 Element 类型 TODO 实现这里的功能,通过模版渲染switch来完成 表单,列表内容的输出
TranslateFunc func() map[string]string // 字段翻译函数:返回用来翻译字段的map
FormatFunc func(value, originValue interface{}) interface{} // 字段格式化函数
SortAble bool // 是否排序字段
Hide bool // 是否对外展示
EditAble bool // 是否可更新
DefaultValueFunc func() string // 数据创建时的默认值
}
字段
Click to show internal directories.
Click to hide internal directories.