model

package
v0.0.0-...-da91ef8 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 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 Bool

type Bool int8

Bool 类型表示布尔值

const (
	False Bool = 0
	True  Bool = 1
)

func (*Bool) Scan

func (b *Bool) Scan(value interface{}) error

实现 sql.Scanner 接口

func (Bool) Value

func (b Bool) Value() (driver.Value, error)

实现 driver.Valuer 接口

type Department

type Department struct {
	DepartmentID int       `gorm:"primaryKey"`
	Name         string    `gorm:"size:255;not null"`
	ParentID     *int      `gorm:"index"`
	Sort         int       `gorm:"index"`
	CreatedAt    time.Time `gorm:"autoCreateTime"`
	UpdatedAt    time.Time `gorm:"autoUpdateTime"`
}

Department 结构体

type KeyResult

type KeyResult struct {
	ID               string `json:"id"`
	Title            string `json:"title"`
	Weight           int    `json:"weight"`
	Owner            string `json:"owner"`
	Date             string `json:"date"`
	Completed        string `json:"completed"`
	SelfRating       *int   `json:"selfRating"`
	Reason           string `json:"reason"`
	ObjectiveID      string `json:"objectiveID"`
	Criteria         string `json:"criteria"`
	Leader           string `json:"leader"`
	LeaderRating     *int   `json:"leaderRating"`
	Department       string `json:"department"`
	CreatedTime      int64  `json:"createdTime"`
	LastModifiedTime int64  `json:"lastModifiedTime"`
}

type Objective

type Objective struct {
	ID               string   `json:"id"`
	Title            string   `json:"title"`
	Owner            string   `json:"owner"`
	Date             string   `json:"date"`
	Weight           int      `json:"weight"`
	KrsIds           []string `json:"krsIds"`
	CreatedTime      int64    `json:"createdTime"`
	LastModifiedTime int64    `json:"lastModifiedTime"`
}

type Role

type Role struct {
	RoleID   uint   `gorm:"primaryKey;autoIncrement"`
	RoleName string `gorm:"size:50;not null;unique"`
}

Role 结构体

type Sortable

type Sortable interface {
	GetValueByKey(key string) int64
}

type User

type User struct {
	UserID          string           `gorm:"primaryKey;size:255"`
	Name            string           `gorm:"size:255;not null"`
	Title           string           `gorm:"size:255"`
	Status          string           `gorm:"size:100"`
	Mobile          string           `gorm:"size:20"`
	Avatar          string           `gorm:"size:255"`
	JobNumber       string           `gorm:"size:50"`
	Sort            int              `gorm:"index"`
	HiredDate       *time.Time       `gorm:"type:timestamp"`
	CreatedAt       time.Time        `gorm:"autoCreateTime"`
	UpdatedAt       time.Time        `gorm:"autoUpdateTime"`
	UserDepartments []UserDepartment `gorm:"foreignKey:UserID;references:UserID"`
}

User 结构体

type UserDepartment

type UserDepartment struct {
	UserID       string     `gorm:"primaryKey;size:255"`
	DepartmentID int        `gorm:"primaryKey"`
	IsLeader     Bool       `gorm:"type:tinyint(1)"`
	CreatedAt    time.Time  `gorm:"autoCreateTime"`
	UpdatedAt    time.Time  `gorm:"autoUpdateTime"`
	Department   Department `gorm:"foreignKey:DepartmentID;references:DepartmentID"`
}

UserDepartment 结构体

type UserRole

type UserRole struct {
	UserID string `gorm:"size:255;not null"`
	RoleID uint   `gorm:"not null"`
}

UserRole 结构体

Jump to

Keyboard shortcuts

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