model

package
v0.0.0-...-c47cd45 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: MulanPSL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	basedto.BaseEntity `gorm:"-"`

	/*  自增Id  */
	Id int32 `gorm:"column:id;type:int(10) unsigned;PRIMARY_KEY;comment:'自增Id'" json:"id"`
	/*  集群NamespaceId  */
	NamespaceId int32 `gorm:"column:namespace_id;type:int(10) unsigned;comment:'集群NamespaceId';default:0" json:"namespace_id"`
	/*  配置项Key  */
	ItemKey string `gorm:"column:item_key;type:varchar(128);comment:'配置项Key';default:'default'" json:"item_key"`
	/*  配置项类型,0: String,1: Number,2: Boolean,3: JSON  */
	Type int8 `` /* 138-byte string literal not displayed */
	/*  配置项值  */
	Value string `gorm:"column:value;type:longtext;comment:'配置项值'" json:"value"`
	/*  注释  */
	Comment string `gorm:"column:comment;type:varchar(1024);comment:'注释'" json:"comment"`
	/*  行号  */
	LineNum int32 `gorm:"column:line_num;type:int(10) unsigned;comment:'行号';default:0" json:"line_num"`
	/*  1: deleted, 0: normal  */
	IsDeleted int8 `gorm:"column:is_deleted;type:tinyint(1);comment:'1: deleted, 0: normal';default:0" json:"is_deleted"`
	/*    */
	DeletedAt time.Time `gorm:"column:deleted_at;type:datetime;comment:''" json:"deleted_at"`
	/*  创建人  */
	CeatedBy string `gorm:"column:ceated_by;type:varchar(64);comment:'创建人';default:'default'" json:"ceated_by"`
	/*  创建时间  */
	CreatedAt time.Time `gorm:"column:created_at;type:timestamp;comment:'创建时间'" json:"created_at"`
	/*  最后修改人  */
	UpdatedBy string `gorm:"column:updated_by;type:varchar(64);comment:'最后修改人'" json:"updated_by"`
	/*  最后修改时间  */
	UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp;comment:'最后修改时间'" json:"updated_at"`
}

配置项目

func NewItem

func NewItem() *Item

func (*Item) AutoMigrate

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

迁移

func (*Item) PkeyName

func (entity *Item) PkeyName() string

func (*Item) PkeyValue

func (entity *Item) PkeyValue() int32

func (*Item) SetCeatedBy

func (entity *Item) SetCeatedBy(CeatedBy string)

func (*Item) SetComment

func (entity *Item) SetComment(Comment string)

func (*Item) SetCreatedAt

func (entity *Item) SetCreatedAt(CreatedAt time.Time)

func (*Item) SetDeletedAt

func (entity *Item) SetDeletedAt(DeletedAt time.Time)

func (*Item) SetId

func (entity *Item) SetId(Id int32)

func (*Item) SetIsDeleted

func (entity *Item) SetIsDeleted(IsDeleted int8)

func (*Item) SetItemKey

func (entity *Item) SetItemKey(ItemKey string)

func (*Item) SetLineNum

func (entity *Item) SetLineNum(LineNum int32)

func (*Item) SetNamespaceId

func (entity *Item) SetNamespaceId(NamespaceId int32)

func (*Item) SetType

func (entity *Item) SetType(Type int8)

func (*Item) SetUpdatedAt

func (entity *Item) SetUpdatedAt(UpdatedAt time.Time)

func (*Item) SetUpdatedBy

func (entity *Item) SetUpdatedBy(UpdatedBy string)

func (*Item) SetValue

func (entity *Item) SetValue(Value string)

func (*Item) TableName

func (entity *Item) TableName() string

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

type ItemEntity

