models

package
v0.0.0-...-5c1822e Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type About

type About struct {
	Id       int32 `orm:"pk;auto"`
	Title    string
	Body     string    `orm:"type(text)"`
	Time     time.Time `orm:"auto_now_add;type(datetime)"`
	Photo    string
	Music    string
	BlogName string
}

关于

type Album

type Album struct {
	Id        int32 `orm:"pk;auto"`
	Title     string
	Content   string `orm:"type(text)"`
	PhotoPath string
	Time      time.Time `orm:"auto_now_add;type(datetime)"`
}

相册表

type Article

type Article struct {
	Id       int32      `json:"id"orm:"pk;auto"`
	Title    string     `json:"title"`
	Body     string     `json:"body"orm:"type(text)"`
	Time     time.Time  `json:"time"orm:"auto_now_add;type(datetime)"`
	Cover    string     `json:"cover"`
	Key      string     `json:"key"`
	Author   string     `json:"author"`
	Category *Category  `json:"category"orm:"rel(fk)"`
	Readers  *Reader    `json:"readers"orm:"rel(one)"`
	Comments []*Comment `json:"comments"orm:"reverse(many);on_delete(cascade)"`
}

文章表

type Category

type Category struct {
	Id       int32      `json:"id" orm:"pk;auto"`
	Name     string     `json:"name" orm:"unique"`
	Articles []*Article `orm:"reverse(many)"`
}

文章类别

type Comment

type Comment struct {
	Id       int32 `orm:"pk;auto"`
	Name     string
	Content  string `orm:"type(text)"`
	Email    string
	Time     time.Time `orm:"auto_now_add;type(datetime)"`
	Articles *Article  `orm:"rel(fk)"`
}

评论表

type File

type File struct {
	Id   int32 `orm:"pk;auto"`
	Name string
	Time time.Time `orm:"auto_now_add;type(datetime)"`
	Path string
}

文件表

type FriendshipLink struct {
	Id    int32 `orm:"pk;auto"`
	Title string
	Link  string
}

友情链接

type Reader

type Reader struct {
	Id         int32    `json:"id" orm:"pk;auto"`
	Number     int      `json:"number" `
	Appreciate int      `json:"appreciate" `
	Articles   *Article `json:"articles" orm:"reverse(one)"`
}

阅读表

type Recommend

type Recommend struct {
	Id     int32  `json:"id" orm:"pk;auto"`
	Title  string `json:"title"`
	Link   string `json:"link"`
	Clicks int    `json:"clicks"`
}

推荐链接表

type TagCloud

type TagCloud struct {
	Id    int32 `orm:"pk;auto"`
	Lable string
}

标签云

type User

type User struct {
	Id       int32  `orm:"pk;auto"`
	UserName string `orm:"unique"`
	Password string
	Token    string
}

用户表

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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