model

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MulanPSL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Position

type Position struct {

	/*    */
	Id *int32 `gorm:"column:id;type:int(11);PRIMARY_KEY;comment:''" json:"id"`
	/*  职位  */
	Name *string `gorm:"column:name;type:varchar(32);comment:'职位'" json:"name"`
	/*    */
	CreateDate *model.LocalTime `gorm:"column:createDate;type:timestamp;comment:''" json:"createDate"`
	/*    */
	Enabled *int8 `gorm:"column:enabled;type:tinyint(1);comment:'';default:1" json:"enabled"`
}

func (*Position) AutoMigrate

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

迁移

func (*Position) GetCreateDate

func (entity *Position) GetCreateDate() model.LocalTime

func (*Position) GetEnabled

func (entity *Position) GetEnabled() int8

func (*Position) GetId

func (entity *Position) GetId() int32

func (*Position) GetName

func (entity *Position) GetName() string

func (*Position) Ini

func (entity *Position) Ini(iniPk bool) *Position

iniPk bool:是否初始化主键Id 初始化指针

func (*Position) IniNil

func (entity *Position) IniNil(iniPk bool) *Position

iniPk bool:是否初始化主键Id 初始化指针

func (*Position) SetCreateDate

func (entity *Position) SetCreateDate(CreateDate model.LocalTime)

func (*Position) SetEnabled

func (entity *Position) SetEnabled(Enabled int8)

func (*Position) SetId

func (entity *Position) SetId(Id int32)

func (*Position) SetName

func (entity *Position) SetName(Name string)

func (*Position) String

func (entity *Position) String() string

指定生成结果转json字符串

func (*Position) TableName

func (entity *Position) TableName() string

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

func (*Position) ToString

func (entity *Position) ToString() string

func (*Position) Unmarshal

func (entity *Position) Unmarshal(body string) error

func (*Position) UnmarshalBy

func (entity *Position) UnmarshalBy(body []byte) error

Jump to

Keyboard shortcuts

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