public async Task <IActionResult> Update([FromBody] SysSystem system) { system.UpdateUserId = UserIdentity.UserId; bool res = await _systemService.UpdateAsync(system); return(Ok(res)); }
public async Task <object> PutAsync(SysSystem entity) { if (ModelState.IsValid) { var json = new ResJson() { success = false }; try { entity.Date = DateTime.Now; if (await sysSystemService.UpdateAsync(entity)) { json.message = "操作成功!"; json.success = true; } else { json.message = "操作失败!"; } } catch (Exception ex) { json.message = "网络超时."; throw ex; } return(json); } else { return(BadRequest()); } }
public async Task <bool> UpdateAsync([FromBody] SysSystem system) { return(await _systemService.UpdateAsync(system)); }