model

package
v0.0.0-...-273922a Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDb

func InitDb()

Types

type Article

type Article struct {
	gorm.Model
	Category Category
	Title    string `gorm:"type:varchar(100);not null" json:"title"`
	Cid      int    `gorm:"type:int;not null " json:"cid"`
	Desc     string `gorm:"type:varchar(200)" json:"desc"`
	Content  string `gorm:"type:longtext" json:"content"`
	Img      string `gorm:"type:varchar(100)" json:"img"`
}

type Category

type Category struct {
	gorm.Model
	Name string `gorm:"type:varchar(20);not null" json:"name"`
}

type User

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(20);not null" json:"username"`
	Password string `gorm:"type:varchar(20);not null" json:"password"`
	Role     int    `gorm:"type:int" json:"role"`
	Avatar   string
}

Jump to

Keyboard shortcuts

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