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), }); }
public async Task <object> Init(ClientInitRequestDto input) { var shops = await _shopRepository.GetListAsync(); return(new { shops = ObjectMapper.Map <List <MallShop>, List <MallShopDto> >(shops) }); }
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 }); }
public ClientInitEvent(ClientInitRequestDto inputData) { InputData = inputData; }