model

package
v0.0.0-...-da9a27d Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2021 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category struct {
	GormModel
	Parent int    `json:"parent" gorm:"index:parent;type:int;not null;column:parent"`
	Name   string `json:"name" gorm:"type:varchar(60);not null;column:name"`
	Order  int    `json:"order" gorm:"type:int;not null;column:order"`
}

Category ...

type GormModel

type GormModel struct {
	ID        uint       `json:"id" gorm:"primary_key"`
	CreatedAt time.Time  `json:"createdAt"`
	UpdatedAt time.Time  `json:"updatedAt"`
	DeletedAt *time.Time `json:"deletedAt" gorm:"index"`
}

GormModel ...

type NoteDetail

type NoteDetail struct {
	GormModel
	Title      string   `json:"title" gorm:"index:title;type:varchar(100);not null;column:title"`
	Text       string   `json:"text" gorm:"type:longtext;column:text"`
	Labels     string   `json:"labels" gorm:"type:varchar(60);not null;column:labels"`
	CategoryID int      `json:"categoryID" gorm:"index:category_id;type:int;not null;column:category_id"`
	Category   Category `json:"category" gorm:"foreignkey:category_id"`
	Status     int      `json:"status" gorm:"type:int;not null;column:status"`
	Author     string   `json:"author" gorm:"type:varchar(60);not null;column:author"`
}

NoteDetail 笔记

type User

type User struct {
	GormModel
	Name   string `json:"name" gorm:"index:name;type:varchar(30);not null;column:name"`
	Pass   string `json:"-" gorm:"type:varchar(60);not null;column:pass"`
	Status int    `json:"status" gorm:"type:int;not null;column:status"`
}

User ...

Jump to

Keyboard shortcuts

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