model

package
v0.6.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dict

type Dict struct {
	Id    int64  `gorm:"column:id;autoIncrement:true;not null;primaryKey;comment:字典ID" json:"id,omitempty"`                   // 字典ID
	Key   string `gorm:"column:key;type:varchar(64);not null;default:'';uniqueIndex:uk_key;comment:关键字" json:"key,omitempty"` // 关键字
	Name  string `gorm:"column:name;type:varchar(64);not null;default:'';comment:名称" json:"name,omitempty"`                   // 名称
	IsPin bool   ``                                                                                                           // 是否锁定,一旦锁定将不可删除
	/* 128-byte string literal not displayed */
	Remark    string    `gorm:"column:remark;type:varchar(128);not null;default:'';comment:备注" json:"remark,omitempty"` // 备注
	CreatedAt time.Time `gorm:"column:created_at;type:datetime;not null;comment:创建时间" json:"created_at,omitempty"`      // 创建时间
	UpdatedAt time.Time `gorm:"column:updated_at;type:datetime;not null;comment:更新时间" json:"updated_at,omitempty"`      // 更新时间
}

Dict 字典

func (*Dict) TableName

func (*Dict) TableName() string

TableName implement schema.Tabler interface

type Dict_Native

type Dict_Native struct {
	ALL       assist.Asterisk
	Id        assist.Int64
	Key       assist.String
	Name      assist.String
	IsPin     assist.Bool
	Remark    assist.String
	CreatedAt assist.Time
	UpdatedAt assist.Time
	// contains filtered or unexported fields
}

func New_Dict added in v0.1.0

func New_Dict(xAlias string) Dict_Native

New_Dict new instance.

func X_Dict added in v0.0.3

func X_Dict() Dict_Native

X_Dict model with TableName `dict`.

func (*Dict_Native) As

func (*Dict_Native) As(alias string) Dict_Native

As alias

func (*Dict_Native) New_Executor

func (*Dict_Native) New_Executor(db *gorm.DB) *assist.Executor[Dict]

New_Executor new entity executor which suggest use only once.

func (*Dict_Native) Select_Expr

func (x *Dict_Native) Select_Expr() []assist.Expr

Select_Expr select model fields

func (*Dict_Native) Select_VariantExpr

func (x *Dict_Native) Select_VariantExpr(prefixes ...string) []assist.Expr

Select_VariantExpr select model fields, but time.Time field convert to timestamp(int64).

func (*Dict_Native) TableName

func (*Dict_Native) TableName() string

TableName hold model `Dict` table name returns `dict`.

func (*Dict_Native) X_Alias

func (x *Dict_Native) X_Alias() string

X_Alias hold table name when call New_Dict or Dict_Active.As that you defined.

Jump to

Keyboard shortcuts

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