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) CheckUserCommentOnObject(ctx context.Context, uid, oid uint64) (bool, error)
- 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) DataProxy() IDataProxy
- func (s *CommentSvc) FullSyncReplyCountCache(ctx context.Context) error
- func (s *CommentSvc) GetPinnedReply(ctx context.Context, oid uint64) (*commentv1.GetPinnedReplyRes, error)
- func (s *CommentSvc) GetReplyDislikesCount(ctx context.Context, rid uint64) (uint64, error)
- func (s *CommentSvc) GetReplyLikesCount(ctx context.Context, rid uint64) (uint64, error)
- func (s *CommentSvc) PageGetObjectReplies(ctx context.Context, in *commentv1.PageGetReplyReq) (*commentv1.PageGetDetailedReplyRes, error)
- func (s *CommentSvc) PageGetReply(ctx context.Context, in *commentv1.PageGetReplyReq) (*commentv1.PageGetReplyRes, error)
- func (s *CommentSvc) PageGetSubReply(ctx context.Context, in *commentv1.PageGetSubReplyReq) (*commentv1.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 IDataProxy
- 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) CheckUserCommentOnObject ¶
获取用户是否评论过某个对象
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
处理点赞或者点踩
func (*CommentSvc) ConsumePinEv ¶
func (s *CommentSvc) ConsumePinEv(ctx context.Context, data *queue.PinReplyData) error
置顶或者取消置顶 每个对象仅支持一条置顶评论,后置顶的评论会替代旧的置顶评论的置顶状态
func (*CommentSvc) CountReply ¶
获取被评论对象oid的评论数量
func (*CommentSvc) DataProxy ¶
func (s *CommentSvc) DataProxy() IDataProxy
func (*CommentSvc) FullSyncReplyCountCache ¶
func (s *CommentSvc) FullSyncReplyCountCache(ctx context.Context) error
全量同步评论数量
func (*CommentSvc) GetPinnedReply ¶
func (s *CommentSvc) GetPinnedReply(ctx context.Context, oid uint64) (*commentv1.GetPinnedReplyRes, error)
func (*CommentSvc) GetReplyDislikesCount ¶
获取评论点踩数
func (*CommentSvc) GetReplyLikesCount ¶
获取评论点赞数量
func (*CommentSvc) PageGetObjectReplies ¶
func (s *CommentSvc) PageGetObjectReplies(ctx context.Context, in *commentv1.PageGetReplyReq) (*commentv1.PageGetDetailedReplyRes, error)
获取评论信息,包含主评论和子评论
func (*CommentSvc) PageGetReply ¶
func (s *CommentSvc) PageGetReply(ctx context.Context, in *commentv1.PageGetReplyReq) (*commentv1.PageGetReplyRes, error)
获取根评论
func (*CommentSvc) PageGetSubReply ¶
func (s *CommentSvc) PageGetSubReply(ctx context.Context, in *commentv1.PageGetSubReplyReq) (*commentv1.PageGetSubReplyRes, error)
获取子评论
func (*CommentSvc) PartialSyncReplyCountCache ¶
func (s *CommentSvc) PartialSyncReplyCountCache(ctx context.Context, offset, limit int64) error
func (*CommentSvc) ReplyDislike ¶
点踩/取消点踩
type IDataProxy ¶
type IDataProxy interface { AddReply(ctx context.Context, data *comm.Model) error DelReply(ctx context.Context, rid uint64, reply *comm.Model) error LikeReply(ctx context.Context, rid, uid uint64) error UnLikeReply(ctx context.Context, rid, uid uint64) error DisLikeReply(ctx context.Context, rid, uid uint64) error UnDisLikeReply(ctx context.Context, rid, uid uint64) error PinReply(ctx context.Context, oid, rid uint64) error UnPinReply(ctx context.Context, oid, rid uint64) error }
同步/异步写入数据接口
type ServiceContext ¶
type ServiceContext struct { Config *config.Config CommentSvc *CommentSvc }
Click to show internal directories.
Click to hide internal directories.