Ejemplo n.º 1
0
        public async Task <InputDto> RemoteCallTest(InputDto input)
        {
            var helloService      = serviceProxyFactory.CreateProxy <IHelloService>();
            var helloactorService = serviceProxyFactory.CreateActorProxy <IHelloActorService>();
            await stateManager.SetState(new TestStateDto("mykey", true));

            var getState = await stateManager.GetState <bool>(new TestStateDto("mykey"));

            var delState = await stateManager.DelState(new TestStateDto("mykey"));

            var invokeresult = await helloService.GetUserInfo(new InputDto()
            {
                name = "xiaoming"
            });

            var invokenoinputresult = await helloService.Test();

            var eventresult = await eventBus.SendEvent("test", new TestEventDto()
            {
                myword = "abc"
            });

            var actorresult = await helloactorService.GetUserInfoByActor(new ActorInputDto()
            {
                Name = "xiaoming", ActorId = "1"
            });

            return(new InputDto()
            {
                name = $"RPC无参调用成功,回调:{JsonSerializer.Serialize(invokenoinputresult)},RPC有参调用成功,回调:{JsonSerializer.Serialize(invokeresult)},事件发送{(eventresult != null ? "成功" : "失败")},状态写入成功,值:{getState},actor调用成功,回调:{JsonSerializer.Serialize(actorresult)}"
            });
        }
 public GoodsUseCaseService(IGoodsRepository repository, IGoodsCategoryRepository goodsCategoryRepository, IEsGoodsRepository esGoodsRepository, ILocalEventBus localEventBus, IServiceProxyFactory serviceProxyFactory, IEventBus eventBus, IStateManager stateManager, IUnitofWork unitofWork)
 {
     this.repository = repository;
     this.goodsCategoryRepository = goodsCategoryRepository;
     this.unitofWork          = unitofWork;
     this.eventBus            = eventBus;
     this.stateManager        = stateManager;
     this.serviceProxyFactory = serviceProxyFactory;
     this.actorService        = serviceProxyFactory.CreateActorProxy <IGoodsActorService>();
     this.esGoodsRepository   = esGoodsRepository;
     this.localEventBus       = localEventBus;
 }