public async Task <IActionResult> Post([FromBody] fw_repair value) { value.CreatedAt = DateTime.Now; value.UpdatedAt = DateTime.Now; value.IsValid = true; if (User.Identity is ClaimsIdentity identity) { value.CreatedBy = identity.Name ?? "admin"; } _fwRepairRpt.Add(value); _fwRepairRpt.Commit(); return(new OkObjectResult(value)); }
public async Task <IActionResult> Put(int id, [FromBody] fw_repair value) { var single = _fwRepairRpt.GetSingle(id); if (single == null) { return(NotFound()); } //更新字段内容 single.UpdatedAt = DateTime.Now; if (User.Identity is ClaimsIdentity identity) { single.CreatedBy = identity.Name ?? "admin"; } _fwRepairRpt.Commit(); return(new NoContentResult()); }
public async Task <IActionResult> PostRepair([FromBody] fw_repair value) { return(new OkObjectResult(value)); }