serve

package
v0.0.0-...-0959ca7 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FORBIDDEN = "没有访问权限"
View Source
var JSON_ERROR = "JSON 解析失败"

Functions

func AddLoginCookie

func AddLoginCookie(c *gin.Context)

func CreateTable

func CreateTable()

func DeleteArticle

func DeleteArticle(Id string) error

func FetchArticlesCount

func FetchArticlesCount(c Condition, Enabled bool) (int, error)

func FetchClassifies

func FetchClassifies(Enabled bool) (map[string]int, error)

func FetchTags

func FetchTags(classify string, Enabled bool) (map[string]int, error)

func InitArticle

func InitArticle(r *gin.Engine)

func InitAuth

func InitAuth(r *gin.Engine)

func InitUtils

func InitUtils(r *gin.Engine)

func InsertArticle

func InsertArticle(A *Article) error

func RemoveLoginCookie

func RemoveLoginCookie(c *gin.Context)

func Return

func Return(c *gin.Context, status bool, data interface{}, message string)

func ReturnFalse

func ReturnFalse(c *gin.Context, message string)

func ReturnTrue

func ReturnTrue(c *gin.Context, data interface{})

func UpdateArticle

func UpdateArticle(A Article) error

func ValidateLogin

func ValidateLogin(j tools.Account) bool

func ValidateLoginStatus

func ValidateLoginStatus(c *gin.Context) bool

Types

type Article

type Article struct {
	Id          int64  `json:"id"`
	Classify    string `json:"classify"`
	Tag         string `json:"tag"`
	Enabled     bool   `json:"enabled"`
	Description string `json:"description"`
	Title       string `json:"title"`
	Raw         string `json:"raw"`
	CreateAt    string `json:"createAt"`
	UpdateAt    string `json:"updateAt"`
}

func FetchArticle

func FetchArticle(Id string, Enabled bool) (Article, error)

func FetchArticles

func FetchArticles(c Condition, Enabled bool) ([]Article, error)

func FetchLogos

func FetchLogos(Enabled bool) ([]Article, error)

func (Article) String

func (a Article) String() string

type Condition

type Condition struct {
	Limit    string
	Offset   string
	Sort     string
	SortType string
	Tag      string
	Title    string
	Classify string
}

func (*Condition) Init

func (c *Condition) Init(e *gin.Context)

func (Condition) String

func (c Condition) String() string

Jump to

Keyboard shortcuts

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