public async Task <IActionResult> OnPost() { if (string.IsNullOrEmpty(Input.Name)) { ModelState.AddModelError("Input.Name", "名称不能为空!"); return(Error()); } var application = await _applicationManager.FindAsync(Input.Id); if (application != null) { application.AppSecret = Input.AppSecret; application.UserId = UserId; application.Summary = Input.Summary; application.Name = Input.Name; } else { application = Input; } var result = await _applicationManager.SaveAsync(application); LogResult(result, Input.Name); return(Json(result, Input.Name)); }
/// <summary> /// 获取文档列表。 /// </summary> /// <param name="appid">应用程序Id。</param> public async Task <IActionResult> OnGet(Guid appid) { Application = await _applicationManager.FindAsync(appid); if (Application == null) { return(NotFound()); } Services = await _applicationManager.LoadApplicationServicesAsync(appid); Document = _serviceManager.GetGroupApiDescriptors(); return(Page()); }