Пример #1
0
        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 = "" }));
            }
        }
Пример #2
0
 public PublicView GetListByPage([FromBody] PublicQuery query)
 {
     try
     {
         return(_userDao.GetListByPage(query));
     }
     catch (Exception ex)
     {
         nlog.Error(ex, "获取所有用户失败!", query.ToJSON());
         return(null);
     }
 }
Пример #3
0
        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 = "" }));
            }
        }
Пример #4
0
        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 = "" }));
            }
        }