handler

package
v0.0.0-...-8ac8648 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostHandler

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

func NewPostHandler

func NewPostHandler(serv service.IPostService, cfgService website_config.Service, postLikeServ post_like.Service, countStats service2.ICountStatsService) *PostHandler

func (*PostHandler) AddLike

func (h *PostHandler) AddLike(ctx *gin.Context) (*apiwrap.ResponseBody[any], error)

func (*PostHandler) AddPost

func (h *PostHandler) AddPost(ctx *gin.Context, req request.PostReq) (*apiwrap.ResponseBody[any], error)

func (*PostHandler) AdminGetPostById

func (h *PostHandler) AdminGetPostById(ctx *gin.Context) (*apiwrap.ResponseBody[vo.PostDetailVO], error)

func (*PostHandler) AdminGetPosts

func (*PostHandler) DeletePost

func (h *PostHandler) DeletePost(ctx *gin.Context) (*apiwrap.ResponseBody[any], error)

func (*PostHandler) GetLatestPosts

func (h *PostHandler) GetLatestPosts(ctx *gin.Context) (*apiwrap.ResponseBody[apiwrap.ListVO[*SummaryPostVO]], error)

func (*PostHandler) GetPostBySug

func (h *PostHandler) GetPostBySug(ctx *gin.Context) (*apiwrap.ResponseBody[domain.DetailPostVO], error)

func (*PostHandler) GetPosts

func (*PostHandler) RegisterGinRoutes

func (h *PostHandler) RegisterGinRoutes(engine *gin.Engine)

func (*PostHandler) UpdatePostIsCommentAllowed

func (h *PostHandler) UpdatePostIsCommentAllowed(ctx *gin.Context, req request.PostCommentAllowedReq) (*apiwrap.ResponseBody[any], error)

func (*PostHandler) UpdatePostIsDisplayed

func (h *PostHandler) UpdatePostIsDisplayed(ctx *gin.Context, req request.PostDisplayReq) (*apiwrap.ResponseBody[any], error)

type SummaryPostVO

type SummaryPostVO struct {
	Sug          string   `json:"sug"`
	Author       string   `json:"author"`
	Title        string   `json:"title"`
	Summary      string   `json:"summary"`
	CoverImg     string   `json:"cover_img"`
	Categories   []string `json:"categories"`
	Tags         []string `json:"tags"`
	LikeCount    int      `json:"like_count"`
	CommentCount int      `json:"comment_count"`
	VisitCount   int      `json:"visit_count"`
	StickyWeight int      `json:"sticky_weight"`
	CreateTime   int64    `json:"create_time"`
}

Jump to

Keyboard shortcuts

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