models

package
v0.0.0-...-596715f Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUserPermission

func GetUserPermission(userId uint) []string

func Migrate

func Migrate(db *gorm.DB)

Types

type Permission

type Permission struct {
	ID          uint   `json:"id" gorm:"PRIMARY_KEY;AUTO_INCREMENT"`
	Name        string `json:"name" gorm:"Type:varchar(100);NOT NULL"`
	DisplayName string `json:"displayName"`
	Desc        string `json:"desc"`
	Status      string `json:"status"`
}

func (Permission) TableName

func (Permission) TableName() string

type Role

type Role struct {
	ID     uint   `json:"id" gorm:"PRIMARY_KEY;AUTO_INCREMENT"`
	Name   string `json:"name" gorm:"Type:varchar(100);NOT NULL"`
	Desc   string `json:"desc"`
	Status string `json:"status"`
}

func (Role) TableName

func (Role) TableName() string

type RolePermission

type RolePermission struct {
	PermissionId uint `gorm:"primary_key"`
	RoleId       uint `gorm:"primary_key"`
}

func (RolePermission) TableName

func (RolePermission) TableName() string

type User

type User struct {
	ID       uint
	Name     string
	Age      uint8
	Email    string
	Password string
}

func (*User) Read

func (u *User) Read(m common.JSON)

func (User) Serialize

func (u User) Serialize() common.JSON

func (User) TableName

func (User) TableName() string

type UserRole

type UserRole struct {
	UserId uint `gorm:"primary_key"`
	RoleId uint `gorm:"primary_key"`
}

func (UserRole) TableName

func (UserRole) TableName() string

Jump to

Keyboard shortcuts

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