public JsonResult Delete([FromForm] WXQ.InOutPutEntites.Input.LogManage.NLog.DeleteInput model) { ResponseResult result = new ResponseResult(); DeleteInputModelValidation validator = new DeleteInputModelValidation(); ValidationResult vr = validator.Validate(model); if (!vr.IsValid) { result.Code = ResponseResultMessageDefine.ParaError; result.Errors = vr.Errors.Select(e => e.ErrorMessage).ToList(); } else { WXQ.BusinessCore.opLogManager.NLogOp op = new WXQ.BusinessCore.opLogManager.NLogOp(); bool rv = op.Delete(model.application, model.level, model.message, model.bgDt, model.endDt, model.Logger, model.CallSite); if (!rv) { result.Code = ResponseResultMessageDefine.OpLost; result.Errors.Add(ResponseResultMessageDefine.OpLostMessage); } else { result.Data = rv; } } return(Json(result)); }
public JsonResult GetNLogList([FromForm] WXQ.InOutPutEntites.Input.LogManage.NLog.GetNLogListInput model) { ResponseResult result = new ResponseResult(); GetNLogListInputModelValidation validator = new GetNLogListInputModelValidation(); ValidationResult vr = validator.Validate(model); if (!vr.IsValid) { result.Code = ResponseResultMessageDefine.ParaError; result.Errors = vr.Errors.Select(e => e.ErrorMessage).ToList(); } else { WXQ.BusinessCore.opLogManager.NLogOp op = new WXQ.BusinessCore.opLogManager.NLogOp(); SqlSugar.PageModel pagemodel = TypeAdapter.Adapt <WXQ.InOutPutEntites.Input.PageInput, SqlSugar.PageModel>(model.Page); ListResult <WXQ.Enties.nlog> rv = op.GetNLogList(model.application, model.level, model.message, model.bgDt, model.endDt, model.Logger, model.CallSite, pagemodel); if (rv == null) { result.Code = ResponseResultMessageDefine.OpLost; result.Errors.Add(ResponseResultMessageDefine.OpLostMessage); } else { result.Data = rv; } } return(Json(result)); }