Beispiel #1
0
        public ResponseMessage List(long ProjectID)
        {
            // 判断是否有权限
            var userproject = _UserManage.GetUserProject(_TenantManage.user.ID, ProjectID);

            if (userproject == null)
            {
                return(new ResponseMessage(MessageResult.Error, "项目不存在"));
            }
            // 获取项目列表
            var list = _DBConnectManage.GetListByProjectID(ProjectID);

            //return new string[] { "value1", "value2" };
            return(new ResponseMessage(MessageResult.Success, "", list.Where(m => m.IsDelete == 0)));
        }
Beispiel #2
0
        ///// <summary>
        ///// 创建模块
        ///// </summary>
        ///// <param name="model"></param>
        ///// <returns></returns>
        //[HttpPost]
        //public ResponseMessage Create([FromBody] ModuleCreateModel model)
        //{
        //    var result = _ModuleManage.Create(new Dao.Models.Module()
        //    {
        //        Name = model.Name,
        //        ProjectID = model.ProjectID
        //    });
        //    if (result)
        //    {
        //        return new ResponseMessage(MessageResult.Success, "");
        //    }
        //    return new ResponseMessage(MessageResult.Error, "创建模块失败");
        //}

        /// <summary>
        /// 获取连接列表
        /// </summary>
        /// <returns></returns>
        public List <DBConnect> GetConnectList(long ProjectID)
        {
            var list = _DBConnectManage.GetListByProjectID(ProjectID);

            return(list);
        }