model

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2020 License: Apache-2.0 Imports: 0 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                   string      `json:"id,omitempty" gorm:"primary_key;comment:'部門編號'"`                                                //部門編號
	Name                 string      `json:"name,omitempty" gorm:"comment:'部門名稱'"`                                                          //部門名稱
	PreviousDepartment   *Department `json:"previousDepartment,omitempty" gorm:"foreignkey:PreviousDepartmentID;association_foreignkey:ID"` //上級部門
	PreviousDepartmentID string      `json:"previousDepartmentID,omitempty" gorm:"comment:'上級部門'"`                                          //上級部門 ID
}

Department 部門模型

func (*Department) GetID

func (d *Department) GetID() string

GetID 用於取得部門 ID

func (*Department) GetName

func (d *Department) GetName() string

GetName 用於取得部門名稱

func (*Department) GetPreviousDepartment

func (d *Department) GetPreviousDepartment() DepartmentModelInterface

GetPreiousDepartment 用於取得上級部門

type DepartmentModelInterface

type DepartmentModelInterface interface {
	GetID() string
	GetName() string
	GetPreviousDepartment() DepartmentModelInterface
}

DepartmentModelInterface 部門模型的實作介面

type Startup

type Startup struct {
}

type StartupInterface

type StartupInterface interface {
}

type User

type User struct {
	ID           string      `json:"id,omitempty" gorm:"primary_key;comment:'使用者 ID'"`                              //使用者 ID
	Username     string      `json:"username,omitempty" gorm:"comment:'使用者名稱'"`                                     //使用者名稱
	Email        string      `json:"email,omitempty" gorm:"comment:'信箱'"`                                           //使用者信箱
	QQ           string      `json:"qq,omitempty" gorm:"comment:'QQ'"`                                              //使用者QQ
	Location     string      `location:"email,omitempty" gorm:"comment:'所在地'"`                                      //所在地
	EXT          int         `json:"ext,omitempty" gorm:"comment:'分機'"`                                             //分機
	Department   *Department `json:"department,omitempty" gorm:"foreignkey:departmentID;association_foreignkey:ID"` //部門
	DepartmentID string      `json:"departmentID,omitempty" gorm:"comment:'部門'"`                                    //部門 ID
}

User

func (*User) GetDepartment

func (u *User) GetDepartment() DepartmentModelInterface

GetDepartment 用於取得使用者部門

func (*User) GetEXT

func (u *User) GetEXT() int

GetEXT 用於取得使用者分機

func (*User) GetEmail

func (u *User) GetEmail() string

GetEmail 用於取得使用者信箱

func (*User) GetID

func (u *User) GetID() string

GetID 用於取得部門 ID

func (*User) GetLocation

func (u *User) GetLocation() string

GetLocation 用於取得使用者所在地

func (*User) GetQQ

func (u *User) GetQQ() string

GetQQ 用於取得使用者 QQ

func (*User) GetUserName

func (u *User) GetUserName() string

GetUsername 用於取得使用者名稱

type UserModelInterface

type UserModelInterface interface {
	GetID() string
	GetUserName() string
	GetEmail() string
	GetQQ() string
	GetLocation() string
	GetEXT() int
	GetDepartment() DepartmentModelInterface
}

UserModelInterface User 模型的實作介面

Jump to

Keyboard shortcuts

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