Example #1
0
        public async Task <JsonResult> AppInfo(AppInfoAddressModel model)
        {
            if (!ModelState.IsValid)
            {
                return(Json(new AiurProtocal {
                    message = "Wrong input.", code = ErrorType.InvalidInput
                }));
            }
            var target = await _dbContext
                         .Apps
                         .SingleOrDefaultAsync(t => t.AppId == model.AppId);

            if (target == null)
            {
                return(Json(new AiurProtocal {
                    message = "Not found.", code = ErrorType.NotFound
                }));
            }
            return(Json(new AppInfoViewModel
            {
                message = "Successfully get target app info.",
                code = ErrorType.Success,
                App = target
            }));
        }
Example #2
0
        public async Task <JsonResult> AppInfo(AppInfoAddressModel model)
        {
            var target = await _dbContext
                         .Apps
                         .SingleOrDefaultAsync(t => t.AppId == model.AppId);

            if (target == null)
            {
                return(Json(new AiurProtocol {
                    Message = $"Could find target app with appId: '{model.AppId}'!", Code = ErrorType.NotFound
                }));
            }
            return(Json(new AppInfoViewModel
            {
                Message = "Successfully get target app info.",
                Code = ErrorType.Success,
                App = target
            }));
        }
Example #3
0
        public async Task <JsonResult> AppInfo(AppInfoAddressModel model)
        {
            if (!ModelState.IsValid)
            {
                return(Json(new AiurProtocal {
                    message = "Wrong input.", code = ErrorType.InvalidInput
                }));
            }
            var target = await _dbContext.Apps.FindAsync(model.AppId);

            if (target == null)
            {
                return(Json(new AiurProtocal {
                    message = "Not found.", code = ErrorType.NotFound
                }));
            }
            return(Json(new AppInfoViewModel
            {
                AppId = target.AppId,
                message = "Successfully get target app info.",
                code = ErrorType.Success,
                CreaterId = target.CreaterId,
                AppName = target.AppName,
                AppDescription = target.AppDescription,
                AppCategory = target.AppCategory,
                AppPlatform = target.AppPlatform,
                AppCreateTime = target.AppCreateTime,
                EnableOAuth = target.EnableOAuth,
                ForceConfirmation = target.ForceConfirmation,
                ForceInputPassword = target.ForceInputPassword,
                DebugMode = target.DebugMode,
                AppDomain = target.AppDomain,
                PrivacyStatementUrl = target.PrivacyStatementUrl,
                LicenseUrl = target.LicenseUrl,
                AppImageUrl = target.AppIconAddress
            }));
        }