model

package
v0.0.0-...-e5d1c0a Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddBuilderColum

func AddBuilderColum(pe *builder.Builder, v Column)

Types

type Column

type Column struct {
	Id           int    `gorm:"column:id"`            // 主键
	CId          int    `gorm:"column:c_id"`          // 所属客户
	SysTableId   int    `gorm:"column:sys_table_id"`  // 所属表单
	Comment      string `gorm:"column:comment"`       // 显示名称
	Mask         string `gorm:"column:mask"`          // 读写规则(AMDQ)
	Orderno      int    `gorm:"column:orderno"`       // 字段排序序号
	Dbname       string `gorm:"column:dbname"`        // 数据库名称
	FullDbname   string `gorm:"column:full_dbname"`   // 数据库全名
	Coltype      string `gorm:"column:coltype"`       // 字段类型
	IsAk         string `gorm:"column:is_ak"`         // 是否输入字段
	IsDk         string `gorm:"column:is_dk"`         // 是否显示字段
	IsNull       string `gorm:"column:is_null"`       // 是否可以为空
	IsUpper      string `gorm:"column:is_upper"`      // 是否大写
	IsPk         string `gorm:"column:is_pk"`         // 是否主键
	DefaultValue string `gorm:"column:default_value"` // 默认值
	SysDictName  string `gorm:"column:sys_dict_name"` // 数据字典
	FkColumnId   int    `gorm:"column:fk_column_id"`  // 外键关联
	Lenth        int    `gorm:"column:lenth"`         // 长度
	Precision    int    `gorm:"column:precision"`     // 精度
	HrColumnId   int    `gorm:"column:hr_column_id"`  // 所属字段组
	DisplayType  int    `gorm:"column:display_type"`  // 显示类型
	SysDict      Dict   `gorm:"-"`
}

func (*Column) SetDefault

func (c *Column) SetDefault()
type ColumnLink struct {
	Column
	FkColumn   Column
	FkTable    Table  `gorm:"-"` //外键表
	FkDkColumn Column `gorm:"-"` //关联表的显示字段
}

type Dict

type Dict struct {
	Id          int        `gorm:"column:id"`          // 主键
	CId         int        `gorm:"column:c_id"`        //
	DictName    string     `gorm:"column:dict_name"`   // 字典名称
	DictType    string     `gorm:"column:dict_type"`   // 字段类型
	Description string     `gorm:"column:description"` // 备注
	Dictitem    []Dictitem `gorm:"-"`
	Default     string     `gorm:"-"`
}

func GetAllDicts

func GetAllDicts(db *gorm.DB) (dicts []Dict, err error)

获取所有的数据字典

func (*Dict) SetDefault

func (d *Dict) SetDefault()

为单个数据字典设置默认值

type Dictitem

type Dictitem struct {
	Id          int    `gorm:"column:id"`          // 主键
	SysDictId   int    `gorm:"column:sys_dict_id"` //
	Orderno     int    `gorm:"column:orderno"`     // 序号
	Label       string `gorm:"column:label"`       // 字典标签
	Value       string `gorm:"column:value"`       // 字典值
	CssClass    string `gorm:"column:css_class"`   // 单对象样式
	ListClass   string `gorm:"column:list_class"`  // 列表样式
	IsDefault   string `gorm:"column:is_default"`  // 是否默认(0:非默认 1:默认)
	Description string `gorm:"column:description"` // 备注
}

type Expr

type Expr struct {
	Clink     string `json:"clink"`
	Condition string `json:"condition"`
	Pdc       string `json:"pdc"`
}
type Menu struct {
	Id         int64  `gorm:"column:id"`           // 主键
	Name       string `gorm:"column:name"`         // 路由名称
	Url        string `gorm:"column:url"`          //路由地址或commpent
	Icon       string `gorm:"column:icon"`         //路由ico
	Orderno    int64  `gorm:"column:orderno"`      //路由排序
	ParentId   int64  `gorm:"column:parent_id"`    //父路由
	SysTableId int64  `gorm:"column:sys_table_id"` //所属表单
	Type       string `gorm:"column:type"`         //类型
	Permission int64  `gorm:"column:permission"`   //权限
	TableName  string `gorm:"column:table_name"`   //表单名称
	DataPrem   Prem   `gorm:"column:data_prem"`    //表单名称
	TableMask  string `gorm:"column:table_mask"`
}
func (m *Menu) Marshal() (jsonRaw []byte)

Marshal 序列化到JSON

type Prem

type Prem struct {
	DisPlay string `json:"display"`
	Filter  Expr   `json:"filter"`
}

demo {"display":"(公司名称 含有 $user_cid$)","filter":{"clink":"sys_company.id","condition":"=$user_cid$"}}

func (*Prem) Scan

func (c *Prem) Scan(input interface{}) error

func (Prem) Value

func (c Prem) Value() (driver.Value, error)

type Table

type Table struct {
	Id            int      `gorm:"column:id"`              // 主键
	CId           int      `gorm:"column:c_id"`            //
	IsUsed        string   `gorm:"column:is_used"`         // 是否启用 Y:是  N:否
	Disname       string   `gorm:"column:disname"`         // 显示名称
	Orderno       int      `gorm:"column:orderno"`         // 序号
	Name          string   `gorm:"column:name"`            // 数据库表名称
	PkColumnId    int      `gorm:"column:pk_column_id"`    // 主键
	RelTableId    int      `gorm:"column:rel_table_id"`    // 实际数据库表
	Filter        string   `gorm:"column:filter"`          // 过滤条件
	TableMask     string   `gorm:"column:table_mask"`      // 表单功能
	AdColumnId    int      `gorm:"column:ad_column_id"`    // 显示健
	DkColumnId    int      `gorm:"column:dk_column_id"`    // 输入健
	Url           string   `gorm:"column:url"`             // 网页链接
	IsMenu        string   `gorm:"column:is_menu"`         // 是否菜单 Y是N否
	ParentTableId int      `gorm:"column:parent_table_id"` // 父表
	TrigAc        string   `gorm:"column:trig_ac"`         // 新增后触发
	TrigAm        string   `gorm:"column:trig_am"`         // 修改后触发
	TrigBm        string   `gorm:"column:trig_bm"`         // 删除前触发
	ProcSubmit    string   `gorm:"column:proc_submit"`     // 提交程序
	ProcUnsubmit  string   `gorm:"column:proc_unsubmit"`   // 反提交程序
	IsBig         string   `gorm:"column:is_big"`          // N否Y海量
	Props         string   `gorm:"column:props"`           // 扩展属性
	Comments      string   `gorm:"column:comments"`        // 备注
	Cols          []Column `gorm:"-"`
}

func (*Table) CheckColumCreate

func (s *Table) CheckColumCreate(tablename string) bool

func (*Table) CheckColumUpdate

func (s *Table) CheckColumUpdate(tablename string) bool

func (*Table) CreateStruct

func (t *Table) CreateStruct() *builder.Struct

根据table构建结构体

func (*Table) CreateStructForDelete

func (t *Table) CreateStructForDelete() *builder.Struct

根据table构建结构体

func (*Table) CreateStructForUpdate

func (t *Table) CreateStructForUpdate(m map[string]interface{}) *builder.Struct

根据table构建结构体

func (*Table) IsBigF

func (t *Table) IsBigF() bool

Jump to

Keyboard shortcuts

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