models

package
v0.0.0-...-8d59c21 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogTypeLogin         = 1
	LogTypePassword      = 2
	LogTypeAddAdminer    = 3
	LogTypeEditAdminer   = 4
	LogTypeDeleteAdminer = 5
)
View Source
const (
	PermissionTypeApi uint8 = 1
	PermissionTypeDef uint8 = 2
)
View Source
const (
	SessionTypeAuth    = 1
	SessionTypeCaptcha = 2
)
View Source
const AdminerStatusLock = 2
View Source
const AdminerStatusOk = 1

Variables

This section is empty.

Functions

func AdminerStatusNames

func AdminerStatusNames() map[uint8]string

func DB

func DB() *gorm.DB

func HasAdminer

func HasAdminer(username string) bool

func InitDB

func InitDB()

func LogTypeNames

func LogTypeNames() map[int]string

func PermissionTypeNames

func PermissionTypeNames() map[uint8]string

Types

type Adminer

type Adminer struct {
	Id        uint32 `gorm:"primary_key;AUTO_INCREMENT"`
	Username  string
	Password  string
	Salt      string
	Name      string
	Phone     string
	Roles     string
	Status    uint8
	IsSuper   uint8
	CreatedAt uint32
	UpdatedAt uint32
	DeletedAt soft_delete.DeletedAt
}

func (*Adminer) IsOK

func (u *Adminer) IsOK() bool

func (*Adminer) Super

func (u *Adminer) Super() bool

func (*Adminer) TableName

func (u *Adminer) TableName() string

type Cache

type Cache struct {
	Id        uint32 `gorm:"primary_key;AUTO_INCREMENT"`
	Name      string
	Sign      string
	Data      string
	CreatedAt uint32
	UpdatedAt uint32
}

func (*Cache) TableName

func (m *Cache) TableName() string

type Config

type Config struct {
	Id        uint32 `gorm:"primary_key;AUTO_INCREMENT"`
	Name      string
	K         string
	V         string
	CreatedAt uint32
	UpdatedAt uint32
}

func (*Config) TableName

func (m *Config) TableName() string

type Log

type Log struct {
	Id        uint64 `gorm:"primary_key;AUTO_INCREMENT"`
	AdminerId uint32
	Type      uint32
	Msg       string
	Details   string
	Ip        string
	Target    uint32
	CreatedAt uint32
	UpdatedAt uint32
}

func (*Log) TableName

func (m *Log) TableName() string

type Permission

type Permission struct {
	Id         uint32 `gorm:"primary_key;AUTO_INCREMENT"`
	Name       string
	Permission string
	Gid        uint32
	Type       uint8
	CreatedAt  uint32
	UpdatedAt  uint32
}

func (*Permission) TableName

func (m *Permission) TableName() string

type PermissionGroup

type PermissionGroup struct {
	Id        uint32 `gorm:"primary_key;AUTO_INCREMENT"`
	Pid       uint32
	Name      string
	Ord       uint32
	CreatedAt uint32
	UpdatedAt uint32
}

func (*PermissionGroup) TableName

func (m *PermissionGroup) TableName() string

type Role

type Role struct {
	Id        uint32 `gorm:"primary_key;AUTO_INCREMENT"`
	Name      string
	CreatedAt uint32
	UpdatedAt uint32
	DeletedAt soft_delete.DeletedAt
}

func (*Role) TableName

func (m *Role) TableName() string

type RolePermission

type RolePermission struct {
	Id         uint32 `gorm:"primary_key;AUTO_INCREMENT"`
	RoleId     uint32
	Permission string
	CreatedAt  uint32
	UpdatedAt  uint32
}

func (*RolePermission) TableName

func (m *RolePermission) TableName() string

type Session

type Session struct {
	Id           uint64 `gorm:"primary_key;AUTO_INCREMENT"`
	AdminerId    uint32
	Type         uint8
	SessionId    string
	SessionValue string
	Expire       uint32
	CreatedAt    uint32
	UpdatedAt    uint32
}

func (*Session) TableName

func (u *Session) TableName() string

Jump to

Keyboard shortcuts

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