comment

package
v0.0.0-...-d80f745 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PinActionUnpin = 0
	PinActionPin   = 1
)

Variables

This section is empty.

Functions

func Commenter

func Commenter() commentv1.ReplyServiceClient

func Init

func Init(c *config.Config)

Types

type CommentRes

type CommentRes struct {
	Replies    []*ReplyItem `json:"replies"`
	NextCursor uint64       `json:"next_cursor"`
	HasNext    bool         `json:"has_next"`
}

type DelReq

type DelReq struct {
	ReplyId uint64 `json:"reply_id"`
}

删除评论

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 DetailedSubReply struct {
	Items      []*ReplyItem `json:"items"`
	NextCursor uint64       `json:"next_cursor"`
	HasNext    bool         `json:"has_next"`
}

type GetCommentsReq

type GetCommentsReq struct {
	Oid    uint64 `form:"oid"`
	Cursor uint64 `form:"cursor,optional"`
	SortBy int    `form:"sort_by,optional"`
}

func (*GetCommentsReq) AsDetailedPb

func (*GetCommentsReq) AsPb

type GetLikeCountReq

type GetLikeCountReq struct {
	ReplyId uint64 `form:"reply_id"`
}

func (*GetLikeCountReq) Validate

func (r *GetLikeCountReq) Validate() error

type GetLikeCountRes

type GetLikeCountRes struct {
	ReplyId uint64 `json:"rid"`
	Likes   uint64 `json:"likes"`
}

type GetSubCommentsReq

type GetSubCommentsReq struct {
	Oid    uint64 `form:"oid"`
	RootId uint64 `form:"root"`
	Cursor uint64 `form:"cursor,optional"`
}

func (*GetSubCommentsReq) AsPb

type PinAction

type PinAction int8

type PinReq

type PinReq struct {
	Oid     uint64    `json:"oid"`
	ReplyId uint64    `json:"reply_id"`
	Action  PinAction `json:"action"`
}

置顶评论

func (*PinReq) Validate

func (r *PinReq) Validate() error

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 PubRes

type PubRes struct {
	ReplyId uint64 `json:"reply_id"`
}

type ReplyItem

type ReplyItem struct {
	*commentv1.ReplyItem
	User *userv1.UserInfo `json:"user"`
}

type ThumbAction

type ThumbAction uint8

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

Jump to

Keyboard shortcuts

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