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 Nation

type Nation 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"`
}

func (*Nation) AutoMigrate

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

迁移

func (*Nation) GetId

func (entity *Nation) GetId() int32

func (*Nation) GetName

func (entity *Nation) GetName() string

func (*Nation) Ini

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

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

func (*Nation) IniNil

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

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

func (*Nation) SetId

func (entity *Nation) SetId(Id int32)

func (*Nation) SetName

func (entity *Nation) SetName(Name string)

func (*Nation) String

func (entity *Nation) String() string

指定生成结果转json字符串

func (*Nation) TableName

func (entity *Nation) TableName() string

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

func (*Nation) ToString

func (entity *Nation) ToString() string

func (*Nation) Unmarshal

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

func (*Nation) UnmarshalBy

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

Jump to

Keyboard shortcuts

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