model

package
v1.0.1-rel-02 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: AFL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InjectMetadataColumnEntity

func InjectMetadataColumnEntity(s *MetadataColumnEntity)

func InjectMetadataColumns

func InjectMetadataColumns(s *MetadataColumns)

func LoadMetadataColumnEntity

func LoadMetadataColumnEntity() baseiface.ISingleton

func LoadMetadataColumns

func LoadMetadataColumns() baseiface.ISingleton

Types

type MetadataColumnEntity

type MetadataColumnEntity struct {
	basedto.BaseEntity `gorm:"-"`
	/*  字段ID  */
	ColId int64 `gorm:"column:col_id;type:INT8;PRIMARY_KEY;default:unique_rowid()" json:"col_id"`
	/*  表ID  */
	TableId int64 `gorm:"column:table_id;type:INT8" json:"table_id"`
	/*  表名  */
	TableNames string `gorm:"column:table_names;type:STRING" json:"table_names"`
	/*  属性名称  */
	PropName string `gorm:"column:prop_name;type:STRING" json:"prop_name"`
	/*  属性类型  */
	PropType string `gorm:"column:prop_type;type:STRING" json:"prop_type"`
	/*  GO类型  */
	GoType string `gorm:"column:go_type;type:STRING" json:"go_type"`
	/*  列名称  */
	ColName string `gorm:"column:col_name;type:STRING" json:"col_name"`
	/*  列数据类型  */
	ColType string `gorm:"column:col_type;type:STRING" json:"col_type"`
	/*  数据类型  */
	DataType string `gorm:"column:data_type;type:STRING" json:"data_type"`
	/*  注释  */
	ColComment string `gorm:"column:col_comment;type:STRING" json:"col_comment"`
	/*  最大长度  */
	MaxLength int32 `gorm:"column:max_length;type:INT4;default:0:::INT8" json:"max_length"`
	/*  可见标识  */
	VisibleFlag bool `gorm:"column:visible_flag;type:BOOL" json:"visible_flag"`
	/*  表达式标识  */
	ExpFlag bool `gorm:"column:exp_flag;type:BOOL" json:"exp_flag"`
	/*  ES类型  */
	EsType string `gorm:"column:es_type;type:VARCHAR" json:"es_type"`
	/*    */
	CreatedAt int64 `gorm:"column:created_at;type:TIMESTAMPTZ" json:"created_at"`
	/*    */
	UpdatedAt int64 `gorm:"column:updated_at;type:TIMESTAMPTZ" json:"updated_at"`
}

func FindBeanMetadataColumnEntity

func FindBeanMetadataColumnEntity() *MetadataColumnEntity

FindBeanMetadataColumnEntity

func NewMetadataColumnEntity

func NewMetadataColumnEntity() *MetadataColumnEntity

func (*MetadataColumnEntity) AutoMigrate

func (entity *MetadataColumnEntity) AutoMigrate(db *gorm.DB) error

迁移

func (*MetadataColumnEntity) PkeyName

func (entity *MetadataColumnEntity) PkeyName() string

func (*MetadataColumnEntity) PkeyValue

func (entity *MetadataColumnEntity) PkeyValue() int64

func (*MetadataColumnEntity) TableName

func (entity *MetadataColumnEntity) TableName() string

gorm默认生成的表名是结构名+'s',所以必须以结构方法指定!

type MetadataColumns

type MetadataColumns struct {
	basedto.BaseEntity `gorm:"-"`
	*basemodel.BaseModel
	/*  字段ID  */
	ColId int64 `gorm:"column:col_id;type:INT8;PRIMARY_KEY;default:unique_rowid()" json:"col_id"`
	/*  表ID  */
	TableId int64 `gorm:"column:table_id;type:INT8" json:"table_id"`
	/*  表名  */
	TableNames string `gorm:"column:table_names;type:STRING" json:"table_names"`
	/*  属性名称  */
	PropName string `gorm:"column:prop_name;type:STRING" json:"prop_name"`
	/*  属性类型  */
	PropType string `gorm:"column:prop_type;type:STRING" json:"prop_type"`
	/*  GO类型  */
	GoType string `gorm:"column:go_type;type:STRING" json:"go_type"`
	/*  列名称  */
	ColName string `gorm:"column:col_name;type:STRING" json:"col_name"`
	/*  列数据类型  */
	ColType string `gorm:"column:col_type;type:STRING" json:"col_type"`
	/*  数据类型  */
	DataType string `gorm:"column:data_type;type:STRING" json:"data_type"`
	/*  注释  */
	ColComment string `gorm:"column:col_comment;type:STRING" json:"col_comment"`
	/*  最大长度  */
	MaxLength int32 `gorm:"column:max_length;type:INT4;default:0:::INT8" json:"max_length"`
	/*  可见标识  */
	VisibleFlag bool `gorm:"column:visible_flag;type:BOOL" json:"visible_flag"`
	/*  表达式标识  */
	ExpFlag bool `gorm:"column:exp_flag;type:BOOL" json:"exp_flag"`
	/*  ES类型  */
	EsType string `gorm:"column:es_type;type:VARCHAR" json:"es_type"`
	/*    */
	CreatedAt time.Time `gorm:"column:created_at;type:TIMESTAMPTZ" json:"created_at"`
	/*    */
	UpdatedAt time.Time `gorm:"column:updated_at;type:TIMESTAMPTZ" json:"updated_at"`
}

元数据字段

func FindBeanMetadataColumns

func FindBeanMetadataColumns() *MetadataColumns

FindBeanMetadataColumns

func NewMetadataColumn

func NewMetadataColumn() *MetadataColumns

func (*MetadataColumns) AutoMigrate

func (entity *MetadataColumns) AutoMigrate(db *gorm.DB) error

迁移

func (*MetadataColumns) PkeyName

func (entity *MetadataColumns) PkeyName() string

func (*MetadataColumns) PkeyValue

func (entity *MetadataColumns) PkeyValue() int64

func (*MetadataColumns) TableName

func (entity *MetadataColumns) TableName() string

gorm默认生成的表名是结构名+'s',所以必须以结构方法指定!

Jump to

Keyboard shortcuts

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