model

package
Version: v0.0.0-...-00ec2d6 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMySqlDB

func GetMySqlDB() *gorm.DB

func InitSelfDB

func InitSelfDB() *gorm.DB

Types

type Account

type Account struct {
	AccountId   string `json:"accountId" gorm:"column:account_id;not null"`
	AccountName string `json:"accountName" gorm:"column:account_name;not null" binding:"required" validate:"min=1,max=32"`
	Password    string `json:"password" gorm:"column:password;not null" binding:"required" validate:"min=5,max=128"`
}

type AccountInfo

type AccountInfo struct {
	AccountId   string `json:"id"`
	AccountName string `json:"username"`
	Password    string `json:"password"`
	CreatedAt   string `json:"createdAt"`
	UpdatedAt   string `json:"updatedAt"`
}

type BaseModel

type BaseModel struct {
	Id        uint64     `gorm:"primary_key;AUTO_INCREMENT;column:id" json:"-"`
	CreatedAt time.Time  `gorm:"column:createdAt" json:"-"`
	UpdatedAt time.Time  `gorm:"column:updatedAt" json:"-"`
	DeletedAt *time.Time `gorm:"column:deletedAt" sql:"index" json:"-"`
}

type DataBase

type DataBase struct {
	MyDB *gorm.DB
}
var DB *DataBase

func (*DataBase) Close

func (db *DataBase) Close()

func (*DataBase) Init

func (db *DataBase) Init()

type List

type List struct {
	Lock  *sync.RWMutex
	IdMap map[uint64]*AccountInfo
}

type Token

type Token struct {
	Token string `json:"token"`
}

Token-令牌.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL