Documentation ¶
Index ¶
- Constants
- func Commenter() commentv1.ReplyServiceClient
- func Init(c *config.Config)
- type CommentRes
- type DelReq
- type DetailedCommentRes
- type DetailedReplyItem
- type DetailedSubReply
- type GetCommentsReq
- type GetLikeCountReq
- type GetLikeCountRes
- type GetSubCommentsReq
- type PinAction
- type PinReq
- type PubReq
- type PubRes
- type ReplyItem
- type ThumbAction
- type ThumbDownReq
- type ThumbUpReq
Constants ¶
View Source
const ( PinActionUnpin = 0 PinActionPin = 1 )
Variables ¶
This section is empty.
Functions ¶
func Commenter ¶
func Commenter() commentv1.ReplyServiceClient
Types ¶
type CommentRes ¶
type DetailedCommentRes ¶
type DetailedCommentRes struct { Replies []*DetailedReplyItem `json:"replies"` PinReply *DetailedReplyItem `json:"pin_reply,omitempty"` // 置顶评论 NextCursor uint64 `json:"next_cursor"` HasNext bool `json:"has_next"` }
type DetailedReplyItem ¶
type DetailedReplyItem struct { Root *ReplyItem `json:"root"` SubReplies *DetailedSubReply `json:"sub_replies"` }
带有子评论的评论信息
func NewDetailedReplyItemFromPb ¶
func NewDetailedReplyItemFromPb(item *commentv1.DetailedReplyItem, userMap map[string]*userv1.UserInfo) *DetailedReplyItem
type DetailedSubReply ¶
type GetCommentsReq ¶
type GetCommentsReq struct { Oid uint64 `form:"oid"` Cursor uint64 `form:"cursor,optional"` SortBy int `form:"sort_by,optional"` }
func (*GetCommentsReq) AsDetailedPb ¶
func (r *GetCommentsReq) AsDetailedPb() *commentv1.PageGetDetailedReplyRequest
func (*GetCommentsReq) AsPb ¶
func (r *GetCommentsReq) AsPb() *commentv1.PageGetReplyRequest
type GetLikeCountReq ¶
type GetLikeCountReq struct {
ReplyId uint64 `form:"reply_id"`
}
func (*GetLikeCountReq) Validate ¶
func (r *GetLikeCountReq) Validate() error
type GetLikeCountRes ¶
type GetSubCommentsReq ¶
type GetSubCommentsReq struct { Oid uint64 `form:"oid"` RootId uint64 `form:"root"` Cursor uint64 `form:"cursor,optional"` }
func (*GetSubCommentsReq) AsPb ¶
func (r *GetSubCommentsReq) AsPb() *commentv1.PageGetSubReplyRequest
type PinReq ¶
type PinReq struct { Oid uint64 `json:"oid"` ReplyId uint64 `json:"reply_id"` Action PinAction `json:"action"` }
置顶评论
type PubReq ¶
type PubReq struct { ReplyType uint32 `json:"reply_type"` Oid uint64 `json:"oid"` Content string `json:"content"` RootId uint64 `json:"root_id,omitempty,optional"` ParentId uint64 `json:"parent_id,omitempty,optional"` ReplyUid uint64 `json:"reply_uid"` }
func (*PubReq) AsPb ¶
func (r *PubReq) AsPb() *commentv1.AddReplyRequest
type ThumbAction ¶
type ThumbAction uint8
const ( ThumbActionUndo ThumbAction = ThumbAction(commentv1.ReplyAction_REPLY_ACTION_UNDO) // 取消 ThumbActionDo ThumbAction = ThumbAction(commentv1.ReplyAction_REPLY_ACTION_DO) // 执行 )
type ThumbDownReq ¶
type ThumbDownReq struct { ReplyId uint64 `json:"reply_id"` Action ThumbAction `json:"action"` // contains filtered or unexported fields }
点踩评论/取消点踩评论
func (*ThumbDownReq) Validate ¶
func (r *ThumbDownReq) Validate() error
type ThumbUpReq ¶
type ThumbUpReq struct { ReplyId uint64 `json:"reply_id"` Action ThumbAction `json:"action"` // contains filtered or unexported fields }
点赞评论/取消点赞评论
func (*ThumbUpReq) Validate ¶
func (r *ThumbUpReq) Validate() error
Click to show internal directories.
Click to hide internal directories.