model

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CamelToSnake

func CamelToSnake(s string) string

驼峰命名转下划线命名

Types

type ColumnEntity

type ColumnEntity struct {
	TABLE_NAME               string `gorm:"column:table_name" json:"TABLE_NAME" form:"TABLE_NAME" comment:"TABLE_NAME"`
	COLUMN_NAME              string `` /* 141-byte string literal not displayed */
	DATA_TYPE                string `gorm:"column:data_type" json:"DATA_TYPE" form:"DATA_TYPE" comment:"DATA_TYPE"`
	CHARACTER_MAXIMUM_LENGTH int    `` /* 137-byte string literal not displayed */
	IS_NULLABLE              string `gorm:"column:is_nullable" json:"IS_NULLABLE" form:"IS_NULLABLE" comment:"IS_NULLABLE"`
	COLUMN_COMMENT           string `gorm:"column:column_comment" json:"COLUMN_COMMENT" form:"COLUMN_COMMENT" comment:"COLUMN_COMMENT"`
}

func (ColumnEntity) TableName

func (ColumnEntity) TableName() string

type DataSource

type DataSource struct {
	app.IdTimeStampsModel
	app.GenericModel
	app.SoftDeleteModel
	UserName    string `gorm:"column:user_name" json:"UserName" form:"UserName" comment:"UserName"`
	Password    string `gorm:"column:password" json:"Password" form:"Password" comment:"Password"`
	Host        string `gorm:"column:host" json:"Host" form:"Host" comment:"Host"`
	Port        int    `gorm:"column:port" json:"Port" form:"Port" comment:"Port"`
	DriverClass string `gorm:"column:driver_class" json:"DriverClass" form:"DriverClass" comment:"DriverClass"`
	DbName      string `gorm:"column:db_name" json:"DbName" form:"DbName" comment:"DbName"`
}

func (DataSource) TableName

func (DataSource) TableName() string

type FieldEntity

type FieldEntity struct {
	Id                       int64  `gorm:"primaryKey;autoIncrement:false" json:"Id,string"`
	MODEL_ID                 int64  `gorm:"column:model_id" json:"MODEL_ID,string" form:"MODEL_ID" comment:"MODEL_ID"`
	COLUMN_NAME              string `gorm:"column:column_name;size:64" json:"COLUMN_NAME" form:"COLUMN_NAME" comment:"COLUMN_NAME"`
	DATA_TYPE                string `gorm:"column:data_type;size:64" json:"DATA_TYPE" form:"DATA_TYPE" comment:"DATA_TYPE"`
	DATA_TYPE_GO             string `gorm:"column:data_type_go;size:64" json:"DATA_TYPE_GO" form:"DATA_TYPE_GO" comment:"DATA_TYPE_GO"`
	CHARACTER_MAXIMUM_LENGTH int    `` /* 138-byte string literal not displayed */
	IS_NULLABLE              string `gorm:"column:is_nullable;size:64" json:"IS_NULLABLE" form:"IS_NULLABLE" comment:"IS_NULLABLE"`
	COLUMN_COMMENT           string `gorm:"column:column_comment;size:64" json:"COLUMN_COMMENT" form:"COLUMN_COMMENT" comment:"COLUMN_COMMENT"`
	COLUMN_NAME_UPPER_CAMEL  string `` /* 141-byte string literal not displayed */
	COLUMN_NAME_LOWER_CAMEL  string `` /* 141-byte string literal not displayed */
	JSON_CONTENT             string `gorm:"column:json_content;size:64" json:"JSON_CONTENT" form:"JSON_CONTENT" comment:"JSON_CONTENT"`
	IS_FORM                  string `gorm:"column:is_form;default:true;size:64" json:"IS_FORM" form:"IS_FORM" comment:"IS_FORM"`
	IS_SEARCH                string `gorm:"column:is_search;default:true;size:64" json:"IS_SEARCH" form:"IS_SEARCH" comment:"IS_SEARCH"`
	IS_HIDE                  string `gorm:"column:is_hide;default:false;size:64" json:"IS_HIDE" form:"IS_HIDE" comment:"IS_HIDE"`
	IS_OVERHIDDEN            string `gorm:"column:is_overhidden;default:true;size:64" json:"IS_OVERHIDDEN" form:"IS_OVERHIDDEN" comment:"IS_OVERHIDDEN"`
	IS_ADDDISPLAY            string `gorm:"column:is_adddisplay;default:true;size:64" json:"IS_ADDDISPLAY" form:"IS_ADDDISPLAY" comment:"IS_ADDDISPLAY"`
	IS_EDITDISPLAY           string `gorm:"column:is_editdisplay;default:true;size:64" json:"IS_EDITDISPLAY" form:"IS_EDITDISPLAY" comment:"IS_EDITDISPLAY"`
}

