| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- package configure
-
- import (
- "time"
-
- "git.x2erp.com/qdy/go-base/model/request/queryreq"
- )
-
- // DicTableRequest 数据库表字典请求(主表+子表合并)
- type DicTableRequest struct {
- // 主表字段
- TableID string `json:"tableID" binding:"required"` // 表ID(主键)
- TableType string `json:"tableType" binding:"required"` // 表类型: 实体表,视图,物化视图
- Name string `json:"name" binding:"required"` // 表名称
- Description string `json:"description"` // 表描述
-
- // 子表字段(字段列表)
- Fields []DicTableFieldRequest `json:"fields"` // 表字段列表
-
- // 系统字段(创建时自动填充)
- Creator string `json:"creator,omitempty"` // 创建人
- CreatedAt time.Time `json:"createdAt,omitempty"` // 创建时间
- UpdatedAt time.Time `json:"updatedAt,omitempty"` // 更新时间
- }
-
- // DicTableFieldRequest 数据库表字段字典请求(子表)
- type DicTableFieldRequest struct {
- // 注意:子表主键规则为 table_id + "." + field_name
- FieldID string `json:"fieldID" binding:"required"` // 字段ID(主键,由系统生成)
- TableID string `json:"tableID" binding:"required"` // 表ID(关联主表)
- FiledType string `json:"filedType" binding:"required"` // 字段类型: 实际字段,计算字段
- DataType string `json:"dataType" binding:"required"` // 数据类型: 字符型,数值型等
- FieldName string `json:"fieldName" binding:"required"` // 字段名称
- FieldNameCN string `json:"fieldNameCN"` // 字段中文名称(ERP中业务名称)
- Description string `json:"description"` // 字段描述
-
- // 系统字段(创建时自动填充)
- Creator string `json:"creator,omitempty"` // 创建人
- CreatedAt time.Time `json:"createdAt,omitempty"` // 创建时间
- UpdatedAt time.Time `json:"updatedAt,omitempty"` // 更新时间
- }
-
- // DicTableDetail 数据库表字典详情(主表+子表)
- type DicTableDetail struct {
- // 主表信息
- Table DicTableDB `json:"table"`
-
- // 子表信息
- Fields []DicTableFieldDB `json:"fields"`
- }
-
- // DicTableList 数据库表字典列表
- type DicTableList struct {
- TotalCount int `json:"totalCount"`
- LastPage int `json:"lastPage"`
- Data []DicTableDB `json:"data"`
- }
-
- // DicTableQueryRequest 数据库表字典查询请求
- type DicTableQueryRequest struct {
- QueryRequest queryreq.QueryRequest `json:"queryRequest"`
- TableID string `json:"tableID,omitempty"`
- }
-
- // DicTableDB 数据库表字典数据库模型
- type DicTableDB struct {
- ID string `db:"id" json:"id"`
- TableID string `db:"table_id" json:"tableID"`
- TableType string `db:"table_type" json:"tableType"`
- Name string `db:"table_name" json:"name"`
- Description string `db:"description" json:"description"`
- Creator string `db:"creator" json:"creator"`
- CreatedAt time.Time `db:"created_at" json:"createdAt"`
- UpdatedAt time.Time `db:"updated_at" json:"updatedAt"`
- DeletedAt *time.Time `db:"deleted_at" json:"deletedAt"`
- }
-
- // DicTableFieldDB 数据库表字段字典数据库模型
- type DicTableFieldDB struct {
- ID string `db:"id" json:"id"`
- FieldID string `db:"field_id" json:"fieldID"`
- TableID string `db:"table_id" json:"tableID"`
- FiledType string `db:"filed_type" json:"filedType"`
- DataType string `db:"data_type" json:"dataType"`
- FieldName string `db:"field_name" json:"fieldName"`
- FieldNameCN string `db:"field_name_cn" json:"fieldNameCN"`
- Description string `db:"description" json:"description"`
- Creator string `db:"creator" json:"creator"`
- CreatedAt time.Time `db:"created_at" json:"createdAt"`
- UpdatedAt time.Time `db:"updated_at" json:"updatedAt"`
- DeletedAt *time.Time `db:"deleted_at" json:"deletedAt"`
- }
|