Exemplo n.º 1
0
        public async Task <object> Init(ClientInitRequestDto input)
        {
            var appName = _httpContextAccessor?.HttpContext.Request.Headers["AppName"].FirstOrDefault();

            await _eventBus.PublishAsync(new ClientInitEvent(input));

            var apps  = _appDefinitionManager.GetAll();
            var shops = await _shopRepository.GetListAsync();

            var categories = await _categoryRepository.GetPublicListAsync(new MallRequestDto()
            {
                ShopId = input.ShopId, AppName = appName
            });

            var spus = await _spuRepository.Include(x => x.Skus).ToListAsync();

            return(new
            {
                shops = ObjectMapper.Map <List <MallShop>, List <MallShopDto> >(shops),
                apps,
                appName,
                categories,
                spus = ObjectMapper.Map <List <ProductSpu>, List <ProductSpuDtoBase> >(spus),
            });
        }
Exemplo n.º 2
0
        public async Task <object> Init(ClientInitRequestDto input)
        {
            var shops = await _shopRepository.GetListAsync();

            return(new
            {
                shops = ObjectMapper.Map <List <MallShop>, List <MallShopDto> >(shops)
            });
        }
Exemplo n.º 3
0
        public async Task <object> Init(ClientInitRequestDto input)
        {
            await _eventBus.PublishAsync(new ClientInitEvent(input));

            var apps = await _appProvider.GetAllAsync();

            var shops = await _shopRepository.GetListAsync();

            var appName = _httpContextAccessor?.HttpContext.Request.Headers["AppName"].FirstOrDefault();

            return(new
            {
                shops = ObjectMapper.Map <List <MallShop>, List <MallShopDto> >(shops),
                apps, appName
            });
        }
Exemplo n.º 4
0
 public ClientInitEvent(ClientInitRequestDto inputData)
 {
     InputData = inputData;
 }