Esempio n. 1
0
        public void CreateArticle(CreateArticleParam param)
        {
            var article = new Article(GuidHelper.GenerateComb().ToString(), param.Title, param.Content, DateTime.Now,
                                      (ArticleState)param.State,
                                      param.CategoryId, param.Tags);

            _articleDomainService.CreateArticle(article);
            _integrationEventBus.PublishEvent(new NewArticleCreatedEvent(article.Id, article.Title, article.Content,
                                                                         article.CreateDate, (ArticleDetailState)article.State, article.CategoryId, article.Tags));
        }
        public void CreateArticle(CreateArticleParam param)
        {
            var article = new Article(param.Id, param.Title, param.Content, DateTime.Now, (ArticleState)param.State, param.CategoryId, param.Tags);

            _articleDomainService.CreateArticle(article);
            _integrationEventBus.PublishEvent(new NewArticleCreatedEvent(article.Id, article.Title, article.Content, article.CreateDate, (NewArticleCreatedState)article.State, article.CategoryId, article.Tags));
        }
Esempio n. 3
0
        public async Task PublishAsync(IntegrationEvent @event)
        {
            try
            {
                await MarkEventAsInProgressAsync(@event.Id);

                _eventBus.PublishEvent(@event);
                await MarkEventAsPublishedAsync(@event.Id);
            }
            catch (Exception ex)
            {
                await MarkEventAsFailedAsync(@event.Id);
            }
        }
Esempio n. 4
0
 public void IntegrationEventTest()
 {
     _integrationEventBus.PublishEvent(new AppleIntegrationEvent());
 }