type ItemEntity struct {
	basedto.BaseEntity `gorm:"-"`

	/*  自增Id  */
	Id int32 `gorm:"column:id;type:int(10) unsigned;PRIMARY_KEY;comment:'自增Id'" json:"id"`
	/*  集群NamespaceId  */
	NamespaceId int32 `gorm:"column:namespace_id;type:int(10) unsigned;comment:'集群NamespaceId';default:0" json:"namespace_id"`
	/*  配置项Key  */
	ItemKey string `gorm:"column:item_key;type:varchar(128);comment:'配置项Key';default:\'default\'" json:"item_key"`
	/*  配置项类型,0: String,1: Number,2: Boolean,3: JSON  */
	Type int8 `` /* 138-byte string literal not displayed */
	/*  配置项值  */
	Value string `gorm:"column:value;type:longtext;comment:'配置项值'" json:"value"`
	/*  注释  */
	Comment string `gorm:"column:comment;type:varchar(1024);comment:'注释'" json:"comment"`
	/*  行号  */
	LineNum int32 `gorm:"column:line_num;type:int(10) unsigned;comment:'行号';default:0" json:"line_num"`
	/*  1: deleted, 0: normal  */
	IsDeleted int8 `gorm:"column:is_deleted;type:tinyint(1);comment:'1: deleted, 0: normal';default:0" json:"is_deleted"`
	/*    */
	DeletedAt int64 `gorm:"column:deleted_at;type:datetime;comment:''" json:"deleted_at,string"`
	/*  创建人  */
	CeatedBy string `gorm:"column:ceated_by;type:varchar(64);comment:'创建人';default:\'default\'" json:"ceated_by"`
	/*  创建时间  */
	CreatedAt int64 `gorm:"column:created_at;type:timestamp;comment:'创建时间'" json:"created_at,string"`
	/*  最后修改人  */
	UpdatedBy string `gorm:"column:updated_by;type:varchar(64);comment:'最后修改人'" json:"updated_by"`
	/*  最后修改时间  */
	UpdatedAt int64 `gorm:"column:updated_at;type:timestamp;comment:'最后修改时间'" json:"updated_at,string"`
}

func NewItemEntity

func NewItemEntity() *ItemEntity

func (*ItemEntity) AutoMigrate

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

迁移

func (*ItemEntity) PkeyName

func (entity *ItemEntity) PkeyName() string

func (*ItemEntity) PkeyValue

func (entity *ItemEntity) PkeyValue() int32

func (*ItemEntity) TableName

func (entity *ItemEntity) TableName() string

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

type ItemParams

type ItemParams struct {
	basedto.BaseEntity `gorm:"-"`

	/*  自增Id  */
	Id *int32 `gorm:"column:id;type:int(10) unsigned;PRIMARY_KEY;comment:'自增Id'" json:"id"`
	/*  集群NamespaceId  */
	NamespaceId *int32 `gorm:"column:namespace_id;type:int(10) unsigned;comment:'集群NamespaceId';default:0" json:"namespace_id"`
	/*  配置项Key  */
	ItemKey *string `gorm:"column:item_key;type:varchar(128);comment:'配置项Key';default:\'default\'" json:"item_key"`
	/*  配置项类型,0: String,1: Number,2: Boolean,3: JSON  */
	Type *int8 `` /* 138-byte string literal not displayed */
	/*  配置项值  */
	Value *string `gorm:"column:value;type:longtext;comment:'配置项值'" json:"value"`
	/*  注释  */
	Comment *string `gorm:"column:comment;type:varchar(1024);comment:'注释'" json:"comment"`
	/*  行号  */
	LineNum *int32 `gorm:"column:line_num;type:int(10) unsigned;comment:'行号';default:0" json:"line_num"`
	/*  1: deleted, 0: normal  */
	IsDeleted *int8 `gorm:"column:is_deleted;type:tinyint(1);comment:'1: deleted, 0: normal';default:0" json:"is_deleted"`
	/*    */
	DeletedAt *time.Time `gorm:"column:deleted_at;type:datetime;comment:''" json:"deleted_at"`
	/*  创建人  */
	CeatedBy *string `gorm:"column:ceated_by;type:varchar(64);comment:'创建人';default:\'default\'" json:"ceated_by"`
	/*  创建时间  */
	CreatedAt *time.Time `gorm:"column:created_at;type:timestamp;comment:'创建时间'" json:"created_at"`
	/*  最后修改人  */
	UpdatedBy *string `gorm:"column:updated_by;type:varchar(64);comment:'最后修改人'" json:"updated_by"`
	/*  最后修改时间  */
	UpdatedAt *time.Time `gorm:"column:updated_at;type:timestamp;comment:'最后修改时间'" json:"updated_at"`
}

func NewItemParams

func NewItemParams() *ItemParams

Jump to

Keyboard shortcuts

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