service

package
v0.0.0-...-5b4efa0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2020 License: BSD-3-Clause Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ArchiveRoutes = []models.Route{
	{Method: "GET", Pattern: "/archive/v1/list", MiddleWare: nil, HandlerFunc: getArchiveTotalByDateList},
	{Method: "GET", Pattern: "/year/v1/list", MiddleWare: nil, HandlerFunc: getArchiveGrouopYearList},
}
View Source
var CommentsRoutes = []models.Route{
	{Method: "POST", Pattern: "/comments/v1/add", MiddleWare: gin.HandlersChain{authmidware.UserToken}, HandlerFunc: transaction.GormTx(savePostsComments)},
	{Method: "POST", Pattern: "/admin/v1/reply", MiddleWare: gin.HandlersChain{authmidware.UserToken}, HandlerFunc: transaction.GormTx(replyComments)},
	{Method: "DELETE", Pattern: "/comments/v1/:id", MiddleWare: gin.HandlersChain{authmidware.AdminToken}, HandlerFunc: transaction.GormTx(deletePostsComments)},
	{Method: "GET", Pattern: "/comments/v1/:id", MiddleWare: gin.HandlersChain{authmidware.AdminToken}, HandlerFunc: getPostsComments},
	{Method: "GET", Pattern: "/comments-posts/v1/list", MiddleWare: nil, HandlerFunc: getPostsCommentsByPostsIdList},
	{Method: "GET", Pattern: "/get/v1/comments", MiddleWare: gin.HandlersChain{authmidware.AdminToken}, HandlerFunc: getPostsCommentsList},
}
View Source
var PostsRoutes = []models.Route{
	{Method: "GET", Pattern: "/health", MiddleWare: nil, HandlerFunc: Health},
	{Method: "GET", Pattern: "/list/v1/posts", MiddleWare: gin.HandlersChain{middlewares.AuthUserLogMiddleware(constants.PostsList, "文章列表")}, HandlerFunc: getPostsList},
	{Method: "GET", Pattern: "/weight/v1/list", MiddleWare: gin.HandlersChain{middlewares.AuthUserLogMiddleware(constants.PostsList, "权重列表")}, HandlerFunc: getWeightList},
	{Method: "GET", Pattern: "/archive/v1/list", MiddleWare: nil, HandlerFunc: getArchiveTotalByDateList},
	{Method: "GET", Pattern: "/hot/v1/list", MiddleWare: nil, HandlerFunc: getHotPostsList},
	{Method: "POST", Pattern: "/posts/v1/add", MiddleWare: gin.HandlersChain{authmidware.AdminToken}, HandlerFunc: transaction.GormTx(savePosts)},
	{Method: "GET", Pattern: "/posts/v1/:id", MiddleWare: gin.HandlersChain{middlewares.AuthUserLogMiddleware(constants.PostsDetail, "获取文章")}, HandlerFunc: getPosts},
	{Method: "DELETE", Pattern: "/posts/v1/:id", MiddleWare: gin.HandlersChain{authmidware.AdminToken}, HandlerFunc: transaction.GormTx(deletePosts)},
	{Method: "PUT", Pattern: "/posts/v1/update", MiddleWare: gin.HandlersChain{authmidware.AdminToken}, HandlerFunc: transaction.GormTx(updatePosts)},
	{Method: "PUT", Pattern: "/status/v1/update", MiddleWare: gin.HandlersChain{authmidware.AdminToken}, HandlerFunc: transaction.GormTx(updatePostsStatus)},
}

Functions

func Health

func Health(c *gin.Context)

Types

type PostsAndTags

type PostsAndTags struct {
	po.Posts     `xorm:"extends"`
	po.PostsTags `xorm:"extends"`
}

func (PostsAndTags) TableName

func (p PostsAndTags) TableName() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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