Пример #1
0
        public async Task <IActionResult> InitAppMarketAsync()
        {
            var appTypes = await _appServices.GetAppTypesAsync();

            var userContext = await GetUserContextAsync();

            if (!userContext.IsAdmin)
            {
                appTypes = appTypes.Where(w => !w.IsSystem).ToList();
            }

            var todayRecommendApp = await _appServices.GetTodayRecommendAsync(userContext.Id);

            var user = await _userServices.GetUserAsync(userContext.Id);

            var(allCount, notReleaseCount) = await _appServices.GetDevelopAndNotReleaseCountAsync(userContext.Id);

            var response = new ResponseModel <dynamic>
            {
                Model = new
                {
                    appTypes,
                    todayRecommendApp,
                    UserName = user.Name,
                    allCount,
                    notReleaseCount
                },
                IsSuccess = true,
                Message   = "应用市场初始化成功"
            };

            return(Json(response));
        }