Documentation ¶
Index ¶
- type CommentHandler
- func (h *CommentHandler) AddComment(ctx *gin.Context, req CommentRequest) (vo api.IdVO, err error)
- func (h *CommentHandler) AddCommentReply(ctx *gin.Context, req ReplyRequest) (vo api.IdVO, err error)
- func (h *CommentHandler) GetCommentsByPostId(ctx *gin.Context) (listVO api.ListVO[vo.PostCommentVO], err error)
- func (h *CommentHandler) GetLatestCommentAndReply(ctx *gin.Context) (result api.ListVO[vo.LatestCommentVO], err 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 configServ.IConfigService, postServ postServ.IPostService, msgServ msgService.IMessageService) *CommentHandler
func (*CommentHandler) AddComment ¶
func (h *CommentHandler) AddComment(ctx *gin.Context, req CommentRequest) (vo api.IdVO, err error)
func (*CommentHandler) AddCommentReply ¶
func (h *CommentHandler) AddCommentReply(ctx *gin.Context, req ReplyRequest) (vo api.IdVO, err error)
func (*CommentHandler) GetCommentsByPostId ¶
func (h *CommentHandler) GetCommentsByPostId(ctx *gin.Context) (listVO api.ListVO[vo.PostCommentVO], err error)
func (*CommentHandler) GetLatestCommentAndReply ¶
func (h *CommentHandler) GetLatestCommentAndReply(ctx *gin.Context) (result api.ListVO[vo.LatestCommentVO], err 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.