article

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddView

func AddView(num int, name string)

AddView 添加文章的view

func AddViewAll

func AddViewAll(num int)

AddViewAll 全局的总访问量

Types

type DB_BLOG_CATES

type DB_BLOG_CATES struct {
	models.Model
	Cate string `json:"cate"`
	Name string `json:"name"`
}

DB_BLOG_CATES 文章分类表模型

type DB_BLOG_COMMENTS

type DB_BLOG_COMMENTS struct {
	models.Model
	Name    string `json:"name"`
	User    string `json:"user"`
	Date    string `json:"date"`
	Comment string `json:"comment"`
}

DB_BLOG_COMMENTS 文章评论表模型

type DB_BLOG_LIKES

type DB_BLOG_LIKES struct {
	models.Model
	Name string `gorm:"unique;not null" json:"name"`
	Like int    `json:"like"`
}

DB_BLOG_LIKES 文章点赞表模型

type DB_BLOG_POST

type DB_BLOG_POST struct {
	models.Model
	ID         int    `gorm:"not null" json:"id"`
	Name       string `gorm:"unique;not null" json:"name"`
	Title      string `json:"title"`
	Date       string `json:"date"`
	DatePlus   string `json:"date_plus"`
	Update     string `json:"update"`
	Abstract   string `json:"abstract"`
	Content    string `json:"content"`
	Tags       string `json:"tags"`
	Categories string `json:"categories"`
	Pin        int    `json:"pin"`
}

DB_BLOG_POST 文章表模型

func Search(name string) (s []DB_BLOG_POST)

Search 模糊搜索 当前支持title name content abstract tag cate

type DB_BLOG_SHARE

type DB_BLOG_SHARE struct {
	models.Model
	Name  string `gorm:"unique;not null" json:"name"`
	Share int    `json:"share"`
}

DB_BLOG_SHARE 文章分享表模型

type DB_BLOG_TAGS

type DB_BLOG_TAGS struct {
	models.Model
	Tag  string `json:"tag"`
	Name string `json:"name"`
}

DB_BLOG_TAGS 文章标签表模型

type DB_BLOG_VIEWS

type DB_BLOG_VIEWS struct {
	models.Model
	Name string `gorm:"unique;not null" json:"name"`
	View int    `json:"view"`
}

DB_BLOG_VIEWS 文章访问量表模型 总views name=ALL/all

func GetViewAllFromdb

func GetViewAllFromdb() (uv DB_BLOG_VIEWS)

GetViewAllFromdb 获取全局总访问量

func GetViewFromdb

func GetViewFromdb(name string) (uv DB_BLOG_VIEWS)

GetViewFromdb 获取文章的访问量

type DB_BLOG_ZHUANLAN

type DB_BLOG_ZHUANLAN struct {
	models.Model
	Name    string `gorm:"unique" json:"name"`
	Title   string `json:"title"`
	Date    string `json:"date"`
	Posts   string `json:"posts"`
	Content string `json:"content"`
}

DB_BLOG_ZHUANLAN 专栏表模型 精选多篇文章后组成一个专栏

Jump to

Keyboard shortcuts

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