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: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseImageURLs

func ParseImageURLs(imageURLs, originImageURLs string) (imgs, oimgs []string, err error)

ParseImageURLs parse img urls to []string.

Types

type Service

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

Service struct.

func New

func New(c *conf.Config, rpcdaos *service.RPCDaos) *Service

New get service.

func (*Service) AddDraft

func (s *Service) AddDraft(c context.Context, mid int64, art *artMdl.ArtParam) (aid int64, err error)

AddDraft add draft.

func (*Service) ArticleCapture

func (s *Service) ArticleCapture(c context.Context, url string) (loc string, size int, err error)

ArticleCapture article capture.

func (*Service) ArticleStat

func (s *Service) ArticleStat(c context.Context, mid int64, ip string) (stat article.UpStat, err error)

ArticleStat get article base data.

func (*Service) ArticleUpCover

func (s *Service) ArticleUpCover(c context.Context, fileType string, body []byte) (url string, err error)

ArticleUpCover article upload cover.

func (*Service) Articles

func (s *Service) Articles(c context.Context, mid int64, pn, ps, sort, group, category int, ip string) (arts *artMdl.ArtList, err error)

Articles get article list.

func (*Service) Categories

func (s *Service) Categories(c context.Context) (*article.Categories, error)

Categories get article category.

func (*Service) DelArticle

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

DelArticle delete article.

func (*Service) DelDraft

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

DelDraft delete draft.

func (*Service) Draft

func (s *Service) Draft(c context.Context, aid, mid int64, ip string) (res *artMdl.Meta, err error)

Draft get draft.

func (*Service) Drafts

func (s *Service) Drafts(c context.Context, mid int64, pn, ps int, ip string) (dls *artMdl.DraftList, err error)

Drafts get draft list.

func (*Service) IsAuthor

func (s *Service) IsAuthor(c context.Context, mid int64, ip string) (ok bool, err error)

IsAuthor checks that whether user has permission to write article.

func (*Service) ParseDraftParam

func (s *Service) ParseDraftParam(c context.Context, categoryStr, reprintStr, tidStr, imageURLs, originImageURLs string) (art *artMdl.ArtParam, err error)

ParseDraftParam parse draft param which type is int.

func (*Service) ParseParam

func (s *Service) ParseParam(c context.Context, categoryStr, reprintStr, tidStr, imageURLs, originImageURLs string) (art *artMdl.ArtParam, err error)

ParseParam parse article param which type is int.

func (*Service) RemainCount

func (s *Service) RemainCount(c context.Context, mid int64, ip string) (rc int, err error)

RemainCount article up limit.

func (*Service) SubArticle

func (s *Service) SubArticle(c context.Context, mid int64, art *artMdl.ArtParam, ak, ck, ip string) (aid int64, err error)

SubArticle submit article.

func (*Service) UpdateArticle

func (s *Service) UpdateArticle(c context.Context, mid int64, art *artMdl.ArtParam, ak, ck, ip string) (err error)

UpdateArticle update article.

func (*Service) View

func (s *Service) View(c context.Context, aid, mid int64, ip string) (res *artMdl.Meta, err error)

View get article detail.

func (*Service) WithDrawArticle

func (s *Service) 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