public async Task <IActionResult> GetAppsAsync(String searchText, Int32 appTypeId, Int32 appStyleId, String appState, Int32 pageIndex, Int32 pageSize)
        {
            Check.IfNullOrZero(searchText, true);
            var user = await GetUserContextAsync();

            var result = await _appServices.GetUserAppsAsync(0, searchText, appTypeId, appStyleId, appState, pageIndex, pageSize);

            foreach (var appDto in result.Models)
            {
                appDto.IsCreater = appDto.UserId == user.Id;
            }

            return(Json(new ResponsePaging <IList <AppDto> >
            {
                TotalCount = result.TotalCount,
                IsSuccess = true,
                Message = "获取app列表成功",
                Model = result.Models
            }));
        }
Exemple #2
0
        public async Task <IActionResult> GetUserAppsAsync(String searchText, Int32 appTypeId, Int32 appStyleId, String appState, Int32 pageIndex, Int32 pageSize)
        {
            Check.IfNullOrZero(searchText, true);

            var response    = new ResponsePaging <IList <AppDto> >();
            var userContext = await GetUserContextAsync();

            var result = await _appServices.GetUserAppsAsync(userContext.Id, searchText, appTypeId, appStyleId, appState, pageIndex, pageSize);

            if (result != null)
            {
                response.TotalCount = result.TotalCount;
                response.IsSuccess  = true;
                response.Message    = "app列表获取成功";
                response.Model      = result.Models;
            }
            else
            {
                response.Message = "app列表获取失败";
            }

            return(Json(response));
        }