func (*FieldEntity) BeforeCreate

func (m *FieldEntity) BeforeCreate(scope *gorm.DB) error

func (FieldEntity) TableName

func (FieldEntity) TableName() string

type ModelEntity

type ModelEntity struct {
	app.IdTimeStampsModel
	app.SoftDeleteModel
	Id            int64         `gorm:"primaryKey;autoIncrement:false" json:"Id,string"`
	TABLE_NAME    string        `gorm:"column:table_name;size:64" json:"TABLE_NAME" form:"TABLE_NAME" comment:"TABLE_NAME"`
	CLASS_NAME    string        `gorm:"column:class_name;size:64" json:"CLASS_NAME" form:"CLASS_NAME" comment:"CLASS_NAME"`
	MODEL_NAME    string        `gorm:"column:model_name;size:64" json:"MODEL_NAME" form:"MODEL_NAME" comment:"MODEL_NAME"`
	Fields        []FieldEntity `gorm:"foreignKey:MODEL_ID;association_foreignkey:Id;constraint:OnCreate:CASCADE,OnUpdate:CASCADE,OnDelete:CASCADE;"`
	TMPL_GROUP_ID int           `gorm:"column:categary_id;default:0" json:"TMPL_GROUP_ID" form:"TMPL_GROUP_ID" comment:"TMPL_GROUP_ID"`
}

func (*ModelEntity) BeforeCreate

func (m *ModelEntity) BeforeCreate(scope *gorm.DB) error

func (ModelEntity) TableName

func (ModelEntity) TableName() string

type TableEntity

type TableEntity struct {
	TABLE_SCHEMA string         `gorm:"column:table_schema" json:"TABLE_SCHEMA" form:"TABLE_SCHEMA" comment:"TABLE_SCHEMA"`
	TABLE_NAME   string         `gorm:"column:table_name" json:"TABLE_NAME" form:"TABLE_NAME" comment:"TABLE_NAME"`
	TABLE_TYPE   string         `gorm:"column:table_type" json:"TABLE_TYPE" form:"TABLE_TYPE" comment:"TABLE_TYPE"`
	Fields       []ColumnEntity `gorm:"foreignKey:TABLE_NAME;references:TABLE_NAME"`
}

func (TableEntity) TableName

func (TableEntity) TableName() string

type TmplEntity

type TmplEntity struct {
	app.SoftDeleteModel
	app.IdTimeStampsModel
	TMPL_GROUP_ID int64  `gorm:"column:categary_id" json:"TMPL_GROUP_ID,string" form:"TMPL_GROUP_ID" comment:"TMPL_GROUP_ID"`
	NAME          string `gorm:"column:name;size:64" json:"NAME" form:"NAME" comment:"NAME"`
	PATH          string `gorm:"column:path;size:64" json:"PATH" form:"PATH" comment:"PATH"`
	CONTENT       string `gorm:"column:content;type:text" json:"CONTENT" form:"CONTENT" comment:"CONTENT"`
	Status        int    `json:"Status" form:"Status" comment:"Status"`
}

func (TmplEntity) TableName

func (TmplEntity) TableName() string

Jump to

Keyboard shortcuts

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