Documentation ¶
Index ¶
- type CommentHandler
- func (h *CommentHandler) AddComment(ctx *gin.Context, req CommentRequest) (*apiwrap.ResponseBody[api.IdVO], error)
- func (h *CommentHandler) AddCommentReply(ctx *gin.Context, req ReplyRequest) (*apiwrap.ResponseBody[api.IdVO], error)
- func (h *CommentHandler) AdminApproveComment(ctx *gin.Context) (*apiwrap.ResponseBody[any], error)
- func (h *CommentHandler) AdminApproveCommentReply(ctx *gin.Context) (*apiwrap.ResponseBody[any], error)
- func (h *CommentHandler) AdminDeleteComment(ctx *gin.Context) (*apiwrap.ResponseBody[any], error)
- func (h *CommentHandler) AdminDeleteCommentReply(ctx *gin.Context) (*apiwrap.ResponseBody[any], error)
- func (h *CommentHandler) AdminDisapproveComment(ctx *gin.Context, req request.DisapproveCommentRequest) (*apiwrap.ResponseBody[any], error)
- func (h *CommentHandler) AdminDisapproveCommentReply(ctx *gin.Context, req request.DisapproveCommentRequest) (*apiwrap.ResponseBody[any], error)
- func (h *CommentHandler) AdminGetComments(ctx *gin.Context, req request.PageRequest) (*apiwrap.ResponseBody[apiwrap.PageVO[vo.AdminCommentVO]], error)
- func (h *CommentHandler) AdminUpdateCommentStatus(ctx *gin.Context, req request.CommentStatusRequest) (*apiwrap.ResponseBody[any], error)
- func (h *CommentHandler) AdminUpdateReplyStatus(ctx *gin.Context, req request.CommentStatusRequest) (*apiwrap.ResponseBody[any], error)
- func (h *CommentHandler) GetCommentsByPostId(ctx *gin.Context) (*apiwrap.ResponseBody[apiwrap.ListVO[vo.PostCommentVO]], error)
- func (h *CommentHandler) GetLatestCommentAndReply(ctx *gin.Context) (*apiwrap.ResponseBody[apiwrap.ListVO[vo.LatestCommentVO]], error)
- func (h *CommentHandler) RegisterGinRoutes(engine *gin.Engine)
- type CommentRequest
- type ReplyRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommentHandler ¶
type CommentHandler struct {
// contains filtered or unexported fields
}
func NewCommentHandler ¶
func NewCommentHandler(serv service.ICommentService, cfgService website_config.Service, postServ post.Service, msgServ msgService.IMessageService, statsServ csService.ICountStatsService) *CommentHandler
func (*CommentHandler) AddComment ¶
func (h *CommentHandler) AddComment(ctx *gin.Context, req CommentRequest) (*apiwrap.ResponseBody[api.IdVO], error)
func (*CommentHandler) AddCommentReply ¶
func (h *CommentHandler) AddCommentReply(ctx *gin.Context, req ReplyRequest) (*apiwrap.ResponseBody[api.IdVO], error)
func (*CommentHandler) AdminApproveComment ¶
func (h *CommentHandler) AdminApproveComment(ctx *gin.Context) (*apiwrap.ResponseBody[any], error)
func (*CommentHandler) AdminApproveCommentReply ¶
func (h *CommentHandler) AdminApproveCommentReply(ctx *gin.Context) (*apiwrap.ResponseBody[any], error)
func (*CommentHandler) AdminDeleteComment ¶
func (h *CommentHandler) AdminDeleteComment(ctx *gin.Context) (*apiwrap.ResponseBody[any], error)
func (*CommentHandler) AdminDeleteCommentReply ¶
func (h *CommentHandler) AdminDeleteCommentReply(ctx *gin.Context) (*apiwrap.ResponseBody[any], error)
func (*CommentHandler) AdminDisapproveComment ¶
func (h *CommentHandler) AdminDisapproveComment(ctx *gin.Context, req request.DisapproveCommentRequest) (*apiwrap.ResponseBody[any], error)
func (*CommentHandler) AdminDisapproveCommentReply ¶
func (h *CommentHandler) AdminDisapproveCommentReply(ctx *gin.Context, req request.DisapproveCommentRequest) (*apiwrap.ResponseBody[any], error)
func (*CommentHandler) AdminGetComments ¶
func (h *CommentHandler) AdminGetComments(ctx *gin.Context, req request.PageRequest) (*apiwrap.ResponseBody[apiwrap.PageVO[vo.AdminCommentVO]], error)
func (*CommentHandler) AdminUpdateCommentStatus ¶
func (h *CommentHandler) AdminUpdateCommentStatus(ctx *gin.Context, req request.CommentStatusRequest) (*apiwrap.ResponseBody[any], error)
func (*CommentHandler) AdminUpdateReplyStatus ¶
func (h *CommentHandler) AdminUpdateReplyStatus(ctx *gin.Context, req request.CommentStatusRequest) (*apiwrap.ResponseBody[any], error)
func (*CommentHandler) GetCommentsByPostId ¶
func (h *CommentHandler) GetCommentsByPostId(ctx *gin.Context) (*apiwrap.ResponseBody[apiwrap.ListVO[vo.PostCommentVO]], error)
func (*CommentHandler) GetLatestCommentAndReply ¶
func (h *CommentHandler) GetLatestCommentAndReply(ctx *gin.Context) (*apiwrap.ResponseBody[apiwrap.ListVO[vo.LatestCommentVO]], error)
func (*CommentHandler) RegisterGinRoutes ¶
func (h *CommentHandler) RegisterGinRoutes(engine *gin.Engine)
type CommentRequest ¶
type ReplyRequest ¶
type ReplyRequest struct { PostId string `json:"postId" binding:"required"` // 如果是对某个回复进行回复,则是某个回复的 id ReplyToId string `json:"replyToId"` UserName string `json:"username" binding:"required"` Email string `json:"email" binding:"required,validateEmailFormat"` Website string `json:"website"` Content string `json:"content" binding:"required,max=200"` }
Click to show internal directories.
Click to hide internal directories.