public async Task <Result> Delete([FromBody] LoggerDeleteRequestDto dto) { //验证请求数据合法性 var result = dto.Valid(); if (!result.Success) { return(result); } //三个月之内的日志不能删除 if (dto.BeginTime > DateTime.Now.AddMonths(-3)) { return(Result.ReFailure(ResultCodes.LogginDeletedCannoBeWithinThreeMonths)); } //数据持久化 _operateLog.Record(ASFPermissions.LoggingDelete, dto, "Success"); //记录日志 await _loggingRepository.Delete(dto); await _unitOfWork.CommitAsync(); return(Result.ReSuccess()); }