public async Task <ResponseMessage> DeleteAttendenceItem(UserInfo User, [FromRoute] string id) { var pagingResponse = new ResponseMessage(); if (!ModelState.IsValid) { pagingResponse.Code = ResponseCodeDefines.ModelStateInvalid; Logger.Warn($"用户{User?.UserName ?? ""}({User?.Id ?? ""})查询考勤信息(PostCustomerListSaleMan)模型验证失败:\r\n{pagingResponse.Message ?? ""},\r\n请求参数为:\r\n" + (id != null ? JsonHelper.ToJson(id) : "")); return(pagingResponse); } try { await _attendanceManage.DeleteAttendence(id, HttpContext.RequestAborted); pagingResponse.Message = "searchattendencelst ok"; } catch (Exception e) { pagingResponse.Code = ResponseCodeDefines.ServiceError; pagingResponse.Message = "服务器错误:" + e.ToString(); Logger.Error($"用户{User?.UserName ?? ""}({User?.Id ?? ""})查询考勤信息(PostCustomerListSaleMan)请求失败:\r\n{pagingResponse.Message ?? ""},\r\n请求参数为:\r\n" + (id != null ? JsonHelper.ToJson(id) : "")); } return(pagingResponse); }