blog

package
v0.0.0-...-872e689 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const ARTICLES_PER_DAY = 200
View Source
const ARTICLE_PER_PAGE = 10
View Source
const ONE_DAY_SECONDS = 86400
View Source
const ONE_WEEK_SECONDS = 604800

Variables

This section is empty.

Functions

This section is empty.

Types

type Article

type Article struct {
	Id       string
	PostTime int
	Link     string
	UserId   string
}

type Blog

type Blog struct {
	Client *redis.Client
}

func NewBlog

func NewBlog() *Blog

func (*Blog) AddOrRemoveGroup

func (blog *Blog) AddOrRemoveGroup(articleId string, addGroup []string, removeGroup []string)

func (*Blog) GetArticle

func (blog *Blog) GetArticle(articleId string) (*Article, error)

func (*Blog) GetArticleListByGroupScore

func (blog *Blog) GetArticleListByGroupScore(group string, page int) ([]*Article, error)

func (*Blog) GetArticleListByScore

func (blog *Blog) GetArticleListByScore(page int, key string) ([]*Article, error)

GetArticleListByScore: 获得对应page的列表

func (*Blog) GetArticleListByTime

func (blog *Blog) GetArticleListByTime(page int) ([]*Article, error)

GetArticleListByTime:

func (*Blog) PostArticle

func (blog *Blog) PostArticle(userId string, link string, group []string) error

PostArticle: 发布文章

func (*Blog) Vote

func (blog *Blog) Vote(userId string, articleId string) error

给文章投票

Jump to

Keyboard shortcuts

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