entity

package
v0.0.0-...-cd8c0a5 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserRoleNoAuthority uint64 = 1 << iota
	UserRoleDefault     uint64 = 1 << iota
	UserRoleSuperUser   uint64 = 1 << iota
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	UserName string
	Iat      int64
	Exp      int64
}

type Model

type Model struct {
	ID        uint           `gorm:"primary_key;comment:id"`
	CreatedAt time.Time      `gorm:"index;comment:作成日"`
	UpdatedAt time.Time      `gorm:"index;comment:更新日"`
	DeletedAt gorm.DeletedAt `gorm:"index;comment:削除日"`
	CreatedBy string         `gorm:"index;comment:作成者"`
	UpdatedBy string         `gorm:"index;comment:更新者"`
}

type User

type User struct {
	Model
	UserName       string     `gorm:"index:idx_name,unique; comment:ユーザ名"`
	LastName       string     `gorm:"comment:性"`
	FirstName      string     `gorm:"comment:名"`
	EmployeeNumber string     `gorm:"index:idx_user_employee_number;default:'no_number';comment:社員番号"`
	Password       string     `gorm:"comment:パスワード"`
	LastLoginAt    *time.Time `gorm:"comment:最終ログイン日時"`
	RoleBitCode    uint64     `gorm:"comment:ユーザ権限"`
}

type UserAuth

type UserAuth struct {
	Model
	UserID      uint   `gorm:"index;comment:ユーザID"`
	User        User   `gorm:"comment:ユーザ"`
	AccessToken string `gorm:"index:unique;comment:アクセストークン"`
}

type UserRole

type UserRole struct {
	Model
	Name     string `gorm:"comment:和名"`
	RoleName string `gorm:"comment:権限名"`
	BitCode  uint64 `gorm:"comment:ビットコード"`
}

Jump to

Keyboard shortcuts

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