Пример #1
0
        /// <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);
        }
Пример #2
0
        /// <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());
        }
Пример #3
0
        /// <summary>
        /// 获取服务节点
        /// </summary>
        /// <param name="filter">查询条件</param>
        /// <returns></returns>
        public ServerNodeDto GetServerNode(ServerNodeFilterDto filter)
        {
            var serverNode = serverNodeService.GetServerNode(CreateQueryObject(filter));

            return(serverNode.MapTo <ServerNodeDto>());
        }
Пример #4
0
        /// <summary>
        /// 获取服务节点分页
        /// </summary>
        /// <param name="filter">查询条件</param>
        /// <returns></returns>
        public IPaging <ServerNodeDto> GetServerNodePaging(ServerNodeFilterDto filter)
        {
            var serverNodePaging = serverNodeService.GetServerNodePaging(CreateQueryObject(filter));

            return(serverNodePaging.ConvertTo <ServerNodeDto>());
        }
Пример #5
0
 /// <summary>
 /// 获取服务节点分页
 /// </summary>
 /// <param name="filter">查询条件</param>
 /// <returns></returns>
 public IPaging <ServerNodeDto> GetServerNodePaging(ServerNodeFilterDto filter)
 {
     return(serverNodeBusiness.GetServerNodePaging(filter));
 }
Пример #6
0
 /// <summary>
 /// 获取服务节点列表
 /// </summary>
 /// <param name="filter">查询条件</param>
 /// <returns></returns>
 public List <ServerNodeDto> GetServerNodeList(ServerNodeFilterDto filter)
 {
     return(serverNodeBusiness.GetServerNodeList(filter));
 }
Пример #7
0
 /// <summary>
 /// 获取服务节点
 /// </summary>
 /// <param name="filter">查询条件</param>
 /// <returns></returns>
 public ServerNodeDto GetServerNode(ServerNodeFilterDto filter)
 {
     return(serverNodeBusiness.GetServerNode(filter));
 }