article

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dao

type Dao struct {
	// contains filtered or unexported fields
}

Dao is archive dao.

func New

func New(c *conf.Config) (d *Dao)

New init api url

func (*Dao) AddArticle

func (d *Dao) AddArticle(c context.Context, art *artMdl.ArtParam) (id int64, err error)

AddArticle add article.

func (*Dao) AddDraft

func (d *Dao) AddDraft(c context.Context, art *artMdl.ArtParam) (id int64, err error)

AddDraft add draft.

func (*Dao) Article

func (d *Dao) Article(c context.Context, aid, mid int64, ip string) (res *model.Article, err error)

Article get article detail.

func (*Dao) ArticleMetas

func (d *Dao) ArticleMetas(c context.Context, aids []int64, ip string) (res map[int64]*model.Meta, err error)

ArticleMetas batch get articles by aids.

func (*Dao) ArticleStat

func (d *Dao) ArticleStat(c context.Context, mid int64, ip string) (res model.UpStat, err error)

ArticleStat article stat

func (*Dao) Articles

func (d *Dao) Articles(c context.Context, mid int64, pn, ps, sort, group, category int, ip string) (res *model.CreationArts, err error)

Articles get article list.

func (*Dao) Categories

func (d *Dao) Categories(c context.Context, ip string) (res *model.Categories, err error)

Categories list all category contain child.

func (*Dao) CategoriesMap

func (d *Dao) CategoriesMap(c context.Context, ip string) (res map[int64]*model.Category, err error)

CategoriesMap list all category.

func (*Dao) DelArticle

func (d *Dao) DelArticle(c context.Context, aid, mid int64, ip string) (err error)

DelArticle delete article.

func (*Dao) DelDraft

func (d *Dao) DelDraft(c context.Context, aid, mid int64, ip string) (err error)

DelDraft delete draft.

func (*Dao) Draft

func (d *Dao) Draft(c context.Context, aid, mid int64, ip string) (res *model.Draft, err error)

Draft get draft detail.

func (*Dao) Drafts

func (d *Dao) Drafts(c context.Context, mid int64, pn, ps int, ip string) (res *model.Drafts, err error)

Drafts get draft list.

func (*Dao) IsAuthor

func (d *Dao) IsAuthor(c context.Context, mid int64, ip string) (res bool, err error)

IsAuthor checks that whether user has permission to write article.

func (*Dao) RemainCount

func (d *Dao) RemainCount(c context.Context, mid int64, ip string) (res int, err error)

RemainCount article up limit.

func (*Dao) ThirtyDayArticle

func (d *Dao) ThirtyDayArticle(c context.Context, mid int64, ip string) (res []*model.ThirtyDayArticle, err error)

ThirtyDayArticle thirty day article

func (*Dao) UpdateArticle

func (d *Dao) UpdateArticle(c context.Context, art *artMdl.ArtParam) (err error)

UpdateArticle update article.

func (*Dao) WithDrawArticle

func (d *Dao) WithDrawArticle(c context.Context, aid, mid int64, ip string) (err error)

WithDrawArticle withdraw article.

Jump to

Keyboard shortcuts

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