Documentation ¶
Index ¶
- type AdminCommentReplyVO
- type AdminCommentVO
- type AdminUserInfoVO
- type BatchApprovedCommentRequest
- type CommentHandler
- func (h *CommentHandler) AddComment(ctx *gin.Context, req CommentRequest) (*apiwrap.ResponseBody[IdVO], error)
- func (h *CommentHandler) AddCommentReply(ctx *gin.Context, req ReplyRequest) (*apiwrap.ResponseBody[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) AdminBatchApproveComments(ctx *gin.Context, req BatchApprovedCommentRequest) (*apiwrap.ResponseBody[any], error)
- func (h *CommentHandler) AdminBatchDeleteComments(ctx *gin.Context, req BatchApprovedCommentRequest) (*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) AdminFindCommentsWithPagination(ctx *gin.Context, req PageRequest) (*apiwrap.ResponseBody[*apiwrap.PageVO[AdminCommentVO]], error)
- func (h *CommentHandler) GetCommentsByPostId(ctx *gin.Context) (*apiwrap.ResponseBody[apiwrap.ListVO[PostCommentVO]], error)
- func (h *CommentHandler) GetLatestCommentAndReply(ctx *gin.Context) (*apiwrap.ResponseBody[apiwrap.ListVO[LatestCommentVO]], error)
- func (h *CommentHandler) RegisterGinRoutes(engine *gin.Engine)
- type CommentRequest
- type IdVO
- type LatestCommentVO
- type PageRequest
- type PostCommentReplyVO
- type PostCommentVO
- type PostInfo
- type ReplyRequest
- type UserInfo
- type UserInfo4Comment
- type UserInfo4Reply
- type UserInfoVO
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminCommentReplyVO ¶
type AdminCommentReplyVO struct { ReplyId string `json:"reply_id"` // 回复内容 Content string `json:"content"` // 被回复的回复 Id ReplyToId string `json:"reply_to_id"` // 用户信息 UserInfo UserInfo4Reply `json:"user_info"` // 被回复用户的信息 RepliedUserInfo UserInfo4Reply `json:"replied_user_info"` ApprovalStatus bool `json:"approval_status"` // 回复时间 CreatedAt int64 `json:"created_at"` // 修改时间 UpdatedAt int64 `json:"updated_at"` }
type AdminCommentVO ¶
type AdminCommentVO struct { Id string `json:"id"` // 文章信息 PostInfo PostInfo `json:"post_info"` // 评论的内容 Content string `json:"content"` // 用户信息 UserInfo UserInfo4Comment `json:"user_info"` ReplyCount int `json:"reply_count"` // 该评论下的所有回复的内容 Replies []AdminCommentVO `json:"replies,omitempty"` ApprovalStatus bool `json:"approval_status"` Type string `json:"type"` // 评论时间 CreatedAt int64 `json:"created_at"` // 修改时间 UpdatedAt int64 `json:"updated_at"` // 被回复的回复 Id ReplyToId string `json:"reply_to_id"` }
type AdminUserInfoVO ¶
type AdminUserInfoVO UserInfoVO
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 message.Service) *CommentHandler
func (*CommentHandler) AddComment ¶
func (h *CommentHandler) AddComment(ctx *gin.Context, req CommentRequest) (*apiwrap.ResponseBody[IdVO], error)
func (*CommentHandler) AddCommentReply ¶
func (h *CommentHandler) AddCommentReply(ctx *gin.Context, req ReplyRequest) (*apiwrap.ResponseBody[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) AdminBatchApproveComments ¶
func (h *CommentHandler) AdminBatchApproveComments(ctx *gin.Context, req BatchApprovedCommentRequest) (*apiwrap.ResponseBody[any], error)
func (*CommentHandler) AdminBatchDeleteComments ¶
func (h *CommentHandler) AdminBatchDeleteComments(ctx *gin.Context, req BatchApprovedCommentRequest) (*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) AdminFindCommentsWithPagination ¶
func (h *CommentHandler) AdminFindCommentsWithPagination(ctx *gin.Context, req PageRequest) (*apiwrap.ResponseBody[*apiwrap.PageVO[AdminCommentVO]], error)
func (*CommentHandler) GetCommentsByPostId ¶
func (h *CommentHandler) GetCommentsByPostId(ctx *gin.Context) (*apiwrap.ResponseBody[apiwrap.ListVO[PostCommentVO]], error)
func (*CommentHandler) GetLatestCommentAndReply ¶
func (h *CommentHandler) GetLatestCommentAndReply(ctx *gin.Context) (*apiwrap.ResponseBody[apiwrap.ListVO[LatestCommentVO]], error)
func (*CommentHandler) RegisterGinRoutes ¶
func (h *CommentHandler) RegisterGinRoutes(engine *gin.Engine)
type CommentRequest ¶
type LatestCommentVO ¶
type PageRequest ¶
type PostCommentReplyVO ¶
type PostCommentReplyVO struct { Id string `json:"id"` CommentId string `json:"comment_id"` // 回复的内容 Content string `json:"content"` // 回复的用户 Name string `json:"name"` Picture string `json:"picture"` Website string `json:"website"` // 被回复的回复 Id ReplyToId string `json:"reply_to_id"` // 被回复的用户 ReplyTo string `json:"reply_to"` // 回复时间 ReplyTime int64 `json:"reply_time"` }
type PostCommentVO ¶
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"` }
type UserInfo4Comment ¶
type UserInfo4Comment UserInfo
type UserInfo4Reply ¶
type UserInfo4Reply UserInfo
Click to show internal directories.
Click to hide internal directories.