staff

package
v0.0.0-...-eb64f0e Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Service handles operations on model Staff.
	Service *serviceProvider
)

Functions

func CreateAdminStaff

func CreateAdminStaff(conn orm.Connection) error

Types

type Permission

type Permission struct {
	URL     string `gorm:"primary_key" sql:"type:varchar(255) not null default ''"`
	RoleId  int16  `gorm:"column:roleid;primary_key" sql:"type:smallint(5) not null default 0"`
	Created *time.Time
}

Permission represents permission of URL.

func (Permission) TableName

func (Permission) TableName() string

TableName returns table name in database.

type Relation

type Relation struct {
	StaffId int32 `gorm:"column:staffid;primary_key" sql:"type:int(11) not null default 0"`
	RoleId  int16 `gorm:"column:roleid;primary_key" sql:"type:smallint(5) not null default 0"`
	Created *time.Time
}

Staff role relation table.

func (Relation) TableName

func (Relation) TableName() string

TableName returns table name in database.

type Role

type Role struct {
	Id      int16  `gorm:"primary_key;auto_increment"`
	Name    string `gorm:"type:varchar(30);unique"`
	Intro   string `gorm:"type:varchar(255)"`
	Active  bool
	Created *time.Time
}

func (Role) TableName

func (Role) TableName() string

TableName returns table name in database.

type Staff

type Staff struct {
	Id        int32      `gorm:"primary_key;auto_increment"`
	Name      string     `gorm:"type:varchar(30);unique"`
	Pwd       string     `gorm:"type:varchar(127);not null;default ''"`
	RealName  string     `gorm:"column:realname;type:varchar(255);not null;default ''"`
	Mobile    string     `gorm:"unique"`
	Email     string     `gorm:"type:varchar(80);unique"`
	CreatedAt *time.Time `gorm:"column:createdat"`
	ResignAt  *time.Time `gorm:"column:resignat"`
	Male      bool
	Active    bool
	Resigned  bool
}

func (Staff) TableName

func (Staff) TableName() string

TableName returns table name in database.

Jump to

Keyboard shortcuts

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