예제 #1
0
        /// <summary>
        /// 删除服务节点
        /// </summary>
        /// <param name="deleteInfo">删除信息</param>
        /// <returns>执行结果</returns>
        public Result DeleteServerNode(DeleteServerNodeCmdDto deleteInfo)
        {
            using (var businessWork = WorkFactory.Create())
            {
                #region 参数判断

                if (deleteInfo == null || deleteInfo.ServerNodeIds.IsNullOrEmpty())
                {
                    return(Result.FailedResult("没有指定要删除的服务节点"));
                }

                #endregion

                var nowServers = ServerNodeDomainService.GetServerNodeList(QueryFactory.Create <ServerNodeQuery>(c => deleteInfo.ServerNodeIds.Contains(c.Id)));
                //删除逻辑
                ServerNodeDomainService.DeleteServerNode(deleteInfo.ServerNodeIds);
                var commitResult = businessWork.Commit();
                return(commitResult.ExecutedSuccess ? Result.SuccessResult("删除成功") : Result.FailedResult("删除失败"));
            }
        }
예제 #2
0
        /// <summary>
        /// 获取服务节点列表
        /// </summary>
        /// <param name="filter">查询条件</param>
        /// <returns></returns>
        public List <ServerNodeDto> GetServerNodeList(ServerNodeFilterDto filter)
        {
            var serverNodeList = ServerNodeDomainService.GetServerNodeList(CreateQueryObject(filter));

            return(serverNodeList.Select(c => c.MapTo <ServerNodeDto>()).ToList());
        }