database

package
v0.0.0-...-14907fc Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnInit

func ConnInit()

func GetDBConn

func GetDBConn() *gorm.DB

func ModelInit

func ModelInit()

ModelInit 每次启动初始化数据库,便于更改数据库结构

Types

type Admin

type Admin struct {
	gorm.Model
	Username string `json:"username" gorm:"type:varchar(100);not null"`
	Password string `json:"password" gorm:"type:varchar(200);not null"`
}

type User

type User struct {
	gorm.Model
	Username    string `json:"username" gorm:"type:varchar(100);not null"`
	Email       string `json:"email" gorm:"type:varchar(100);not null"`
	Password    string `json:"password" gorm:"type:varchar(200);not null"`
	Description string `json:"description" gorm:"type:varchar(100);not null"`
	Status      string `json:"status" gorm:"type:varchar(50);not null"`
}

Jump to

Keyboard shortcuts

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