public async Task <JsonResult> GetUserList(PublicQuery query) { try { PublicView publicView = await _userService.GetListByPage(query); foreach (var item in publicView.UserList) { if (item.Role != null) { item.RoleName = item.Role.CName; } if (item.Department != null) { item.DepartmentName = item.Department.Name; } if (item.Area != null) { item.AreaName = item.Area.Name; } } return(Json(new { total = publicView.TotalCount, rows = publicView.UserList })); } catch (Exception ex) { _logService.Error(string.Format("获取用户列表失败!query = 【{0}】", query.ToJSON()), ex); return(Json(new { total = 0, data = "" })); } }
public PublicView GetListByPage([FromBody] PublicQuery query) { try { return(_userDao.GetListByPage(query)); } catch (Exception ex) { nlog.Error(ex, "获取所有用户失败!", query.ToJSON()); return(null); } }
public async Task <JsonResult> GetRoleList(PublicQuery query) { try { PublicView publicView = await _roleService.GetListByPage(query); return(Json(new { total = publicView.TotalCount, rows = publicView.RoleList })); } catch (Exception ex) { _logService.Error(string.Format("获取角色列表失败!query = 【{0}】", query.ToJSON()), ex); return(Json(new { total = 0, data = "" })); } }
public async Task <JsonResult> GetAppLogList(PublicQuery query) { try { PublicView publicView = await _applogService.GetAppLogs(query); return(Json(new { total = publicView.TotalCount, rows = publicView.ApplicationLogList })); } catch (Exception ex) { _logService.Error(string.Format("获取异常日志列表失败!query = 【{0}】", query.ToJSON()), ex); return(Json(new { total = 0, data = "" })); } }