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 Department

type Department struct {

	/*    */
	Id *int32 `gorm:"column:id;type:int(11);PRIMARY_KEY;comment:''" json:"id"`
	/*  编码  */
	Code *string `gorm:"column:code;type:varchar(32);comment:'编码';default:\'none\'" json:"code"`
	/*  部门名称  */
	Name *string `gorm:"column:name;type:varchar(32);comment:'部门名称'" json:"name"`
	/*    */
	ParentId *int32 `gorm:"column:parentId;type:int(11);comment:''" json:"parentId"`
	/*    */
	DepPath *string `gorm:"column:depPath;type:varchar(255);comment:''" json:"depPath"`
	/*    */
	Enabled *model.BitField `gorm:"column:enabled;type:bit(1);comment:''" json:"enabled"`
	/*    */
	IsParent *int8 `gorm:"column:isParent;type:tinyint(1);comment:'';default:0" json:"isParent"`
	/*  负责人  */
	MngrId *int32 `gorm:"column:mngrId;type:int(11);comment:'负责人';default:0" json:"mngrId"`
	/*  0-部门 1-班组  */
	Type *int32 `gorm:"column:type;type:int(11);comment:'0-部门 1-班组';default:0" json:"type"`
}

func (*Department) AutoMigrate

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

迁移

func (*Department) GetCode

func (entity *Department) GetCode() string

func (*Department) GetDepPath

func (entity *Department) GetDepPath() string

func (*Department) GetEnabled

func (entity *Department) GetEnabled() model.BitField

func (*Department) GetId

func (entity *Department) GetId() int32

func (*Department) GetIsParent

func (entity *Department) GetIsParent() int8

func (*Department) GetMngrId

func (entity *Department) GetMngrId() int32

func (*Department) GetName

func (entity *Department) GetName() string

func (*Department) GetParentId

func (entity *Department) GetParentId() int32

func (*Department) GetType

func (entity *Department) GetType() int32

func (*Department) Ini

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

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

func (*Department) IniNil

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

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

func (*Department) SetCode

func (entity *Department) SetCode(Code string)

func (*Department) SetDepPath

func (entity *Department) SetDepPath(DepPath string)

func (*Department) SetEnabled

func (entity *Department) SetEnabled(Enabled model.BitField)

func (*Department) SetId

func (entity *Department) SetId(Id int32)

func (*Department) SetIsParent

func (entity *Department) SetIsParent(IsParent int8)

func (*Department) SetMngrId

func (entity *Department) SetMngrId(MngrId int32)

func (*Department) SetName

func (entity *Department) SetName(Name string)

func (*Department) SetParentId

func (entity *Department) SetParentId(ParentId int32)

func (*Department) SetType

func (entity *Department) SetType(Type int32)

func (*Department) String

func (entity *Department) String() string

指定生成结果转json字符串

func (*Department) TableName

func (entity *Department) TableName() string

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

func (*Department) ToString

func (entity *Department) ToString() string

func (*Department) Unmarshal

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

func (*Department) UnmarshalBy

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

Jump to

Keyboard shortcuts

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