service

package
v0.0.0-...-e0e8746 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Article

type Article struct {
	ID            int
	TagID         int
	Title         string
	Desc          string
	Content       string
	CoverImageURL string
	State         int
	CreatedBy     string
	ModifiedBy    string

	PageNum  int
	PageSize int
}

Article 文章结构体

func (*Article) Add

func (a *Article) Add() error

Add 添加文章

func (*Article) Count

func (a *Article) Count() (int, error)

Count 文章计数

func (*Article) Delete

func (a *Article) Delete() error

Delete 删除文章

func (*Article) Edit

func (a *Article) Edit() error

Edit 编辑文章

func (*Article) ExistByID

func (a *Article) ExistByID() (bool, error)

ExistByID 通过ID判断文章是否存在

func (*Article) Get

func (a *Article) Get() (*models.Article, error)

Get 获取文章

func (*Article) GetAll

func (a *Article) GetAll() ([]*models.Article, error)

GetAll 获取全部文章

type Auth

type Auth struct {
	Username string
	Password string
}

Auth 认证结构体

func (*Auth) Check

func (a *Auth) Check() (bool, error)

Check 认证鉴权

type Tag

type Tag struct {
	ID         int
	Name       string
	CreatedBy  string
	ModifiedBy string
	State      int

	PageNum  int
	PageSize int
}

Tag 标签结构体

func (*Tag) Add

func (t *Tag) Add() error

Add 添加标签

func (*Tag) Count

func (t *Tag) Count() (int, error)

Count 标签计数

func (*Tag) Delete

func (t *Tag) Delete() error

Delete 删除标签

func (*Tag) Edit

func (t *Tag) Edit() error

Edit 编辑标签

func (*Tag) ExistByID

func (t *Tag) ExistByID() (bool, error)

ExistByID 通过ID判断标签是否存在

func (*Tag) ExistByName

func (t *Tag) ExistByName() (bool, error)

ExistByName 通过名字判断标签是否存在

func (*Tag) Export

func (t *Tag) Export() (string, error)

Export 给标签添加导出功能

func (*Tag) GetAll

func (t *Tag) GetAll() ([]models.Tag, error)

GetAll 获取全部标签

func (*Tag) Import

func (t *Tag) Import(r io.Reader) error

Import 给标签添加导入功能

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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