Exemplo n.º 1
0
        /// <summary>
        /// 将领域事件通过CAP 发出集成事件,由消息服务接受并处理
        /// </summary>
        /// <param name="notification"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public Task Handle(ProjectViewedEvent notification, CancellationToken cancellationToken)
        {
            var @event = new ProjectViewedIntergrationEvent
            {
                Company      = notification.Company,
                Introduction = notification.Introduction,
                Viewer       = notification.ProjectViewer
            };

            _capPublisher.Publish("proshare.projectapi.projectviewed", @event);
            return(Task.CompletedTask);
        }
        public Task Handle(ProjectViewedEvent notification, CancellationToken cancellationToken)
        {
            var @event = new ProjectViewedIntergrationEvent()
            {
                Avatar       = notification.Avatar,
                Company      = notification.Company,
                Introduction = notification.Introduction,
                Viewer       = notification.Viewer,
            };

            _capPublisher.Publish("finbook.projectapi.projectviewed", @event);

            return(Task.CompletedTask);
        }