/// <summary> /// 根据查询条件生成查询对象 /// </summary> /// <param name="filter">查询条件</param> /// <returns></returns> public IQuery CreateQueryObject(ServerNodeFilterDto filter) { if (filter == null) { return(null); } IQuery query = QueryFactory.Create <ServerNodeQuery>(filter); if (!filter.Ids.IsNullOrEmpty()) { query.In <ServerNodeQuery>(c => c.Id, filter.Ids); } if (!filter.InstanceName.IsNullOrEmpty()) { query.Equal <ServerNodeQuery>(c => c.InstanceName, filter.InstanceName); } if (!filter.Name.IsNullOrEmpty()) { query.Like <ServerNodeQuery>(c => c.Name, filter.Name); } if (filter.Status.HasValue) { query.Equal <ServerNodeQuery>(c => c.Status, filter.Status.Value); } if (!filter.Host.IsNullOrEmpty()) { query.Equal <ServerNodeQuery>(c => c.Host, filter.Host); } if (filter.ThreadCount.HasValue) { query.Equal <ServerNodeQuery>(c => c.ThreadCount, filter.ThreadCount.Value); } if (!filter.ThreadPriority.IsNullOrEmpty()) { query.Equal <ServerNodeQuery>(c => c.ThreadPriority, filter.ThreadPriority); } if (!filter.Description.IsNullOrEmpty()) { query.Equal <ServerNodeQuery>(c => c.Description, filter.Description); } return(query); }
/// <summary> /// 获取服务节点列表 /// </summary> /// <param name="filter">查询条件</param> /// <returns></returns> public List <ServerNodeDto> GetServerNodeList(ServerNodeFilterDto filter) { var serverNodeList = serverNodeService.GetServerNodeList(CreateQueryObject(filter)); return(serverNodeList.Select(c => c.MapTo <ServerNodeDto>()).ToList()); }
/// <summary> /// 获取服务节点 /// </summary> /// <param name="filter">查询条件</param> /// <returns></returns> public ServerNodeDto GetServerNode(ServerNodeFilterDto filter) { var serverNode = serverNodeService.GetServerNode(CreateQueryObject(filter)); return(serverNode.MapTo <ServerNodeDto>()); }
/// <summary> /// 获取服务节点分页 /// </summary> /// <param name="filter">查询条件</param> /// <returns></returns> public IPaging <ServerNodeDto> GetServerNodePaging(ServerNodeFilterDto filter) { var serverNodePaging = serverNodeService.GetServerNodePaging(CreateQueryObject(filter)); return(serverNodePaging.ConvertTo <ServerNodeDto>()); }
/// <summary> /// 获取服务节点分页 /// </summary> /// <param name="filter">查询条件</param> /// <returns></returns> public IPaging <ServerNodeDto> GetServerNodePaging(ServerNodeFilterDto filter) { return(serverNodeBusiness.GetServerNodePaging(filter)); }
/// <summary> /// 获取服务节点列表 /// </summary> /// <param name="filter">查询条件</param> /// <returns></returns> public List <ServerNodeDto> GetServerNodeList(ServerNodeFilterDto filter) { return(serverNodeBusiness.GetServerNodeList(filter)); }
/// <summary> /// 获取服务节点 /// </summary> /// <param name="filter">查询条件</param> /// <returns></returns> public ServerNodeDto GetServerNode(ServerNodeFilterDto filter) { return(serverNodeBusiness.GetServerNode(filter)); }