model

package
v0.0.0-...-2bb31bb Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminBaseModel

type AdminBaseModel struct {
	BaseModel
	CreatedBy string `gorm:"default:null;type:varchar(36)"`
	UpdatedBy string `gorm:"default:null;type:varchar(36)"`
	DeletedBy string `gorm:"default:null;type:varchar(36)"`
}

type BaseModel

type BaseModel struct {
	Id        string `gorm:"type:varchar(36);primarykey"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
}

func (*BaseModel) BeforeCreate

func (base *BaseModel) BeforeCreate(tx *gorm.DB) error

type Oauth2Client

type Oauth2Client struct {
	AdminBaseModel
	ClientId    string `gorm:"type:varchar(255);not null"`
	Name        string `gorm:"type:varchar(255);not null"`
	Secret      string `gorm:"type:varchar(255);not null"`
	Domain      string `gorm:"type:varchar(255);not null"`
	Description string `gorm:"type:text"`
}

type Role

type Role struct {
	BaseModel
	Code string `gorm:"not null;type:varchar(32);unique"`
	Name string `gorm:"not null;type:varchar(32);unique"`
}

type RoleKey

type RoleKey struct {
	BaseModel
	Method    string `gorm:"not null; type:varchar(8)"`
	Path      string `gorm:"not null; type:varchar(128)"`
	Key       string `gorm:"not null; type:varchar(32)"`
	KeyAccess string `gorm:"not null; type:varchar(8)"`
}

type RoleKeyMapping

type RoleKeyMapping struct {
	BaseModel
	RoleId    string `gorm:"not null"`
	Role      Role
	RoleKeyId string `gorm:"not null"`
	RoleKey   RoleKey
	IsAllow   bool `gorm:"not null"`
}

type User

type User struct {
	AdminBaseModel
	Name         string `gorm:"not null; type:varchar(255)"`
	Username     string `gorm:"not null; type:varchar(255)"`
	Email        string `gorm:"not null; type:varchar(255); uniqueIndex"`
	Password     string `gorm:"not null; type:varchar(255)"`
	Phone        string `gorm:"type:varchar(30)"`
	RoleId       string `gorm:"not null"`
	Role         Role
	IsActive     bool       `gorm:""`
	LastLoggedIn *time.Time `gorm:""`
}

Jump to

Keyboard shortcuts

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