Documentation
¶
Index ¶
- Variables
- func Load(cfg config.Config) error
- func LoadBuildIn(dir string, prefix string) error
- func LoadFrom(dir string, prefix string) error
- func ProcessDelete(process *gou.Process) interface{}
- func ProcessDeleteIn(process *gou.Process) interface{}
- func ProcessDeleteWhere(process *gou.Process) interface{}
- func ProcessFind(process *gou.Process) interface{}
- func ProcessInsert(process *gou.Process) interface{}
- func ProcessQuickSave(process *gou.Process) interface{}
- func ProcessSave(process *gou.Process) interface{}
- func ProcessSearch(process *gou.Process) interface{}
- func ProcessSelect(process *gou.Process) interface{}
- func ProcessSetting(process *gou.Process) interface{}
- func ProcessUpdateIn(process *gou.Process) interface{}
- func ProcessUpdateWhere(process *gou.Process) interface{}
- type Bind
- type Hooks
- type Table
- func (table *Table) APIGuard(guard string, sid string, global map[string]interface{}, args ...interface{})
- func (table *Table) After(process string, data interface{}, args []interface{}, sid string) interface{}
- func (table *Table) Before(process string, processArgs []interface{}, sid string) []interface{}
- func (table *Table) Reload() (*Table, error)
Constants ¶
This section is empty.
Variables ¶
var Tables = map[string]*Table{}
Tables 已载入模型
Functions ¶
func ProcessDelete ¶
ProcessDelete xiang.table.Delete 删除指定主键值的数据记录, 请求成功返回null
func ProcessDeleteIn ¶
ProcessDeleteIn xiang.table.DeleteIn 按条件批量删除数据, 请求成功返回删除行数
func ProcessDeleteWhere ¶
ProcessDeleteWhere xiang.table.DeleteWhere 按条件批量删除数据, 请求成功返回删除行数
func ProcessFind ¶
ProcessFind xiang.table.Find 按主键值查询单条数据, 请求成功返回对应主键的数据记录
func ProcessInsert ¶
ProcessInsert xiang.table.Insert 插入多条数据记录,请求成功返回插入行数
func ProcessQuickSave ¶
ProcessQuickSave xiang.table.QuickSave 保存多条记录。如数据记录中包含主键字段则更新,不包含主键字段则创建记录;返回创建或更新的记录主键值
func ProcessSave ¶
ProcessSave xiang.table.Save 保存单条记录。如数据记录中包含主键字段则更新,不包含主键字段则创建记录;返回创建或更新的记录主键值
func ProcessSearch ¶
ProcessSearch xiang.table.Search 按条件查询数据记录, 请求成功返回符合查询条件带有分页信息的数据对象
func ProcessSelect ¶
ProcessSelect xiang.table.Select 单表数据查询,一般用于下拉菜单检索
func ProcessSetting ¶
ProcessSetting xiang.table.Setting 读取数据表格配置信息, 请求成功返回配置信息对象
func ProcessUpdateIn ¶
ProcessUpdateIn xiang.table.UpdateWhere 按条件批量更新数据, 请求成功返回更新行数
func ProcessUpdateWhere ¶
ProcessUpdateWhere xiang.table.UpdateWhere 按条件批量更新数据, 请求成功返回更新行数
Types ¶
type Hooks ¶
type Hooks struct {
BeforeFind string `json:"before:find,omitempty"`
AfterFind string `json:"after:find,omitempty"`
BeforeSearch string `json:"before:search,omitempty"`
AfterSearch string `json:"after:search,omitempty"`
BeforeSave string `json:"before:save,omitempty"`
AfterSave string `json:"after:save,omitempty"`
BeforeDelete string `json:"before:delete,omitempty"`
AfterDelete string `json:"after:delete,omitempty"`
BeforeInsert string `json:"before:insert,omitempty"`
AfterInsert string `json:"after:insert,omitempty"`
BeforeDeleteIn string `json:"before:delete-in,omitempty"`
AfterDeleteIn string `json:"after:delete-in,omitempty"`
BeforeDeleteWhere string `json:"before:delete-where,omitempty"`
AfterDeleteWhere string `json:"after:delete-where,omitempty"`
BeforeUpdateIn string `json:"before:update-in,omitempty"`
AfterUpdateIn string `json:"after:update-in,omitempty"`
BeforeUpdateWhere string `json:"before:update-where,omitempty"`
AfterUpdateWhere string `json:"after:update-where,omitempty"`
BeforeQuicksave string `json:"before:quicksave,omitempty"`
AfterQuicksave string `json:"after:quicksave,omitempty"`
BeforeSelect string `json:"before:select,omitempty"`
AfterSelect string `json:"after:select,omitempty"`
}
Hooks 表格数据模型
type Table ¶
type Table struct {
Table string `json:"-"`
Source string `json:"-"`
Guard string `json:"guard,omitempty"`
Name string `json:"name"`
Version string `json:"version"`
Title string `json:"title,omitempty"`
Decription string `json:"decription,omitempty"`
Bind Bind `json:"bind,omitempty"`
Hooks Hooks `json:"hooks,omitempty"`
APIs map[string]share.API `json:"apis,omitempty"`
Columns map[string]share.Column `json:"columns,omitempty"`
Filters map[string]share.Filter `json:"filters,omitempty"`
List share.Page `json:"list,omitempty"`
Edit share.Page `json:"edit,omitempty"`
View share.Page `json:"view,omitempty"`
Insert share.Page `json:"insert,omitempty"`
}
Table 数据表格配置结构
func (*Table) APIGuard ¶
func (table *Table) APIGuard(guard string, sid string, global map[string]interface{}, args ...interface{})
APIGuard API鉴权
func (*Table) After ¶
func (table *Table) After(process string, data interface{}, args []interface{}, sid string) interface{}
After 运行 After hook