예제 #1
0
 public Post Add(Post param)
 {
     _publishToTopic.PublishCP(new IncreasingCP()
     {
         UserId = param.AuthorId,
         Point  = 5
     });
     return(_postRepository.Add(param));
 }
예제 #2
0
        private async Task IncreaseCPFor100LikesAsync(string postId)
        {
            var post = _postRepository.GetById(postId);
            int x    = post.LikeCount % 100;

            if (x + 1 == 100)
            {
                _publishToTopic.PublishCP(new IncreasingCP()
                {
                    UserId = post.AuthorId,
                    Point  = 1
                });
            }
        }