Documentation ¶
Index ¶
- type Cache
- func (c *Cache) BatchSetReplyCount(ctx context.Context, batch map[uint64]uint64) error
- func (c *Cache) DecrReplyCount(ctx context.Context, oid uint64, decrement int64) error
- func (c *Cache) DecrReplyCountWhenExist(ctx context.Context, oid uint64, decrement int64) error
- func (c *Cache) DelPinned(ctx context.Context, oid uint64) error
- func (c *Cache) DelReplyCount(ctx context.Context, oid uint64) error
- func (c *Cache) GetPinned(ctx context.Context, oid uint64) (*comm.Model, error)
- func (c *Cache) GetReplyCount(ctx context.Context, oid uint64) (uint64, error)
- func (c *Cache) IncrReplyCount(ctx context.Context, oid uint64, increment int64) error
- func (c *Cache) IncrReplyCountWhenExist(ctx context.Context, oid uint64, increment int64) error
- func (c *Cache) SetPinned(ctx context.Context, model *comm.Model) error
- func (c *Cache) SetReplyCount(ctx context.Context, oid, count uint64) error
- type CommentSvc
- func (s *CommentSvc) ConsumeAddReplyEv(ctx context.Context, data *queue.AddReplyData) error
- func (s *CommentSvc) ConsumeDelReplyEv(ctx context.Context, data *queue.DelReplyData) error
- func (s *CommentSvc) ConsumeLikeDislikeEv(ctx context.Context, data *queue.BinaryReplyData) error
- func (s *CommentSvc) ConsumePinEv(ctx context.Context, data *queue.PinReplyData) error
- func (s *CommentSvc) CountReply(ctx context.Context, oid uint64) (uint64, error)
- func (s *CommentSvc) FullSyncReplyCountCache(ctx context.Context) error
- func (s *CommentSvc) GetPinnedReply(ctx context.Context, oid uint64) (*sdk.GetPinnedReplyRes, error)
- func (s *CommentSvc) PageGetObjectReplies(ctx context.Context, in *sdk.PageGetReplyReq) (*sdk.PageGetDetailedReplyRes, error)
- func (s *CommentSvc) PageGetReply(ctx context.Context, in *sdk.PageGetReplyReq) (*sdk.PageGetReplyRes, error)
- func (s *CommentSvc) PageGetSubReply(ctx context.Context, in *sdk.PageGetSubReplyReq) (*sdk.PageGetSubReplyRes, error)
- func (s *CommentSvc) PartialSyncReplyCountCache(ctx context.Context, offset, limit int64) error
- func (s *CommentSvc) ReplyAdd(ctx context.Context, req *model.ReplyReq) (*model.ReplyRes, error)
- func (s *CommentSvc) ReplyDel(ctx context.Context, rid uint64) error
- func (s *CommentSvc) ReplyDislike(ctx context.Context, rid uint64, action int8) error
- func (s *CommentSvc) ReplyLike(ctx context.Context, rid uint64, action int8) error
- func (s *CommentSvc) ReplyPin(ctx context.Context, oid, rid uint64, action int8) error
- type ServiceContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) BatchSetReplyCount ¶
func (*Cache) DecrReplyCount ¶
func (*Cache) DecrReplyCountWhenExist ¶
func (*Cache) GetReplyCount ¶
被评论对象的评论数量
func (*Cache) IncrReplyCount ¶
func (*Cache) IncrReplyCountWhenExist ¶
type CommentSvc ¶
type CommentSvc struct {
// contains filtered or unexported fields
}
func NewCommentSvc ¶
func NewCommentSvc(ctx *ServiceContext, repo *repo.Repo, cache *redis.Redis) *CommentSvc
func (*CommentSvc) ConsumeAddReplyEv ¶
func (s *CommentSvc) ConsumeAddReplyEv(ctx context.Context, data *queue.AddReplyData) error
job related methods
func (*CommentSvc) ConsumeDelReplyEv ¶
func (s *CommentSvc) ConsumeDelReplyEv(ctx context.Context, data *queue.DelReplyData) error
func (*CommentSvc) ConsumeLikeDislikeEv ¶
func (s *CommentSvc) ConsumeLikeDislikeEv(ctx context.Context, data *queue.BinaryReplyData) error
处理点赞或者点踩 TODO 对接点赞系统
func (*CommentSvc) ConsumePinEv ¶
func (s *CommentSvc) ConsumePinEv(ctx context.Context, data *queue.PinReplyData) error
置顶或者取消置顶 每个对象仅支持一条置顶评论,后置顶的评论会替代旧的置顶评论的置顶状态
func (*CommentSvc) CountReply ¶
获取被评论对象oid的评论数量
func (*CommentSvc) FullSyncReplyCountCache ¶
func (s *CommentSvc) FullSyncReplyCountCache(ctx context.Context) error
全量同步评论数量
func (*CommentSvc) GetPinnedReply ¶
func (s *CommentSvc) GetPinnedReply(ctx context.Context, oid uint64) (*sdk.GetPinnedReplyRes, error)
func (*CommentSvc) PageGetObjectReplies ¶
func (s *CommentSvc) PageGetObjectReplies(ctx context.Context, in *sdk.PageGetReplyReq) (*sdk.PageGetDetailedReplyRes, error)
获取评论信息,包含主评论和子评论
func (*CommentSvc) PageGetReply ¶
func (s *CommentSvc) PageGetReply(ctx context.Context, in *sdk.PageGetReplyReq) (*sdk.PageGetReplyRes, error)
获取根评论
func (*CommentSvc) PageGetSubReply ¶
func (s *CommentSvc) PageGetSubReply(ctx context.Context, in *sdk.PageGetSubReplyReq) (*sdk.PageGetSubReplyRes, error)
获取子评论
func (*CommentSvc) PartialSyncReplyCountCache ¶
func (s *CommentSvc) PartialSyncReplyCountCache(ctx context.Context, offset, limit int64) error
func (*CommentSvc) ReplyDislike ¶
TODO 点踩/取消点踩
type ServiceContext ¶
type ServiceContext struct { Config *config.Config CommentSvc *CommentSvc }
Click to show internal directories.
Click to hide internal directories.