domain

package
v0.0.0-...-e31b469 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseModel

type BaseModel struct {
	ID        string     `gorm:"type:char(36);primary_key;comment:'标识'"`
	CreatedAt time.Time  `gorm:"comment:'创建时间'"`
	UpdatedAt time.Time  `gorm:"comment:'更新时间'"`
	DeletedAt *time.Time `gorm:"comment:'删除时间'"`
}

BaseModel is

func NewBase

func NewBase() *BaseModel

New

type RSAKey

type RSAKey struct {
	BaseModel
	Scope      string `gorm:"type:varchar(20)"`
	Version    int    `gorm:"not_null"`
	PublicKey  string `gorm:"type:varchar(500)"`
	PrivateKey string `gorm:"type:varchar(1000)"`
}

RSAKey : Record a rsa information,

type Role

type Role struct {
	BaseModel
	Name        string `gorm:"type:varchar(50);not_null"`
	Description string `gorm:"type:varchar(200)"`
	Enabled     bool   `gorm:"not_null"`
	SystemID    string `gorm:"type:varchar(50);not_null"`
}

Role :

type User

type User struct {
	BaseModel
	UserID          string `gorm:"type:varchar(50);comment:'用户标识'"`
	Password        string `gorm:"type:varchar(100);comment:'密码'"`
	PasswordVersion int    `gorm:"not_null:size:2;comment:'密码版本'"`
	UserState       int    `gorm:"not_null;size:1;comment:'用户状态^0:停用,1:启用。'"`
	UserName        string `gorm:"type:varchar(100);comment:'用户姓名'"`
	Email           string `gorm:"type:varchar(100);comment:'电子邮箱'"`
	Phone           string `gorm:"type:varchar(20);comment:'电话'"`
}

User :

type UserNRole

type UserNRole struct {
	BaseModel
	UserID string `gorm:"type:char(36);not_null"`
	RoleID string `gorm:"type:char(36);not_null"`
}

UserNRole : Connection the users and the roles.

Jump to

Keyboard shortcuts

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