From abf3352c81507e1239b64726690ebf62b07d65ee Mon Sep 17 00:00:00 2001
From: yangzhiyue <904666286@qq.com>
Date: Wed, 18 Aug 2021 22:26:26 +0800
Subject: [PATCH 1/2] add dss-framework module close #363 close #364 close #365
close #366 close #367 close #368 close #369
---
dss-framework/dss-appconn-framework/pom.xml | 127 ++++
.../appconn/SpringAppConnManager.java | 36 ++
.../framework/appconn/dao/AppConnMapper.java | 52 ++
.../appconn/dao/AppInstanceMapper.java | 40 ++
.../appconn/dao/impl/appConnMapper.xml | 81 +++
.../appconn/dao/impl/appInstanceMapper.xml | 49 ++
.../framework/appconn/entity/AppConnBean.java | 155 +++++
.../appconn/entity/AppConnResource.java | 51 ++
.../appconn/entity/AppInstanceBean.java | 110 ++++
.../AppConnNotExistsErrorException.java | 32 +
.../restful/AppConnManagerRestfulApi.java | 106 +++
.../service/AppConnResourceUploadService.java | 26 +
.../service/impl/AppConnInfoServiceImpl.java | 69 ++
.../impl/AppConnResourceServiceImpl.java | 173 +++++
.../appconn/utils/AppConnServiceUtils.java | 33 +
dss-framework/dss-framework-common/pom.xml | 115 ++++
.../exception/DSSFrameworkErrorException.java | 39 ++
.../DSSFrameworkRuntimeException.java | 27 +
.../exception/DSSFrameworkWarnException.java | 33 +
.../common/exception/ThrowingConsumer.java | 23 +
.../common/exception/ThrowingFunction.java | 23 +
.../utils/DSSFrameworkExceptionUtils.java | 57 ++
.../framework/common/utils/RestfulUtils.java | 48 ++
...start-dss-framework-orchestrator-server.sh | 36 ++
.../stop-dss-framework-orchestrator-server.sh | 47 ++
.../dss-framework-orchestrator-server/pom.xml | 187 ++++++
.../src/main/assembly/distribution.xml | 44 ++
.../server/conf/OrchestratorConf.java | 24 +
.../server/conf/OrchestratorSpringConf.java | 33 +
.../constant/DSSOrchestratorConstant.java | 22 +
.../OrchestratorSpringConfiguration.java | 34 +
.../server/entity/UploadFileResponse.java | 32 +
.../query/QueryOrchestratorVersion.java | 35 +
.../server/restful/OrchestratorIERestful.java | 181 ++++++
.../server/restful/OrchestratorRestful.java | 150 +++++
.../service/OrchestratorPluginService.java | 29 +
.../server/service/OrchestratorService.java | 99 +++
.../impl/OrchestratorPluginServiceImpl.java | 160 +++++
.../service/impl/OrchestratorServiceImpl.java | 376 +++++++++++
.../DSSOrchestratorServerApplication.scala | 39 ++
.../receiver/DSSOrchestratorChooser.scala | 58 ++
.../receiver/DSSOrchestratorReceiver.scala | 114 ++++
.../bin/start-dss-framework-project-server.sh | 36 ++
.../bin/stop-dss-framework-project-server.sh | 47 ++
.../dss-framework-project-server/pom.xml | 252 ++++++++
.../src/main/assembly/distribution.xml | 44 ++
.../framework/project/conf/ProjectConf.java | 26 +
.../project/conf/ProjectSpringConf.java | 43 ++
.../conf/ValidationExceptionMapper.java | 52 ++
.../project/contant/OrchestratorTypeEnum.java | 88 +++
.../contant/ProjectServerResponse.java | 49 ++
.../contant/ProjectSpringConfiguration.java | 34 +
.../project/contant/ProjectUserPrivEnum.java | 50 ++
.../project/dao/DSSOrchestratorMapper.java | 31 +
.../project/dao/DSSProjectMapper.java | 75 +++
.../project/dao/DSSProjectUserMapper.java | 45 ++
.../project/dao/impl/DSSProjectMapper.xml | 77 +++
.../project/entity/DSSOrchestrator.java | 236 +++++++
.../project/entity/DSSProjectDO.java | 344 ++++++++++
.../project/entity/DSSProjectUser.java | 106 +++
.../project/entity/po/DSSProjectPo.java | 276 ++++++++
.../project/entity/po/ProjectRelationPo.java | 58 ++
.../entity/request/ForbiddenFlowRequest.java | 79 +++
.../request/OrchestratorCreateRequest.java | 161 +++++
.../request/OrchestratorDeleteRequest.java | 74 +++
.../request/OrchestratorModifyRequest.java | 152 +++++
.../entity/request/OrchestratorRequest.java | 83 +++
.../entity/request/ProjectCreateRequest.java | 160 +++++
.../entity/request/ProjectDeleteRequest.java | 67 ++
.../entity/request/ProjectModifyRequest.java | 184 ++++++
.../entity/request/ProjectQueryRequest.java | 59 ++
.../entity/request/RemoveFlowRequest.java | 67 ++
.../entity/response/ProjectResponse.java | 222 +++++++
.../entity/vo/AbstractOrchestratorVo.java | 48 ++
.../entity/vo/CommonOrchestratorVo.java | 26 +
.../entity/vo/DSSFlowOrchestratorFlowVo.java | 86 +++
.../project/entity/vo/DSSProjectDetailVo.java | 109 ++++
.../project/entity/vo/DSSProjectVo.java | 54 ++
.../project/entity/vo/LabelRouteVo.java | 30 +
.../entity/vo/OrchestratorBaseInfo.java | 229 +++++++
.../entity/vo/OrdinaryOrchestratorVo.java | 26 +
.../project/entity/vo/ProcessNode.java | 28 +
.../project/entity/vo/ProjectInfoVo.java | 61 ++
.../project/entity/vo/QueryProjectVo.java | 165 +++++
.../exception/DSSProjectErrorException.java | 30 +
.../exception/DSSProjectWarnException.java | 29 +
.../exception/LambdaWarnException.java | 28 +
.../DSSFrameworkOrchestratorRestful.java | 149 +++++
.../DSSFrameworkProjectRestfulApi.java | 188 ++++++
.../DSSFrameworkOrchestratorService.java | 40 ++
.../service/DSSFrameworkProjectService.java | 39 ++
.../service/DSSOrchestratorService.java | 55 ++
.../project/service/DSSProjectService.java | 67 ++
.../service/DSSProjectUserService.java | 46 ++
.../DSSFrameworkOrchestratorServiceImpl.java | 295 +++++++++
.../impl/DSSFrameworkProjectServiceImpl.java | 226 +++++++
.../impl/DSSOrchestratorServiceImpl.java | 306 +++++++++
.../service/impl/DSSProjectServiceImpl.java | 259 ++++++++
.../impl/DSSProjectUserServiceImpl.java | 188 ++++++
.../project/utils/ApplicationArea.java | 52 ++
.../framework/project/utils/LambdaHelper.java | 41 ++
.../project/utils/ProjectStringUtils.java | 67 ++
.../project/utils/ProjectUserUtils.java | 52 ++
.../framework/project/utils/RestfulUtils.java | 46 ++
.../server/DSSProjectServerApplication.scala | 38 ++
.../project/server/rpc/ProjectReceiver.scala | 80 +++
.../server/rpc/ProjectReceiverChooser.scala | 47 ++
.../project/server/service/BMLService.scala | 183 ++++++
.../start-dss-framework-workspace-server.sh | 36 ++
.../stop-dss-framework-workspace-server.sh | 47 ++
.../dss-framework-workspace-server/pom.xml | 133 ++++
.../src/main/assembly/distribution.xml | 320 ++++++++++
.../workspace/annotation/DSSWorkspaceUM.java | 29 +
.../annotation/WorkspaceIdChecker.java | 29 +
.../workspace/aop/DSSPrivCheckerAspect.java | 28 +
.../aop/DSSUWorkspaceIdCheckerAspect.java | 29 +
.../workspace/aop/DSSWorkspaceUMAspect.java | 26 +
.../framework/workspace/bean/BaseEntity.java | 63 ++
.../workspace/bean/DSSApplication.java | 169 +++++
.../workspace/bean/DSSApplicationBean.java | 57 ++
.../workspace/bean/DSSComponentRole.java | 102 +++
.../workspace/bean/DSSDictionary.java | 304 +++++++++
.../framework/workspace/bean/DSSFavorite.java | 70 ++
.../framework/workspace/bean/DSSHomepage.java | 48 ++
.../dss/framework/workspace/bean/DSSMenu.java | 169 +++++
.../framework/workspace/bean/DSSMenuRole.java | 115 ++++
.../dss/framework/workspace/bean/DSSRole.java | 89 +++
.../dss/framework/workspace/bean/DSSUser.java | 93 +++
.../workspace/bean/DSSWorkspace.java | 124 ++++
.../workspace/bean/DSSWorkspaceComponent.java | 48 ++
.../bean/DSSWorkspaceComponentInfo.java | 106 +++
.../bean/DSSWorkspaceComponentPriv.java | 100 +++
.../bean/DSSWorkspaceComponentRolePriv.java | 106 +++
.../workspace/bean/DSSWorkspaceHomepage.java | 88 +++
.../bean/DSSWorkspaceHomepageSetting.java | 68 ++
.../bean/DSSWorkspaceMenuComponentUrl.java | 86 +++
.../workspace/bean/DSSWorkspaceMenuRole.java | 95 +++
.../bean/DSSWorkspaceMenuRolePriv.java | 86 +++
.../workspace/bean/DSSWorkspaceUser.java | 63 ++
.../framework/workspace/bean/LinkisUser.java | 84 +++
.../dss/framework/workspace/bean/Sidebar.java | 185 ++++++
.../workspace/bean/SidebarContent.java | 223 +++++++
.../framework/workspace/bean/StaffInfo.java | 147 +++++
.../workspace/bean/WorkSpaceUserAndRole.java | 80 +++
.../dto/response/HomepageDemoInstanceVo.java | 93 +++
.../bean/dto/response/HomepageDemoMenuVo.java | 86 +++
.../bean/dto/response/HomepageVideoVo.java | 75 +++
.../response/OnestopMenuAppInstanceVo.java | 158 +++++
.../bean/dto/response/OnestopMenuVo.java | 59 ++
.../dto/response/WorkspaceDepartmentVo.java | 41 ++
.../dto/response/WorkspaceFavoriteVo.java | 98 +++
.../workspace/bean/vo/AbstractDSSVO.java | 21 +
.../workspace/bean/vo/DSSDatasourceVO.java | 123 ++++
.../bean/vo/DSSDictionaryRequestVO.java | 53 ++
.../bean/vo/DSSPersonalWorkflowVO.java | 83 +++
.../workspace/bean/vo/DSSProjectUserVo.java | 82 +++
.../workspace/bean/vo/DSSPublicTableVO.java | 123 ++++
.../bean/vo/DSSScheduledWorkFlow.java | 21 +
.../bean/vo/DSSScheduledWorkFlowVO.java | 131 ++++
.../bean/vo/DSSWorkflowVersionVO.java | 93 +++
.../bean/vo/DSSWorkspaceComponentPrivVO.java | 72 +++
.../bean/vo/DSSWorkspaceHomePageVO.java | 63 ++
.../vo/DSSWorkspaceHomepageSettingVO.java | 86 +++
.../bean/vo/DSSWorkspaceMenuPrivVO.java | 70 ++
.../bean/vo/DSSWorkspaceMenuPrivsVO.java | 48 ++
.../workspace/bean/vo/DSSWorkspaceMenuVO.java | 75 +++
.../bean/vo/DSSWorkspaceOverviewVO.java | 119 ++++
.../workspace/bean/vo/DSSWorkspacePrivVO.java | 88 +++
.../workspace/bean/vo/DSSWorkspaceRoleVO.java | 62 ++
.../vo/DSSWorkspaceScriptisStatiticVO.java | 65 ++
.../bean/vo/DSSWorkspaceStatisticVO.java | 22 +
.../workspace/bean/vo/DSSWorkspaceUserVO.java | 97 +++
.../workspace/bean/vo/DSSWorkspaceVO.java | 89 +++
.../workspace/bean/vo/DepartmentVO.java | 58 ++
.../bean/vo/SecondaryWorkspaceMenuVO.java | 57 ++
.../workspace/bean/vo/SidebarContentVO.java | 74 +++
.../workspace/bean/vo/SidebarVO.java | 64 ++
.../workspace/bean/vo/StaffInfoVO.java | 57 ++
.../framework/workspace/bean/vo/VOUtils.java | 28 +
.../AbstractWorkspaceComponentInfoVO.java | 131 ++++
.../vo/info/DSSWorkspaceScriptisInfoVO.java | 39 ++
.../vo/info/DSSWorkspaceVisualisInfoVO.java | 40 ++
.../vo/info/DSSWorkspaceWorkflowInfoVO.java | 45 ++
.../workspace/constant/ApplicationConf.java | 42 ++
.../workspace/dao/DSSApplicationMapper.java | 28 +
.../workspace/dao/DSSComponentRoleMapper.java | 33 +
.../workspace/dao/DSSDictionaryMapper.java | 27 +
.../workspace/dao/DSSMenuRoleMapper.java | 31 +
.../workspace/dao/DSSUserMapper.java | 26 +
.../dao/DSSWorkspaceHomepageMapper.java | 31 +
.../workspace/dao/DSSWorkspaceInfoMapper.java | 41 ++
.../workspace/dao/DSSWorkspaceMapper.java | 50 ++
.../workspace/dao/DSSWorkspaceMenuMapper.java | 75 +++
.../workspace/dao/DSSWorkspacePrivMapper.java | 48 ++
.../dao/DSSWorkspaceProjectMapper.java | 157 +++++
.../workspace/dao/DSSWorkspaceRoleMapper.java | 138 ++++
.../workspace/dao/DSSWorkspaceUserMapper.java | 99 +++
.../workspace/dao/LinkisUserMapper.java | 26 +
.../workspace/dao/SidebarContentMapper.java | 26 +
.../workspace/dao/SidebarMapper.java | 29 +
.../workspace/dao/WorkspaceMapper.java | 68 ++
.../dao/impl/DSSComponentRoleMapper.xml | 31 +
.../workspace/dao/impl/DSSMenuRoleMapper.xml | 31 +
.../dao/impl/DSSWorkspaceHomepageMapper.xml | 29 +
.../workspace/dao/impl/DSSWorkspaceMapper.xml | 81 +++
.../dao/impl/DSSWorkspaceUserMapper.xml | 29 +
.../workspace/dao/impl/WorkspaceMapper.xml | 193 ++++++
.../DSSWorkspaceDuplicateNameException.java | 28 +
.../DSSWorkspaceLoginFailException.java | 30 +
.../restful/DSSDictionaryRestful.java | 134 ++++
.../workspace/restful/DSSSideInfoRestful.java | 59 ++
.../restful/DSSWorkspacePrivRestful.java | 122 ++++
.../restful/DSSWorkspaceRestful.java | 134 ++++
.../restful/DSSWorkspaceRoleRestful.java | 212 ++++++
.../restful/DSSWorkspaceUserRestful.java | 169 +++++
.../restful/WorkspaceRestfulApi.java | 177 +++++
.../service/DSSDictionaryService.java | 45 ++
.../workspace/service/DSSSideInfoService.java | 28 +
.../workspace/service/DSSUserService.java | 32 +
.../service/DSSWorkspaceMenuService.java | 30 +
.../service/DSSWorkspacePrivService.java | 30 +
.../service/DSSWorkspaceRoleService.java | 30 +
.../service/DSSWorkspaceService.java | 86 +++
.../service/DSSWorkspaceUserService.java | 39 ++
.../workspace/service/StaffInfoGetter.java | 30 +
.../impl/DSSDictionaryServiceImpl.java | 120 ++++
.../service/impl/DSSSideInfoServiceImpl.java | 129 ++++
.../service/impl/DSSUserServiceImpl.java | 98 +++
.../impl/DSSWorkspaceMenuServiceImpl.java | 63 ++
.../impl/DSSWorkspacePrivServiceImpl.java | 65 ++
.../impl/DSSWorkspaceRoleServiceImpl.java | 108 ++++
.../service/impl/DSSWorkspaceServiceImpl.java | 604 ++++++++++++++++++
.../impl/DSSWorkspaceUserServiceImpl.java | 99 +++
.../service/impl/DefaultStaffInfoGetter.java | 40 ++
.../workspace/util/ApplicationUtils.java | 50 ++
.../workspace/util/CommonRoleEnum.java | 64 ++
.../workspace/util/DSSDictionaryConstant.java | 22 +
.../workspace/util/DSSWorkspaceConstant.java | 32 +
.../workspace/util/RestfulUtils.java | 49 ++
.../workspace/util/RestulHelper.java | 45 ++
.../workspace/util/WorkspaceDBHelper.java | 337 ++++++++++
.../util/WorkspaceServerConstant.java | 24 +
.../workspace/util/WorkspaceSpringConfig.java | 36 ++
.../pom.xml | 114 ++++
.../ConversionDSSOrchestratorPlugin.java | 35 +
.../publish/ExportDSSOrchestratorPlugin.java | 47 ++
.../publish/ImportDSSOrchestratorPlugin.java | 54 ++
.../publish/conf/DSSOrchestratorConf.java | 24 +
.../ConversionDSSOrchestratorPluginImpl.java | 50 ++
.../impl/ExportDSSOrchestratorPluginImpl.java | 221 +++++++
.../impl/ImportDSSOrchestratorPluginImpl.java | 194 ++++++
.../publish/io/export/MetaExportService.java | 37 ++
.../publish/io/export/MetaWriter.java | 172 +++++
.../io/export/impl/MetaExportServiceImpl.java | 61 ++
.../publish/io/input/MetaInputService.java | 34 +
.../publish/io/input/MetaReader.java | 166 +++++
.../io/input/impl/MetaInputServiceImpl.java | 61 ++
.../publish/job/ConversionJobEntity.java | 119 ++++
.../job/OrchestratorConversionJob.java | 107 ++++
dss-framework/pom.xml | 40 ++
260 files changed, 22734 insertions(+)
create mode 100644 dss-framework/dss-appconn-framework/pom.xml
create mode 100644 dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/SpringAppConnManager.java
create mode 100644 dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/dao/AppConnMapper.java
create mode 100644 dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/dao/AppInstanceMapper.java
create mode 100644 dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/dao/impl/appConnMapper.xml
create mode 100644 dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/dao/impl/appInstanceMapper.xml
create mode 100644 dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/entity/AppConnBean.java
create mode 100644 dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/entity/AppConnResource.java
create mode 100644 dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/entity/AppInstanceBean.java
create mode 100644 dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/exception/AppConnNotExistsErrorException.java
create mode 100644 dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/restful/AppConnManagerRestfulApi.java
create mode 100644 dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/service/AppConnResourceUploadService.java
create mode 100644 dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/service/impl/AppConnInfoServiceImpl.java
create mode 100644 dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/service/impl/AppConnResourceServiceImpl.java
create mode 100644 dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/utils/AppConnServiceUtils.java
create mode 100644 dss-framework/dss-framework-common/pom.xml
create mode 100644 dss-framework/dss-framework-common/src/main/java/com/webank/wedatasphere/dss/framework/common/exception/DSSFrameworkErrorException.java
create mode 100644 dss-framework/dss-framework-common/src/main/java/com/webank/wedatasphere/dss/framework/common/exception/DSSFrameworkRuntimeException.java
create mode 100644 dss-framework/dss-framework-common/src/main/java/com/webank/wedatasphere/dss/framework/common/exception/DSSFrameworkWarnException.java
create mode 100644 dss-framework/dss-framework-common/src/main/java/com/webank/wedatasphere/dss/framework/common/exception/ThrowingConsumer.java
create mode 100644 dss-framework/dss-framework-common/src/main/java/com/webank/wedatasphere/dss/framework/common/exception/ThrowingFunction.java
create mode 100644 dss-framework/dss-framework-common/src/main/java/com/webank/wedatasphere/dss/framework/common/utils/DSSFrameworkExceptionUtils.java
create mode 100644 dss-framework/dss-framework-common/src/main/java/com/webank/wedatasphere/dss/framework/common/utils/RestfulUtils.java
create mode 100644 dss-framework/dss-framework-orchestrator-server/bin/start-dss-framework-orchestrator-server.sh
create mode 100644 dss-framework/dss-framework-orchestrator-server/bin/stop-dss-framework-orchestrator-server.sh
create mode 100644 dss-framework/dss-framework-orchestrator-server/pom.xml
create mode 100644 dss-framework/dss-framework-orchestrator-server/src/main/assembly/distribution.xml
create mode 100644 dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/conf/OrchestratorConf.java
create mode 100644 dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/conf/OrchestratorSpringConf.java
create mode 100644 dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/constant/DSSOrchestratorConstant.java
create mode 100644 dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/constant/OrchestratorSpringConfiguration.java
create mode 100644 dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/entity/UploadFileResponse.java
create mode 100644 dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/entity/query/QueryOrchestratorVersion.java
create mode 100644 dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/restful/OrchestratorIERestful.java
create mode 100644 dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/restful/OrchestratorRestful.java
create mode 100644 dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/service/OrchestratorPluginService.java
create mode 100644 dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/service/OrchestratorService.java
create mode 100644 dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/service/impl/OrchestratorPluginServiceImpl.java
create mode 100644 dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/service/impl/OrchestratorServiceImpl.java
create mode 100644 dss-framework/dss-framework-orchestrator-server/src/main/scala/com/webank/wedatasphere/dss/orchestrator/server/DSSOrchestratorServerApplication.scala
create mode 100644 dss-framework/dss-framework-orchestrator-server/src/main/scala/com/webank/wedatasphere/dss/orchestrator/server/receiver/DSSOrchestratorChooser.scala
create mode 100644 dss-framework/dss-framework-orchestrator-server/src/main/scala/com/webank/wedatasphere/dss/orchestrator/server/receiver/DSSOrchestratorReceiver.scala
create mode 100644 dss-framework/dss-framework-project-server/bin/start-dss-framework-project-server.sh
create mode 100644 dss-framework/dss-framework-project-server/bin/stop-dss-framework-project-server.sh
create mode 100644 dss-framework/dss-framework-project-server/pom.xml
create mode 100644 dss-framework/dss-framework-project-server/src/main/assembly/distribution.xml
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/conf/ProjectConf.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/conf/ProjectSpringConf.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/conf/ValidationExceptionMapper.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/contant/OrchestratorTypeEnum.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/contant/ProjectServerResponse.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/contant/ProjectSpringConfiguration.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/contant/ProjectUserPrivEnum.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/dao/DSSOrchestratorMapper.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/dao/DSSProjectMapper.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/dao/DSSProjectUserMapper.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/dao/impl/DSSProjectMapper.xml
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/DSSOrchestrator.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/DSSProjectDO.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/DSSProjectUser.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/po/DSSProjectPo.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/po/ProjectRelationPo.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/ForbiddenFlowRequest.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/OrchestratorCreateRequest.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/OrchestratorDeleteRequest.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/OrchestratorModifyRequest.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/OrchestratorRequest.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/ProjectCreateRequest.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/ProjectDeleteRequest.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/ProjectModifyRequest.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/ProjectQueryRequest.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/RemoveFlowRequest.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/response/ProjectResponse.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/AbstractOrchestratorVo.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/CommonOrchestratorVo.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/DSSFlowOrchestratorFlowVo.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/DSSProjectDetailVo.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/DSSProjectVo.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/LabelRouteVo.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/OrchestratorBaseInfo.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/OrdinaryOrchestratorVo.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/ProcessNode.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/ProjectInfoVo.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/QueryProjectVo.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/exception/DSSProjectErrorException.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/exception/DSSProjectWarnException.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/exception/LambdaWarnException.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/restful/DSSFrameworkOrchestratorRestful.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/restful/DSSFrameworkProjectRestfulApi.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/DSSFrameworkOrchestratorService.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/DSSFrameworkProjectService.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/DSSOrchestratorService.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/DSSProjectService.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/DSSProjectUserService.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/impl/DSSFrameworkOrchestratorServiceImpl.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/impl/DSSFrameworkProjectServiceImpl.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/impl/DSSOrchestratorServiceImpl.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/impl/DSSProjectServiceImpl.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/impl/DSSProjectUserServiceImpl.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/utils/ApplicationArea.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/utils/LambdaHelper.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/utils/ProjectStringUtils.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/utils/ProjectUserUtils.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/utils/RestfulUtils.java
create mode 100644 dss-framework/dss-framework-project-server/src/main/scala/com/webank/wedatasphere/dss/framework/project/server/DSSProjectServerApplication.scala
create mode 100644 dss-framework/dss-framework-project-server/src/main/scala/com/webank/wedatasphere/dss/framework/project/server/rpc/ProjectReceiver.scala
create mode 100644 dss-framework/dss-framework-project-server/src/main/scala/com/webank/wedatasphere/dss/framework/project/server/rpc/ProjectReceiverChooser.scala
create mode 100644 dss-framework/dss-framework-project-server/src/main/scala/com/webank/wedatasphere/dss/framework/project/server/service/BMLService.scala
create mode 100644 dss-framework/dss-framework-workspace-server/bin/start-dss-framework-workspace-server.sh
create mode 100644 dss-framework/dss-framework-workspace-server/bin/stop-dss-framework-workspace-server.sh
create mode 100644 dss-framework/dss-framework-workspace-server/pom.xml
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/assembly/distribution.xml
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/annotation/DSSWorkspaceUM.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/annotation/WorkspaceIdChecker.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/aop/DSSPrivCheckerAspect.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/aop/DSSUWorkspaceIdCheckerAspect.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/aop/DSSWorkspaceUMAspect.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/BaseEntity.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSApplication.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSApplicationBean.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSComponentRole.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSDictionary.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSFavorite.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSHomepage.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSMenu.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSMenuRole.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSRole.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSUser.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspace.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceComponent.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceComponentInfo.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceComponentPriv.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceComponentRolePriv.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceHomepage.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceHomepageSetting.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceMenuComponentUrl.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceMenuRole.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceMenuRolePriv.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceUser.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/LinkisUser.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/Sidebar.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/SidebarContent.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/StaffInfo.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/WorkSpaceUserAndRole.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/dto/response/HomepageDemoInstanceVo.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/dto/response/HomepageDemoMenuVo.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/dto/response/HomepageVideoVo.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/dto/response/OnestopMenuAppInstanceVo.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/dto/response/OnestopMenuVo.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/dto/response/WorkspaceDepartmentVo.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/dto/response/WorkspaceFavoriteVo.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/AbstractDSSVO.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSDatasourceVO.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSDictionaryRequestVO.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSPersonalWorkflowVO.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSProjectUserVo.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSPublicTableVO.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSScheduledWorkFlow.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSScheduledWorkFlowVO.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkflowVersionVO.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkspaceComponentPrivVO.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkspaceHomePageVO.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkspaceHomepageSettingVO.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkspaceMenuPrivVO.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkspaceMenuPrivsVO.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkspaceMenuVO.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkspaceOverviewVO.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkspacePrivVO.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkspaceRoleVO.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkspaceScriptisStatiticVO.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkspaceStatisticVO.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkspaceUserVO.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkspaceVO.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DepartmentVO.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/SecondaryWorkspaceMenuVO.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/SidebarContentVO.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/SidebarVO.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/StaffInfoVO.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/VOUtils.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/info/AbstractWorkspaceComponentInfoVO.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/info/DSSWorkspaceScriptisInfoVO.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/info/DSSWorkspaceVisualisInfoVO.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/info/DSSWorkspaceWorkflowInfoVO.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/constant/ApplicationConf.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/dao/DSSApplicationMapper.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/dao/DSSComponentRoleMapper.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/dao/DSSDictionaryMapper.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/dao/DSSMenuRoleMapper.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/dao/DSSUserMapper.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/dao/DSSWorkspaceHomepageMapper.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/dao/DSSWorkspaceInfoMapper.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/dao/DSSWorkspaceMapper.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/dao/DSSWorkspaceMenuMapper.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/dao/DSSWorkspacePrivMapper.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/dao/DSSWorkspaceProjectMapper.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/dao/DSSWorkspaceRoleMapper.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/dao/DSSWorkspaceUserMapper.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/dao/LinkisUserMapper.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/dao/SidebarContentMapper.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/dao/SidebarMapper.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/dao/WorkspaceMapper.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/dao/impl/DSSComponentRoleMapper.xml
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/dao/impl/DSSMenuRoleMapper.xml
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/dao/impl/DSSWorkspaceHomepageMapper.xml
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/dao/impl/DSSWorkspaceMapper.xml
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/dao/impl/DSSWorkspaceUserMapper.xml
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/dao/impl/WorkspaceMapper.xml
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/exception/DSSWorkspaceDuplicateNameException.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/exception/DSSWorkspaceLoginFailException.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/restful/DSSDictionaryRestful.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/restful/DSSSideInfoRestful.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/restful/DSSWorkspacePrivRestful.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/restful/DSSWorkspaceRestful.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/restful/DSSWorkspaceRoleRestful.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/restful/DSSWorkspaceUserRestful.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/restful/WorkspaceRestfulApi.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/service/DSSDictionaryService.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/service/DSSSideInfoService.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/service/DSSUserService.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/service/DSSWorkspaceMenuService.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/service/DSSWorkspacePrivService.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/service/DSSWorkspaceRoleService.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/service/DSSWorkspaceService.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/service/DSSWorkspaceUserService.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/service/StaffInfoGetter.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/service/impl/DSSDictionaryServiceImpl.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/service/impl/DSSSideInfoServiceImpl.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/service/impl/DSSUserServiceImpl.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/service/impl/DSSWorkspaceMenuServiceImpl.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/service/impl/DSSWorkspacePrivServiceImpl.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/service/impl/DSSWorkspaceRoleServiceImpl.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/service/impl/DSSWorkspaceServiceImpl.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/service/impl/DSSWorkspaceUserServiceImpl.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/service/impl/DefaultStaffInfoGetter.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/util/ApplicationUtils.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/util/CommonRoleEnum.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/util/DSSDictionaryConstant.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/util/DSSWorkspaceConstant.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/util/RestfulUtils.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/util/RestulHelper.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/util/WorkspaceDBHelper.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/util/WorkspaceServerConstant.java
create mode 100644 dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/util/WorkspaceSpringConfig.java
create mode 100644 dss-framework/framework-plugins/dss-framework-orchestrator-publish/pom.xml
create mode 100644 dss-framework/framework-plugins/dss-framework-orchestrator-publish/src/main/java/com/webank/wedatasphere/dss/orchestrator/publish/ConversionDSSOrchestratorPlugin.java
create mode 100644 dss-framework/framework-plugins/dss-framework-orchestrator-publish/src/main/java/com/webank/wedatasphere/dss/orchestrator/publish/ExportDSSOrchestratorPlugin.java
create mode 100644 dss-framework/framework-plugins/dss-framework-orchestrator-publish/src/main/java/com/webank/wedatasphere/dss/orchestrator/publish/ImportDSSOrchestratorPlugin.java
create mode 100644 dss-framework/framework-plugins/dss-framework-orchestrator-publish/src/main/java/com/webank/wedatasphere/dss/orchestrator/publish/conf/DSSOrchestratorConf.java
create mode 100644 dss-framework/framework-plugins/dss-framework-orchestrator-publish/src/main/java/com/webank/wedatasphere/dss/orchestrator/publish/impl/ConversionDSSOrchestratorPluginImpl.java
create mode 100644 dss-framework/framework-plugins/dss-framework-orchestrator-publish/src/main/java/com/webank/wedatasphere/dss/orchestrator/publish/impl/ExportDSSOrchestratorPluginImpl.java
create mode 100644 dss-framework/framework-plugins/dss-framework-orchestrator-publish/src/main/java/com/webank/wedatasphere/dss/orchestrator/publish/impl/ImportDSSOrchestratorPluginImpl.java
create mode 100644 dss-framework/framework-plugins/dss-framework-orchestrator-publish/src/main/java/com/webank/wedatasphere/dss/orchestrator/publish/io/export/MetaExportService.java
create mode 100644 dss-framework/framework-plugins/dss-framework-orchestrator-publish/src/main/java/com/webank/wedatasphere/dss/orchestrator/publish/io/export/MetaWriter.java
create mode 100644 dss-framework/framework-plugins/dss-framework-orchestrator-publish/src/main/java/com/webank/wedatasphere/dss/orchestrator/publish/io/export/impl/MetaExportServiceImpl.java
create mode 100644 dss-framework/framework-plugins/dss-framework-orchestrator-publish/src/main/java/com/webank/wedatasphere/dss/orchestrator/publish/io/input/MetaInputService.java
create mode 100644 dss-framework/framework-plugins/dss-framework-orchestrator-publish/src/main/java/com/webank/wedatasphere/dss/orchestrator/publish/io/input/MetaReader.java
create mode 100644 dss-framework/framework-plugins/dss-framework-orchestrator-publish/src/main/java/com/webank/wedatasphere/dss/orchestrator/publish/io/input/impl/MetaInputServiceImpl.java
create mode 100644 dss-framework/framework-plugins/dss-framework-orchestrator-publish/src/main/java/com/webank/wedatasphere/dss/orchestrator/publish/job/ConversionJobEntity.java
create mode 100644 dss-framework/framework-plugins/dss-framework-orchestrator-publish/src/main/java/com/webank/wedatasphere/dss/orchestrator/publish/job/OrchestratorConversionJob.java
create mode 100644 dss-framework/pom.xml
diff --git a/dss-framework/dss-appconn-framework/pom.xml b/dss-framework/dss-appconn-framework/pom.xml
new file mode 100644
index 0000000000..2ab3817824
--- /dev/null
+++ b/dss-framework/dss-appconn-framework/pom.xml
@@ -0,0 +1,127 @@
+
+
+
+
+
+ dss
+ com.webank.wedatasphere.dss
+ 1.0.0
+
+
+ 4.0.0
+
+ dss-appconn-framework
+
+
+
+ junit
+ junit
+ 4.12
+ test
+
+
+
+
+ com.webank.wedatasphere.linkis
+ linkis-mybatis
+ ${linkis.version}
+ provided
+
+
+
+ com.webank.wedatasphere.dss
+ dss-appconn-manager-core
+ ${dss.version}
+
+
+ com.webank.wedatasphere.dss
+ dss-common
+ ${dss.version}
+ provided
+
+
+ com.webank.wedatasphere.linkis
+ linkis-rpc
+ ${linkis.version}
+ provided
+
+
+ linkis-common
+ com.webank.wedatasphere.linkis
+
+
+
+
+ com.webank.wedatasphere.linkis
+ linkis-bml-client
+ ${linkis.version}
+
+
+ commons-beanutils
+ commons-beanutils
+
+
+ linkis-common
+ com.webank.wedatasphere.linkis
+
+
+ json4s-jackson_2.11
+ org.json4s
+
+
+
+
+ jakarta.annotation
+ jakarta.annotation-api
+ 1.3.5
+ provided
+
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+
+
+
+ net.alchim31.maven
+ scala-maven-plugin
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+
+
+
+
+ src/main/java
+
+ **/*.xml
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/SpringAppConnManager.java b/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/SpringAppConnManager.java
new file mode 100644
index 0000000000..0a68dbc5d6
--- /dev/null
+++ b/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/SpringAppConnManager.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.appconn;
+
+import com.webank.wedatasphere.dss.appconn.manager.impl.AbstractAppConnManager;
+import com.webank.wedatasphere.dss.appconn.manager.service.AppConnInfoService;
+import com.webank.wedatasphere.dss.appconn.manager.service.AppConnResourceService;
+import com.webank.wedatasphere.linkis.DataWorkCloudApplication;
+
+
+public class SpringAppConnManager extends AbstractAppConnManager {
+
+ @Override
+ protected AppConnInfoService createAppConnInfoService() {
+ return DataWorkCloudApplication.getApplicationContext().getBean(AppConnInfoService.class);
+ }
+
+ @Override
+ protected AppConnResourceService createAppConnResourceService() {
+ return DataWorkCloudApplication.getApplicationContext().getBean(AppConnResourceService.class);
+ }
+}
diff --git a/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/dao/AppConnMapper.java b/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/dao/AppConnMapper.java
new file mode 100644
index 0000000000..7eaa59040e
--- /dev/null
+++ b/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/dao/AppConnMapper.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.appconn.dao;
+
+
+import com.webank.wedatasphere.dss.framework.appconn.entity.AppConnBean;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+
+@Mapper
+public interface AppConnMapper {
+
+ /**
+ * get all appconnbeans
+ * */
+ List getAllAppConnBeans();
+
+ /**
+ * get all appconns' name
+ * */
+ List getAllAppConnsName();
+
+ /**
+ * get appconnbeans by name
+ * */
+ AppConnBean getAppConnBeanByName(@Param("appConnName") String appConnName);
+
+ /**
+ * get appconn by id
+ * */
+ AppConnBean getAppConnBeanById(@Param("appConnId") Long appConnId);
+
+ void updateResourceByName(AppConnBean appConnBean);
+
+}
\ No newline at end of file
diff --git a/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/dao/AppInstanceMapper.java b/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/dao/AppInstanceMapper.java
new file mode 100644
index 0000000000..7015067016
--- /dev/null
+++ b/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/dao/AppInstanceMapper.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.appconn.dao;
+
+
+import com.webank.wedatasphere.dss.framework.appconn.entity.AppInstanceBean;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+
+@Mapper
+public interface AppInstanceMapper {
+
+ /**
+ * get instance by appconnid
+ * */
+ List getAppInstancesByAppConnId(@Param("appConnId") Long appConnId);
+
+ /**
+ * get instance by appconnid and label
+ * */
+ List getAppInstance(@Param("appConnId") Long appConnId,
+ @Param("label") String label);
+}
diff --git a/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/dao/impl/appConnMapper.xml b/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/dao/impl/appConnMapper.xml
new file mode 100644
index 0000000000..1e0a308978
--- /dev/null
+++ b/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/dao/impl/appConnMapper.xml
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `appconn_name`, `is_user_need_init`, `level`, `if_iframe`, `is_external`,
+ `reference`, `class_name`, `appconn_class_path`,`resource`
+
+
+
+ `id`, `appconn_name`, `is_user_need_init`, `level`, `if_iframe`, `is_external`,
+ `reference`, `class_name`, `appconn_class_path`, `resource`
+
+
+
+
+
+
+
+
+
+
+
+ update `dss_appconn`
+
+ resource=#{resource},
+ appconn_class_path=#{appConnClassPath},
+
+ where appconn_name=#{appConnName}
+
+
\ No newline at end of file
diff --git a/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/dao/impl/appInstanceMapper.xml b/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/dao/impl/appInstanceMapper.xml
new file mode 100644
index 0000000000..f1cd23c2ff
--- /dev/null
+++ b/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/dao/impl/appInstanceMapper.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `id`, `appconn_id`, `label`, `url`, `enhance_json`, `homepage_url`, `redirect_url`
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/entity/AppConnBean.java b/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/entity/AppConnBean.java
new file mode 100644
index 0000000000..9e63c8a2b2
--- /dev/null
+++ b/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/entity/AppConnBean.java
@@ -0,0 +1,155 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.appconn.entity;
+
+import com.webank.wedatasphere.dss.appconn.manager.entity.AppConnInfo;
+import com.webank.wedatasphere.dss.common.entity.Resource;
+import java.io.Serializable;
+import java.util.List;
+
+
+
+public class AppConnBean implements AppConnInfo, Serializable {
+
+ private static final long serialVersionUID=1L;
+ private Long id;
+ private String appConnName;
+ private String isUserNeedInit;
+ private String level;
+ private Boolean ifIframe;
+ private Boolean isExternal;
+
+ // todo:目前通过这两个字段在classpath下加载类。
+ // todo:未来这两个字段的作用是在bml和默认应用的。
+ private String reference;
+ private String resource;
+ private Resource resourceObj;
+ private String className;
+ private String appConnClassPath;
+
+ private List appInstanceBeans;
+
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ @Override
+ public String getAppConnName() {
+ return appConnName;
+ }
+
+ public void setAppConnName(String appConnName) {
+ this.appConnName = appConnName;
+ }
+
+ public String getIsUserNeedInit() {
+ return isUserNeedInit;
+ }
+
+ public void setIsUserNeedInit(String isUserNeedInit) {
+ this.isUserNeedInit = isUserNeedInit;
+ }
+
+ public String getLevel() {
+ return level;
+ }
+
+ public void setLevel(String level) {
+ this.level = level;
+ }
+
+ public Boolean getIfIframe() {
+ return ifIframe;
+ }
+
+ public void setIfIframe(Boolean ifIframe) {
+ this.ifIframe = ifIframe;
+ }
+
+ public Boolean getExternal() {
+ return isExternal;
+ }
+
+ public void setExternal(Boolean external) {
+ isExternal = external;
+ }
+
+ public String getReference() {
+ return reference;
+ }
+
+ public void setReference(String reference) {
+ this.reference = reference;
+ }
+
+ public String getResource() {
+ return resource;
+ }
+
+ public void setResource(String resource) {
+ this.resource = resource;
+ }
+
+ public List getAppInstanceBeans() {
+ return appInstanceBeans;
+ }
+
+ public void setAppInstanceBeans(List appInstanceBeans) {
+ this.appInstanceBeans = appInstanceBeans;
+ }
+
+ @Override
+ public String getClassName() {
+ return className;
+ }
+
+ @Override
+ public Resource getAppConnResource() {
+ return resourceObj;
+ }
+
+ public void setAppConnResource(Resource resource) {
+ resourceObj = resource;
+ }
+
+ public void setClassName(String className) {
+ this.className = className;
+ }
+
+ public String getAppConnClassPath() {
+ return appConnClassPath;
+ }
+
+ public void setAppConnClassPath(String appConnClassPath) {
+ this.appConnClassPath = appConnClassPath;
+ }
+
+ @Override
+ public String toString() {
+ return "AppConnBean{" +
+ "id=" + id +
+ ", appConnName='" + appConnName + '\'' +
+ ", className='" + className + '\'' +
+ ", appConnClassPath='" + appConnClassPath + '\'' +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/entity/AppConnResource.java b/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/entity/AppConnResource.java
new file mode 100644
index 0000000000..a698e6bc8b
--- /dev/null
+++ b/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/entity/AppConnResource.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.appconn.entity;
+
+import com.webank.wedatasphere.dss.common.entity.Resource;
+
+
+public class AppConnResource {
+
+ private Resource resource;
+ private long lastModifiedTime;
+ private long size;
+
+ public Resource getResource() {
+ return resource;
+ }
+
+ public void setResource(Resource resource) {
+ this.resource = resource;
+ }
+
+ public long getLastModifiedTime() {
+ return lastModifiedTime;
+ }
+
+ public void setLastModifiedTime(long lastModifiedTime) {
+ this.lastModifiedTime = lastModifiedTime;
+ }
+
+ public long getSize() {
+ return size;
+ }
+
+ public void setSize(long size) {
+ this.size = size;
+ }
+}
diff --git a/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/entity/AppInstanceBean.java b/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/entity/AppInstanceBean.java
new file mode 100644
index 0000000000..1914a0a29b
--- /dev/null
+++ b/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/entity/AppInstanceBean.java
@@ -0,0 +1,110 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.appconn.entity;
+
+import com.webank.wedatasphere.dss.appconn.manager.entity.AppInstanceInfo;
+import java.io.Serializable;
+
+
+public class AppInstanceBean implements AppInstanceInfo, Serializable {
+
+ private static final long serialVersionUID=1L;
+
+ private Long id;
+ private Long appConnId;
+ private String label;
+ private String url;
+ private String enhanceJson;
+ private String homepageUrl;
+ private String redirectUrl;
+
+ @Override
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public Long getAppconnId() {
+ return appConnId;
+ }
+
+ public void setAppConnId(Long appConnId) {
+ this.appConnId = appConnId;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public void setLabel(String label) {
+ this.label = label;
+ }
+
+ @Override
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ @Override
+ public String getEnhanceJson() {
+ return enhanceJson;
+ }
+
+ public void setEnhanceJson(String enhanceJson) {
+ this.enhanceJson = enhanceJson;
+ }
+
+ @Override
+ public String getHomepageUrl() {
+ return homepageUrl;
+ }
+
+ public void setHomepageUrl(String homepageUrl) {
+ this.homepageUrl = homepageUrl;
+ }
+
+ @Override
+ public String getRedirectUrl() {
+ return redirectUrl;
+ }
+
+ @Override
+ public String getLabels() {
+ return label;
+ }
+
+ public void setRedirectUrl(String redirectUrl) {
+ this.redirectUrl = redirectUrl;
+ }
+
+ @Override
+ public String toString() {
+ return "AppInstanceBean{" +
+ "id=" + id +
+ ", appConnId=" + appConnId +
+ ", label='" + label + '\'' +
+ ", url='" + url + '\'' +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/exception/AppConnNotExistsErrorException.java b/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/exception/AppConnNotExistsErrorException.java
new file mode 100644
index 0000000000..d73dfcb3ca
--- /dev/null
+++ b/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/exception/AppConnNotExistsErrorException.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.appconn.exception;
+
+import com.webank.wedatasphere.dss.common.exception.DSSErrorException;
+
+
+public class AppConnNotExistsErrorException extends DSSErrorException {
+
+ public AppConnNotExistsErrorException(int errCode, String desc) {
+ super(errCode, desc);
+ }
+
+ public AppConnNotExistsErrorException(int errCode, String desc, Throwable cause) {
+ super(errCode, desc);
+ initCause(cause);
+ }
+}
diff --git a/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/restful/AppConnManagerRestfulApi.java b/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/restful/AppConnManagerRestfulApi.java
new file mode 100644
index 0000000000..e9aabdb319
--- /dev/null
+++ b/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/restful/AppConnManagerRestfulApi.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.appconn.restful;
+
+import com.webank.wedatasphere.dss.appconn.manager.entity.AppConnInfo;
+import com.webank.wedatasphere.dss.appconn.manager.entity.AppInstanceInfo;
+import com.webank.wedatasphere.dss.appconn.manager.service.AppConnInfoService;
+import com.webank.wedatasphere.dss.common.utils.DSSExceptionUtils;
+import com.webank.wedatasphere.dss.framework.appconn.service.AppConnResourceUploadService;
+import com.webank.wedatasphere.linkis.server.Message;
+import java.util.List;
+import javax.annotation.PostConstruct;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import org.apache.commons.lang.exception.ExceptionUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+
+@Component
+@Path("/dss/framework/project/appconn")
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes(MediaType.APPLICATION_JSON)
+public class AppConnManagerRestfulApi {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(AppConnManagerRestfulApi.class);
+
+ @Autowired
+ private AppConnInfoService appConnInfoService;
+ @Autowired
+ private AppConnResourceUploadService appConnResourceUploadService;
+
+ @PostConstruct
+ public void init() {
+ LOGGER.info("Try to scan AppConn plugins...");
+ appConnInfoService.getAppConnInfos().forEach(DSSExceptionUtils.handling(appConnInfo -> {
+ LOGGER.info("Try to load or update AppConn {}.", appConnInfo.getAppConnName());
+ appConnResourceUploadService.upload(appConnInfo.getAppConnName());
+ }));
+ LOGGER.info("All AppConn plugins has scanned.");
+ }
+
+ @GET
+ @Path("listAppConnInfos")
+ public Response listAppConnInfos() {
+ List extends AppConnInfo> appConnInfos = appConnInfoService.getAppConnInfos();
+ Message message = Message.ok("Get AppConnInfo list succeed.");
+ message.data("appConnInfos", appConnInfos);
+ return Message.messageToResponse(message);
+ }
+
+ @GET
+ @Path("{appConnName}/get")
+ public Response get(@PathParam("appConnName") String appConnName) {
+ AppConnInfo appConnInfo = appConnInfoService.getAppConnInfo(appConnName);
+ Message message = Message.ok("Get AppConnInfo succeed.");
+ message.data("appConnInfo", appConnInfo);
+ return Message.messageToResponse(message);
+ }
+
+ @GET
+ @Path("/{appConnName}/getAppInstances")
+ public Response getAppInstancesByAppConnInfo(@PathParam("appConnName") String appConnName) {
+ List extends AppInstanceInfo> appInstanceInfos = appConnInfoService.getAppInstancesByAppConnName(appConnName);
+ Message message = Message.ok("Get AppInstance list succeed.");
+ message.data("appInstanceInfos", appInstanceInfos);
+ return Message.messageToResponse(message);
+ }
+
+ @GET
+ @Path("/{appConnName}/load")
+ public Response load(@PathParam("appConnName") String appConnName) {
+ LOGGER.info("Try to load a new AppConn {}.", appConnName);
+ try {
+ appConnResourceUploadService.upload(appConnName);
+ } catch (Exception e) {
+ LOGGER.error("Load AppConn " + appConnName + " failed.", e);
+ Message message = Message.error("Load AppConn " + appConnName + " failed. Reason: " + ExceptionUtils.getRootCauseMessage(e));
+ return Message.messageToResponse(message);
+ }
+ Message message = Message.ok("Load AppConn " + appConnName + " succeed.");
+ return Message.messageToResponse(message);
+ }
+
+}
diff --git a/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/service/AppConnResourceUploadService.java b/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/service/AppConnResourceUploadService.java
new file mode 100644
index 0000000000..f97951b77d
--- /dev/null
+++ b/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/service/AppConnResourceUploadService.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.appconn.service;
+
+import com.webank.wedatasphere.dss.common.exception.DSSErrorException;
+
+
+public interface AppConnResourceUploadService {
+
+ void upload(String appConnName) throws DSSErrorException;
+
+}
diff --git a/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/service/impl/AppConnInfoServiceImpl.java b/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/service/impl/AppConnInfoServiceImpl.java
new file mode 100644
index 0000000000..c150791782
--- /dev/null
+++ b/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/service/impl/AppConnInfoServiceImpl.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.appconn.service.impl;
+
+import com.webank.wedatasphere.dss.appconn.manager.entity.AppConnInfo;
+import com.webank.wedatasphere.dss.appconn.manager.entity.AppInstanceInfo;
+import com.webank.wedatasphere.dss.appconn.manager.service.AppConnInfoService;
+import com.webank.wedatasphere.dss.framework.appconn.dao.AppConnMapper;
+import com.webank.wedatasphere.dss.framework.appconn.dao.AppInstanceMapper;
+import com.webank.wedatasphere.dss.framework.appconn.entity.AppConnBean;
+import com.webank.wedatasphere.dss.framework.appconn.utils.AppConnServiceUtils;
+import java.util.List;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+
+@Component
+public class AppConnInfoServiceImpl implements AppConnInfoService {
+
+ @Autowired
+ private AppConnMapper appConnMapper;
+
+ @Autowired
+ private AppInstanceMapper appInstanceMapper;
+
+ @Override
+ public List extends AppConnInfo> getAppConnInfos() {
+ List appConnBeans = appConnMapper.getAllAppConnBeans();
+ appConnBeans.forEach(appConnBean -> {
+ String resource = appConnBean.getResource();
+ if(StringUtils.isNotBlank(resource)) {
+ appConnBean.setAppConnResource(AppConnServiceUtils.stringToResource(resource).getResource());
+ }
+ });
+ return appConnBeans;
+ }
+
+ @Override
+ public AppConnInfo getAppConnInfo(String appConnName) {
+ return appConnMapper.getAppConnBeanByName(appConnName);
+ }
+
+ @Override
+ public List extends AppInstanceInfo> getAppInstancesByAppConnInfo(AppConnInfo appConnInfo) {
+ Long id = ((AppConnBean) appConnInfo).getId();
+ return appInstanceMapper.getAppInstancesByAppConnId(id);
+ }
+
+ @Override
+ public List extends AppInstanceInfo> getAppInstancesByAppConnName(String appConnName) {
+ AppConnBean appConnBean = appConnMapper.getAppConnBeanByName(appConnName);
+ return getAppInstancesByAppConnInfo(appConnBean);
+ }
+}
diff --git a/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/service/impl/AppConnResourceServiceImpl.java b/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/service/impl/AppConnResourceServiceImpl.java
new file mode 100644
index 0000000000..2d8ff0d5b2
--- /dev/null
+++ b/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/service/impl/AppConnResourceServiceImpl.java
@@ -0,0 +1,173 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.appconn.service.impl;
+
+import com.webank.wedatasphere.dss.appconn.loader.utils.AppConnUtils;
+import com.webank.wedatasphere.dss.appconn.manager.AppConnManager;
+import com.webank.wedatasphere.dss.appconn.manager.entity.AppConnInfo;
+import com.webank.wedatasphere.dss.appconn.manager.impl.AbstractAppConnManager;
+import com.webank.wedatasphere.dss.appconn.manager.service.AppConnResourceService;
+import com.webank.wedatasphere.dss.appconn.manager.utils.AppConnIndexFileUtils;
+import com.webank.wedatasphere.dss.common.entity.Resource;
+import com.webank.wedatasphere.dss.common.exception.DSSErrorException;
+import com.webank.wedatasphere.dss.common.utils.ZipHelper;
+import com.webank.wedatasphere.dss.framework.appconn.dao.AppConnMapper;
+import com.webank.wedatasphere.dss.framework.appconn.entity.AppConnBean;
+import com.webank.wedatasphere.dss.framework.appconn.entity.AppConnResource;
+import com.webank.wedatasphere.dss.framework.appconn.exception.AppConnNotExistsErrorException;
+import com.webank.wedatasphere.dss.framework.appconn.service.AppConnResourceUploadService;
+import com.webank.wedatasphere.dss.framework.appconn.utils.AppConnServiceUtils;
+import com.webank.wedatasphere.linkis.bml.client.BmlClient;
+import com.webank.wedatasphere.linkis.bml.client.BmlClientFactory;
+import com.webank.wedatasphere.linkis.bml.protocol.BmlUpdateResponse;
+import com.webank.wedatasphere.linkis.bml.protocol.BmlUploadResponse;
+import com.webank.wedatasphere.linkis.common.utils.Utils;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+
+@Component
+public class AppConnResourceServiceImpl implements AppConnResourceService, AppConnResourceUploadService {
+
+ private Logger LOGGER = LoggerFactory.getLogger(AppConnResourceServiceImpl.class);
+ private static final String LIB_NAME = "/lib";
+
+ @Autowired
+ private AppConnMapper appConnMapper;
+ private BmlClient bmlClient;
+
+ @PostConstruct
+ public void init() {
+ bmlClient = BmlClientFactory.createBmlClient();
+ }
+
+ @Override
+ public String getAppConnHome(AppConnInfo appConnInfo) {
+ AppConnBean appConnBean = (AppConnBean) appConnInfo;
+ String appConnHome=appConnBean.getAppConnClassPath();
+ if(appConnHome.endsWith(LIB_NAME)){
+ appConnHome =appConnHome.substring(0,appConnHome.lastIndexOf(LIB_NAME));
+ }
+ return appConnHome;
+ }
+
+ @Override
+ public void upload(String appConnName) throws DSSErrorException {
+ File appConnPath = new File(AppConnUtils.getAppConnHomePath(), appConnName);
+ if (!appConnPath.exists()) {
+ throw new AppConnNotExistsErrorException(20350, "AppConn home path " + appConnPath.getPath() + " not exists.");
+ } else if (!appConnPath.isDirectory()) {
+ throw new AppConnNotExistsErrorException(20350, "AppConn home path " + appConnPath.getPath() + " is not a directory.");
+ }
+ File zipFile = new File(appConnPath.getPath() + ".zip");
+ if (zipFile.exists() && !zipFile.delete()) {
+ throw new AppConnNotExistsErrorException(20001, "No permission to delete old zip file " + zipFile);
+ }
+ ZipHelper.zip(appConnPath.getPath(), false);
+// TODO ZipUtils.fileToZip(appConnPath.getPath(), AppConnUtils.getAppConnHomePath(), appConnName + ".zip");
+ AppConnBean appConnBean = appConnMapper.getAppConnBeanByName(appConnName);
+ AppConnResource appConnResource;
+ File indexFile = null;
+ if (appConnBean == null) {
+ throw new AppConnNotExistsErrorException(20350, "AppConn not exists in DB, please update db at first.");
+ } else if (StringUtils.isNotBlank(appConnBean.getResource())) {
+ // If resource is exists, then indexFile is also exists.
+ appConnResource = AppConnServiceUtils.stringToResource(appConnBean.getResource());
+ indexFile = AppConnIndexFileUtils.getIndexFile(appConnPath);
+ if (appConnPath.lastModified() == appConnResource.getLastModifiedTime()
+ && zipFile.length() == appConnResource.getSize() && AppConnIndexFileUtils.isLatestIndex(appConnPath, appConnResource.getResource())) {
+ LOGGER.info("No necessary to update the AppConn {}, since it's packages has no changes in path {}.", appConnName, appConnPath.getPath());
+ return;
+ }
+ } else {
+ // If resource is not exists, this is the first time to upload this AppConn.
+ appConnResource = new AppConnResource();
+ }
+ // At first, upload appConn file to BML
+ Resource resource = new Resource();
+ InputStream inputStream = null;
+ if (appConnResource.getResource() != null) {
+ try {
+ inputStream = new FileInputStream(zipFile.getPath());
+
+ BmlUpdateResponse response = bmlClient.updateResource(Utils.getJvmUser(), appConnResource.getResource().getResourceId(), zipFile.getPath(),inputStream);
+ resource.setResourceId(appConnResource.getResource().getResourceId());
+ resource.setVersion(response.version());
+ } catch (FileNotFoundException e) {
+ throw new AppConnNotExistsErrorException(20351, "AppConn update to bml failed"+e.getMessage());
+ } finally {
+ IOUtils.closeQuietly(inputStream);
+ }
+ } else {
+
+ try {
+ inputStream = new FileInputStream(zipFile.getPath());
+ BmlUploadResponse response = bmlClient.uploadResource(Utils.getJvmUser(), zipFile.getPath(), inputStream);
+ resource.setResourceId(response.resourceId());
+ resource.setVersion(response.version());
+ } catch (FileNotFoundException e) {
+ throw new AppConnNotExistsErrorException(20352, "AppConn update to bml failed"+e.getMessage());
+ } finally {
+ IOUtils.closeQuietly(inputStream);
+ }
+
+ }
+ resource.setFileName(zipFile.getName());
+ // Then, insert into db.
+ appConnResource.setLastModifiedTime(appConnPath.lastModified());
+ appConnResource.setSize(zipFile.length());
+ appConnResource.setResource(resource);
+ String resourceStr = AppConnServiceUtils.resourceToString(appConnResource);
+
+ AppConnBean appConnBeanReLoad = new AppConnBean();
+ appConnBeanReLoad.setId(appConnBean.getId());
+ appConnBeanReLoad.setResource(resourceStr);
+ appConnBeanReLoad.setAppConnName(appConnName);
+ appConnBeanReLoad.setAppConnClassPath(appConnPath.getPath());
+ appConnBeanReLoad.setClassName(appConnBean.getClassName());
+ appConnMapper.updateResourceByName(appConnBeanReLoad);
+ // update index file.
+ if (indexFile != null && !indexFile.delete()) {
+ throw new AppConnNotExistsErrorException(20350, "Delete index file " + indexFile.getName() + " failed, please ensure the permission is all right.");
+ }
+ indexFile = new File(appConnPath, AppConnIndexFileUtils.getIndexFileName(resource));
+ try {
+ indexFile.createNewFile();
+ } catch (IOException e) {
+ throw new AppConnNotExistsErrorException(20350, "create index file " + indexFile.getName() + " failed, please ensure the permission is all right.", e);
+ }
+ // Finally, reload this AppConn.
+ ((AbstractAppConnManager) AppConnManager.getAppConnManager()).reloadAppConn(appConnBeanReLoad);
+ LOGGER.info("AppConn {} has updated resource to {}.", appConnName, resourceStr);
+ }
+
+ @PreDestroy
+ public void destory() {
+ IOUtils.closeQuietly(bmlClient);
+ }
+}
diff --git a/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/utils/AppConnServiceUtils.java b/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/utils/AppConnServiceUtils.java
new file mode 100644
index 0000000000..11d851cd8c
--- /dev/null
+++ b/dss-framework/dss-appconn-framework/src/main/java/com/webank/wedatasphere/dss/framework/appconn/utils/AppConnServiceUtils.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.appconn.utils;
+
+import com.webank.wedatasphere.dss.common.utils.DSSCommonUtils;
+import com.webank.wedatasphere.dss.framework.appconn.entity.AppConnResource;
+
+
+public class AppConnServiceUtils {
+
+ public static String resourceToString(AppConnResource resource) {
+ return DSSCommonUtils.COMMON_GSON.toJson(resource);
+ }
+
+ public static AppConnResource stringToResource(String resource) {
+ return DSSCommonUtils.COMMON_GSON.fromJson(resource, AppConnResource.class);
+ }
+
+}
diff --git a/dss-framework/dss-framework-common/pom.xml b/dss-framework/dss-framework-common/pom.xml
new file mode 100644
index 0000000000..05aac9fe15
--- /dev/null
+++ b/dss-framework/dss-framework-common/pom.xml
@@ -0,0 +1,115 @@
+
+
+
+
+
+ dss
+ com.webank.wedatasphere.dss
+ 1.0.0
+
+
+ 4.0.0
+ dss-framework-common
+
+
+
+ com.webank.wedatasphere.linkis
+ linkis-module
+ ${linkis.version}
+ provided
+
+
+ org.springframework.cloud
+ spring-cloud-netflix
+
+
+ spring-cloud-starter-netflix-eureka-client
+ org.springframework.cloud
+
+
+
+
+ org.apache.commons
+ commons-math3
+ provided
+
+
+ xstream
+ com.thoughtworks.xstream
+
+
+ org.springframework.cloud
+ spring-cloud-starter-netflix-eureka-client
+ ${spring.cloud.version}
+ provided
+
+
+ logback-classic
+ ch.qos.logback
+
+
+ log4j-to-slf4j
+ org.apache.logging.log4j
+
+
+ gson
+ com.google.code.gson
+
+
+ jsr311-api
+ javax.ws.rs
+
+
+ xstream
+ com.thoughtworks.xstream
+
+
+ commons-math
+ org.apache.commons
+
+
+ jackson-core
+ com.fasterxml.jackson.core
+
+
+ spring-boot-autoconfigure
+ org.springframework.boot
+
+
+ spring-boot-starter-aop
+ org.springframework.boot
+
+
+ spring-boot-starter
+ org.springframework.boot
+
+
+ spring-boot-starter-cache
+ org.springframework.boot
+
+
+
+
+ com.webank.wedatasphere.linkis
+ linkis-mybatis
+ ${linkis.version}
+ provided
+
+
+
\ No newline at end of file
diff --git a/dss-framework/dss-framework-common/src/main/java/com/webank/wedatasphere/dss/framework/common/exception/DSSFrameworkErrorException.java b/dss-framework/dss-framework-common/src/main/java/com/webank/wedatasphere/dss/framework/common/exception/DSSFrameworkErrorException.java
new file mode 100644
index 0000000000..2a0e291333
--- /dev/null
+++ b/dss-framework/dss-framework-common/src/main/java/com/webank/wedatasphere/dss/framework/common/exception/DSSFrameworkErrorException.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.common.exception;
+
+import com.webank.wedatasphere.linkis.common.exception.ErrorException;
+
+
+public class DSSFrameworkErrorException extends ErrorException {
+
+ public DSSFrameworkErrorException(int errorCode, String errorDesc){
+ super(errorCode, errorDesc);
+ }
+
+ public static void dealErrorException(int errorCode, String errorDesc, Throwable t) throws DSSFrameworkErrorException{
+ DSSFrameworkErrorException dssFrameworkErrorException = new DSSFrameworkErrorException(errorCode, errorDesc);
+ dssFrameworkErrorException.initCause(t);
+ throw dssFrameworkErrorException;
+ }
+
+ public static void dealErrorException(int errorCode, String errorDesc) throws DSSFrameworkErrorException{
+ throw new DSSFrameworkErrorException(errorCode, errorDesc);
+ }
+
+
+}
diff --git a/dss-framework/dss-framework-common/src/main/java/com/webank/wedatasphere/dss/framework/common/exception/DSSFrameworkRuntimeException.java b/dss-framework/dss-framework-common/src/main/java/com/webank/wedatasphere/dss/framework/common/exception/DSSFrameworkRuntimeException.java
new file mode 100644
index 0000000000..1e1df42ebd
--- /dev/null
+++ b/dss-framework/dss-framework-common/src/main/java/com/webank/wedatasphere/dss/framework/common/exception/DSSFrameworkRuntimeException.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.common.exception;
+
+import com.webank.wedatasphere.linkis.common.exception.WarnException;
+
+
+public class DSSFrameworkRuntimeException extends WarnException {
+
+ public DSSFrameworkRuntimeException(String msg){
+ super(100000, msg);
+ }
+}
diff --git a/dss-framework/dss-framework-common/src/main/java/com/webank/wedatasphere/dss/framework/common/exception/DSSFrameworkWarnException.java b/dss-framework/dss-framework-common/src/main/java/com/webank/wedatasphere/dss/framework/common/exception/DSSFrameworkWarnException.java
new file mode 100644
index 0000000000..b41db5bc9e
--- /dev/null
+++ b/dss-framework/dss-framework-common/src/main/java/com/webank/wedatasphere/dss/framework/common/exception/DSSFrameworkWarnException.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.common.exception;
+
+import com.webank.wedatasphere.linkis.common.exception.WarnException;
+
+
+public class DSSFrameworkWarnException extends WarnException {
+ public DSSFrameworkWarnException(int errorCode, String errorDesc){
+ super(errorCode, errorDesc);
+ }
+
+ public static void dealWarnException(int errorCode, String errorDesc, Throwable t) throws DSSFrameworkWarnException {
+ DSSFrameworkWarnException dssFrameworkWarnException = new DSSFrameworkWarnException(errorCode, errorDesc);
+ dssFrameworkWarnException.initCause(t);
+ throw dssFrameworkWarnException;
+ }
+
+}
diff --git a/dss-framework/dss-framework-common/src/main/java/com/webank/wedatasphere/dss/framework/common/exception/ThrowingConsumer.java b/dss-framework/dss-framework-common/src/main/java/com/webank/wedatasphere/dss/framework/common/exception/ThrowingConsumer.java
new file mode 100644
index 0000000000..56cf17087b
--- /dev/null
+++ b/dss-framework/dss-framework-common/src/main/java/com/webank/wedatasphere/dss/framework/common/exception/ThrowingConsumer.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.common.exception;
+
+
+@FunctionalInterface
+public interface ThrowingConsumer {
+ void accept(T t) throws E;
+}
diff --git a/dss-framework/dss-framework-common/src/main/java/com/webank/wedatasphere/dss/framework/common/exception/ThrowingFunction.java b/dss-framework/dss-framework-common/src/main/java/com/webank/wedatasphere/dss/framework/common/exception/ThrowingFunction.java
new file mode 100644
index 0000000000..54e1f3b379
--- /dev/null
+++ b/dss-framework/dss-framework-common/src/main/java/com/webank/wedatasphere/dss/framework/common/exception/ThrowingFunction.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.common.exception;
+
+
+@FunctionalInterface
+public interface ThrowingFunction {
+ R accept(T t) throws E;
+}
diff --git a/dss-framework/dss-framework-common/src/main/java/com/webank/wedatasphere/dss/framework/common/utils/DSSFrameworkExceptionUtils.java b/dss-framework/dss-framework-common/src/main/java/com/webank/wedatasphere/dss/framework/common/utils/DSSFrameworkExceptionUtils.java
new file mode 100644
index 0000000000..24b8468930
--- /dev/null
+++ b/dss-framework/dss-framework-common/src/main/java/com/webank/wedatasphere/dss/framework/common/utils/DSSFrameworkExceptionUtils.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.common.utils;
+
+
+import com.webank.wedatasphere.dss.framework.common.exception.DSSFrameworkRuntimeException;
+import com.webank.wedatasphere.dss.framework.common.exception.ThrowingConsumer;
+import com.webank.wedatasphere.dss.framework.common.exception.ThrowingFunction;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.function.Consumer;
+import java.util.function.Function;
+
+
+public class DSSFrameworkExceptionUtils {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(DSSFrameworkExceptionUtils.class);
+
+ public static Consumer handling(
+ ThrowingConsumer throwingConsumer) {
+ return i -> {
+ try {
+ throwingConsumer.accept(i);
+ } catch (Exception e) {
+ LOGGER.error("execute failed,reason:",e);
+ throw new DSSFrameworkRuntimeException(e.getMessage());
+ }
+ };
+ }
+
+ public static Function map(
+ ThrowingFunction throwingFunction) {
+ return i -> {
+ try {
+ return throwingFunction.accept(i);
+ } catch (Exception e) {
+ LOGGER.error("execute failed,reason:",e);
+ throw new DSSFrameworkRuntimeException(e.getMessage());
+ }
+ };
+ }
+}
diff --git a/dss-framework/dss-framework-common/src/main/java/com/webank/wedatasphere/dss/framework/common/utils/RestfulUtils.java b/dss-framework/dss-framework-common/src/main/java/com/webank/wedatasphere/dss/framework/common/utils/RestfulUtils.java
new file mode 100644
index 0000000000..5e9b7d185f
--- /dev/null
+++ b/dss-framework/dss-framework-common/src/main/java/com/webank/wedatasphere/dss/framework/common/utils/RestfulUtils.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.common.utils;
+
+import com.webank.wedatasphere.linkis.server.Message;
+import org.apache.commons.math3.util.Pair;
+
+import javax.ws.rs.core.Response;
+import java.util.Arrays;
+
+
+public class RestfulUtils {
+
+
+ public static Response dealError(String reason){
+ Message message = Message.error(reason);
+ return Message.messageToResponse(message);
+ }
+
+ public static Response dealOk(String msg){
+ Message message = Message.ok(msg);
+ return Message.messageToResponse(message);
+ }
+
+
+
+ @SafeVarargs
+ public static Response dealOk(String msg, Pair... data){
+ Message message = Message.ok(msg);
+ Arrays.stream(data).forEach(p -> message.data(p.getKey(), p.getValue()));
+ return Message.messageToResponse(message);
+ }
+
+}
diff --git a/dss-framework/dss-framework-orchestrator-server/bin/start-dss-framework-orchestrator-server.sh b/dss-framework/dss-framework-orchestrator-server/bin/start-dss-framework-orchestrator-server.sh
new file mode 100644
index 0000000000..7e592a27a6
--- /dev/null
+++ b/dss-framework/dss-framework-orchestrator-server/bin/start-dss-framework-orchestrator-server.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+cd `dirname $0`
+cd ..
+HOME=`pwd`
+export DWS_ENGINE_MANAGER_HOME=$HOME
+
+export DWS_ENGINE_MANAGER_PID=$HOME/bin/linkis.pid
+
+if [[ -f "${DWS_ENGINE_MANAGER_PID}" ]]; then
+ pid=$(cat ${DWS_ENGINE_MANAGER_PID})
+ if kill -0 ${pid} >/dev/null 2>&1; then
+ echo "DSS SERVER is already running."
+ return 0;
+ fi
+fi
+
+export DWS_ENGINE_MANAGER_LOG_PATH=$HOME/logs
+export DWS_ENGINE_MANAGER_HEAP_SIZE="1G"
+
+export DWS_ENGINE_MANAGER_JAVA_OPTS="-Xms$DWS_ENGINE_MANAGER_HEAP_SIZE -Xmx$DWS_ENGINE_MANAGER_HEAP_SIZE -XX:+UseG1GC -XX:MaxPermSize=500m -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=20012"
+
+#export DWS_ENGINE_MANAGER_JAVA_OPTS="-Xms$DWS_ENGINE_MANAGER_HEAP_SIZE -Xmx$DWS_ENGINE_MANAGER_HEAP_SIZE -XX:+UseG1GC -XX:MaxPermSize=500m"
+
+nohup java $DWS_ENGINE_MANAGER_JAVA_OPTS -cp $HOME/conf:$HOME/lib/* com.webank.wedatasphere.linkis.DataWorkCloudApplication 2>&1 > $DWS_ENGINE_MANAGER_LOG_PATH/linkis.out &
+pid=$!
+if [[ -z "${pid}" ]]; then
+ echo "DSS SERVER start failed!"
+ sleep 1
+ exit 1
+else
+ echo "DSS SERVER start succeeded!"
+ echo $pid > $DWS_ENGINE_MANAGER_PID
+ sleep 1
+fi
+exit 1
\ No newline at end of file
diff --git a/dss-framework/dss-framework-orchestrator-server/bin/stop-dss-framework-orchestrator-server.sh b/dss-framework/dss-framework-orchestrator-server/bin/stop-dss-framework-orchestrator-server.sh
new file mode 100644
index 0000000000..2ca464de62
--- /dev/null
+++ b/dss-framework/dss-framework-orchestrator-server/bin/stop-dss-framework-orchestrator-server.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+cd `dirname $0`
+cd ..
+HOME=`pwd`
+
+export FLOW_ENTRANCE_HOME_PID=$HOME/bin/linkis.pid
+
+function wait_for_FLOW_ENTRANCE_HOME_to_die() {
+ local pid
+ local count
+ pid=$1
+ timeout=$2
+ count=0
+ timeoutTime=$(date "+%s")
+ let "timeoutTime+=$timeout"
+ currentTime=$(date "+%s")
+ forceKill=1
+
+ while [[ $currentTime -lt $timeoutTime ]]; do
+ $(kill ${pid} > /dev/null 2> /dev/null)
+ if kill -0 ${pid} > /dev/null 2>&1; then
+ sleep 3
+ else
+ forceKill=0
+ break
+ fi
+ currentTime=$(date "+%s")
+ done
+
+ if [[ forceKill -ne 0 ]]; then
+ $(kill -9 ${pid} > /dev/null 2> /dev/null)
+ fi
+}
+
+if [[ ! -f "${FLOW_ENTRANCE_HOME_PID}" ]]; then
+ echo "DSS SERVER is not running"
+else
+ pid=$(cat ${FLOW_ENTRANCE_HOME_PID})
+ if [[ -z "${pid}" ]]; then
+ echo "DSS SERVER is not running"
+ else
+ wait_for_FLOW_ENTRANCE_HOME_to_die $pid 40
+ $(rm -f ${FLOW_ENTRANCE_HOME_PID})
+ echo "DSS SERVER is stopped."
+ fi
+fi
\ No newline at end of file
diff --git a/dss-framework/dss-framework-orchestrator-server/pom.xml b/dss-framework/dss-framework-orchestrator-server/pom.xml
new file mode 100644
index 0000000000..d847d188d9
--- /dev/null
+++ b/dss-framework/dss-framework-orchestrator-server/pom.xml
@@ -0,0 +1,187 @@
+
+
+
+
+
+ dss
+ com.webank.wedatasphere.dss
+ 1.0.0
+
+
+ 4.0.0
+
+ dss-framework-orchestrator-server
+
+
+
+ com.webank.wedatasphere.dss
+ dss-framework-common
+ ${dss.version}
+
+
+ com.webank.wedatasphere.dss
+ dss-orchestrator-core
+ ${dss.version}
+
+
+ commons-beanutils
+ commons-beanutils
+
+
+ commons-collections
+ commons-collections
+
+
+
+
+ com.webank.wedatasphere.dss
+ dss-orchestrator-db
+ ${dss.version}
+
+
+
+ com.webank.wedatasphere.dss
+ dss-orchestrator-loader
+ ${dss.version}
+
+
+ com.webank.wedatasphere.dss
+ dss-framework-orchestrator-publish
+ ${dss.version}
+
+
+
+ com.webank.wedatasphere.linkis
+ linkis-rpc
+ ${linkis.version}
+ provided
+
+
+ spring-cloud-starter-netflix-eureka-client
+ org.springframework.cloud
+
+
+
+
+
+ com.webank.wedatasphere.dss
+ dss-contextservice
+ ${dss.version}
+
+
+ linkis-common
+ com.webank.wedatasphere.linkis
+
+
+ commons-text
+ org.apache.commons
+
+
+ json4s-jackson_2.11
+ org.json4s
+
+
+
+
+
+ com.webank.wedatasphere.linkis
+ linkis-mybatis
+ ${linkis.version}
+ provided
+
+
+ com.webank.wedatasphere.dss
+ dss-common
+ ${dss.version}
+ provided
+
+
+ com.webank.wedatasphere.dss
+ dss-appconn-manager-client
+ ${dss.version}
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+
+
+
+ net.alchim31.maven
+ scala-maven-plugin
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+
+ 8
+
+
+
+ org.apache.maven.plugins
+ maven-assembly-plugin
+ 2.3
+ false
+
+
+ make-assembly
+ package
+
+ single
+
+
+
+ src/main/assembly/distribution.xml
+
+
+
+
+
+ false
+ out
+ false
+ false
+
+ src/main/assembly/distribution.xml
+
+
+
+
+
+
+ src/main/java
+
+ **/*.xml
+ **/*.properties
+ **/*.yml
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dss-framework/dss-framework-orchestrator-server/src/main/assembly/distribution.xml b/dss-framework/dss-framework-orchestrator-server/src/main/assembly/distribution.xml
new file mode 100644
index 0000000000..313ea1281e
--- /dev/null
+++ b/dss-framework/dss-framework-orchestrator-server/src/main/assembly/distribution.xml
@@ -0,0 +1,44 @@
+
+
+
+ dss-framework-orchestrator-server
+
+ dir
+
+ true
+ dss-framework-orchestrator-server
+
+
+
+
+
+ lib
+ true
+ true
+ false
+ true
+ true
+
+
+
+
+
+
+
diff --git a/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/conf/OrchestratorConf.java b/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/conf/OrchestratorConf.java
new file mode 100644
index 0000000000..4bef87f060
--- /dev/null
+++ b/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/conf/OrchestratorConf.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.orchestrator.server.conf;
+
+import com.webank.wedatasphere.linkis.common.conf.CommonVars;
+
+
+public class OrchestratorConf {
+ public static final CommonVars DSS_UPLOAD_PATH = CommonVars.apply("wds.dss.file.upload.dir", "/appcom/tmp/uploads");
+}
diff --git a/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/conf/OrchestratorSpringConf.java b/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/conf/OrchestratorSpringConf.java
new file mode 100644
index 0000000000..e2df01daa3
--- /dev/null
+++ b/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/conf/OrchestratorSpringConf.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.orchestrator.server.conf;
+
+import com.webank.wedatasphere.dss.contextservice.service.ContextService;
+import com.webank.wedatasphere.dss.contextservice.service.impl.ContextServiceImpl;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+
+@Configuration
+public class OrchestratorSpringConf {
+
+ @Bean(name = "contextService")
+ public ContextService createContextService(){
+ return ContextServiceImpl.getInstance();
+ }
+
+}
diff --git a/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/constant/DSSOrchestratorConstant.java b/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/constant/DSSOrchestratorConstant.java
new file mode 100644
index 0000000000..81a5bb06bc
--- /dev/null
+++ b/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/constant/DSSOrchestratorConstant.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.orchestrator.server.constant;
+
+
+public class DSSOrchestratorConstant {
+ public static final String PUBLISH_FLOW_REPORT_FORMATE = "工作流名:%s,版本号:%s,工作流内容为空,请自行修改或者删除";
+}
diff --git a/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/constant/OrchestratorSpringConfiguration.java b/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/constant/OrchestratorSpringConfiguration.java
new file mode 100644
index 0000000000..f9176d6c69
--- /dev/null
+++ b/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/constant/OrchestratorSpringConfiguration.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.orchestrator.server.constant;
+
+import com.webank.wedatasphere.dss.orchestrator.server.service.OrchestratorPluginService;
+import com.webank.wedatasphere.dss.orchestrator.server.service.impl.OrchestratorPluginServiceImpl;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+public class OrchestratorSpringConfiguration {
+
+ @Bean
+ @ConditionalOnMissingBean
+ public OrchestratorPluginService createOrchestratorPluginService() {
+ return new OrchestratorPluginServiceImpl();
+ }
+
+}
\ No newline at end of file
diff --git a/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/entity/UploadFileResponse.java b/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/entity/UploadFileResponse.java
new file mode 100644
index 0000000000..d1d72a6c1a
--- /dev/null
+++ b/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/entity/UploadFileResponse.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.orchestrator.server.entity;
+
+public class UploadFileResponse {
+ private String fileName;
+ private String fileDownloadUri;
+ private String fileType;
+ private long size;
+
+ public UploadFileResponse(String fileName, String fileDownloadUri, String fileType, long size) {
+ this.fileName = fileName;
+ this.fileDownloadUri = fileDownloadUri;
+ this.fileType = fileType;
+ this.size = size;
+ }
+ // getter and setter ...
+}
diff --git a/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/entity/query/QueryOrchestratorVersion.java b/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/entity/query/QueryOrchestratorVersion.java
new file mode 100644
index 0000000000..110d021e8b
--- /dev/null
+++ b/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/entity/query/QueryOrchestratorVersion.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.orchestrator.server.entity.query;
+
+import javax.validation.constraints.NotNull;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class QueryOrchestratorVersion {
+
+ @NotNull(message = "orchestratorId不能为空")
+ private Long orchestratorId;
+
+ public Long getOrchestratorId() {
+ return orchestratorId;
+ }
+
+ public void setOrchestratorId(Long orchestratorId) {
+ this.orchestratorId = orchestratorId;
+ }
+}
\ No newline at end of file
diff --git a/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/restful/OrchestratorIERestful.java b/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/restful/OrchestratorIERestful.java
new file mode 100644
index 0000000000..465c752259
--- /dev/null
+++ b/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/restful/OrchestratorIERestful.java
@@ -0,0 +1,181 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.orchestrator.server.restful;
+
+import com.webank.wedatasphere.dss.common.exception.DSSErrorException;
+import com.webank.wedatasphere.dss.common.label.DSSLabel;
+import com.webank.wedatasphere.dss.common.label.EnvDSSLabel;
+import com.webank.wedatasphere.dss.common.label.LabelKeyConvertor;
+import com.webank.wedatasphere.dss.common.utils.DSSCommonUtils;
+import com.webank.wedatasphere.dss.orchestrator.common.entity.OrchestratorVo;
+import com.webank.wedatasphere.dss.orchestrator.core.DSSOrchestratorContext;
+import com.webank.wedatasphere.dss.orchestrator.core.service.BMLService;
+import com.webank.wedatasphere.dss.orchestrator.publish.ExportDSSOrchestratorPlugin;
+import com.webank.wedatasphere.dss.orchestrator.publish.ImportDSSOrchestratorPlugin;
+import com.webank.wedatasphere.dss.orchestrator.server.service.OrchestratorService;
+import com.webank.wedatasphere.dss.standard.app.sso.Workspace;
+import com.webank.wedatasphere.dss.standard.sso.utils.SSOHelper;
+import com.webank.wedatasphere.linkis.server.Message;
+import com.webank.wedatasphere.linkis.server.security.SecurityFilter;
+import org.apache.commons.io.IOUtils;
+import org.glassfish.jersey.media.multipart.FormDataBodyPart;
+import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
+import org.glassfish.jersey.media.multipart.FormDataMultiPart;
+import org.glassfish.jersey.media.multipart.FormDataParam;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.ws.rs.*;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes({MediaType.APPLICATION_JSON, MediaType.MULTIPART_FORM_DATA})
+@Component
+@Path("/dss/framework/orchestrator")
+public class OrchestratorIERestful {
+ private static final Logger logger = LoggerFactory.getLogger(OrchestratorIERestful.class);
+ @Autowired
+ private BMLService bmlService;
+ @Autowired
+ OrchestratorService orchestratorService;
+ @Autowired
+ private DSSOrchestratorContext orchestratorContext;
+
+ @POST
+ @Path("/importOrchestratorFile")
+ public Response importOrcFile(@Context HttpServletRequest req,
+ @FormDataParam("projectName") String projectName,
+ @FormDataParam("projectID") Long projectID,
+ @FormDataParam("labels") String labels,
+ FormDataMultiPart form) throws DSSErrorException, UnsupportedEncodingException {
+ List files = form.getFields("file");
+ if (null == files || files.size() == 0) {
+ throw new DSSErrorException(100788, "Import orchestrator failed for files is empty");
+ }
+ Long importOrcId = 0L;
+ for (FormDataBodyPart p : files) {
+ InputStream inputStream = p.getValueAs(InputStream.class);
+ FormDataContentDisposition fileDetail = p.getFormDataContentDisposition();
+ String fileName = new String(fileDetail.getFileName().getBytes("ISO8859-1"), "UTF-8");
+ String userName = SecurityFilter.getLoginUsername(req);
+ //调用工具类生产label
+ List dssLabelList = getDSSLabelList(labels);
+// String fileDownloadUri = ServletUriComponentsBuilder.fromCurrentContextPath()
+// .path("/downloadFile/")
+// .path(fileName)
+// .toUriString();
+// java.nio.file.Path targetLocation = DSSFileService.fileStorageLocation.resolve(fileName);
+ Workspace workspace = SSOHelper.getWorkspace(req);
+ //3、打包新的zip包上传BML
+// InputStream inputStream = bmlService.readLocalResourceFile(userName, targetLocation.toAbsolutePath().toString());
+ Map resultMap = bmlService.upload(userName, inputStream,
+ fileName, projectName);
+ try {
+ importOrcId = orchestratorContext.getDSSOrchestratorPlugin(ImportDSSOrchestratorPlugin.class).importOrchestrator(userName,
+ workspace.getWorkspaceName(),
+ projectName,
+ projectID,
+ resultMap.get("resourceId").toString(),
+ resultMap.get("version").toString(),
+ dssLabelList,
+ workspace);
+ } catch (Exception e) {
+ logger.error("Import orchestrator failed for ", e);
+ throw new DSSErrorException(100789, "Import orchestrator failed for " + e.getMessage());
+ }
+ }
+ return Message.messageToResponse(Message.ok().data("importOrcId", importOrcId));
+ }
+
+ @GET
+ @Path("/exportOrchestrator")
+ public void exportOrcFile(@Context HttpServletRequest req,
+ @Context HttpServletResponse resp,
+ @DefaultValue("exportOrc") @QueryParam("outputFileName") String outputFileName,
+ @DefaultValue("utf-8") @QueryParam("charset") String charset,
+ @DefaultValue("zip") @QueryParam("outputFileType") String outputFileType,
+ @QueryParam("projectName") String projectName,
+ @QueryParam("orchestratorId") Long orchestratorId,
+ @QueryParam("orcVersionId") Long orcVersionId,
+ @DefaultValue("false") @QueryParam("addOrcVersion") Boolean addOrcVersion,
+ @QueryParam("labels") String labels) throws DSSErrorException, IOException {
+ resp.addHeader("Content-Disposition", "attachment;filename="
+ + new String(outputFileName.getBytes("UTF-8"), "ISO8859-1") + "." + outputFileType);
+ resp.setCharacterEncoding(charset);
+ Workspace workspace = SSOHelper.getWorkspace(req);
+ String userName = SecurityFilter.getLoginUsername(req);
+ List dssLabelList = getDSSLabelList(labels);
+ Map res = null;
+ OrchestratorVo orchestratorVo = orchestratorService.getOrchestratorVoById(orchestratorId);
+ orcVersionId = orchestratorVo.getDssOrchestratorVersion().getId();
+ logger.info("export orchestrator orchestratorId " + orchestratorId + ",orcVersionId:" + orcVersionId);
+ try {
+ res = orchestratorContext.getDSSOrchestratorPlugin(ExportDSSOrchestratorPlugin.class).exportOrchestrator(userName,
+ workspace.getWorkspaceName(),
+ orchestratorId,
+ orcVersionId,
+ projectName,
+ dssLabelList,
+ addOrcVersion,
+ workspace);
+ } catch (Exception e) {
+ logger.error("export orchestrator failed for ", e);
+ throw new DSSErrorException(100789, "export orchestrator failed for " + e.getMessage());
+ }
+ if (null != res) {
+ Map downRes = bmlService.download(userName,
+ res.get("resourceId").toString(),
+ res.get("version").toString());
+
+ InputStream inputStream = (InputStream) downRes.get("is");
+ try {
+ IOUtils.copy(inputStream, resp.getOutputStream());
+ resp.getOutputStream().flush();
+ } finally {
+ IOUtils.closeQuietly(inputStream);
+ }
+ }
+ }
+
+ //生成label list
+ public List getDSSLabelList(String labels) {
+ //原来的逻辑
+// List dssLabelList = Arrays.asList(dssLabels.split(",")).stream().map(label -> {
+// DSSLabel dssLabel = new EnvDSSLabel(label);
+// return dssLabel;
+// }).collect(Collectors.toList());
+ String labelStr = DSSCommonUtils.ENV_LABEL_VALUE_DEV;
+ Map labelMap = DSSCommonUtils.COMMON_GSON.fromJson(labels, Map.class);
+ if (labelMap.containsKey(LabelKeyConvertor.ROUTE_LABEL_KEY)) {
+ labelStr = (String) labelMap.get(LabelKeyConvertor.ROUTE_LABEL_KEY);
+ }
+ List dssLabelList = Arrays.asList(new EnvDSSLabel(labelStr));
+ return dssLabelList;
+ }
+}
\ No newline at end of file
diff --git a/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/restful/OrchestratorRestful.java b/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/restful/OrchestratorRestful.java
new file mode 100644
index 0000000000..8e3cbed25d
--- /dev/null
+++ b/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/restful/OrchestratorRestful.java
@@ -0,0 +1,150 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.orchestrator.server.restful;
+
+import com.webank.wedatasphere.dss.common.label.DSSLabel;
+import com.webank.wedatasphere.dss.common.label.DSSLabelUtil;
+import com.webank.wedatasphere.dss.common.label.EnvDSSLabel;
+import com.webank.wedatasphere.dss.common.label.LabelKeyConvertor;
+import com.webank.wedatasphere.dss.common.utils.DSSCommonUtils;
+import com.webank.wedatasphere.dss.orchestrator.common.entity.DSSOrchestratorInfo;
+import com.webank.wedatasphere.dss.orchestrator.common.entity.OrchestratorVo;
+import com.webank.wedatasphere.dss.orchestrator.server.entity.query.QueryOrchestratorVersion;
+import com.webank.wedatasphere.dss.orchestrator.server.service.OrchestratorService;
+import com.webank.wedatasphere.dss.standard.app.sso.Workspace;
+import com.webank.wedatasphere.dss.standard.sso.utils.SSOHelper;
+import com.webank.wedatasphere.linkis.server.Message;
+import com.webank.wedatasphere.linkis.server.security.SecurityFilter;
+import org.codehaus.jackson.JsonNode;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+
+@Component
+@Path("/dss/framework/orchestrator")
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes(MediaType.APPLICATION_JSON)
+public class OrchestratorRestful {
+ private final static Logger LOGGER = LoggerFactory.getLogger(OrchestratorRestful.class);
+ @Autowired
+ OrchestratorService orchestratorService;
+
+ @POST
+ @Path("/addOrchestrator")
+ public Response addOrchestrator(@Context HttpServletRequest req, JsonNode json) throws Exception {
+ String userName = SecurityFilter.getLoginUsername(req);
+ String name = json.get("name").getTextValue();
+ String workspaceName = json.get("workspaceName").getTextValue();
+ String projectName = json.get("projectName").getTextValue();
+ String typeStr = json.get("type").getTextValue();
+ String desc = json.get("desc").getTextValue();
+ Long projectID = json.get("projectID").getLongValue();
+// List dssLabelList = Arrays.asList(dssLabels.split(",")).stream().map(label -> {
+// DSSLabel dssLabel = new EnvDSSLabel(label);
+// return dssLabel;
+// }).collect(Collectors.toList());
+ List dssLabelList = getDSSLabelList(json);
+ DSSOrchestratorInfo dssOrchestratorInfo = new DSSOrchestratorInfo();
+ dssOrchestratorInfo.setName(name);
+ dssOrchestratorInfo.setCreator(userName);
+ dssOrchestratorInfo.setDesc(desc);
+ dssOrchestratorInfo.setType(typeStr);
+ OrchestratorVo orchestratorVo = orchestratorService.createOrchestrator(userName,
+ workspaceName,
+ projectName,
+ projectID,
+ desc,
+ dssOrchestratorInfo,
+ dssLabelList);
+ return Message.messageToResponse(Message.ok().data("OrchestratorVo", orchestratorVo));
+ }
+
+
+ @POST
+ @Path("/rollbackOrchestrator")
+ public Response rollbackOrchestrator(@Context HttpServletRequest request, JsonNode jsonNode) {
+ String username = SecurityFilter.getLoginUsername(request);
+ Long orchestratorId = jsonNode.get("orchestratorId").getLongValue();
+ String version = jsonNode.get("version").getTextValue();
+ Long projectId = jsonNode.get("projectId").getLongValue();
+ String projectName = jsonNode.get("projectName").getTextValue();
+ Workspace workspace = SSOHelper.getWorkspace(request);
+ DSSLabel envDSSLabel = getDSSLabelList(jsonNode).get(0);
+ try {
+ String newVersion = orchestratorService.rollbackOrchestrator(username, projectId, projectName, orchestratorId, version, envDSSLabel, workspace);
+ Message message = Message.ok("回滚版本成功").data("newVersion", newVersion);
+ return Message.messageToResponse(message);
+ } catch (final Throwable t) {
+ LOGGER.error("Failed to rollback orchestrator for user {} orchestratorId {}, projectId {} version {}",
+ username, orchestratorId, projectId, version, t);
+ return Message.messageToResponse(Message.error("回滚工作流版本失败"));
+ }
+ }
+
+ @POST
+ @Path("/openOrchestrator")
+ public Response openOrchestrator(@Context HttpServletRequest req, JsonNode json) throws Exception {
+ String openUrl = "";
+ String userName = SecurityFilter.getLoginUsername(req);
+ List dssLabelList = getDSSLabelList(json);
+ String workspaceName = json.get("workspaceName").getTextValue();
+ Long orchestratorId = json.get("orchestratorId").getLongValue();
+ openUrl = orchestratorService.openOrchestrator(userName, workspaceName, orchestratorId, dssLabelList);
+ OrchestratorVo orchestratorVo = orchestratorService.getOrchestratorVoById(orchestratorId);
+ LOGGER.info("open url is {}, orcId is {}, dssLabels is {}", openUrl, orchestratorId, dssLabelList);
+ return Message.messageToResponse(Message.ok().
+ data("OrchestratorOpenUrl", openUrl).
+ data("OrchestratorVo", orchestratorVo));
+ }
+
+ /**
+ * 获取编排模式下的所有版本号
+ *
+ * @param queryOrchestratorVersion
+ * @return
+ * @throws Exception
+ */
+ @POST
+ @Path("/getVersionByOrchestratorId")
+ public Response getVersionByOrchestratorId(@Valid QueryOrchestratorVersion queryOrchestratorVersion) throws Exception {
+ List list = orchestratorService.getVersionByOrchestratorId(queryOrchestratorVersion.getOrchestratorId());
+ return Message.messageToResponse(Message.ok().data("list", list));
+ }
+
+ //生成label list
+ public List getDSSLabelList(JsonNode json) {
+ JsonNode labelJsonNode = json.get(DSSCommonUtils.DSS_LABELS_KEY);
+ String dssLabel = labelJsonNode.get(LabelKeyConvertor.ROUTE_LABEL_KEY).getTextValue();
+ List dssLabelList = Arrays.asList(new EnvDSSLabel(dssLabel));
+ return dssLabelList;
+ }
+}
diff --git a/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/service/OrchestratorPluginService.java b/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/service/OrchestratorPluginService.java
new file mode 100644
index 0000000000..f329849593
--- /dev/null
+++ b/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/service/OrchestratorPluginService.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.orchestrator.server.service;
+
+import com.webank.wedatasphere.dss.orchestrator.common.protocol.RequestFrameworkConvertOrchestration;
+import com.webank.wedatasphere.dss.orchestrator.common.protocol.ResponseConvertOrchestrator;
+
+
+public interface OrchestratorPluginService {
+
+ ResponseConvertOrchestrator convertOrchestration(RequestFrameworkConvertOrchestration requestConversionOrchestration);
+
+ ResponseConvertOrchestrator getConvertOrchestrationStatus(String id);
+
+}
diff --git a/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/service/OrchestratorService.java b/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/service/OrchestratorService.java
new file mode 100644
index 0000000000..beefda5eb5
--- /dev/null
+++ b/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/service/OrchestratorService.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.orchestrator.server.service;
+
+
+import com.webank.wedatasphere.dss.common.label.DSSLabel;
+import com.webank.wedatasphere.dss.orchestrator.common.entity.DSSOrchestratorInfo;
+import com.webank.wedatasphere.dss.orchestrator.common.entity.DSSOrchestratorVersion;
+import com.webank.wedatasphere.dss.orchestrator.common.entity.OrchestratorVo;
+import com.webank.wedatasphere.dss.standard.app.sso.Workspace;
+import java.util.List;
+
+
+public interface OrchestratorService {
+ /**
+ * 新建编排,实例化一个用户的Orchestrator,并创建数据库记录
+ *
+ * @param dssOrchestratorInfo
+ * @return
+ */
+ OrchestratorVo createOrchestrator(String userName,
+ String workspaceName,
+ String projectName,
+ Long projectId,
+ String description,
+ DSSOrchestratorInfo dssOrchestratorInfo,
+ List dssLabels) throws Exception;
+
+
+ /**
+ * 更新编排,更新编排的基本信息
+ *
+ * @param dssOrchestratorInfo
+ */
+ void updateOrchestrator(String userName,
+ String workspaceName,
+ DSSOrchestratorInfo dssOrchestratorInfo,
+ List dssLabels) throws Exception;
+
+ /**
+ * 删除编排,根据编排ID删除一个编排
+ *
+ * @param orchestratorInfoId
+ */
+ void deleteOrchestrator(String userName,
+ String workspaceName,
+ String projectName,
+ Long orchestratorInfoId,
+ List dssLabels) throws Exception;
+
+
+ /**
+ * 返回一个编排,包含编排的基本信息和最新版本信息
+ *
+ * @param orchestratorId
+ * @return
+ */
+ OrchestratorVo getOrchestratorVoById(Long orchestratorId);
+
+ /**
+ * 根据一个集合查找
+ *
+ * @param orchestratorIds
+ * @return
+ */
+
+ List getOrchestratorVoList(List orchestratorIds);
+
+ String openOrchestrator(String userName, String workspaceName, Long orchestratorId, List dssLabels) throws Exception;
+ /**
+ * 获取编排模式下的版本号
+ *
+ * @param orchestratorId
+ * @return
+ */
+ List getVersionByOrchestratorId(Long orchestratorId);
+
+// OrchestratorInfo getOrchestratorInfo(String username, Long workflowId);
+
+ List getOrchestratorVersions(String username, Long projectId, Long orchestratorId);
+
+ String rollbackOrchestrator(String username, Long projectId, String projectName,
+ Long orchestratorId, String version, DSSLabel dssLabel, Workspace workspace) throws Exception;
+
+}
diff --git a/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/service/impl/OrchestratorPluginServiceImpl.java b/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/service/impl/OrchestratorPluginServiceImpl.java
new file mode 100644
index 0000000000..b00762ef34
--- /dev/null
+++ b/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/service/impl/OrchestratorPluginServiceImpl.java
@@ -0,0 +1,160 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.orchestrator.server.service.impl;
+
+import com.webank.wedatasphere.dss.common.entity.project.DSSProject;
+import com.webank.wedatasphere.dss.common.label.DSSLabel;
+import com.webank.wedatasphere.dss.common.utils.DSSExceptionUtils;
+import com.webank.wedatasphere.dss.orchestrator.common.entity.DSSOrchestratorInfo;
+import com.webank.wedatasphere.dss.orchestrator.common.entity.DSSOrchestratorVersion;
+import com.webank.wedatasphere.dss.orchestrator.common.entity.OrchestratorInfo;
+import com.webank.wedatasphere.dss.orchestrator.common.protocol.RequestFrameworkConvertOrchestration;
+import com.webank.wedatasphere.dss.orchestrator.common.protocol.ResponseConvertOrchestrator;
+import com.webank.wedatasphere.dss.orchestrator.common.protocol.ResponseOperateOrchestrator;
+import com.webank.wedatasphere.dss.orchestrator.core.DSSOrchestratorContext;
+import com.webank.wedatasphere.dss.orchestrator.db.dao.OrchestratorMapper;
+import com.webank.wedatasphere.dss.orchestrator.publish.ExportDSSOrchestratorPlugin;
+import com.webank.wedatasphere.dss.orchestrator.publish.job.ConversionJobEntity;
+import com.webank.wedatasphere.dss.orchestrator.publish.job.OrchestratorConversionJob;
+import com.webank.wedatasphere.dss.orchestrator.server.service.OrchestratorPluginService;
+import com.webank.wedatasphere.dss.standard.app.sso.Workspace;
+import com.webank.wedatasphere.linkis.common.utils.Utils;
+import com.webank.wedatasphere.linkis.manager.label.builder.factory.LabelBuilderFactoryContext;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.atomic.AtomicInteger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+
+public class OrchestratorPluginServiceImpl implements OrchestratorPluginService {
+
+ private final Logger LOGGER = LoggerFactory.getLogger(getClass());
+
+ @Autowired
+ private OrchestratorMapper orchestratorMapper;
+
+ @Autowired
+ private DSSOrchestratorContext dssOrchestratorContext;
+
+ private ExecutorService releaseThreadPool = Utils.newCachedThreadPool(50, "Convert-Orchestration-Thread-", true);
+ private Map orchestratorConversionJobMap = new ConcurrentHashMap<>();
+ private AtomicInteger idGenerator = new AtomicInteger();
+
+ @Override
+ public ResponseConvertOrchestrator convertOrchestration(RequestFrameworkConvertOrchestration requestConversionOrchestration) {
+ Long toPublishOrcId;
+ if(requestConversionOrchestration.getOrcAppId() != null) {
+ OrchestratorInfo orchestratorInfo = orchestratorMapper.getOrcInfoByAppId(requestConversionOrchestration.getOrcAppId());
+ toPublishOrcId = orchestratorInfo.getOrchestratorId();
+ } else if(requestConversionOrchestration.getOrcIds() != null && !requestConversionOrchestration.getOrcIds().isEmpty()) {
+ toPublishOrcId = requestConversionOrchestration.getOrcIds().get(0);
+ } else {
+ return new ResponseConvertOrchestrator("-1", ResponseOperateOrchestrator.failed("Both orcAppId and orcIds are not exists."));
+ }
+ DSSOrchestratorInfo dssOrchestratorInfo = orchestratorMapper.getOrchestrator(toPublishOrcId);
+ long projectId = dssOrchestratorInfo.getProjectId();
+ //把orcId装车第三方的AppId
+ List refAppIdList = new ArrayList<>();
+ List publishedOrcIds;
+ List labels = LabelBuilderFactoryContext.getLabelBuilderFactory().getLabels(requestConversionOrchestration.getLabels());
+ if(requestConversionOrchestration.isConvertAllOrcs()) {
+ //这个地方应该是要获取所有的已经发布过的orchestrator
+ publishedOrcIds = orchestratorMapper.getAllOrcIdsByProjectId(projectId);
+ if (!publishedOrcIds.contains(toPublishOrcId)){
+ publishedOrcIds.add(toPublishOrcId);
+ }
+ for (Long orcId : publishedOrcIds) {
+ DSSOrchestratorVersion dssOrchestratorVersion = orchestratorMapper.getLatestOrchestratorVersionById(orcId);
+ refAppIdList.add(dssOrchestratorVersion.getAppId());
+ }
+ } else {
+ publishedOrcIds = new ArrayList<>();
+ if(requestConversionOrchestration.getOrcAppId() != null) {
+ publishedOrcIds.add(toPublishOrcId);
+ DSSOrchestratorVersion dssOrchestratorVersion = orchestratorMapper.getLatestOrchestratorVersionById(toPublishOrcId);
+ refAppIdList.add(dssOrchestratorVersion.getAppId());
+ }
+ if(requestConversionOrchestration.getOrcIds() != null && !requestConversionOrchestration.getOrcIds().isEmpty()) {
+ for (Long orcId : requestConversionOrchestration.getOrcIds()) {
+ DSSOrchestratorVersion dssOrchestratorVersion = orchestratorMapper.getLatestOrchestratorVersionById(orcId);
+ publishedOrcIds.add(orcId);
+ refAppIdList.add(dssOrchestratorVersion.getAppId());
+ }
+ }
+ }
+ OrchestratorConversionJob job = new OrchestratorConversionJob();
+ job.setId(generateId());
+ ConversionJobEntity entity = new ConversionJobEntity();
+ entity.setResponse(ResponseOperateOrchestrator.inited());
+ entity.setCreateTime(new Date());
+ entity.setUserName(requestConversionOrchestration.getUserName());
+ entity.setOrcIdList(publishedOrcIds);
+ entity.setRefAppIdList(refAppIdList);
+ entity.setLabels(labels);
+ entity.setWorkspace((Workspace) requestConversionOrchestration.getWorkspace());
+ DSSProject dssProject = new DSSProject();
+ dssProject.setId(projectId);
+ entity.setProject(dssProject);
+ job.setConversionJobEntity(entity);
+ job.setConversionDSSOrchestratorPlugins(dssOrchestratorContext.getOrchestratorPlugins());
+ job.afterConversion(response -> this.updateDBAfterConversion(response, job, requestConversionOrchestration));
+ //submit it
+ releaseThreadPool.submit(job);
+ orchestratorConversionJobMap.put(job.getId(), job);
+ return new ResponseConvertOrchestrator(job.getId(), entity.getResponse());
+ }
+
+ @Override
+ public ResponseConvertOrchestrator getConvertOrchestrationStatus(String id) {
+ OrchestratorConversionJob job = orchestratorConversionJobMap.get(id);
+ if(job.getConversionJobEntity().getResponse().isCompleted()) {
+ orchestratorConversionJobMap.remove(id);
+ }
+ return new ResponseConvertOrchestrator(job.getId(), job.getConversionJobEntity().getResponse());
+ }
+
+ private String generateId() {
+ return String.valueOf(idGenerator.getAndIncrement());
+ }
+
+ @Transactional(rollbackFor = Exception.class)
+ private void updateDBAfterConversion(ResponseOperateOrchestrator response,
+ OrchestratorConversionJob job,
+ RequestFrameworkConvertOrchestration requestConversionOrchestration) {
+ LOGGER.info("{} completed with status {}.", job.getId(), response.getJobStatus());
+ if(response.isSucceed()) {
+ //1. 进行导出,用于升级版本,目的是为了复用原来的代码
+ List orcIdList = job.getConversionJobEntity().getOrcIdList();
+ orcIdList.forEach(DSSExceptionUtils.handling(orcId -> {
+ DSSOrchestratorInfo dssOrchestratorInfo = orchestratorMapper.getOrchestrator(orcId);
+ dssOrchestratorContext.getDSSOrchestratorPlugin(ExportDSSOrchestratorPlugin.class)
+ .orchestratorVersionIncrease(orcId, job.getConversionJobEntity().getUserName(), requestConversionOrchestration.getComment(),
+ requestConversionOrchestration.getWorkspace().getWorkspaceName(), dssOrchestratorInfo,
+ job.getConversionJobEntity().getProject().getName(), job.getConversionJobEntity().getLabels());
+ }));
+ //2. 做一个标记表示已经发布过了
+ orcIdList.forEach(orchestratorMapper::setPublished);
+ }
+ }
+}
diff --git a/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/service/impl/OrchestratorServiceImpl.java b/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/service/impl/OrchestratorServiceImpl.java
new file mode 100644
index 0000000000..d9e37e1dee
--- /dev/null
+++ b/dss-framework/dss-framework-orchestrator-server/src/main/java/com/webank/wedatasphere/dss/orchestrator/server/service/impl/OrchestratorServiceImpl.java
@@ -0,0 +1,376 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.orchestrator.server.service.impl;
+
+import com.webank.wedatasphere.dss.appconn.core.AppConn;
+import com.webank.wedatasphere.dss.appconn.manager.AppConnManager;
+import com.webank.wedatasphere.dss.common.exception.DSSErrorException;
+import com.webank.wedatasphere.dss.common.label.DSSLabel;
+import com.webank.wedatasphere.dss.common.utils.DSSExceptionUtils;
+import com.webank.wedatasphere.dss.contextservice.service.ContextService;
+import com.webank.wedatasphere.dss.orchestrator.common.entity.DSSOrchestratorInfo;
+import com.webank.wedatasphere.dss.orchestrator.common.entity.DSSOrchestratorVersion;
+import com.webank.wedatasphere.dss.orchestrator.common.entity.OrchestratorVo;
+import com.webank.wedatasphere.dss.orchestrator.core.DSSOrchestrator;
+import com.webank.wedatasphere.dss.orchestrator.core.exception.DSSOrchestratorErrorException;
+import com.webank.wedatasphere.dss.orchestrator.common.ref.OrchestratorCopyRequestRef;
+import com.webank.wedatasphere.dss.orchestrator.common.ref.OrchestratorCopyResponseRef;
+import com.webank.wedatasphere.dss.orchestrator.common.ref.OrchestratorCreateRequestRef;
+import com.webank.wedatasphere.dss.orchestrator.common.ref.OrchestratorDeleteRequestRef;
+import com.webank.wedatasphere.dss.orchestrator.common.ref.OrchestratorOpenRequestRef;
+import com.webank.wedatasphere.dss.orchestrator.common.ref.OrchestratorUpdateRef;
+import com.webank.wedatasphere.dss.orchestrator.core.utils.OrchestratorUtils;
+import com.webank.wedatasphere.dss.orchestrator.db.dao.OrchestratorMapper;
+import com.webank.wedatasphere.dss.orchestrator.loader.OrchestratorManager;
+import com.webank.wedatasphere.dss.orchestrator.loader.utils.OrchestratorLoaderUtils;
+import com.webank.wedatasphere.dss.orchestrator.server.service.OrchestratorService;
+import com.webank.wedatasphere.dss.standard.app.development.ref.CommonResponseRef;
+import com.webank.wedatasphere.dss.standard.app.development.ref.UrlResponseRef;
+import com.webank.wedatasphere.dss.standard.app.development.service.RefCRUDService;
+import com.webank.wedatasphere.dss.standard.app.development.service.RefQueryService;
+import com.webank.wedatasphere.dss.standard.app.development.standard.DevelopmentIntegrationStandard;
+import com.webank.wedatasphere.dss.standard.app.sso.Workspace;
+import com.webank.wedatasphere.dss.standard.common.desc.AppInstance;
+import com.webank.wedatasphere.dss.standard.common.entity.ref.AppConnRefFactoryUtils;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.UUID;
+import javafx.util.Pair;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+
+
+@Service
+public class OrchestratorServiceImpl implements OrchestratorService {
+ private static final Logger LOGGER = LoggerFactory.getLogger(OrchestratorServiceImpl.class);
+ @Autowired
+ private OrchestratorManager orchestratorManager;
+ @Autowired
+ private OrchestratorMapper orchestratorMapper;
+ @Autowired
+ private ContextService contextService;
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public OrchestratorVo createOrchestrator(String userName,
+ String workspaceName,
+ String projectName,
+ Long projectId,
+ String description,
+ DSSOrchestratorInfo dssOrchestratorInfo,
+ List dssLabels) throws Exception {
+ OrchestratorVo orchestratorVo = new OrchestratorVo();
+ //todo 增加校验
+ String uuid = UUID.randomUUID().toString();
+
+ //作为Orchestrator的唯一标识,包括跨环境导入导出也不发生变化。
+ dssOrchestratorInfo.setUUID(uuid);
+ orchestratorMapper.addOrchestrator(dssOrchestratorInfo);
+ Pair standMap = OrchestratorLoaderUtils.getOrcDevelopStandard(userName, workspaceName, dssOrchestratorInfo, dssLabels);
+ DSSOrchestrator dssOrchestrator = orchestratorManager.getOrCreateOrchestrator(userName,
+ workspaceName, dssOrchestratorInfo.getType(), dssOrchestratorInfo.getAppConnName(), dssLabels);
+ AppConn orchestratorAppConn = dssOrchestrator.getAppConn();
+ if (null != standMap && null != orchestratorAppConn) {
+ //访问工作流微模块创建工作流
+ OrchestratorCreateRequestRef ref = AppConnRefFactoryUtils.newAppConnRef(OrchestratorCreateRequestRef.class,
+ orchestratorAppConn.getClass().getClassLoader(), dssOrchestratorInfo.getType());
+ if (null != ref) {
+ ref.setUserName(userName);
+ ref.setWorkspaceName(workspaceName);
+ ref.setProjectName(projectName);
+ ref.setProjectId(projectId);
+ ref.setDssOrchestratorInfo(dssOrchestratorInfo);
+ String version = OrchestratorUtils.generateNewVersion();
+ String contextId = contextService.createContextID(workspaceName, projectName, dssOrchestratorInfo.getName(), version, userName);
+ ref.setContextID(contextId);
+ LOGGER.info("Create a new ContextId: {} ", contextId);
+ RefCRUDService crudService =standMap.getValue().getRefCRUDService(standMap.getKey());
+ if (crudService != null) {
+ CommonResponseRef appRef = (CommonResponseRef) crudService
+ .getRefCreationOperation().createRef(ref);
+ if (null != appRef) {
+ DSSOrchestratorVersion dssOrchestratorVersion = new DSSOrchestratorVersion();
+ dssOrchestratorVersion.setOrchestratorId(dssOrchestratorInfo.getId());
+ dssOrchestratorVersion.setAppId(appRef.getOrcId());
+ dssOrchestratorVersion.setContent(appRef.getContent());
+ dssOrchestratorVersion.setComment(description);
+ dssOrchestratorVersion.setProjectId(projectId);
+ dssOrchestratorVersion.setSource("Orchestrator create");
+ dssOrchestratorVersion.setUpdater(userName);
+ dssOrchestratorVersion.setVersion(version);
+ dssOrchestratorVersion.setUpdateTime(new Date());
+ dssOrchestratorVersion.setFormatContextId(contextId);
+ orchestratorMapper.addOrchestratorVersion(dssOrchestratorVersion);
+ orchestratorVo.setDssOrchestratorInfo(dssOrchestratorInfo);
+ orchestratorVo.setDssOrchestratorVersion(dssOrchestratorVersion);
+ } else {
+ LOGGER.error("create ref return appRef is null");
+ throw new DSSErrorException(100068, "Use appInstance create workflow failed!");
+ }
+ } else {
+ LOGGER.error("crudService is null can not continue");
+ throw new DSSErrorException(60092, "create crudService is null");
+ }
+ } else {
+ LOGGER.error("ref is null can not continue");
+ throw new DSSErrorException(60093, "ref is null can not continue");
+ }
+ } else {
+ throw new DSSErrorException(100069, "Can not find correct devCRUDService");
+ }
+ return orchestratorVo;
+ }
+
+ @Override
+ public void updateOrchestrator(String userName,
+ String workspaceName,
+ DSSOrchestratorInfo dssOrchestratorInfo,
+ List dssLabels) throws Exception {
+ orchestratorMapper.updateOrchestrator(dssOrchestratorInfo);
+ DSSOrchestratorVersion dssOrchestratorVersion = orchestratorMapper.getLatestOrchestratorVersionById(dssOrchestratorInfo.getId());
+
+ //todo 目前写死为工作流,这里应该是要和dssOrchestratorInfo.type作为参数传入
+ AppConn appConn = AppConnManager.getAppConnManager().getAppConn("workflow");
+ if(appConn==null){
+ LOGGER.error("appConn is null,not update workflow");
+ return;
+ }
+ OrchestratorUpdateRef orchestratorUpdateRef = AppConnRefFactoryUtils.newAppConnRef(OrchestratorUpdateRef.class,
+ appConn.getClass().getClassLoader(), dssOrchestratorInfo.getType());
+ if (orchestratorUpdateRef != null) {
+ orchestratorUpdateRef.setOrcId(dssOrchestratorVersion.getAppId());
+ orchestratorUpdateRef.setUserName(userName);
+ orchestratorUpdateRef.setDescription(dssOrchestratorInfo.getComment());
+ orchestratorUpdateRef.setOrcName(dssOrchestratorInfo.getName());
+ orchestratorUpdateRef.setUses(dssOrchestratorInfo.getUses());
+ //update ref orchestrator info
+ Pair standMap = OrchestratorLoaderUtils.getOrcDevelopStandard(userName, workspaceName, dssOrchestratorInfo, dssLabels);
+ if (null != standMap ) {
+ RefCRUDService crudService = standMap.getValue().getRefCRUDService(standMap.getKey());
+ if (null != crudService) {
+ crudService.getRefUpdateOperation().updateRef(orchestratorUpdateRef);
+ }
+ } else {
+ LOGGER.error("processService is null,can not do crud service");
+ DSSExceptionUtils.dealErrorException(60056, "process service is null, can not do crud", DSSErrorException.class);
+ }
+
+ } else {
+ LOGGER.error("update ref is null, can not continue doing");
+ DSSExceptionUtils.dealErrorException(61123, "update ref is null, can not continue doing", DSSErrorException.class);
+ }
+
+ }
+
+ @Override
+ public void deleteOrchestrator(String userName,
+ String workspaceName,
+ String projectName,
+ Long orchestratorInfoId,
+ List dssLabels) throws Exception {
+
+ DSSOrchestratorInfo dssOrchestratorInfo = orchestratorMapper.getOrchestrator(orchestratorInfoId);
+ if(null== dssOrchestratorInfo){
+ LOGGER.error("dssOrchestratorInfo is null,no need to delete");
+ return;
+ }
+ DSSOrchestratorVersion dssOrchestratorVersion = orchestratorMapper.getLatestOrchestratorVersionById(orchestratorInfoId);
+
+ //todo 是否需要删除版本信息
+
+ //todo 删除版本信息对应的工作流信息
+
+ OrchestratorDeleteRequestRef orchestratorDeleteRequestRef = null;
+ try {
+ //todo 目前写死为工作流,这里应该是要和dssOrchestratorInfo.type作为参数传入
+ AppConn appConn = AppConnManager.getAppConnManager().getAppConn(dssOrchestratorInfo.getType());
+ if(appConn == null){
+ LOGGER.error("appConn is null, not delete {}." + dssOrchestratorInfo.getType());
+ return;
+ }
+ orchestratorDeleteRequestRef = AppConnRefFactoryUtils.newAppConnRefByPackageName(OrchestratorDeleteRequestRef.class,
+ appConn.getClass().getClassLoader(), appConn.getClass().getPackage().getName());
+ } catch (Exception e) {
+ LOGGER.error("Failed to create a new ref for {}.", OrchestratorDeleteRequestRef.class, e);
+ }
+ assert orchestratorDeleteRequestRef != null;
+ Pair standMap = OrchestratorLoaderUtils.getOrcDevelopStandard(userName, workspaceName, dssOrchestratorInfo, dssLabels);
+
+ RefCRUDService refCRUDService = standMap.getValue().getRefCRUDService (standMap.getKey());
+
+ //删除只需要
+ orchestratorDeleteRequestRef.setAppId(dssOrchestratorVersion.getAppId());
+ orchestratorDeleteRequestRef.setOrcId(orchestratorInfoId);
+ orchestratorDeleteRequestRef.setUserName(userName);
+ orchestratorDeleteRequestRef.setDSSLabels(dssLabels);
+ if (null != refCRUDService) {
+ refCRUDService.getRefDeletionOperation().deleteRef(orchestratorDeleteRequestRef);
+ }
+
+ orchestratorMapper.deleteOrchestrator(orchestratorInfoId);
+ }
+
+ @Override
+ public List getOrchestratorVoList(List orchestratorIds) {
+ List orchestratorVoList = new ArrayList<>();
+ orchestratorIds.stream().forEach(orchestratorId -> {
+ OrchestratorVo orchestratorVo = getOrchestratorVoById(orchestratorId);
+ orchestratorVoList.add(orchestratorVo);
+ });
+ return orchestratorVoList;
+ }
+
+ @Override
+ public String openOrchestrator(String userName, String workspaceName, Long orchestratorId, List dssLabels) throws Exception {
+ DSSOrchestratorInfo dssOrchestratorInfo = orchestratorMapper.getOrchestrator(orchestratorId);
+ DSSOrchestratorVersion dssOrchestratorVersion = orchestratorMapper.getLatestOrchestratorVersionById(orchestratorId);
+ if (null == dssOrchestratorInfo || null == dssOrchestratorVersion) {
+ throw new DSSOrchestratorErrorException(1000856, "can not find orc from db for orcId: " + orchestratorId);
+ }
+ OrchestratorOpenRequestRef orchestratorOpenRequestRef = null;
+ Pair standMap = OrchestratorLoaderUtils.getOrcDevelopStandard(userName, workspaceName, dssOrchestratorInfo, dssLabels);
+
+ DSSOrchestrator dssOrchestrator = orchestratorManager.getOrCreateOrchestrator(userName,
+ workspaceName, dssOrchestratorInfo.getType(), dssOrchestratorInfo.getAppConnName(), dssLabels);
+ AppConn orchestratorAppConn = dssOrchestrator.getAppConn();
+
+ try {
+ orchestratorOpenRequestRef = AppConnRefFactoryUtils.newAppConnRefByPackageName(OrchestratorOpenRequestRef.class,
+ orchestratorAppConn.getClass().getClassLoader(), orchestratorAppConn.getClass().getPackage().getName());
+ } catch (final Exception e) {
+ LOGGER.error("Failed to open a new ref for {}", OrchestratorOpenRequestRef.class, e);
+ }
+ assert orchestratorOpenRequestRef != null;
+ RefQueryService refQueryService =standMap.getValue().getRefQueryService (standMap.getKey());
+
+ orchestratorOpenRequestRef.setRefAppId(dssOrchestratorVersion.getAppId());
+ orchestratorOpenRequestRef.setOrchestratorId(orchestratorId);
+ orchestratorOpenRequestRef.setUserName(userName);
+ orchestratorOpenRequestRef.setSecondaryType(dssOrchestratorInfo.getSecondaryType());
+ orchestratorOpenRequestRef.setDSSLabels(dssLabels);
+ if (null != refQueryService) {
+ UrlResponseRef urlResponseRef=(UrlResponseRef) refQueryService.getRefQueryOperation().query(orchestratorOpenRequestRef);
+ return urlResponseRef.getUrl();
+ }
+ return null;
+ }
+
+ @Override
+ public OrchestratorVo getOrchestratorVoById(Long orchestratorId) {
+
+ DSSOrchestratorInfo dssOrchestratorInfo = orchestratorMapper.getOrchestrator(orchestratorId);
+ DSSOrchestratorVersion dssOrchestratorVersion = orchestratorMapper.getLatestOrchestratorVersionById(orchestratorId);
+
+ OrchestratorVo orchestratorVo = new OrchestratorVo();
+ orchestratorVo.setDssOrchestratorInfo(dssOrchestratorInfo);
+ orchestratorVo.setDssOrchestratorVersion(dssOrchestratorVersion);
+ return orchestratorVo;
+ }
+
+ @Override
+ public List getVersionByOrchestratorId(Long orchestratorId) {
+ return orchestratorMapper.getVersionByOrchestratorId(orchestratorId);
+ }
+
+// @Override
+// public OrchestratorInfo getOrchestratorInfo(String username, Long workflowId) {
+// LOGGER.info("{} ask the orcInfo for workflowId {}", username, workflowId);
+// OrchestratorInfo orchestratorInfo = orchestratorMapper.getOrcInfoByAppId(workflowId);
+// LOGGER.info("workflowId is {} , orcId is {}, orcVersionId is {}", workflowId, orchestratorInfo.getOrchestratorId(), orchestratorInfo.getOrchestratorVersionId());
+// return orchestratorInfo;
+// }
+
+ @Override
+ public List getOrchestratorVersions(String username, Long projectId, Long orchestratorId) {
+ LOGGER.info("user {} wants to get orc versions in projectId {} for orcId {}", username, projectId, orchestratorId);
+ List orchestratorVersions = orchestratorMapper.getOrchestratorVersions(projectId, orchestratorId);
+ LOGGER.info("projectId is {} , orcId is {}, orcVersions are {}", projectId, orchestratorId, orchestratorVersions);
+ return orchestratorVersions;
+ }
+
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public String rollbackOrchestrator(String userName, Long projectId, String projectName,
+ Long orchestratorId, String version, DSSLabel dssLabel, Workspace workspace) throws Exception {
+ //1.新建一个版本
+ //2.然后将version的版本内容进行去workflow进行cp
+ //3.然后把生产的内容进行update到数据库
+ String latestVersion = orchestratorMapper.getLatestVersion(orchestratorId);
+ List labels = new ArrayList<>();
+ labels.add(dssLabel);
+ DSSOrchestratorInfo dssOrchestratorInfo = orchestratorMapper.getOrchestrator(orchestratorId);
+ String newVersion = OrchestratorUtils.increaseVersion(latestVersion);
+ DSSOrchestratorVersion dssOrchestratorVersion = new DSSOrchestratorVersion();
+ dssOrchestratorVersion.setId(orchestratorId);
+ dssOrchestratorVersion.setVersion(newVersion);
+ dssOrchestratorVersion.setUpdateTime(new Date());
+ dssOrchestratorVersion.setProjectId(projectId);
+ dssOrchestratorVersion.setUpdater(userName);
+ dssOrchestratorVersion.setComment("回滚工作流到版本:" + version);
+ dssOrchestratorVersion.setSource("rollback from version :" + version);
+ Long appId = orchestratorMapper.getAppIdByVersion(orchestratorId, version);
+
+ Pair standMap = OrchestratorLoaderUtils.getOrcDevelopStandard(userName, workspace.getWorkspaceName(), dssOrchestratorInfo, labels);
+
+ if(standMap == null){
+ LOGGER.error("dev stand Service is null");
+ throw new DSSErrorException(61105, "dev stand Service is null");
+ }
+ RefCRUDService refcrudservice = standMap.getValue().getRefCRUDService(standMap.getKey());
+ if (null != refcrudservice) {
+ try {
+ OrchestratorCopyRequestRef orchestratorCopyRequestRef =
+ AppConnRefFactoryUtils.newAppConnRef(OrchestratorCopyRequestRef.class,
+ refcrudservice.getClass().getClassLoader(), dssOrchestratorInfo.getType());
+ orchestratorCopyRequestRef.setCopyOrcAppId(appId);
+ orchestratorCopyRequestRef.setCopyOrcVersionId(dssOrchestratorVersion.getOrchestratorId());
+ orchestratorCopyRequestRef.setUserName(userName);
+ Field field = orchestratorCopyRequestRef.getClass().getDeclaredField("projectName");
+ field.setAccessible(true);
+ field.set(orchestratorCopyRequestRef, projectName);
+
+ //5、生成上下文ContextId
+ String contextId = contextService.createContextID(workspace.getWorkspaceName(), projectName, dssOrchestratorInfo.getName(), dssOrchestratorVersion.getVersion(), userName);
+ dssOrchestratorVersion.setContextId(contextId);
+ LOGGER.info("Create a new ContextId for import: {} ", contextId);
+
+ orchestratorCopyRequestRef.setContextID(contextId);
+ OrchestratorCopyResponseRef orchestratorCopyResponseRef =
+ (OrchestratorCopyResponseRef) refcrudservice.getRefCopyOperation().copyRef(orchestratorCopyRequestRef);
+ dssOrchestratorVersion.setAppId(orchestratorCopyResponseRef.getCopyTargetAppId());
+ dssOrchestratorVersion.setContent(orchestratorCopyResponseRef.getCopyTargetContent());
+ dssOrchestratorVersion.setFormatContextId(contextId);
+ //update appConn node contextId
+ orchestratorMapper.addOrchestratorVersion(dssOrchestratorVersion);
+ } catch (final Throwable t) {
+ LOGGER.error("Faild to copy app in orchestrator server", t);
+ DSSExceptionUtils.dealErrorException(60099, "Faild to copy app in orchestrator server", t, DSSOrchestratorErrorException.class);
+ }
+ return dssOrchestratorVersion.getVersion();
+ } else {
+ throw new DSSOrchestratorErrorException(10023, "获取第三方应用的Ref为空,不能完成拷贝操作!");
+ }
+ }
+
+}
diff --git a/dss-framework/dss-framework-orchestrator-server/src/main/scala/com/webank/wedatasphere/dss/orchestrator/server/DSSOrchestratorServerApplication.scala b/dss-framework/dss-framework-orchestrator-server/src/main/scala/com/webank/wedatasphere/dss/orchestrator/server/DSSOrchestratorServerApplication.scala
new file mode 100644
index 0000000000..848f1ea22e
--- /dev/null
+++ b/dss-framework/dss-framework-orchestrator-server/src/main/scala/com/webank/wedatasphere/dss/orchestrator/server/DSSOrchestratorServerApplication.scala
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.orchestrator.server
+
+import com.webank.wedatasphere.dss.common.utils.DSSMainHelper
+import com.webank.wedatasphere.linkis.DataWorkCloudApplication
+import com.webank.wedatasphere.linkis.common.utils.{Logging, Utils}
+
+
+object DSSOrchestratorServerApplication extends Logging {
+
+ val userName: String = System.getProperty("user.name")
+ val hostName: String = Utils.getComputerName
+
+ def main(args: Array[String]): Unit = {
+ val serviceName = System.getProperty("serviceName")//ProjectConf.SERVICE_NAME.getValue
+ DSSMainHelper.formatPropertyFiles(serviceName)
+ val allArgs = args ++ DSSMainHelper.getExtraSpringOptions
+ System.setProperty("hostName", hostName)
+ System.setProperty("userName", userName)
+ info(s"Ready to start $serviceName with args: ${allArgs.toList}.")
+ println(s"Test Ready to start $serviceName with args: ${allArgs.toList}.")
+ DataWorkCloudApplication.main(allArgs)
+ }
+}
\ No newline at end of file
diff --git a/dss-framework/dss-framework-orchestrator-server/src/main/scala/com/webank/wedatasphere/dss/orchestrator/server/receiver/DSSOrchestratorChooser.scala b/dss-framework/dss-framework-orchestrator-server/src/main/scala/com/webank/wedatasphere/dss/orchestrator/server/receiver/DSSOrchestratorChooser.scala
new file mode 100644
index 0000000000..c5ccda43c6
--- /dev/null
+++ b/dss-framework/dss-framework-orchestrator-server/src/main/scala/com/webank/wedatasphere/dss/orchestrator/server/receiver/DSSOrchestratorChooser.scala
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.orchestrator.server.receiver
+
+import com.webank.wedatasphere.dss.orchestrator.common.protocol._
+import com.webank.wedatasphere.dss.orchestrator.core.DSSOrchestratorContext
+import com.webank.wedatasphere.dss.orchestrator.server.service.{OrchestratorPluginService, OrchestratorService}
+import com.webank.wedatasphere.linkis.rpc.{RPCMessageEvent, Receiver, ReceiverChooser}
+import javax.annotation.PostConstruct
+import org.springframework.beans.factory.annotation.Autowired
+import org.springframework.stereotype.Component
+
+
+
+@Component
+class DSSOrchestratorChooser extends ReceiverChooser {
+
+ @Autowired
+ var orchestratorService: OrchestratorService = _
+
+ @Autowired
+ var orchestratorPluginService: OrchestratorPluginService = _
+
+ @Autowired
+ var orchestratorContext: DSSOrchestratorContext = _
+
+ var receiver: Option[DSSOrchestratorReceiver] = _
+
+ @PostConstruct
+ def init(): Unit = receiver = Some(new DSSOrchestratorReceiver(orchestratorService,orchestratorPluginService,orchestratorContext))
+
+ override def chooseReceiver(event: RPCMessageEvent): Option[Receiver] = event.message match {
+ case _: RequestCreateOrchestrator => receiver
+ case _: RequestUpdateOrchestrator => receiver
+ case _: RequestDeleteOrchestrator => receiver
+ case _: RequestExportOrchestrator => receiver
+ case _: RequestImportOrchestrator => receiver
+ case _: RequestQueryOrchestrator => receiver
+ case _: RequestFrameworkConvertOrchestration => receiver
+ case _: RequestFrameworkConvertOrchestrationStatus => receiver
+ case _: RequestOrchestratorVersion => receiver
+ case _ => None
+ }
+}
\ No newline at end of file
diff --git a/dss-framework/dss-framework-orchestrator-server/src/main/scala/com/webank/wedatasphere/dss/orchestrator/server/receiver/DSSOrchestratorReceiver.scala b/dss-framework/dss-framework-orchestrator-server/src/main/scala/com/webank/wedatasphere/dss/orchestrator/server/receiver/DSSOrchestratorReceiver.scala
new file mode 100644
index 0000000000..946b0481b8
--- /dev/null
+++ b/dss-framework/dss-framework-orchestrator-server/src/main/scala/com/webank/wedatasphere/dss/orchestrator/server/receiver/DSSOrchestratorReceiver.scala
@@ -0,0 +1,114 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.orchestrator.server.receiver
+
+import java.util
+
+import com.webank.wedatasphere.dss.common.exception.DSSErrorException
+import com.webank.wedatasphere.dss.common.protocol._
+import com.webank.wedatasphere.dss.common.utils.DSSCommonUtils
+import com.webank.wedatasphere.dss.orchestrator.common.entity.OrchestratorVo
+import com.webank.wedatasphere.dss.orchestrator.common.protocol._
+import com.webank.wedatasphere.dss.orchestrator.core.DSSOrchestratorContext
+import com.webank.wedatasphere.dss.orchestrator.publish.{ExportDSSOrchestratorPlugin, ImportDSSOrchestratorPlugin}
+import com.webank.wedatasphere.dss.orchestrator.server.service.{OrchestratorPluginService, OrchestratorService}
+import com.webank.wedatasphere.dss.standard.app.sso.Workspace
+import com.webank.wedatasphere.linkis.rpc.{Receiver, Sender}
+
+import scala.concurrent.duration.Duration
+
+
+
+class DSSOrchestratorReceiver(orchestratorService: OrchestratorService,orchestratorPluginService: OrchestratorPluginService,orchestratorContext: DSSOrchestratorContext) extends Receiver {
+
+ override def receive(message: Any, sender: Sender): Unit = {}
+
+ override def receiveAndReply(message: Any, sender: Sender): Any = message match {
+ case reqCreateOrchestrator: RequestCreateOrchestrator =>
+ val orchestratorVo: OrchestratorVo = orchestratorService.createOrchestrator(reqCreateOrchestrator.getUserName,
+ reqCreateOrchestrator.getWorkspaceName,
+ reqCreateOrchestrator.getProjectName,
+ reqCreateOrchestrator.getProjectId,
+ reqCreateOrchestrator.getDescription,
+ reqCreateOrchestrator.getDssOrchestratorInfo,
+ reqCreateOrchestrator.getDssLabels)
+ ResponseCreateOrchestrator(orchestratorVo.getDssOrchestratorInfo.getId, orchestratorVo.getDssOrchestratorVersion.getId)
+
+ case reqUpdateOrchestrator: RequestUpdateOrchestrator =>
+ orchestratorService.updateOrchestrator(reqUpdateOrchestrator.getUserName,
+ reqUpdateOrchestrator.getWorkspaceName,
+ reqUpdateOrchestrator.getDssOrchestratorInfo,
+ reqUpdateOrchestrator.getDssLabels)
+ ResponseOperateOrchestrator.success()
+
+ case reqDeleteOrchestrator: RequestDeleteOrchestrator =>
+ orchestratorService.deleteOrchestrator(reqDeleteOrchestrator.getUserName,
+ reqDeleteOrchestrator.getWorkspaceName,
+ reqDeleteOrchestrator.getProjectName,
+ reqDeleteOrchestrator.getOrchestratorId,
+ reqDeleteOrchestrator.getDssLabels
+ )
+ ResponseOperateOrchestrator.success()
+
+ case reqExportOrchestrator: RequestExportOrchestrator =>
+ val dssExportOrcResource: util.Map[String, AnyRef] = orchestratorContext.getDSSOrchestratorPlugin(classOf[ExportDSSOrchestratorPlugin]).exportOrchestrator(
+ reqExportOrchestrator.getUserName,
+ reqExportOrchestrator.getWorkspaceName,
+ reqExportOrchestrator.getOrchestratorId,
+ reqExportOrchestrator.getOrcVersionId,
+ reqExportOrchestrator.getProjectName,
+ reqExportOrchestrator.getDssLabels,
+ reqExportOrchestrator.getAddOrcVersion,
+ DSSCommonUtils.COMMON_GSON.fromJson(reqExportOrchestrator.getWorkspaceStr, classOf[Workspace]))
+ ResponseExportOrchestrator(dssExportOrcResource.get("resourceId").toString,
+ dssExportOrcResource.get("version").toString, dssExportOrcResource.get("orcVersionId").asInstanceOf[Long]
+ )
+
+ case requestImportOrchestrator: RequestImportOrchestrator =>
+ val importOrcId = orchestratorContext.getDSSOrchestratorPlugin(classOf[ImportDSSOrchestratorPlugin]).importOrchestrator(
+ requestImportOrchestrator.getUserName,
+ requestImportOrchestrator.getWorkspaceName,
+ requestImportOrchestrator.getProjectName,
+ requestImportOrchestrator.getProjectId,
+ requestImportOrchestrator.getResourceId,
+ requestImportOrchestrator.getBmlVersion,
+ requestImportOrchestrator.getDssLabels,
+ DSSCommonUtils.COMMON_GSON.fromJson(requestImportOrchestrator.getWorkspaceStr, classOf[Workspace]))
+ ResponseImportOrchestrator(importOrcId)
+
+ case requestQueryOrchestrator: RequestQueryOrchestrator =>
+ val requestIdList = requestQueryOrchestrator.getOrchestratorIds
+ val queryOrchestratorList: util.List[OrchestratorVo] = orchestratorService.getOrchestratorVoList(requestIdList)
+ new ResponseQueryOrchestrator(queryOrchestratorList)
+
+ case requestConversionOrchestration: RequestFrameworkConvertOrchestration =>
+ //发布调度
+ orchestratorPluginService.convertOrchestration(requestConversionOrchestration)
+ case requestConversionOrchestrationStatus: RequestFrameworkConvertOrchestrationStatus =>
+ orchestratorPluginService.getConvertOrchestrationStatus(requestConversionOrchestrationStatus.getId)
+
+ case requestOrchestratorVersion: RequestOrchestratorVersion =>
+ val projectId = requestOrchestratorVersion.getProjectId
+ val username = requestOrchestratorVersion.getUsername
+ val orchestratorId = requestOrchestratorVersion.getOrchestratorId
+ val orchestratorVersions = orchestratorService.getOrchestratorVersions(username, projectId, orchestratorId)
+ new ResponseOrchetratorVersion(projectId, orchestratorId, orchestratorVersions)
+ case _ => throw new DSSErrorException(90000, "")
+ }
+
+ override def receiveAndReply(message: Any, duration: Duration, sender: Sender): Any = {}
+}
diff --git a/dss-framework/dss-framework-project-server/bin/start-dss-framework-project-server.sh b/dss-framework/dss-framework-project-server/bin/start-dss-framework-project-server.sh
new file mode 100644
index 0000000000..93242ae192
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/bin/start-dss-framework-project-server.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+cd `dirname $0`
+cd ..
+HOME=`pwd`
+export DWS_ENGINE_MANAGER_HOME=$HOME
+
+export DWS_ENGINE_MANAGER_PID=$HOME/bin/linkis.pid
+
+if [[ -f "${DWS_ENGINE_MANAGER_PID}" ]]; then
+ pid=$(cat ${DWS_ENGINE_MANAGER_PID})
+ if kill -0 ${pid} >/dev/null 2>&1; then
+ echo "DSS SERVER is already running."
+ return 0;
+ fi
+fi
+
+export DWS_ENGINE_MANAGER_LOG_PATH=$HOME/logs
+export DWS_ENGINE_MANAGER_HEAP_SIZE="1G"
+
+export DWS_ENGINE_MANAGER_JAVA_OPTS="-Xms$DWS_ENGINE_MANAGER_HEAP_SIZE -Xmx$DWS_ENGINE_MANAGER_HEAP_SIZE -XX:+UseG1GC -XX:MaxPermSize=500m -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=20013"
+
+#export DWS_ENGINE_MANAGER_JAVA_OPTS="-Xms$DWS_ENGINE_MANAGER_HEAP_SIZE -Xmx$DWS_ENGINE_MANAGER_HEAP_SIZE -XX:+UseG1GC -XX:MaxPermSize=500m"
+
+nohup java $DWS_ENGINE_MANAGER_JAVA_OPTS -cp $HOME/conf:$HOME/lib/* com.webank.wedatasphere.linkis.DataWorkCloudApplication 2>&1 > $DWS_ENGINE_MANAGER_LOG_PATH/linkis.out &
+pid=$!
+if [[ -z "${pid}" ]]; then
+ echo "DSS SERVER start failed!"
+ sleep 1
+ exit 1
+else
+ echo "DSS SERVER start succeeded!"
+ echo $pid > $DWS_ENGINE_MANAGER_PID
+ sleep 1
+fi
+exit 1
\ No newline at end of file
diff --git a/dss-framework/dss-framework-project-server/bin/stop-dss-framework-project-server.sh b/dss-framework/dss-framework-project-server/bin/stop-dss-framework-project-server.sh
new file mode 100644
index 0000000000..2ca464de62
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/bin/stop-dss-framework-project-server.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+cd `dirname $0`
+cd ..
+HOME=`pwd`
+
+export FLOW_ENTRANCE_HOME_PID=$HOME/bin/linkis.pid
+
+function wait_for_FLOW_ENTRANCE_HOME_to_die() {
+ local pid
+ local count
+ pid=$1
+ timeout=$2
+ count=0
+ timeoutTime=$(date "+%s")
+ let "timeoutTime+=$timeout"
+ currentTime=$(date "+%s")
+ forceKill=1
+
+ while [[ $currentTime -lt $timeoutTime ]]; do
+ $(kill ${pid} > /dev/null 2> /dev/null)
+ if kill -0 ${pid} > /dev/null 2>&1; then
+ sleep 3
+ else
+ forceKill=0
+ break
+ fi
+ currentTime=$(date "+%s")
+ done
+
+ if [[ forceKill -ne 0 ]]; then
+ $(kill -9 ${pid} > /dev/null 2> /dev/null)
+ fi
+}
+
+if [[ ! -f "${FLOW_ENTRANCE_HOME_PID}" ]]; then
+ echo "DSS SERVER is not running"
+else
+ pid=$(cat ${FLOW_ENTRANCE_HOME_PID})
+ if [[ -z "${pid}" ]]; then
+ echo "DSS SERVER is not running"
+ else
+ wait_for_FLOW_ENTRANCE_HOME_to_die $pid 40
+ $(rm -f ${FLOW_ENTRANCE_HOME_PID})
+ echo "DSS SERVER is stopped."
+ fi
+fi
\ No newline at end of file
diff --git a/dss-framework/dss-framework-project-server/pom.xml b/dss-framework/dss-framework-project-server/pom.xml
new file mode 100644
index 0000000000..d5b79a300d
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/pom.xml
@@ -0,0 +1,252 @@
+
+
+
+
+
+ dss
+ com.webank.wedatasphere.dss
+ 1.0.0
+
+
+ 4.0.0
+
+ dss-framework-project-server
+
+
+
+ com.webank.wedatasphere.dss
+ dss-framework-common
+ ${dss.version}
+
+
+ commons-math3
+ org.apache.commons
+
+
+
+
+
+ org.apache.commons
+ commons-math3
+ provided
+
+
+
+ com.webank.wedatasphere.dss
+ dss-appconn-framework
+ ${dss.version}
+
+
+
+ com.webank.wedatasphere.dss
+ dss-structure-integration-standard
+ ${dss.version}
+
+
+ commons-collections
+ commons-collections
+
+
+ dss-common
+ com.webank.wedatasphere.dss
+
+
+ linkis-common
+ com.webank.wedatasphere.linkis
+
+
+
+
+
+ com.webank.wedatasphere.dss
+ dss-development-process-standard
+ ${dss.version}
+
+
+
+ com.webank.wedatasphere.dss
+ dss-orchestrator-core
+ ${dss.version}
+
+
+ commons-collections
+ commons-collections
+
+
+ linkis-common
+ com.webank.wedatasphere.linkis
+
+
+ commons-lang3
+ org.apache.commons
+
+
+ commons-logging
+ commons-logging
+
+
+
+
+
+ com.webank.wedatasphere.dss
+ dss-orchestrator-db
+ ${dss.version}
+
+
+
+
+
+ org.apache.commons
+ commons-lang3
+ ${commons.lang3.version}
+ provided
+
+
+
+ org.glassfish.jersey.ext
+ jersey-bean-validation
+ 2.21
+ provided
+
+
+ com.webank.wedatasphere.linkis
+ linkis-rpc
+ ${linkis.version}
+ provided
+
+
+ linkis-common
+ com.webank.wedatasphere.linkis
+
+
+
+
+ com.webank.wedatasphere.dss
+ dss-framework-workspace-server
+ ${dss.version}
+
+
+ linkis-common
+ com.webank.wedatasphere.linkis
+
+
+ commons-logging
+ commons-logging
+
+
+ commons-codec
+ commons-codec
+
+
+ commons-lang3
+ org.apache.commons
+
+
+ json4s-jackson_2.11
+ org.json4s
+
+
+
+
+
+ com.webank.wedatasphere.linkis
+ linkis-mybatis
+ ${linkis.version}
+ provided
+
+
+ com.webank.wedatasphere.dss
+ dss-common
+ ${dss.version}
+ provided
+
+
+ com.webank.wedatasphere.dss
+ dss-sender-service
+ ${dss.version}
+ provided
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+
+
+
+ net.alchim31.maven
+ scala-maven-plugin
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+
+
+ org.apache.maven.plugins
+ maven-assembly-plugin
+ 2.3
+ false
+
+
+ make-assembly
+ package
+
+ single
+
+
+
+ src/main/assembly/distribution.xml
+
+
+
+
+
+ false
+ out
+ false
+ false
+
+ src/main/assembly/distribution.xml
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+
+ 8
+
+
+
+
+
+ src/main/java
+
+ **/*.xml
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dss-framework/dss-framework-project-server/src/main/assembly/distribution.xml b/dss-framework/dss-framework-project-server/src/main/assembly/distribution.xml
new file mode 100644
index 0000000000..a506dcb069
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/assembly/distribution.xml
@@ -0,0 +1,44 @@
+
+
+
+ dss-framework-project-server
+
+ dir
+
+ true
+ dss-framework-project-server
+
+
+
+
+
+ lib
+ true
+ true
+ false
+ true
+ true
+
+
+
+
+
+
+
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/conf/ProjectConf.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/conf/ProjectConf.java
new file mode 100644
index 0000000000..67bd65d9d7
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/conf/ProjectConf.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.conf;
+
+import com.webank.wedatasphere.linkis.common.conf.CommonVars;
+
+
+public interface ProjectConf {
+
+ CommonVars SUPPORT_ABILITY = CommonVars.apply("wds.dss.framework.project.support.ability", "import,export,publish");
+
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/conf/ProjectSpringConf.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/conf/ProjectSpringConf.java
new file mode 100644
index 0000000000..f29748335a
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/conf/ProjectSpringConf.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.conf;
+
+import com.webank.wedatasphere.dss.framework.project.service.DSSFrameworkOrchestratorService;
+import com.webank.wedatasphere.dss.framework.project.service.DSSProjectUserService;
+import com.webank.wedatasphere.dss.framework.project.service.impl.DSSFrameworkOrchestratorServiceImpl;
+import com.webank.wedatasphere.dss.framework.project.service.impl.DSSProjectUserServiceImpl;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+
+@Configuration
+public class ProjectSpringConf {
+
+ @Bean
+ @ConditionalOnMissingBean
+ public DSSProjectUserService createDSSProjectUserService() {
+ return new DSSProjectUserServiceImpl();
+ }
+
+ @Bean
+ @ConditionalOnMissingBean
+ public DSSFrameworkOrchestratorService createDSSFrameworkOrchestratorService() {
+ return new DSSFrameworkOrchestratorServiceImpl();
+ }
+
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/conf/ValidationExceptionMapper.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/conf/ValidationExceptionMapper.java
new file mode 100644
index 0000000000..4b16c64032
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/conf/ValidationExceptionMapper.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.conf;
+
+
+
+import com.webank.wedatasphere.linkis.server.Message;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.validation.ConstraintViolation;
+import javax.validation.ConstraintViolationException;
+import javax.validation.ValidationException;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.ExceptionMapper;
+import javax.ws.rs.ext.Provider;
+
+
+
+@Provider
+public class ValidationExceptionMapper implements ExceptionMapper {
+
+ private final Logger LOGGER = LoggerFactory.getLogger(getClass());
+
+ @Override
+ public Response toResponse(ValidationException e) {
+ if (LOGGER.isDebugEnabled()){
+ LOGGER.debug("failed to validate request bean", e);
+ }
+ StringBuilder strBuilder = new StringBuilder();
+ for (ConstraintViolation> cv : ((ConstraintViolationException) e).getConstraintViolations()) {
+ strBuilder.append(cv.getMessage()).append(";");
+ }
+ Message message = Message.error(strBuilder.toString());
+ return Message.messageToResponse(message);
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/contant/OrchestratorTypeEnum.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/contant/OrchestratorTypeEnum.java
new file mode 100644
index 0000000000..5db47b925c
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/contant/OrchestratorTypeEnum.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.contant;
+
+import com.webank.wedatasphere.dss.orchestrator.core.type.OrchestratorKindEnum;
+import org.apache.commons.lang.StringUtils;
+
+import java.util.Arrays;
+
+public enum OrchestratorTypeEnum {
+
+ WORKFLOW("'pom_work_flow'", 1, "工作流"),
+ SINGLE_TASK("'pom_single_task'",2, "单任务"),
+ COMBINED("'pom_consist_orchestrator'",3, "组合编排");
+
+ private String key;
+ private Integer type;
+ private String name;
+
+ OrchestratorTypeEnum(String key, Integer type, String name) {
+ this.key = key;
+ this.type = type;
+ this.name = name;
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+ public void setKey(String key) {
+ this.key = key;
+ }
+
+ public Integer getType() {
+ return type;
+ }
+
+ public void setType(Integer type) {
+ this.type = type;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public static Integer getTypeByKey(String key){
+ return Arrays.stream(OrchestratorTypeEnum.values())
+ .filter(a -> a.getKey().equals(key))
+ .map(OrchestratorTypeEnum::getType)
+ .findFirst()
+ .orElse(0);
+ }
+
+ public static String getKeyByOrcType(String type) {
+ int index = Arrays.stream(OrchestratorKindEnum.values())
+ .filter(a -> a.getName().equals(type))
+ .map(OrchestratorKindEnum::getIndex)
+ .findFirst()
+ .orElse(0);
+ String key = Arrays.stream(OrchestratorTypeEnum.values())
+ .filter(a -> a.getType().equals(index))
+ .map(OrchestratorTypeEnum::getKey)
+ .findFirst()
+ .orElse(null);
+ return StringUtils.isNotBlank(key) ? key.replace("'", "") : null;
+ }
+
+
+
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/contant/ProjectServerResponse.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/contant/ProjectServerResponse.java
new file mode 100644
index 0000000000..93fbef2e47
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/contant/ProjectServerResponse.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.contant;
+
+public enum ProjectServerResponse {
+ PROJECT_NOT_EDIT_AUTH(6001,"没有修改权限"),
+ PROJECT_NOT_EDIT_NAME(6002,"不能修改工程名称"),
+ PROJECT_NOT_EXIST(6003,"工程不存在"),
+ PROJECT_IS_NOT_ADMIN(6004,"只有创建人或管理员才能编辑工程")
+ ;
+
+ ProjectServerResponse(int code, String msg) {
+ this.code = code;
+ this.msg = msg;
+ }
+
+ private int code;
+ private String msg;
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public String getMsg() {
+ return msg;
+ }
+
+ public void setMsg(String msg) {
+ this.msg = msg;
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/contant/ProjectSpringConfiguration.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/contant/ProjectSpringConfiguration.java
new file mode 100644
index 0000000000..12f52b7c9a
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/contant/ProjectSpringConfiguration.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.contant;
+
+import com.webank.wedatasphere.dss.framework.project.service.DSSProjectService;
+import com.webank.wedatasphere.dss.framework.project.service.impl.DSSProjectServiceImpl;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+public class ProjectSpringConfiguration {
+
+ @Bean
+ @ConditionalOnMissingBean
+ public DSSProjectService createProjectService() {
+ return new DSSProjectServiceImpl();
+ }
+
+}
\ No newline at end of file
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/contant/ProjectUserPrivEnum.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/contant/ProjectUserPrivEnum.java
new file mode 100644
index 0000000000..3de13c31cf
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/contant/ProjectUserPrivEnum.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.contant;
+
+
+public enum ProjectUserPrivEnum {
+
+ PRIV_ACCESS(1,"查看权限"),
+ PRIV_EDIT(2,"编辑权限"),
+ PRIV_RELEASE(3,"发布权限");
+
+ ProjectUserPrivEnum(int rank, String name) {
+ this.rank = rank;
+ this.name = name;
+ }
+
+ private int rank;
+
+ private String name;
+
+ public int getRank() {
+ return rank;
+ }
+
+ public void setRank(int rank) {
+ this.rank = rank;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/dao/DSSOrchestratorMapper.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/dao/DSSOrchestratorMapper.java
new file mode 100644
index 0000000000..b310318b21
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/dao/DSSOrchestratorMapper.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.webank.wedatasphere.dss.framework.project.entity.DSSOrchestrator;
+import org.apache.ibatis.annotations.*;
+
+
+@Mapper
+public interface DSSOrchestratorMapper extends BaseMapper {
+
+ @Select("Select `uuid` from `dss_orchestrator_info` where `id` = #{orchestratorId} ")
+ String getUUID(@Param("orchestratorId") Long orchestratorId);
+}
+
+
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/dao/DSSProjectMapper.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/dao/DSSProjectMapper.java
new file mode 100644
index 0000000000..5cc71f1697
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/dao/DSSProjectMapper.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.webank.wedatasphere.dss.framework.project.entity.DSSProjectDO;
+import com.webank.wedatasphere.dss.framework.project.entity.po.DSSProjectPo;
+import com.webank.wedatasphere.dss.framework.project.entity.po.ProjectRelationPo;
+import com.webank.wedatasphere.dss.framework.project.entity.request.ProjectQueryRequest;
+import com.webank.wedatasphere.dss.framework.project.entity.vo.ProjectInfoVo;
+import com.webank.wedatasphere.dss.framework.project.entity.vo.QueryProjectVo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+
+import java.util.List;
+
+
+@Mapper
+public interface DSSProjectMapper extends BaseMapper {
+
+ void addProject(DSSProjectPo dssProjectPo);
+
+ @Select("select id from dss_project where `name` = #{projectName}")
+ Long getProjectIdByName(@Param("projectName") String projectName);
+
+ @Select("select `name` from dss_project where `id` = #{projectId}")
+ String getProjectNameById(@Param("projectId") Long projectId);
+
+
+ @Select("select `id` from dss_project where `workspace_id` = #{workspaceId} and visible = #{visible}")
+ List getProjectIdsByWorkspaceId(@Param("workspaceId") Long workspaceId,@Param("visible")int visible);
+
+
+ List getListByParam(ProjectQueryRequest projectRequest);
+
+ /**
+ * 获取工程详情:工程名称、空间名称
+ */
+ ProjectInfoVo getProjectInfoById(@Param("id") Long id);
+
+ void saveProjectRelation(List projectRelationPoList);
+
+ @Select("select `appconn_instance_project_id` from dss_appconn_project_relation " +
+ "where `project_id` = #{dssProjectId} and `appconn_instance_id` = #{appInstanceId}")
+ Long getAppConnProjectId(@Param("appInstanceId")Long appInstanceId, @Param("dssProjectId")Long dssProjectId);
+
+
+ @Update("update dss_project set `visible` = 0 where `id` = #{projectId}")
+ void deleteProject(@Param("projectId")Long projectId);
+
+ @Select("SELECT a.url FROM dss_appconn_instance a LEFT JOIN dss_appconn b ON a.appconn_id = b.id WHERE b.appconn_name=#{schedulisName} LIMIT 1")
+ String getSchedualisUrl(@Param("schedulisName")String schedulisName);
+
+ @Select("SELECT a.appconn_instance_project_id FROM dss_appconn_project_relation a WHERE a.appconn_instance_id = 1 AND a.project_id = #{projectId} LIMIT 1")
+ Long getSchedulisProjectId(@Param("projectId")Long projectId);
+
+ @Update("update dss_appconn_project_relation set appconn_instance_project_id = #{schedulisProjectId} WHERE appconn_instance_id = 1 AND project_id = #{projectId} ")
+ int updateSchedulisProjectId(@Param("schedulisProjectId")Long schedulisProjectId,@Param("projectId")Long projectId);
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/dao/DSSProjectUserMapper.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/dao/DSSProjectUserMapper.java
new file mode 100644
index 0000000000..999ec38ac1
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/dao/DSSProjectUserMapper.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.webank.wedatasphere.dss.framework.project.entity.DSSProjectUser;
+import org.apache.ibatis.annotations.*;
+
+import java.util.List;
+
+
+@Mapper
+public interface DSSProjectUserMapper extends BaseMapper {
+ @Insert({
+ ""
+ })
+ void insertBatchProjectUser(@Param("list") List projectUserList);
+
+ @Delete("delete from dss_project_user where project_id = #{projectID}")
+ void deleteAllPriv(@Param("projectID") long projectID);
+
+ @Select("SELECT COUNT(0) FROM dss_workspace_user_role WHERE workspace_id = #{workspaceId} AND username = #{username} AND role_id = #{roleId} ")
+ Long isAdminByUsername(@Param("workspaceId")Long workspaceId,@Param("username")String username,@Param("roleId")int roleId);
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/dao/impl/DSSProjectMapper.xml b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/dao/impl/DSSProjectMapper.xml
new file mode 100644
index 0000000000..4713083937
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/dao/impl/DSSProjectMapper.xml
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+ id,`name`,`source`, `workspace_id`,`description`,`org_id`,`visibility`,`is_transfer`,`initial_org_id`,
+ `username`,`create_time`,`create_by`,`product`,`application_area`,`business`
+ , `user_id`, `create_by_str`, `update_by_str`
+
+
+
+ INSERT INTO dss_project ()
+ VALUES
+ (#{id},#{name},#{source}, #{workspaceId}, #{description},#{orgID},#{visibility},#{isTransfer},#{initialOrgID},
+ #{username},#{createTime},#{createBy},#{product},#{applicationArea},#{business},
+ #{userID},#{createByStr},#{updateByStr})
+
+
+
+
+
+
+
+ insert into dss_appconn_project_relation
+ (
+ `project_id`,
+ `appconn_instance_id`,
+ `appconn_instance_project_id`
+ )
+ values
+
+ (
+ #{item.dssProjectId},
+ #{item.appInstanceId},
+ #{item.appInstanceProjectId}
+ )
+
+
+
+
+
\ No newline at end of file
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/DSSOrchestrator.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/DSSOrchestrator.java
new file mode 100644
index 0000000000..6269691e3f
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/DSSOrchestrator.java
@@ -0,0 +1,236 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.util.*;
+
+
+@TableName(value = "dss_project_orchestrator")
+public class DSSOrchestrator implements Serializable {
+
+ private static final long serialVersionUID=1L;
+
+ /**
+ * 主键ID
+ */
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 空间id
+ */
+ private Long workspaceId;
+
+ /**
+ * 工程id
+ */
+ private Long projectId;
+
+ /**
+ * 编排模式id(工作流,调用orchestrator服务返回的orchestratorId)
+ */
+ private Long orchestratorId;
+
+ /**
+ * 编排模式版本id(工作流,调用orchestrator服务返回的orchestratorVersionId)
+ */
+ private Long orchestratorVersionId;
+
+ /**
+ * 编排名称
+ */
+ private String orchestratorName;
+
+ /**
+ * 编排模式,取得的值是dss_dictionary中的dic_key(parent_key=p_orchestratorment_mode)
+ */
+ private String orchestratorMode;
+
+ /**
+ * 编排方式
+ */
+ private String orchestratorWay;
+
+ /**
+ * 用途
+ */
+ private String uses;
+
+ /**
+ * 描述
+ */
+ private String description;
+
+ /**
+ * 创建人
+ */
+ private String createUser;
+
+ /**
+ * 创建时间
+ */
+ private Date createTime;
+
+ /**
+ * 更新人
+ */
+ private String updateUser;
+
+ /**
+ * 更新时间
+ */
+ private Date updateTime;
+
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public Long getWorkspaceId() {
+ return workspaceId;
+ }
+
+ public void setWorkspaceId(Long workspaceId) {
+ this.workspaceId = workspaceId;
+ }
+
+ public Long getProjectId() {
+ return projectId;
+ }
+
+ public void setProjectId(Long projectId) {
+ this.projectId = projectId;
+ }
+
+ public Long getOrchestratorId() {
+ return orchestratorId;
+ }
+
+ public void setOrchestratorId(Long orchestratorId) {
+ this.orchestratorId = orchestratorId;
+ }
+
+ public Long getOrchestratorVersionId() {
+ return orchestratorVersionId;
+ }
+
+ public void setOrchestratorVersionId(Long orchestratorVersionId) {
+ this.orchestratorVersionId = orchestratorVersionId;
+ }
+
+ public String getOrchestratorName() {
+ return orchestratorName;
+ }
+
+ public void setOrchestratorName(String orchestratorName) {
+ this.orchestratorName = orchestratorName;
+ }
+
+ public String getOrchestratorMode() {
+ return orchestratorMode;
+ }
+
+ public void setOrchestratorMode(String orchestratorMode) {
+ this.orchestratorMode = orchestratorMode;
+ }
+
+ public String getOrchestratorWay() {
+ return orchestratorWay;
+ }
+
+ public void setOrchestratorWay(String orchestratorWay) {
+ this.orchestratorWay = orchestratorWay;
+ }
+
+ public String getUses() {
+ return uses;
+ }
+
+ public void setUses(String uses) {
+ this.uses = uses;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getCreateUser() {
+ return createUser;
+ }
+
+ public void setCreateUser(String createUser) {
+ this.createUser = createUser;
+ }
+
+ public Date getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(Date createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getUpdateUser() {
+ return updateUser;
+ }
+
+ public void setUpdateUser(String updateUser) {
+ this.updateUser = updateUser;
+ }
+
+ public Date getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(Date updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ @Override
+ public String toString() {
+ return "DSSOrchestrator{" +
+ "id=" + id +
+ ", workspaceId=" + workspaceId +
+ ", projectId=" + projectId +
+ ", orchestratorId=" + orchestratorId +
+ ", orchestratorVersionId=" + orchestratorVersionId +
+ ", orchestratorName='" + orchestratorName + '\'' +
+ ", orchestratorMode='" + orchestratorMode + '\'' +
+ ", orchestratorWay='" + orchestratorWay + '\'' +
+ ", uses='" + uses + '\'' +
+ ", description='" + description + '\'' +
+ ", createUser='" + createUser + '\'' +
+ ", createTime=" + createTime +
+ ", updateUser='" + updateUser + '\'' +
+ ", updateTime=" + updateTime +
+ '}';
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/DSSProjectDO.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/DSSProjectDO.java
new file mode 100644
index 0000000000..a26f72a5e9
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/DSSProjectDO.java
@@ -0,0 +1,344 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+
+@TableName(value = "dss_project")
+public class DSSProjectDO implements Serializable {
+
+ private static final long serialVersionUID=1L;
+
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ private String name;
+
+ /**
+ * Source of the dss_project
+ */
+ private String source;
+
+ private String description;
+
+ private Long userId;
+
+ private String username;
+
+ private Long workspaceId;
+
+ private Date createTime;
+
+ private String createBy;
+
+ private Date updateTime;
+
+ private String updateBy;
+
+ /**
+ * Organization ID
+ */
+ private Long orgId;
+
+ private Boolean visibility;
+
+ /**
+ * Reserved word
+ */
+ private Boolean isTransfer;
+
+ private Long initialOrgId;
+
+ /**
+ * If it is archived
+ */
+ @TableField("isArchive")
+ private Boolean isArchive;
+
+ private String pic;
+
+ private Integer starNum;
+
+ private String product;
+
+ private Integer applicationArea;
+
+ private String business;
+
+ private Integer isPersonal;
+
+ private String createByStr;
+
+ private String updateByStr;
+ /**
+ * 开发流程,多个以英文逗号分隔,取得的值是dss_dictionary中的dic_key(parent_key=p_develop_process),首尾以英文逗号结束
+ */
+ private String devProcess;
+
+ /**
+ * 编码模式,多个以英文逗号分隔,取得的值是dss_dictionary中的dic_key(parent_key=p_arrangement_mode或下面一级),首尾以英文逗号结束
+ */
+ private String orchestratorMode;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getSource() {
+ return source;
+ }
+
+ public void setSource(String source) {
+ this.source = source;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Long getUserId() {
+ return userId;
+ }
+
+ public void setUserId(Long userId) {
+ this.userId = userId;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public Long getWorkspaceId() {
+ return workspaceId;
+ }
+
+ public void setWorkspaceId(Long workspaceId) {
+ this.workspaceId = workspaceId;
+ }
+
+ public Date getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(Date createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getCreateBy() {
+ return createBy;
+ }
+
+ public void setCreateBy(String createBy) {
+ this.createBy = createBy;
+ }
+
+ public Date getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(Date updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public String getUpdateBy() {
+ return updateBy;
+ }
+
+ public void setUpdateBy(String updateBy) {
+ this.updateBy = updateBy;
+ }
+
+ public Long getOrgId() {
+ return orgId;
+ }
+
+ public void setOrgId(Long orgId) {
+ this.orgId = orgId;
+ }
+
+ public Boolean getVisibility() {
+ return visibility;
+ }
+
+ public void setVisibility(Boolean visibility) {
+ this.visibility = visibility;
+ }
+
+ public Boolean getTransfer() {
+ return isTransfer;
+ }
+
+ public void setTransfer(Boolean transfer) {
+ isTransfer = transfer;
+ }
+
+ public Long getInitialOrgId() {
+ return initialOrgId;
+ }
+
+ public void setInitialOrgId(Long initialOrgId) {
+ this.initialOrgId = initialOrgId;
+ }
+
+ public Boolean getArchive() {
+ return isArchive;
+ }
+
+ public void setArchive(Boolean archive) {
+ isArchive = archive;
+ }
+
+ public String getPic() {
+ return pic;
+ }
+
+ public void setPic(String pic) {
+ this.pic = pic;
+ }
+
+ public Integer getStarNum() {
+ return starNum;
+ }
+
+ public void setStarNum(Integer starNum) {
+ this.starNum = starNum;
+ }
+
+ public String getProduct() {
+ return product;
+ }
+
+ public void setProduct(String product) {
+ this.product = product;
+ }
+
+ public Integer getApplicationArea() {
+ return applicationArea;
+ }
+
+ public void setApplicationArea(Integer applicationArea) {
+ this.applicationArea = applicationArea;
+ }
+
+ public String getBusiness() {
+ return business;
+ }
+
+ public void setBusiness(String business) {
+ this.business = business;
+ }
+
+ public Integer getIsPersonal() {
+ return isPersonal;
+ }
+
+ public void setIsPersonal(Integer isPersonal) {
+ this.isPersonal = isPersonal;
+ }
+
+ public String getCreateByStr() {
+ return createByStr;
+ }
+
+ public void setCreateByStr(String createByStr) {
+ this.createByStr = createByStr;
+ }
+
+ public String getUpdateByStr() {
+ return updateByStr;
+ }
+
+ public void setUpdateByStr(String updateByStr) {
+ this.updateByStr = updateByStr;
+ }
+
+ public String getDevProcess() {
+ return devProcess;
+ }
+
+ public void setDevProcess(String devProcess) {
+ this.devProcess = devProcess;
+ }
+
+ public String getOrchestratorMode() {
+ return orchestratorMode;
+ }
+
+ public void setOrchestratorMode(String orchestratorMode) {
+ this.orchestratorMode = orchestratorMode;
+ }
+
+ @Override
+ public String toString() {
+ return "DSSProject{" +
+ "id=" + id +
+ ", name='" + name + '\'' +
+ ", source='" + source + '\'' +
+ ", description='" + description + '\'' +
+ ", userId=" + userId +
+ ", username='" + username + '\'' +
+ ", workspaceId=" + workspaceId +
+ ", createTime=" + createTime +
+ ", createBy='" + createBy + '\'' +
+ ", updateTime=" + updateTime +
+ ", updateBy='" + updateBy + '\'' +
+ ", orgId=" + orgId +
+ ", visibility=" + visibility +
+ ", isTransfer=" + isTransfer +
+ ", initialOrgId=" + initialOrgId +
+ ", isArchive=" + isArchive +
+ ", pic='" + pic + '\'' +
+ ", starNum=" + starNum +
+ ", product='" + product + '\'' +
+ ", applicationArea=" + applicationArea +
+ ", business='" + business + '\'' +
+ ", isPersonal=" + isPersonal +
+ ", createByStr='" + createByStr + '\'' +
+ ", updateByStr='" + updateByStr + '\'' +
+ ", devProcess='" + devProcess + '\'' +
+ ", orchestratorMode='" + orchestratorMode + '\'' +
+ '}';
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/DSSProjectUser.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/DSSProjectUser.java
new file mode 100644
index 0000000000..9494d501e2
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/DSSProjectUser.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+@TableName(value = "dss_project_user")
+public class DSSProjectUser implements Serializable {
+
+ private static final long serialVersionUID=1L;
+
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ private Long projectId;
+
+ private String username;
+
+ private Long workspaceId;
+
+ /**
+ * 权限等级:1-查看,2-编辑,3-发布
+ */
+ private Integer priv;
+
+ private Date lastUpdateTime;
+
+ public DSSProjectUser() {
+ }
+
+
+ public DSSProjectUser(Long workspaceId, Long projectId, String username, int priv) {
+ this.workspaceId = workspaceId;
+ this.projectId = projectId;
+ this.username = username;
+ this.priv = priv;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public Long getProjectId() {
+ return projectId;
+ }
+
+ public void setProjectId(Long projectId) {
+ this.projectId = projectId;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public Long getWorkspaceId() {
+ return workspaceId;
+ }
+
+ public void setWorkspaceId(Long workspaceId) {
+ this.workspaceId = workspaceId;
+ }
+
+ public Integer getPriv() {
+ return priv;
+ }
+
+ public void setPriv(Integer priv) {
+ this.priv = priv;
+ }
+
+ public Date getLastUpdateTime() {
+ return lastUpdateTime;
+ }
+
+ public void setLastUpdateTime(Date lastUpdateTime) {
+ this.lastUpdateTime = lastUpdateTime;
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/po/DSSProjectPo.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/po/DSSProjectPo.java
new file mode 100644
index 0000000000..f6d6513ece
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/po/DSSProjectPo.java
@@ -0,0 +1,276 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.entity.po;
+
+import java.util.Date;
+import java.util.List;
+
+
+public class DSSProjectPo {
+
+
+ private Long id;
+ private String name;
+ private String description;
+ private String source;
+ private Date createTime;
+ private String createBy; //兼容Visualis 后修改类型
+ private Date updateTime;
+ private Long orgID;
+ private Boolean visibility;
+ private Boolean isTransfer;
+ private Boolean isArchive;
+ private Long initialOrgID;
+ private String pic;
+ private Long starNum;
+ private String product;
+ private Integer applicationArea;
+ private String business;
+ private Integer workspaceId;
+ private String projectGroup;
+ private String workspaceName;
+ private String username;
+ private Integer isPersonal;
+
+ private Long userID;
+ private String createByStr;
+ private String updateByStr;
+
+ private List accessUsers;
+ private List editUsers;
+
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getSource() {
+ return source;
+ }
+
+ public void setSource(String source) {
+ this.source = source;
+ }
+
+
+
+ public Date getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(Date createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getCreateBy() {
+ return createBy;
+ }
+
+ public void setCreateBy(String createBy) {
+ this.createBy = createBy;
+ }
+
+ public Date getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(Date updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public Long getOrgID() {
+ return orgID;
+ }
+
+ public void setOrgID(Long orgID) {
+ this.orgID = orgID;
+ }
+
+ public Boolean getVisibility() {
+ return visibility;
+ }
+
+ public void setVisibility(Boolean visibility) {
+ this.visibility = visibility;
+ }
+
+ public Boolean getTransfer() {
+ return isTransfer;
+ }
+
+ public void setTransfer(Boolean transfer) {
+ isTransfer = transfer;
+ }
+
+ public Boolean getArchive() {
+ return isArchive;
+ }
+
+ public void setArchive(Boolean archive) {
+ isArchive = archive;
+ }
+
+ public Long getInitialOrgID() {
+ return initialOrgID;
+ }
+
+ public void setInitialOrgID(Long initialOrgID) {
+ this.initialOrgID = initialOrgID;
+ }
+
+ public String getPic() {
+ return pic;
+ }
+
+ public void setPic(String pic) {
+ this.pic = pic;
+ }
+
+ public Long getStarNum() {
+ return starNum;
+ }
+
+ public void setStarNum(Long starNum) {
+ this.starNum = starNum;
+ }
+
+ public String getProduct() {
+ return product;
+ }
+
+ public void setProduct(String product) {
+ this.product = product;
+ }
+
+ public Integer getApplicationArea() {
+ return applicationArea;
+ }
+
+ public void setApplicationArea(Integer applicationArea) {
+ this.applicationArea = applicationArea;
+ }
+
+ public String getBusiness() {
+ return business;
+ }
+
+ public void setBusiness(String business) {
+ this.business = business;
+ }
+
+ public Integer getWorkspaceId() {
+ return workspaceId;
+ }
+
+ public void setWorkspaceId(Integer workspaceId) {
+ this.workspaceId = workspaceId;
+ }
+
+ public String getProjectGroup() {
+ return projectGroup;
+ }
+
+ public void setProjectGroup(String projectGroup) {
+ this.projectGroup = projectGroup;
+ }
+
+ public List getAccessUsers() {
+ return accessUsers;
+ }
+
+ public void setAccessUsers(List accessUsers) {
+ this.accessUsers = accessUsers;
+ }
+
+ public List getEditUsers() {
+ return editUsers;
+ }
+
+ public void setEditUsers(List editUsers) {
+ this.editUsers = editUsers;
+ }
+
+
+ public String getWorkspaceName() {
+ return workspaceName;
+ }
+
+ public void setWorkspaceName(String workspaceName) {
+ this.workspaceName = workspaceName;
+ }
+
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public Integer getIsPersonal() {
+ return isPersonal;
+ }
+
+ public void setIsPersonal(Integer isPersonal) {
+ this.isPersonal = isPersonal;
+ }
+
+ public Long getUserID() {
+ return userID;
+ }
+
+ public void setUserID(Long userID) {
+ this.userID = userID;
+ }
+
+ public String getCreateByStr() {
+ return createByStr;
+ }
+
+ public void setCreateByStr(String createByStr) {
+ this.createByStr = createByStr;
+ }
+
+ public String getUpdateByStr() {
+ return updateByStr;
+ }
+
+ public void setUpdateByStr(String updateByStr) {
+ this.updateByStr = updateByStr;
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/po/ProjectRelationPo.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/po/ProjectRelationPo.java
new file mode 100644
index 0000000000..d7648d0f4c
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/po/ProjectRelationPo.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.entity.po;
+
+
+public class ProjectRelationPo {
+
+ private Long dssProjectId;
+
+ private Long appInstanceId;
+
+ private Long appInstanceProjectId;
+
+
+ public ProjectRelationPo(Long dssProjectId, Long appInstanceId, Long appInstanceProjectId) {
+ this.dssProjectId = dssProjectId;
+ this.appInstanceId = appInstanceId;
+ this.appInstanceProjectId = appInstanceProjectId;
+ }
+
+ public Long getDssProjectId() {
+ return dssProjectId;
+ }
+
+ public void setDssProjectId(Long dssProjectId) {
+ this.dssProjectId = dssProjectId;
+ }
+
+ public Long getAppInstanceId() {
+ return appInstanceId;
+ }
+
+ public void setAppInstanceId(Long appInstanceId) {
+ this.appInstanceId = appInstanceId;
+ }
+
+ public Long getAppInstanceProjectId() {
+ return appInstanceProjectId;
+ }
+
+ public void setAppInstanceProjectId(Long appInstanceProjectId) {
+ this.appInstanceProjectId = appInstanceProjectId;
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/ForbiddenFlowRequest.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/ForbiddenFlowRequest.java
new file mode 100644
index 0000000000..91e7eff88d
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/ForbiddenFlowRequest.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.entity.request;
+
+import javax.validation.constraints.NotNull;
+import javax.xml.bind.annotation.XmlRootElement;
+
+
+@XmlRootElement
+public class ForbiddenFlowRequest {
+
+ @NotNull(message = "编排模式Id不能为空")
+ private Long orchestratorId;
+
+ @NotNull(message = "工程id不能为空")
+ private Long projectId;
+
+ @NotNull(message = "禁用标示不能为空")
+ private String activeFlag;
+
+ @NotNull(message = "工作流名称不能为空")
+ private String orchestratorName;
+
+ public Long getProjectId() {
+ return projectId;
+ }
+
+ public void setProjectId(Long projectId) {
+ this.projectId = projectId;
+ }
+
+ public String getOrchestratorName() {
+ return orchestratorName;
+ }
+
+ public void setOrchestratorName(String orchestratorName) {
+ this.orchestratorName = orchestratorName;
+ }
+
+ public String getActiveFlag() {
+ return activeFlag;
+ }
+
+ public void setActiveFlag(String activeFlag) {
+ this.activeFlag = activeFlag;
+ }
+
+ public Long getOrchestratorId() {
+ return orchestratorId;
+ }
+
+ public void setOrchestratorId(Long orchestratorId) {
+ this.orchestratorId = orchestratorId;
+ }
+
+ @Override
+ public String toString() {
+ return "ForbiddenFlowRequest{" +
+ "orchestratorId=" + orchestratorId +
+ ", projectId=" + projectId +
+ ", activeFlag='" + activeFlag + '\'' +
+ ", orchestratorName='" + orchestratorName + '\'' +
+ '}';
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/OrchestratorCreateRequest.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/OrchestratorCreateRequest.java
new file mode 100644
index 0000000000..9fbd697d4a
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/OrchestratorCreateRequest.java
@@ -0,0 +1,161 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.entity.request;
+
+import com.webank.wedatasphere.dss.framework.project.entity.vo.LabelRouteVo;
+
+import javax.validation.constraints.NotNull;
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+
+
+@XmlRootElement
+public class OrchestratorCreateRequest {
+
+ @NotNull(message = "workspaceId不能为空")
+ private Long workspaceId;
+
+ @NotNull(message = "工程id不能为空")
+ private Long projectId;
+
+ @NotNull(message = "编排名称不能为空")
+ private String orchestratorName;
+
+ /**
+ * 编排模式,如工作流,组合编排等
+ */
+ @NotNull(message = "编排模式类型不能为空")
+ private String orchestratorMode;
+
+ /**
+ * 编排方式
+ */
+ @NotNull(message = "编排方式不能为空")
+ private List orchestratorWays;
+
+ /**
+ * 编排用途
+ */
+ private String uses;
+
+ @NotNull(message = "描述不能为空")
+ private String description;
+
+
+ private String projectName;
+
+ private String workspaceName;
+
+ /**
+ * labels是通过前端进行传入的,主要是用来进行当前的环境信息
+ */
+ private LabelRouteVo labels;
+
+ public Long getWorkspaceId() {
+ return workspaceId;
+ }
+
+ public void setWorkspaceId(Long workspaceId) {
+ this.workspaceId = workspaceId;
+ }
+
+ public Long getProjectId() {
+ return projectId;
+ }
+
+ public void setProjectId(Long projectId) {
+ this.projectId = projectId;
+ }
+
+ public String getOrchestratorName() {
+ return orchestratorName;
+ }
+
+ public void setOrchestratorName(String orchestratorName) {
+ this.orchestratorName = orchestratorName;
+ }
+
+ public String getOrchestratorMode() {
+ return orchestratorMode;
+ }
+
+ public void setOrchestratorMode(String orchestratorMode) {
+ this.orchestratorMode = orchestratorMode;
+ }
+
+ public List getOrchestratorWays() {
+ return orchestratorWays;
+ }
+
+ public void setOrchestratorWays(List orchestratorWays) {
+ this.orchestratorWays = orchestratorWays;
+ }
+
+ public String getUses() {
+ return uses;
+ }
+
+ public void setUses(String uses) {
+ this.uses = uses;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public LabelRouteVo getLabels() {
+ return labels;
+ }
+
+ public void setLabels(LabelRouteVo labels) {
+ this.labels = labels;
+ }
+
+ public String getProjectName() {
+ return projectName;
+ }
+
+ public void setProjectName(String projectName) {
+ this.projectName = projectName;
+ }
+
+ public String getWorkspaceName() {
+ return workspaceName;
+ }
+
+ public void setWorkspaceName(String workspaceName) {
+ this.workspaceName = workspaceName;
+ }
+
+ @Override
+ public String toString() {
+ return "OrchestratorCreateRequest{" +
+ "workspaceId=" + workspaceId +
+ ", projectId=" + projectId +
+ ", arrangeName='" + orchestratorName + '\'' +
+ ", arrangeMode='" + orchestratorMode + '\'' +
+ ", arrangeWays=" + orchestratorWays +
+ ", uses='" + uses + '\'' +
+ ", description='" + description + '\'' +
+ ", labels=" + labels +
+ '}';
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/OrchestratorDeleteRequest.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/OrchestratorDeleteRequest.java
new file mode 100644
index 0000000000..15f79847c9
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/OrchestratorDeleteRequest.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.entity.request;
+
+import com.webank.wedatasphere.dss.framework.project.entity.vo.LabelRouteVo;
+
+import javax.validation.constraints.NotNull;
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+
+
+@XmlRootElement
+public class OrchestratorDeleteRequest {
+
+ @NotNull(message = "id不能为空")
+ private Long id;
+
+ @NotNull(message = "workspaceId不能为空")
+ private Long workspaceId;
+
+ @NotNull(message = "工程id不能为空")
+ private Long projectId;
+
+ /**
+ * dssLabels是通过前端进行传入的,主要是用来进行当前的环境信息
+ */
+ private LabelRouteVo labels;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public Long getWorkspaceId() {
+ return workspaceId;
+ }
+
+ public void setWorkspaceId(Long workspaceId) {
+ this.workspaceId = workspaceId;
+ }
+
+ public Long getProjectId() {
+ return projectId;
+ }
+
+ public void setProjectId(Long projectId) {
+ this.projectId = projectId;
+ }
+
+ public LabelRouteVo getLabels() {
+ return labels;
+ }
+
+ public void setLabels(LabelRouteVo labels) {
+ this.labels = labels;
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/OrchestratorModifyRequest.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/OrchestratorModifyRequest.java
new file mode 100644
index 0000000000..2a8a9c9e3c
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/OrchestratorModifyRequest.java
@@ -0,0 +1,152 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.entity.request;
+
+import com.webank.wedatasphere.dss.framework.project.entity.vo.LabelRouteVo;
+
+import javax.validation.constraints.NotNull;
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+
+
+@XmlRootElement
+public class OrchestratorModifyRequest {
+
+ @NotNull(message = "id不能为空")
+ private Long id;
+
+ @NotNull(message = "workspaceId不能为空")
+ private Long workspaceId;
+
+ @NotNull(message = "工程id不能为空")
+ private Long projectId;
+
+ @NotNull(message = "编排名称不能为空")
+ private String orchestratorName;
+
+ /**
+ * 编排模式,如工作流,组合编排等
+ */
+ @NotNull(message = "编排模式不能为空")
+ private String orchestratorMode;
+
+ /**
+ * 编排方式
+ */
+ @NotNull(message = "编排方式不能为空")
+ private List orchestratorWays;
+
+ /**
+ * 编排用途
+ */
+ private String uses;
+
+ @NotNull(message = "描述不能为空")
+ private String description;
+
+ /**
+ * labels是通过前端进行传入的,主要是用来进行当前的环境信息
+ */
+ private LabelRouteVo labels;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public Long getWorkspaceId() {
+ return workspaceId;
+ }
+
+ public void setWorkspaceId(Long workspaceId) {
+ this.workspaceId = workspaceId;
+ }
+
+ public Long getProjectId() {
+ return projectId;
+ }
+
+ public void setProjectId(Long projectId) {
+ this.projectId = projectId;
+ }
+
+ public String getOrchestratorName() {
+ return orchestratorName;
+ }
+
+ public void setOrchestratorName(String orchestratorName) {
+ this.orchestratorName = orchestratorName;
+ }
+
+ public String getOrchestratorMode() {
+ return orchestratorMode;
+ }
+
+ public void setOrchestratorMode(String orchestratorMode) {
+ this.orchestratorMode = orchestratorMode;
+ }
+
+ public List getOrchestratorWays() {
+ return orchestratorWays;
+ }
+
+ public void setOrchestratorWays(List orchestratorWays) {
+ this.orchestratorWays = orchestratorWays;
+ }
+
+ public String getUses() {
+ return uses;
+ }
+
+ public void setUses(String uses) {
+ this.uses = uses;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public LabelRouteVo getLabels() {
+ return labels;
+ }
+
+ public void setLabels(LabelRouteVo labels) {
+ this.labels = labels;
+ }
+
+ @Override
+ public String toString() {
+ return "OrchestratorModifyRequest{" +
+ "id=" + id +
+ ", workspaceId=" + workspaceId +
+ ", projectId=" + projectId +
+ ", orchestratorName='" + orchestratorName + '\'' +
+ ", orchestratorMode='" + orchestratorMode + '\'' +
+ ", orchestratorWays=" + orchestratorWays +
+ ", uses='" + uses + '\'' +
+ ", description='" + description + '\'' +
+ ", labels=" + labels +
+ '}';
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/OrchestratorRequest.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/OrchestratorRequest.java
new file mode 100644
index 0000000000..235e5485d7
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/OrchestratorRequest.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.entity.request;
+
+import javax.validation.constraints.NotNull;
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+
+
+@XmlRootElement
+public class OrchestratorRequest {
+
+ private Long id;
+
+ @NotNull(message = "workspaceId不能为空")
+ private Long workspaceId;
+
+ @NotNull(message = "工程id不能为空")
+ private Long projectId;
+
+ /**
+ * 编排类型,如工作流,组合编排等
+ */
+ // @NotNull(message = "编排类型不能为空")
+ private String orchestratorMode;
+
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public Long getWorkspaceId() {
+ return workspaceId;
+ }
+
+ public void setWorkspaceId(Long workspaceId) {
+ this.workspaceId = workspaceId;
+ }
+
+ public Long getProjectId() {
+ return projectId;
+ }
+
+ public void setProjectId(Long projectId) {
+ this.projectId = projectId;
+ }
+
+ public String getOrchestratorMode() {
+ return orchestratorMode;
+ }
+
+ public void setOrchestratorMode(String orchestratorMode) {
+ this.orchestratorMode = orchestratorMode;
+ }
+
+ @Override
+ public String toString() {
+ return "OrchestratorRequest{" +
+ "id=" + id +
+ ", workspaceId=" + workspaceId +
+ ", projectId=" + projectId +
+ ", orchestratorMode='" + orchestratorMode + '\'' +
+ '}';
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/ProjectCreateRequest.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/ProjectCreateRequest.java
new file mode 100644
index 0000000000..4d9710881d
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/ProjectCreateRequest.java
@@ -0,0 +1,160 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.entity.request;
+
+import javax.validation.constraints.NotNull;
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+
+
+@XmlRootElement
+public class ProjectCreateRequest {
+
+ @NotNull(message = "工程名称不能为空")
+ private String name;
+
+ @NotNull(message = "应用领域不能为空")
+ private Integer applicationArea;
+
+ private String business;
+
+ //产品
+ private String product;
+
+ private List releaseUsers;
+
+ private List editUsers;
+
+ private List accessUsers;
+
+ @NotNull(message = "工程描述不能为空")
+ private String description;
+
+ /**
+ * 工作空间名,因为是全局唯一的
+ */
+ @NotNull(message = "workspaceId不能为空")
+ private Long workspaceId;
+
+ private String workspaceName;
+ /**
+ * 开发流程 list
+ */
+ private List devProcessList;
+
+ /**
+ * 编码模式 list
+ */
+ private List orchestratorModeList;
+
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Integer getApplicationArea() {
+ return applicationArea;
+ }
+
+ public void setApplicationArea(Integer applicationArea) {
+ this.applicationArea = applicationArea;
+ }
+
+ public String getBusiness() {
+ return business;
+ }
+
+ public void setBusiness(String business) {
+ this.business = business;
+ }
+
+ public String getProduct() {
+ return product;
+ }
+
+ public void setProduct(String product) {
+ this.product = product;
+ }
+
+ public List getReleaseUsers() {
+ return releaseUsers;
+ }
+
+ public void setReleaseUsers(List releaseUsers) {
+ this.releaseUsers = releaseUsers;
+ }
+
+ public List getEditUsers() {
+ return editUsers;
+ }
+
+ public void setEditUsers(List editUsers) {
+ this.editUsers = editUsers;
+ }
+
+ public List getAccessUsers() {
+ return accessUsers;
+ }
+
+ public void setAccessUsers(List accessUsers) {
+ this.accessUsers = accessUsers;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Long getWorkspaceId() {
+ return workspaceId;
+ }
+
+ public void setWorkspaceId(Long workspaceId) {
+ this.workspaceId = workspaceId;
+ }
+
+ public String getWorkspaceName() {
+ return workspaceName;
+ }
+
+ public void setWorkspaceName(String workspaceName) {
+ this.workspaceName = workspaceName;
+ }
+
+ public List getDevProcessList() {
+ return devProcessList;
+ }
+
+ public void setDevProcessList(List devProcessList) {
+ this.devProcessList = devProcessList;
+ }
+
+ public List getOrchestratorModeList() {
+ return orchestratorModeList;
+ }
+
+ public void setOrchestratorModeList(List orchestratorModeList) {
+ this.orchestratorModeList = orchestratorModeList;
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/ProjectDeleteRequest.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/ProjectDeleteRequest.java
new file mode 100644
index 0000000000..031521267d
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/ProjectDeleteRequest.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.entity.request;
+
+import javax.validation.constraints.NotNull;
+import javax.xml.bind.annotation.XmlRootElement;
+
+
+@XmlRootElement
+public class ProjectDeleteRequest {
+
+ @NotNull(message = "工程id不能为空")
+ private Long id;
+
+ @NotNull(message = "确认不能为空")
+ private boolean sure;
+
+ @NotNull(message = "同步删除其它系统工程不能为空")
+ private boolean ifDelOtherSys;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public boolean isSure() {
+ return sure;
+ }
+
+ public void setSure(boolean sure) {
+ this.sure = sure;
+ }
+
+ public boolean isIfDelOtherSys() {
+ return ifDelOtherSys;
+ }
+
+ public void setIfDelOtherSys(boolean ifDelOtherSys) {
+ this.ifDelOtherSys = ifDelOtherSys;
+ }
+
+ @Override
+ public String toString() {
+ return "ProjectDeleteRequest{" +
+ "id=" + id +
+ ", sure=" + sure +
+ ", ifDelOtherSys=" + ifDelOtherSys +
+ '}';
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/ProjectModifyRequest.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/ProjectModifyRequest.java
new file mode 100644
index 0000000000..655e63c381
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/ProjectModifyRequest.java
@@ -0,0 +1,184 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.entity.request;
+
+import javax.validation.constraints.NotNull;
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+
+
+@XmlRootElement
+public class ProjectModifyRequest {
+
+
+ @NotNull(message = "工程名称不能为空")
+ private String name;
+
+ @NotNull(message = "工程id不能为空")
+ private Long id;
+
+ @NotNull(message = "应用领域不能为空")
+ private String applicationArea;
+
+ //业务
+ private String business;
+
+ //编辑权限用户
+ private List editUsers;
+
+ //查看权限用户
+ private List accessUsers;
+
+ //发布权限用户
+ private List releaseUsers;
+
+ @NotNull(message = "工程描述不能为空")
+ private String description;
+
+ //产品
+ private String product;
+
+ /**
+ * 工作空间名,因为是全局唯一的
+ */
+ @NotNull(message = "workspaceId不能为空")
+ private Long workspaceId;
+
+ /*
+ 开发流程 code list
+ */
+ private List devProcessList;
+
+ /**
+ * 编排模式 code list
+ */
+ private List orchestratorModeList;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getApplicationArea() {
+ return applicationArea;
+ }
+
+ public void setApplicationArea(String applicationArea) {
+ this.applicationArea = applicationArea;
+ }
+
+ public String getBusiness() {
+ return business;
+ }
+
+ public void setBusiness(String business) {
+ this.business = business;
+ }
+
+ public List getEditUsers() {
+ return editUsers;
+ }
+
+ public void setEditUsers(List editUsers) {
+ this.editUsers = editUsers;
+ }
+
+ public List getAccessUsers() {
+ return accessUsers;
+ }
+
+ public void setAccessUsers(List accessUsers) {
+ this.accessUsers = accessUsers;
+ }
+
+ public List getReleaseUsers() {
+ return releaseUsers;
+ }
+
+ public void setReleaseUsers(List releaseUsers) {
+ this.releaseUsers = releaseUsers;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getProduct() {
+ return product;
+ }
+
+ public void setProduct(String product) {
+ this.product = product;
+ }
+
+ public Long getWorkspaceId() {
+ return workspaceId;
+ }
+
+ public void setWorkspaceId(Long workspaceId) {
+ this.workspaceId = workspaceId;
+ }
+
+ public List getDevProcessList() {
+ return devProcessList;
+ }
+
+ public void setDevProcessList(List devProcessList) {
+ this.devProcessList = devProcessList;
+ }
+
+ public List getOrchestratorModeList() {
+ return orchestratorModeList;
+ }
+
+ public void setOrchestratorModeList(List orchestratorModeList) {
+ this.orchestratorModeList = orchestratorModeList;
+ }
+
+ @Override
+ public String toString() {
+ return "ProjectModifyRequest{" +
+ "name='" + name + '\'' +
+ ", id=" + id +
+ ", applicationArea='" + applicationArea + '\'' +
+ ", business='" + business + '\'' +
+ ", editUsers=" + editUsers +
+ ", accessUsers=" + accessUsers +
+ ", releaseUsers=" + releaseUsers +
+ ", description='" + description + '\'' +
+ ", product='" + product + '\'' +
+ ", workspaceId=" + workspaceId +
+ ", devProcessList=" + devProcessList +
+ ", orchestratorModeList=" + orchestratorModeList +
+ '}';
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/ProjectQueryRequest.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/ProjectQueryRequest.java
new file mode 100644
index 0000000000..b0147415ae
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/ProjectQueryRequest.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.entity.request;
+
+import javax.validation.constraints.NotNull;
+import javax.xml.bind.annotation.XmlRootElement;
+import java.io.Serializable;
+
+
+@XmlRootElement
+public class ProjectQueryRequest implements Serializable {
+
+ private static final long serialVersionUID=1L;
+
+ private Long id;
+
+ @NotNull(message = "workspaceId不能为空")
+ private Long workspaceId;
+
+ private String username;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public Long getWorkspaceId() {
+ return workspaceId;
+ }
+
+ public void setWorkspaceId(Long workspaceId) {
+ this.workspaceId = workspaceId;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/RemoveFlowRequest.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/RemoveFlowRequest.java
new file mode 100644
index 0000000000..d1f7cfd83b
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/request/RemoveFlowRequest.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.entity.request;
+
+import javax.validation.constraints.NotNull;
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+
+
+@XmlRootElement
+public class RemoveFlowRequest {
+
+ private Long orchestratorId;
+
+ @NotNull(message = "工程id不能为空")
+ private Long projectId;
+
+ @NotNull(message = "工作流名称不能为空")
+ private String orchestratorName;
+
+ public Long getProjectId() {
+ return projectId;
+ }
+
+ public void setProjectId(Long projectId) {
+ this.projectId = projectId;
+ }
+
+ public String getOrchestratorName() {
+ return orchestratorName;
+ }
+
+ public void setOrchestratorName(String orchestratorName) {
+ this.orchestratorName = orchestratorName;
+ }
+
+ public Long getOrchestratorId() {
+ return orchestratorId;
+ }
+
+ public void setOrchestratorId(Long orchestratorId) {
+ this.orchestratorId = orchestratorId;
+ }
+
+ @Override
+ public String toString() {
+ return "RemoveFlowRequest{" +
+ "orchestratorId=" + orchestratorId +
+ ", projectId=" + projectId +
+ ", orchestratorName='" + orchestratorName + '\'' +
+ '}';
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/response/ProjectResponse.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/response/ProjectResponse.java
new file mode 100644
index 0000000000..9344ee01c3
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/response/ProjectResponse.java
@@ -0,0 +1,222 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.entity.response;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+
+public class ProjectResponse implements Serializable {
+ private static final long serialVersionUID=1L;
+ //工程id
+ private Long id;
+ //应用领域
+ private Integer applicationArea;
+ //业务
+ private String business;
+ //创建人
+ private String createBy;
+ //工程描述
+ private String description;
+ //工程名称
+ private String name;
+ //
+ private String source;
+ //产品
+ private String product;
+ private Boolean isArchive;
+ //工程创建时间
+ private Date createTime;
+ //工程修改时间
+ private Date updateTime;
+
+ /**
+ * 发布用户 list
+ */
+ private List releaseUsers;
+
+ /**
+ * 编辑用户 list
+ */
+ private List editUsers;
+
+ /**
+ * 查看用户 list
+ */
+ private List accessUsers;
+
+ /**
+ * 开发流程 list
+ */
+ private List devProcessList;
+
+ /**
+ * 编码模式 list
+ */
+ private List orchestratorModeList;
+
+ public Date getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(Date createTime) {
+ this.createTime = createTime;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public Integer getApplicationArea() {
+ return applicationArea;
+ }
+
+ public void setApplicationArea(Integer applicationArea) {
+ this.applicationArea = applicationArea;
+ }
+
+ public String getBusiness() {
+ return business;
+ }
+
+ public void setBusiness(String business) {
+ this.business = business;
+ }
+
+ public String getCreateBy() {
+ return createBy;
+ }
+
+ public void setCreateBy(String createBy) {
+ this.createBy = createBy;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getSource() {
+ return source;
+ }
+
+ public void setSource(String source) {
+ this.source = source;
+ }
+
+ public String getProduct() {
+ return product;
+ }
+
+ public void setProduct(String product) {
+ this.product = product;
+ }
+
+ public Boolean getArchive() {
+ return isArchive;
+ }
+
+ public void setArchive(Boolean archive) {
+ isArchive = archive;
+ }
+
+ public List getReleaseUsers() {
+ return releaseUsers;
+ }
+
+ public void setReleaseUsers(List releaseUsers) {
+ this.releaseUsers = releaseUsers;
+ }
+
+ public List getEditUsers() {
+ return editUsers;
+ }
+
+ public void setEditUsers(List editUsers) {
+ this.editUsers = editUsers;
+ }
+
+ public List getAccessUsers() {
+ return accessUsers;
+ }
+
+ public void setAccessUsers(List accessUsers) {
+ this.accessUsers = accessUsers;
+ }
+
+ public List getDevProcessList() {
+ return devProcessList;
+ }
+
+ public void setDevProcessList(List devProcessList) {
+ this.devProcessList = devProcessList;
+ }
+
+ public List getOrchestratorModeList() {
+ return orchestratorModeList;
+ }
+
+ public void setOrchestratorModeList(List orchestratorModeList) {
+ this.orchestratorModeList = orchestratorModeList;
+ }
+
+ public Date getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(Date updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ @Override
+ public String toString() {
+ return "ResponseProjectVo{" +
+ "id=" + id +
+ ", applicationArea=" + applicationArea +
+ ", business='" + business + '\'' +
+ ", createBy='" + createBy + '\'' +
+ ", description='" + description + '\'' +
+ ", name='" + name + '\'' +
+ ", source='" + source + '\'' +
+ ", product='" + product + '\'' +
+ ", isArchive=" + isArchive +
+ ", createTime=" + createTime +
+ ", updateTime=" + updateTime +
+ ", releaseUsers=" + releaseUsers +
+ ", editUsers=" + editUsers +
+ ", accessUsers=" + accessUsers +
+ ", devProcessList=" + devProcessList +
+ ", orchestratorModeList=" + orchestratorModeList +
+ '}';
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/AbstractOrchestratorVo.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/AbstractOrchestratorVo.java
new file mode 100644
index 0000000000..5a32ef18f8
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/AbstractOrchestratorVo.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.entity.vo;
+
+
+public abstract class AbstractOrchestratorVo {
+
+ final static String WORK_FLOW = "workflow";
+
+ final static String ORDINARY = "ordinary";
+
+ private Long orchestratorId;
+
+ private String orchestratorVersion;
+
+ public Long getOrchestratorId() {
+ return orchestratorId;
+ }
+
+ public void setOrchestratorId(Long orchestratorId) {
+ this.orchestratorId = orchestratorId;
+ }
+
+ public String getOrchestratorVersion() {
+ return orchestratorVersion;
+ }
+
+ public void setOrchestratorVersion(String orchestratorVersion) {
+ this.orchestratorVersion = orchestratorVersion;
+ }
+
+ abstract String getType();
+
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/CommonOrchestratorVo.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/CommonOrchestratorVo.java
new file mode 100644
index 0000000000..93700f75a1
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/CommonOrchestratorVo.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.entity.vo;
+
+
+public class CommonOrchestratorVo extends AbstractOrchestratorVo{
+
+ @Override
+ String getType() {
+ return WORK_FLOW;
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/DSSFlowOrchestratorFlowVo.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/DSSFlowOrchestratorFlowVo.java
new file mode 100644
index 0000000000..fa231af966
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/DSSFlowOrchestratorFlowVo.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.entity.vo;
+
+import java.util.List;
+
+
+public class DSSFlowOrchestratorFlowVo {
+
+ private Integer orchestratorId;
+
+ private String orchestratorVersion;
+
+ /**
+ * flowId 传递到前端让前端使用进行工作流的渲染
+ */
+ private String flowId;
+
+ private String description;
+
+ private String name;
+
+ private List tags;
+
+ public Integer getOrchestratorId() {
+ return orchestratorId;
+ }
+
+ public void setOrchestratorId(Integer orchestratorId) {
+ this.orchestratorId = orchestratorId;
+ }
+
+ public String getOrchestratorVersion() {
+ return orchestratorVersion;
+ }
+
+ public void setOrchestratorVersion(String orchestratorVersion) {
+ this.orchestratorVersion = orchestratorVersion;
+ }
+
+ public String getFlowId() {
+ return flowId;
+ }
+
+ public void setFlowId(String flowId) {
+ this.flowId = flowId;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public List getTags() {
+ return tags;
+ }
+
+ public void setTags(List tags) {
+ this.tags = tags;
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/DSSProjectDetailVo.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/DSSProjectDetailVo.java
new file mode 100644
index 0000000000..cf5a850334
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/DSSProjectDetailVo.java
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.entity.vo;
+
+import java.util.List;
+
+
+
+public class DSSProjectDetailVo extends DSSProjectVo {
+
+ /**
+ * 发布用户 list
+ */
+ private List releaseUsers;
+
+ /**
+ * 编辑用户 list
+ */
+ private List editUsers;
+
+ /**
+ * 查看用户 list
+ */
+ private List accessUsers;
+
+ /**
+ * 开发的模式,主要是工作流和应用工具
+ */
+ private String projectMode;
+
+ /**
+ * 应用领域,不为空
+ */
+ private String applicationArea;
+
+
+ /**
+ * 使用业务
+ */
+ private String business;
+
+
+ private String description;
+
+
+ public List getEditUsers() {
+ return editUsers;
+ }
+
+ public void setEditUsers(List editUsers) {
+ this.editUsers = editUsers;
+ }
+
+ public List getAccessUsers() {
+ return accessUsers;
+ }
+
+ public void setAccessUsers(List accessUsers) {
+ this.accessUsers = accessUsers;
+ }
+
+ public String getProjectMode() {
+ return projectMode;
+ }
+
+ public void setProjectMode(String projectMode) {
+ this.projectMode = projectMode;
+ }
+
+ public String getApplicationArea() {
+ return applicationArea;
+ }
+
+ public void setApplicationArea(String applicationArea) {
+ this.applicationArea = applicationArea;
+ }
+
+ public String getBusiness() {
+ return business;
+ }
+
+ public void setBusiness(String business) {
+ this.business = business;
+ }
+
+ @Override
+ public String getDescription() {
+ return description;
+ }
+
+ @Override
+ public void setDescription(String description) {
+ this.description = description;
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/DSSProjectVo.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/DSSProjectVo.java
new file mode 100644
index 0000000000..a7206d4526
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/DSSProjectVo.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.entity.vo;
+
+import java.util.List;
+
+
+public class DSSProjectVo {
+
+ private Long id;
+
+ private String name;
+
+ private String description;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/LabelRouteVo.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/LabelRouteVo.java
new file mode 100644
index 0000000000..621a99b2ba
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/LabelRouteVo.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.entity.vo;
+
+public class LabelRouteVo {
+
+ private String route;
+
+ public String getRoute() {
+ return route;
+ }
+
+ public void setRoute(String route) {
+ this.route = route;
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/OrchestratorBaseInfo.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/OrchestratorBaseInfo.java
new file mode 100644
index 0000000000..63a3e45f2c
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/OrchestratorBaseInfo.java
@@ -0,0 +1,229 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.entity.vo;
+
+import java.util.Date;
+import java.util.List;
+
+public class OrchestratorBaseInfo {
+ /**
+ * 主键ID
+ */
+ private Long id;
+
+ /**
+ * 空间id
+ */
+ private Long workspaceId;
+
+ /**
+ * 工程id
+ */
+ private Long projectId;
+
+ /**
+ * 编排模式id(工作流,调用orchestrator服务返回的orchestratorId)
+ */
+ private Long orchestratorId;
+
+ /**
+ * 编排模式版本id(工作流,调用orchestrator服务返回的orchestratorVersionId)
+ */
+ private Long orchestratorVersionId;
+
+ /**
+ * 编排名称
+ */
+ private String orchestratorName;
+
+ /**
+ * 编排模式,取得的值是dss_dictionary中的dic_key(parent_key=p_orchestratorment_mode)
+ */
+ private String orchestratorMode;
+
+ /**
+ * 编排方式
+ */
+ //private String orchestratorWay;
+
+ /**
+ * 用途
+ */
+ private String uses;
+
+ /**
+ * 描述
+ */
+ private String description;
+
+ /**
+ * 创建人
+ */
+ private String createUser;
+
+ /**
+ * 创建时间
+ */
+ private Date createTime;
+
+ /**
+ * 更新人
+ */
+ private String updateUser;
+
+ /**
+ * 更新时间
+ */
+ private Date updateTime;
+
+ private List orchestratorWays;
+
+ private boolean flowEditLockExist=false;
+
+ /**
+ * 工程权限等级:0-查看,1-编辑,2-发布
+ */
+ private Integer priv;
+
+ public Integer getPriv() {
+ return priv;
+ }
+
+ public void setPriv(Integer priv) {
+ this.priv = priv;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public Long getWorkspaceId() {
+ return workspaceId;
+ }
+
+ public void setWorkspaceId(Long workspaceId) {
+ this.workspaceId = workspaceId;
+ }
+
+ public Long getProjectId() {
+ return projectId;
+ }
+
+ public void setProjectId(Long projectId) {
+ this.projectId = projectId;
+ }
+
+ public Long getOrchestratorId() {
+ return orchestratorId;
+ }
+
+ public void setOrchestratorId(Long orchestratorId) {
+ this.orchestratorId = orchestratorId;
+ }
+
+ public Long getOrchestratorVersionId() {
+ return orchestratorVersionId;
+ }
+
+ public void setOrchestratorVersionId(Long orchestratorVersionId) {
+ this.orchestratorVersionId = orchestratorVersionId;
+ }
+
+ public String getOrchestratorName() {
+ return orchestratorName;
+ }
+
+ public void setOrchestratorName(String orchestratorName) {
+ this.orchestratorName = orchestratorName;
+ }
+
+ public String getOrchestratorMode() {
+ return orchestratorMode;
+ }
+
+ public void setOrchestratorMode(String orchestratorMode) {
+ this.orchestratorMode = orchestratorMode;
+ }
+
+ public String getUses() {
+ return uses;
+ }
+
+ public void setUses(String uses) {
+ this.uses = uses;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getCreateUser() {
+ return createUser;
+ }
+
+ public void setCreateUser(String createUser) {
+ this.createUser = createUser;
+ }
+
+ public Date getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(Date createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getUpdateUser() {
+ return updateUser;
+ }
+
+ public void setUpdateUser(String updateUser) {
+ this.updateUser = updateUser;
+ }
+
+ public Date getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(Date updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public List getOrchestratorWays() {
+ return orchestratorWays;
+ }
+
+ public void setOrchestratorWays(List orchestratorWays) {
+ this.orchestratorWays = orchestratorWays;
+ }
+
+ public boolean isFlowEditLockExist() {
+ return flowEditLockExist;
+ }
+
+ public void setFlowEditLockExist(boolean flowEditLockExist) {
+ this.flowEditLockExist = flowEditLockExist;
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/OrdinaryOrchestratorVo.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/OrdinaryOrchestratorVo.java
new file mode 100644
index 0000000000..4c643f8bbe
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/OrdinaryOrchestratorVo.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.entity.vo;
+
+
+public class OrdinaryOrchestratorVo extends AbstractOrchestratorVo{
+
+ @Override
+ String getType() {
+ return ORDINARY;
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/ProcessNode.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/ProcessNode.java
new file mode 100644
index 0000000000..094c32a852
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/ProcessNode.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.entity.vo;
+
+
+public interface ProcessNode {
+
+ Integer getIndex();
+
+ String getName();
+
+ String getChName();
+
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/ProjectInfoVo.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/ProjectInfoVo.java
new file mode 100644
index 0000000000..abe420c482
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/ProjectInfoVo.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.entity.vo;
+
+import java.io.Serializable;
+
+
+public class ProjectInfoVo implements Serializable {
+
+ private static final long serialVersionUID=1L;
+ private Long id;
+ private Long workspaceId;
+ private String projectName;
+ private String workspaceName;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public Long getWorkspaceId() {
+ return workspaceId;
+ }
+
+ public void setWorkspaceId(Long workspaceId) {
+ this.workspaceId = workspaceId;
+ }
+
+ public String getProjectName() {
+ return projectName;
+ }
+
+ public void setProjectName(String projectName) {
+ this.projectName = projectName;
+ }
+
+ public String getWorkspaceName() {
+ return workspaceName;
+ }
+
+ public void setWorkspaceName(String workspaceName) {
+ this.workspaceName = workspaceName;
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/QueryProjectVo.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/QueryProjectVo.java
new file mode 100644
index 0000000000..687b6d3617
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/entity/vo/QueryProjectVo.java
@@ -0,0 +1,165 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.entity.vo;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+
+public class QueryProjectVo implements Serializable {
+
+ private static final long serialVersionUID=1L;
+ private Long id;
+ private Integer applicationArea;
+ private String business;
+ private String createBy;
+ private String description;
+ private String name;
+ private String source;
+ private String product;
+ private Boolean isArchive;
+ private Date createTime;
+ private Date updateTime;
+
+ private String devProcess;
+ private String orchestratorMode;
+ private String pusername;
+
+ private Integer visible;
+
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public Integer getApplicationArea() {
+ return applicationArea;
+ }
+
+ public void setApplicationArea(Integer applicationArea) {
+ this.applicationArea = applicationArea;
+ }
+
+ public String getBusiness() {
+ return business;
+ }
+
+ public void setBusiness(String business) {
+ this.business = business;
+ }
+
+ public String getCreateBy() {
+ return createBy;
+ }
+
+ public void setCreateBy(String createBy) {
+ this.createBy = createBy;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getSource() {
+ return source;
+ }
+
+ public void setSource(String source) {
+ this.source = source;
+ }
+
+ public String getProduct() {
+ return product;
+ }
+
+ public void setProduct(String product) {
+ this.product = product;
+ }
+
+ public Boolean getArchive() {
+ return isArchive;
+ }
+
+ public void setArchive(Boolean archive) {
+ isArchive = archive;
+ }
+
+ public Date getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(Date createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getDevProcess() {
+ return devProcess;
+ }
+
+ public void setDevProcess(String devProcess) {
+ this.devProcess = devProcess;
+ }
+
+ public String getOrchestratorMode() {
+ return orchestratorMode;
+ }
+
+ public void setOrchestratorMode(String orchestratorMode) {
+ this.orchestratorMode = orchestratorMode;
+ }
+
+ public String getPusername() {
+ return pusername;
+ }
+
+ public void setPusername(String pusername) {
+ this.pusername = pusername;
+ }
+
+ public Date getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(Date updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public Integer getVisible() {
+ return visible;
+ }
+
+ public void setVisible(Integer visible) {
+ this.visible = visible;
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/exception/DSSProjectErrorException.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/exception/DSSProjectErrorException.java
new file mode 100644
index 0000000000..9e291f489c
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/exception/DSSProjectErrorException.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.exception;
+
+import com.webank.wedatasphere.linkis.common.exception.ErrorException;
+
+
+public class DSSProjectErrorException extends ErrorException {
+
+ public DSSProjectErrorException(int errorCode, String errorDesc){
+ super(errorCode, errorDesc);
+ }
+
+
+
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/exception/DSSProjectWarnException.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/exception/DSSProjectWarnException.java
new file mode 100644
index 0000000000..175271ab66
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/exception/DSSProjectWarnException.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.exception;
+
+import com.webank.wedatasphere.linkis.common.exception.WarnException;
+
+
+public class DSSProjectWarnException extends WarnException {
+ public DSSProjectWarnException(int errorCode, String errorDesc){
+ super(errorCode, errorDesc);
+ }
+
+
+
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/exception/LambdaWarnException.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/exception/LambdaWarnException.java
new file mode 100644
index 0000000000..f14debcd0f
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/exception/LambdaWarnException.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.exception;
+
+
+public class LambdaWarnException extends DSSProjectWarnException {
+
+
+ public LambdaWarnException(int errorCode, String errorDesc) {
+ super(errorCode, errorDesc);
+ }
+
+
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/restful/DSSFrameworkOrchestratorRestful.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/restful/DSSFrameworkOrchestratorRestful.java
new file mode 100644
index 0000000000..6591dad5e2
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/restful/DSSFrameworkOrchestratorRestful.java
@@ -0,0 +1,149 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.restful;
+
+import com.webank.wedatasphere.dss.framework.common.utils.RestfulUtils;
+import com.webank.wedatasphere.dss.framework.project.dao.DSSProjectMapper;
+import com.webank.wedatasphere.dss.framework.project.entity.request.*;
+import com.webank.wedatasphere.dss.framework.project.entity.vo.CommonOrchestratorVo;
+import com.webank.wedatasphere.dss.framework.project.service.DSSFrameworkOrchestratorService;
+import com.webank.wedatasphere.dss.framework.project.service.DSSOrchestratorService;
+import com.webank.wedatasphere.dss.standard.app.sso.Workspace;
+import com.webank.wedatasphere.dss.standard.sso.utils.SSOHelper;
+import com.webank.wedatasphere.linkis.server.security.SecurityFilter;
+import org.apache.commons.math3.util.Pair;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+import javax.ws.rs.*;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+
+@Component
+@Path("/dss/framework/project")
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes(MediaType.APPLICATION_JSON)
+public class DSSFrameworkOrchestratorRestful {
+
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(DSSFrameworkOrchestratorRestful.class);
+
+ @Autowired
+ private DSSFrameworkOrchestratorService dssFrameworkOrchestratorService;
+ @Autowired
+ private DSSOrchestratorService orchestratorService;
+
+ @Autowired
+ private DSSProjectMapper projectMapper;
+
+ /**
+ * 创建编排模式
+ *
+ * @param httpServletRequest
+ * @param createRequest
+ * @return
+ */
+ @POST
+ @Path("createOrchestrator")
+ public Response createOrchestrator(@Context HttpServletRequest httpServletRequest, @Valid OrchestratorCreateRequest createRequest) {
+ String username = SecurityFilter.getLoginUsername(httpServletRequest);
+ Workspace workspace = SSOHelper.getWorkspace(httpServletRequest);
+ LOGGER.info("workspace is {}", workspace.getWorkspaceName());
+ try {
+ //保存编排模式
+ //todo 先注释掉
+ // orchestratorService.saveOrchestrator(createRequest,null,username);
+ // return RestfulUtils.dealOk("创建工作流编排模式成功", new Pair<>("orchestratorId", 1L));
+ CommonOrchestratorVo orchestratorVo = dssFrameworkOrchestratorService.createOrchestrator(username, createRequest, workspace);
+ return RestfulUtils.dealOk("创建工作流编排模式成功", new Pair<>("orchestratorId", orchestratorVo.getOrchestratorId()));
+ } catch (Exception e) {
+ LOGGER.error("Failed to create orchestrator {} for user {}", createRequest, username, e);
+ return RestfulUtils.dealError("创建工作流编排模式失败:" + e.getMessage());
+ }
+ }
+
+ /**
+ * 查询所有的编排模式
+ *
+ * @param httpServletRequest
+ * @param orchestratorRequest
+ * @return
+ */
+ @POST
+ @Path("getAllOrchestrator")
+ public Response getAllOrchestrator(@Context HttpServletRequest httpServletRequest, @Valid OrchestratorRequest orchestratorRequest) {
+ try {
+ String username = SecurityFilter.getLoginUsername(httpServletRequest);
+ return RestfulUtils.dealOk("获取编排模式成功", new Pair<>("page", orchestratorService.getListByPage(orchestratorRequest, username)));
+ } catch (Exception e) {
+ LOGGER.error("getAllOrchestratorError ", e);
+ return RestfulUtils.dealError("获取编排模式失败:" + e.getMessage());
+ }
+ }
+
+ /**
+ * 修改编排模式
+ *
+ * @param httpServletRequest
+ * @param modifyRequest
+ * @return
+ */
+ @POST
+ @Path("modifyOrchestrator")
+ public Response modifyOrchestrator(@Context HttpServletRequest httpServletRequest, @Valid OrchestratorModifyRequest modifyRequest) {
+ String username = SecurityFilter.getLoginUsername(httpServletRequest);
+ Workspace workspace = SSOHelper.getWorkspace(httpServletRequest);
+ LOGGER.info("workspace is {}", workspace.getWorkspaceName());
+ try {
+ CommonOrchestratorVo orchestratorVo = dssFrameworkOrchestratorService.modifyOrchestrator(username, modifyRequest,workspace);
+ //保存编排模式
+// orchestratorService.updateOrchestrator(modifyRequest, username);
+ return RestfulUtils.dealOk("创建工作流编排模式成功", new Pair<>("orchestratorId", orchestratorVo.getOrchestratorId()));
+ } catch (Exception e) {
+ LOGGER.error("Failed to create orchestrator {} for user {}", modifyRequest, username, e);
+ return RestfulUtils.dealError("创建工作流编排模式失败:" + e.getMessage());
+ }
+ }
+
+ /**
+ * 删除编排模式
+ *
+ * @param httpServletRequest
+ * @param deleteRequest
+ * @return
+ */
+ @POST
+ @Path("deleteOrchestrator")
+ public Response deleteOrchestrator(@Context HttpServletRequest httpServletRequest, @Valid OrchestratorDeleteRequest deleteRequest) {
+ String username = SecurityFilter.getLoginUsername(httpServletRequest);
+ Workspace workspace = SSOHelper.getWorkspace(httpServletRequest);
+ LOGGER.info("workspace is {}", workspace.getWorkspaceName());
+ try {
+ dssFrameworkOrchestratorService.deleteOrchestrator(username, deleteRequest,workspace);
+ return RestfulUtils.dealOk("删除工作流编排模式成功");
+ } catch (Exception e) {
+ LOGGER.error("Failed to delete orchestrator {} for user {}", deleteRequest, username, e);
+ return RestfulUtils.dealError("删除工作流编排模式失败:" + e.getMessage());
+ }
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/restful/DSSFrameworkProjectRestfulApi.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/restful/DSSFrameworkProjectRestfulApi.java
new file mode 100644
index 0000000000..258e044554
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/restful/DSSFrameworkProjectRestfulApi.java
@@ -0,0 +1,188 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.restful;
+
+import com.webank.wedatasphere.dss.common.utils.DSSCommonUtils;
+import com.webank.wedatasphere.dss.framework.project.entity.request.ProjectCreateRequest;
+import com.webank.wedatasphere.dss.framework.project.entity.request.ProjectDeleteRequest;
+import com.webank.wedatasphere.dss.framework.project.entity.request.ProjectModifyRequest;
+import com.webank.wedatasphere.dss.framework.project.entity.request.ProjectQueryRequest;
+import com.webank.wedatasphere.dss.framework.project.entity.response.ProjectResponse;
+import com.webank.wedatasphere.dss.framework.project.entity.vo.DSSProjectVo;
+import com.webank.wedatasphere.dss.framework.project.service.DSSFrameworkProjectService;
+import com.webank.wedatasphere.dss.framework.project.service.DSSProjectService;
+import com.webank.wedatasphere.dss.framework.project.utils.ApplicationArea;
+import com.webank.wedatasphere.dss.framework.project.utils.RestfulUtils;
+import com.webank.wedatasphere.dss.standard.app.sso.Workspace;
+import com.webank.wedatasphere.dss.standard.sso.utils.SSOHelper;
+import com.webank.wedatasphere.linkis.server.Message;
+import com.webank.wedatasphere.linkis.server.security.SecurityFilter;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import org.apache.commons.math3.util.Pair;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+
+@Component
+@Path("/dss/framework/project")
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes(MediaType.APPLICATION_JSON)
+public class DSSFrameworkProjectRestfulApi {
+ private static final Logger LOGGER = LoggerFactory.getLogger(DSSFrameworkProjectRestfulApi.class);
+ @Autowired
+ DSSFrameworkProjectService dssFrameworkProjectService;
+ @Autowired
+ private DSSProjectService projectService;
+
+ /**
+ * 获取所有工程或者单个工程
+ *
+ * @param request
+ * @return
+ */
+ @GET
+ @Path("getWorkSpaceStr")
+ public Response getWorkSpaceStr(@Context HttpServletRequest request) {
+ Workspace workspace = SSOHelper.getWorkspace(request);
+ Message message = Message.ok("").data("workspaceStr", DSSCommonUtils.COMMON_GSON.toJson(workspace));
+ return Message.messageToResponse(message);
+ }
+
+ /**
+ * 获取所有工程或者单个工程
+ *
+ * @param request
+ * @param projectRequest
+ * @return
+ */
+ @POST
+ @Path("getAllProjects")
+ public Response getAllProjects(@Context HttpServletRequest request, @Valid ProjectQueryRequest projectRequest) {
+ String username = SecurityFilter.getLoginUsername(request);
+ projectRequest.setUsername(username);
+ List dssProjectVos = projectService.getListByParam(projectRequest);
+ Message message = Message.ok("获取工作空间的工程成功").data("projects", dssProjectVos);
+ return Message.messageToResponse(message);
+ }
+
+ /**
+ * 新建工程,通过和各个AppConn进行交互,将需要满足工程规范的所有的appconn进行创建工程
+ */
+ @POST
+ @Path("createProject")
+ public Response createProject(@Context HttpServletRequest request, @Valid ProjectCreateRequest projectCreateRequest) {
+ String username = SecurityFilter.getLoginUsername(request);
+ Workspace workspace = SSOHelper.getWorkspace(request);
+ try {
+ DSSProjectVo dssProjectVo = dssFrameworkProjectService.createProject(projectCreateRequest, username, workspace);
+ if (dssProjectVo != null) {
+ return Message.messageToResponse(Message.ok("创建工程成功").data("project", dssProjectVo));
+ } else {
+ return Message.messageToResponse(Message.error("创建工程失败"));
+ }
+ } catch (final Throwable t) {
+ LOGGER.error("failed to create project {} for user {}", projectCreateRequest.getName(), username, t);
+ return RestfulUtils.dealError("创建工程失败:" + t.getMessage());
+ }
+ }
+
+ /**
+ * 编辑工程
+ *
+ * @param request
+ * @param projectModifyRequest
+ * @return
+ */
+ @POST
+ @Path("modifyProject")
+ public Response modifyProject(@Context HttpServletRequest request, @Valid ProjectModifyRequest projectModifyRequest) {
+ String username = SecurityFilter.getLoginUsername(request);
+ try {
+ dssFrameworkProjectService.modifyProject(projectModifyRequest, username);
+ return Message.messageToResponse(Message.ok("修改工程成功"));
+ } catch (Exception e) {
+ LOGGER.error("Failed to modify project {} for user {}", projectModifyRequest.getName(), username, e);
+ return RestfulUtils.dealError("修改工程失败:" + e.getMessage());
+ }
+ }
+
+ /**
+ * 删除工程
+ *
+ * @param request
+ * @param projectDeleteRequest
+ * @return
+ */
+ @POST
+ @Path("deleteProject")
+ public Response deleteProject(@Context HttpServletRequest request, @Valid ProjectDeleteRequest projectDeleteRequest) {
+ String username = SecurityFilter.getLoginUsername(request);
+ Workspace workspace = SSOHelper.getWorkspace(request);
+ try{
+ projectService.deleteProject(username, projectDeleteRequest, workspace);
+ return RestfulUtils.dealOk("删除工程成功");
+ }catch(final Throwable t){
+ LOGGER.error("Failed to delete {} for user {}", projectDeleteRequest, username);
+ return RestfulUtils.dealError("删除工程失败");
+ }
+ }
+
+ @GET
+ @Path("/listApplicationAreas")
+ public Response listApplicationAreas(@Context HttpServletRequest req) {
+ String header = req.getHeader("Content-language").trim();
+ ApplicationArea[] applicationAreas = ApplicationArea.values();
+ List areas = new ArrayList<>();
+ Arrays.stream(applicationAreas).forEach(item -> {
+ if ("zh-CN".equals(header)) {
+ areas.add(item.getName());
+ } else {
+ areas.add(item.getEnName());
+ }
+ });
+ return Message.messageToResponse(Message.ok().data("applicationAreas", areas));
+ }
+
+
+ @GET
+ @Path("/getProjectAbilities")
+ public Response getProjectAbilities(@Context HttpServletRequest request){
+ //为了获取到此环境的能力,导入 导出 发布等
+ String username = SecurityFilter.getLoginUsername(request);
+ try{
+ List projectAbilities = projectService.getProjectAbilities(username);
+ return RestfulUtils.dealOk("获取工程能力成功", new Pair<>("projectAbilities", projectAbilities));
+ }catch(final Throwable t){
+ LOGGER.error("failed to get project ability for user {}", username, t);
+ return RestfulUtils.dealError("获取工程能力失败");
+ }
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/DSSFrameworkOrchestratorService.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/DSSFrameworkOrchestratorService.java
new file mode 100644
index 0000000000..a9618f4550
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/DSSFrameworkOrchestratorService.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.service;
+
+import com.webank.wedatasphere.dss.framework.project.entity.request.OrchestratorCreateRequest;
+import com.webank.wedatasphere.dss.framework.project.entity.request.OrchestratorDeleteRequest;
+import com.webank.wedatasphere.dss.framework.project.entity.request.OrchestratorModifyRequest;
+import com.webank.wedatasphere.dss.framework.project.entity.vo.CommonOrchestratorVo;
+import com.webank.wedatasphere.dss.standard.app.sso.Workspace;
+
+
+public interface DSSFrameworkOrchestratorService {
+
+
+
+ CommonOrchestratorVo createOrchestrator(String username, OrchestratorCreateRequest orchestratorCreateRequest, Workspace workspace) throws Exception;
+
+
+
+ CommonOrchestratorVo modifyOrchestrator(String username, OrchestratorModifyRequest orchestratorModifyRequest, Workspace workspace) throws Exception;
+
+
+
+ CommonOrchestratorVo deleteOrchestrator(String username, OrchestratorDeleteRequest orchestratorDeleteRequest, Workspace workspace) throws Exception;
+
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/DSSFrameworkProjectService.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/DSSFrameworkProjectService.java
new file mode 100644
index 0000000000..920e4ff410
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/DSSFrameworkProjectService.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.service;
+
+import com.webank.wedatasphere.dss.framework.project.entity.request.ProjectCreateRequest;
+import com.webank.wedatasphere.dss.framework.project.entity.request.ProjectModifyRequest;
+import com.webank.wedatasphere.dss.framework.project.entity.vo.DSSProjectDetailVo;
+import com.webank.wedatasphere.dss.framework.project.entity.vo.DSSProjectVo;
+import com.webank.wedatasphere.dss.framework.project.entity.vo.ProcessNode;
+import com.webank.wedatasphere.dss.framework.project.exception.DSSProjectErrorException;
+import com.webank.wedatasphere.dss.standard.app.sso.Workspace;
+
+import java.util.List;
+
+
+public interface DSSFrameworkProjectService {
+
+ DSSProjectDetailVo getProjectSettings(Long projectId);
+
+
+ DSSProjectVo createProject(ProjectCreateRequest projectCreateRequest, String username, Workspace workspace) throws Exception;
+
+ void modifyProject(ProjectModifyRequest projectModifyRequest, String username) throws Exception;
+
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/DSSOrchestratorService.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/DSSOrchestratorService.java
new file mode 100644
index 0000000000..b397e358c1
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/DSSOrchestratorService.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import java.util.*;
+
+import com.webank.wedatasphere.dss.framework.common.exception.DSSFrameworkErrorException;
+import com.webank.wedatasphere.dss.framework.project.entity.*;
+import com.webank.wedatasphere.dss.framework.project.entity.request.*;
+import com.webank.wedatasphere.dss.framework.project.entity.vo.OrchestratorBaseInfo;
+import com.webank.wedatasphere.dss.framework.project.exception.DSSProjectErrorException;
+import com.webank.wedatasphere.dss.orchestrator.common.protocol.RequestProjectImportOrchestrator;
+import com.webank.wedatasphere.dss.orchestrator.common.ref.OrchestratorCreateResponseRef;
+
+
+public interface DSSOrchestratorService extends IService {
+
+
+ void saveOrchestrator(OrchestratorCreateRequest orchestratorCreateRequest, OrchestratorCreateResponseRef responseRef, String username) throws DSSFrameworkErrorException, DSSProjectErrorException;
+
+
+ void updateOrchestrator(OrchestratorModifyRequest orchestratorModifyRequest, String username) throws DSSFrameworkErrorException, DSSProjectErrorException;
+
+
+ List getListByPage(OrchestratorRequest orchestratorRequest, String username);
+
+
+ boolean deleteOrchestrator(OrchestratorDeleteRequest orchestratorDeleteRequest, String username) throws DSSProjectErrorException;
+
+
+ void isExistSameNameBeforeCreate(Long workspaceId, Long projectId, String orchestratorName) throws DSSFrameworkErrorException;
+
+
+ Long isExistSameNameBeforeUpdate(OrchestratorModifyRequest orchestratorModifRequest)throws DSSFrameworkErrorException;
+
+
+ DSSOrchestrator getOrchestratorById(Long id);
+
+ Long importOrchestrator(RequestProjectImportOrchestrator orchestratorInfo) throws Exception;
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/DSSProjectService.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/DSSProjectService.java
new file mode 100644
index 0000000000..6d1d02d845
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/DSSProjectService.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.webank.wedatasphere.dss.common.label.DSSLabel;
+import com.webank.wedatasphere.dss.framework.project.entity.DSSProjectDO;
+import com.webank.wedatasphere.dss.framework.project.entity.request.ProjectCreateRequest;
+import com.webank.wedatasphere.dss.framework.project.entity.request.ProjectDeleteRequest;
+import com.webank.wedatasphere.dss.framework.project.entity.request.ProjectModifyRequest;
+import com.webank.wedatasphere.dss.framework.project.entity.request.ProjectQueryRequest;
+import com.webank.wedatasphere.dss.framework.project.entity.response.ProjectResponse;
+import com.webank.wedatasphere.dss.framework.project.entity.vo.ProjectInfoVo;
+import com.webank.wedatasphere.dss.framework.project.exception.DSSProjectErrorException;
+import com.webank.wedatasphere.dss.orchestrator.common.entity.DSSOrchestratorInfo;
+import com.webank.wedatasphere.dss.orchestrator.common.protocol.RequestProjectImportOrchestrator;
+import com.webank.wedatasphere.dss.standard.app.sso.Workspace;
+import com.webank.wedatasphere.dss.standard.common.desc.AppInstance;
+
+import java.util.List;
+import java.util.Map;
+
+public interface DSSProjectService extends IService {
+
+
+ DSSProjectDO createProject(String username, ProjectCreateRequest projectCreateRequest);
+
+
+ void modifyProject(String username, ProjectModifyRequest modifyRequest) throws DSSProjectErrorException;
+
+
+ DSSProjectDO getProjectByName(String name);
+
+
+ DSSProjectDO getProjectById(Long id);
+
+
+ List getListByParam(ProjectQueryRequest projectRequest);
+
+
+ ProjectInfoVo getProjectInfoById(Long id);
+
+ void saveProjectRelation(DSSProjectDO project, Map projectMap);
+
+ Long getAppConnProjectId(Long dssProjectId, String appConnName, List dssLabels) throws Exception;
+
+ void deleteProject(String username, ProjectDeleteRequest projectDeleteRequest, Workspace workspace) throws Exception;
+
+ List getProjectAbilities(String username);
+
+
+ Long importOrchestrator(RequestProjectImportOrchestrator orchestratorInfo) throws Exception;
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/DSSProjectUserService.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/DSSProjectUserService.java
new file mode 100644
index 0000000000..65b3b4e75f
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/DSSProjectUserService.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.service;
+
+import com.webank.wedatasphere.dss.framework.project.entity.DSSProjectDO;
+import com.webank.wedatasphere.dss.framework.project.entity.request.ProjectCreateRequest;
+import com.webank.wedatasphere.dss.framework.project.entity.DSSProjectUser;
+import com.webank.wedatasphere.dss.framework.project.entity.request.ProjectModifyRequest;
+import com.webank.wedatasphere.dss.framework.project.exception.DSSProjectErrorException;
+
+import java.util.List;
+
+public interface DSSProjectUserService {
+
+
+ boolean isEditProjectAuth(Long projectId,String username) throws DSSProjectErrorException;
+
+
+ List getEditProjectList(Long projectId, String username);
+
+
+ void saveProjectUser(Long projectID, String username, ProjectCreateRequest dssProjectCreateRequest)throws Exception;
+
+
+ void modifyProjectUser(DSSProjectDO dbProject, ProjectModifyRequest projectModifyRequest, String loginuser)throws Exception;
+
+
+ List getListByParam(Long workspaceId, String username);
+
+
+ boolean isAdminByUsername(Long workspaceId,String username);
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/impl/DSSFrameworkOrchestratorServiceImpl.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/impl/DSSFrameworkOrchestratorServiceImpl.java
new file mode 100644
index 0000000000..54642b9584
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/impl/DSSFrameworkOrchestratorServiceImpl.java
@@ -0,0 +1,295 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.service.impl;
+
+
+import com.webank.wedatasphere.dss.appconn.core.ext.OnlyDevelopmentAppConn;
+import com.webank.wedatasphere.dss.appconn.manager.AppConnManager;
+import com.webank.wedatasphere.dss.common.label.DSSLabel;
+import com.webank.wedatasphere.dss.common.label.EnvDSSLabel;
+import com.webank.wedatasphere.dss.common.utils.DSSExceptionUtils;
+import com.webank.wedatasphere.dss.framework.project.conf.ProjectConf;
+import com.webank.wedatasphere.dss.framework.project.contant.OrchestratorTypeEnum;
+import com.webank.wedatasphere.dss.framework.project.contant.ProjectServerResponse;
+import com.webank.wedatasphere.dss.framework.project.dao.DSSOrchestratorMapper;
+import com.webank.wedatasphere.dss.framework.project.entity.DSSOrchestrator;
+import com.webank.wedatasphere.dss.framework.project.entity.request.OrchestratorCreateRequest;
+import com.webank.wedatasphere.dss.framework.project.entity.request.OrchestratorDeleteRequest;
+import com.webank.wedatasphere.dss.framework.project.entity.request.OrchestratorModifyRequest;
+import com.webank.wedatasphere.dss.framework.project.entity.vo.CommonOrchestratorVo;
+import com.webank.wedatasphere.dss.framework.project.entity.vo.ProjectInfoVo;
+import com.webank.wedatasphere.dss.framework.project.exception.DSSProjectErrorException;
+import com.webank.wedatasphere.dss.framework.project.service.DSSFrameworkOrchestratorService;
+import com.webank.wedatasphere.dss.framework.project.service.DSSOrchestratorService;
+import com.webank.wedatasphere.dss.framework.project.service.DSSProjectService;
+import com.webank.wedatasphere.dss.orchestrator.common.entity.DSSOrchestratorInfo;
+import com.webank.wedatasphere.dss.orchestrator.common.ref.DefaultOrchestratorCreateRequestRef;
+import com.webank.wedatasphere.dss.orchestrator.common.ref.OrchestratorCreateRequestRef;
+import com.webank.wedatasphere.dss.orchestrator.common.ref.OrchestratorCreateResponseRef;
+import com.webank.wedatasphere.dss.orchestrator.common.ref.OrchestratorFrameworkAppConn;
+import com.webank.wedatasphere.dss.orchestrator.common.ref.impl.WorkflowOrchestratoDeleteRequestRef;
+import com.webank.wedatasphere.dss.orchestrator.common.ref.impl.WorkflowOrchestratorUpdateRequestRef;
+import com.webank.wedatasphere.dss.orchestrator.core.type.OrchestratorKindEnum;
+import com.webank.wedatasphere.dss.standard.app.development.operation.RefCreationOperation;
+import com.webank.wedatasphere.dss.standard.app.development.operation.RefDeletionOperation;
+import com.webank.wedatasphere.dss.standard.app.development.operation.RefUpdateOperation;
+import com.webank.wedatasphere.dss.standard.app.development.ref.CommonResponseRef;
+import com.webank.wedatasphere.dss.standard.app.development.service.RefCRUDService;
+import com.webank.wedatasphere.dss.standard.app.development.standard.DevelopmentIntegrationStandard;
+import com.webank.wedatasphere.dss.standard.app.sso.Workspace;
+import com.webank.wedatasphere.dss.standard.common.desc.AppInstance;
+import com.webank.wedatasphere.dss.standard.common.exception.operation.ExternalOperationFailedException;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+
+public class DSSFrameworkOrchestratorServiceImpl implements DSSFrameworkOrchestratorService {
+
+ protected final Logger LOGGER = LoggerFactory.getLogger(getClass());
+
+ @Autowired
+ private DSSOrchestratorMapper orchestratorMapper;
+ @Autowired
+ private DSSOrchestratorService orchestratorService;
+ @Autowired
+ private DSSProjectService projectService;
+
+ /**
+ * 1.拿到的dss orchestrator的appconn
+ * 2.然后创建
+ *
+ * @param orchestratorCreateRequest 创建参数
+ * @return
+ */
+ @Override
+ @SuppressWarnings("ConstantConditions")
+ public CommonOrchestratorVo createOrchestrator(String username, OrchestratorCreateRequest orchestratorCreateRequest,
+ Workspace workspace) throws Exception {
+ //是否存在相同的编排名称
+ orchestratorService.isExistSameNameBeforeCreate(orchestratorCreateRequest.getProjectId(),orchestratorCreateRequest.getWorkspaceId(),orchestratorCreateRequest.getOrchestratorName());
+ //判断工程是否存在,并且取出工程名称和空间名称
+ ProjectInfoVo projectInfoVo = projectService.getProjectInfoById(orchestratorCreateRequest.getProjectId());
+ if (projectInfoVo == null) {
+ DSSExceptionUtils.dealErrorException(ProjectServerResponse.PROJECT_NOT_EXIST.getCode(),
+ ProjectServerResponse.PROJECT_NOT_EXIST.getMsg(), DSSProjectErrorException.class);
+ }
+ //1.去orchestratorFramework创建编排模式
+ //2.将工程和orchestrator的关系存储到的数据库中
+ LOGGER.info("{} begins to create a orchestrator {}", username, orchestratorCreateRequest);
+ //新建编排模式需要将编排模式的类型等内容提交给OrchestratorFramework
+ CommonOrchestratorVo orchestratorVo = new CommonOrchestratorVo();
+ try {
+ OrchestratorKindEnum orchestratorKindEnum = OrchestratorKindEnum.
+ getType(OrchestratorTypeEnum.getTypeByKey(orchestratorCreateRequest.getOrchestratorMode()));
+ List dssLabels = Arrays.asList(new EnvDSSLabel(orchestratorCreateRequest.getLabels().getRoute()));
+ OrchestratorCreateRequestRef orchestratorCreateRequestRef = null;
+ String appconnName = "workflow";
+ switch (orchestratorKindEnum) {
+ case WORKFLOW:
+ orchestratorCreateRequestRef = new DefaultOrchestratorCreateRequestRef();
+ appconnName = "workflow";
+ break;
+ case COMBINED:
+ appconnName = "combined";
+ break;
+ case SINGLE_TASK:
+ appconnName = "singleTask";
+ break;
+ default:
+ orchestratorCreateRequestRef = new DefaultOrchestratorCreateRequestRef();
+ }
+ orchestratorCreateRequestRef.setUserName(username);
+ orchestratorCreateRequestRef.setDSSLabels(dssLabels);
+ orchestratorCreateRequestRef.setProjectId(orchestratorCreateRequest.getProjectId());
+ orchestratorCreateRequestRef.setProjectName(StringUtils.isBlank(orchestratorCreateRequest.getProjectName()) ? projectInfoVo.getProjectName() : orchestratorCreateRequest.getProjectName());
+ orchestratorCreateRequestRef.setWorkspaceName(StringUtils.isBlank(orchestratorCreateRequest.getWorkspaceName()) ? projectInfoVo.getWorkspaceName() : orchestratorCreateRequest.getWorkspaceName());
+ DSSOrchestratorInfo dssOrchestratorInfo = new DSSOrchestratorInfo();
+ dssOrchestratorInfo.setType(orchestratorKindEnum.getName());
+ dssOrchestratorInfo.setDesc(orchestratorCreateRequest.getDescription());
+ dssOrchestratorInfo.setCreateTime(new Date(System.currentTimeMillis()));
+ dssOrchestratorInfo.setAppConnName(appconnName);
+ dssOrchestratorInfo.setName(orchestratorCreateRequest.getOrchestratorName());
+ dssOrchestratorInfo.setCreator(username);
+ dssOrchestratorInfo.setProjectId(orchestratorCreateRequest.getProjectId());
+ dssOrchestratorInfo.setComment(orchestratorCreateRequest.getDescription());
+ dssOrchestratorInfo.setSecondaryType(orchestratorCreateRequest.getOrchestratorWays().toString());
+ orchestratorCreateRequestRef.setDssOrchestratorInfo(dssOrchestratorInfo);
+ //根据label获取对应label的创建operation
+ RefCreationOperation refCreationOperation =
+ getRefCreationOperation(dssLabels).getRefCreationOperation();
+ //调用orchestrator服务 创建编排模式、编排模式版本
+ OrchestratorCreateResponseRef responseRef =(OrchestratorCreateResponseRef) refCreationOperation.createRef(orchestratorCreateRequestRef);
+ LOGGER.info("operation ends to create ref, content is {}", responseRef.getContent());
+ Long orchestratorId = responseRef.getOrcId();
+ Long versionId = responseRef.getOrchestratorVersionId();
+ LOGGER.info("orchestratorId is {}, and version is {}", orchestratorId, versionId);
+ orchestratorVo.setOrchestratorId(orchestratorId);
+ //保存编排模式到数据库
+ orchestratorService.saveOrchestrator(orchestratorCreateRequest, responseRef, username);
+ } catch (final Exception e) {
+ DSSExceptionUtils.dealErrorException(60033, "failed to create orchestrator", e, DSSProjectErrorException.class);
+ }
+ return orchestratorVo;
+ }
+
+ @Override
+ public CommonOrchestratorVo modifyOrchestrator(String username, OrchestratorModifyRequest orchestratorModifyRequest, Workspace workspace) throws Exception {
+ //判断工程是否存在,并且取出工程名称和空间名称
+ ProjectInfoVo projectInfoVo = projectService.getProjectInfoById(orchestratorModifyRequest.getProjectId());
+ if (projectInfoVo == null) {
+ DSSExceptionUtils.dealErrorException(ProjectServerResponse.PROJECT_NOT_EXIST.getCode(),
+ ProjectServerResponse.PROJECT_NOT_EXIST.getMsg(), DSSProjectErrorException.class);
+ }
+ //是否存在相同的编排名称
+ Long orchestratorId = orchestratorService.isExistSameNameBeforeUpdate(orchestratorModifyRequest);
+ //1.去orchestratorFramework创建编排模式
+ //2.将工程和orchestrator的关系存储到的数据库中
+ LOGGER.info("{} begins to update a orchestrator {}", username, orchestratorModifyRequest);
+ //新建编排模式需要将编排模式的类型等内容提交给OrchestratorFramework
+ CommonOrchestratorVo orchestratorVo = new CommonOrchestratorVo();
+ try {
+ OrchestratorKindEnum orchestratorKindEnum = OrchestratorKindEnum.
+ getType(OrchestratorTypeEnum.getTypeByKey(orchestratorModifyRequest.getOrchestratorMode()));
+ List dssLabels = Arrays.asList(new EnvDSSLabel(orchestratorModifyRequest.getLabels().getRoute()));
+ String appconnName = "workflow";
+ WorkflowOrchestratorUpdateRequestRef orchestratorUpdateRequestRef = new WorkflowOrchestratorUpdateRequestRef();
+ switch (orchestratorKindEnum) {
+ case COMBINED:
+ appconnName = "combined";
+ break;
+ case SINGLE_TASK:
+ appconnName = "singleTask";
+ break;
+ default:
+ appconnName = "workflow";
+ orchestratorUpdateRequestRef = new WorkflowOrchestratorUpdateRequestRef();
+ }
+ DSSOrchestratorInfo dssOrchestratorInfo = new DSSOrchestratorInfo();
+ dssOrchestratorInfo.setId(orchestratorId);
+ dssOrchestratorInfo.setType(orchestratorKindEnum.getName());
+ dssOrchestratorInfo.setDesc(orchestratorModifyRequest.getDescription());
+ dssOrchestratorInfo.setCreateTime(new Date(System.currentTimeMillis()));
+ dssOrchestratorInfo.setAppConnName(appconnName);
+ dssOrchestratorInfo.setName(orchestratorModifyRequest.getOrchestratorName());
+ dssOrchestratorInfo.setCreator(username);
+ dssOrchestratorInfo.setProjectId(orchestratorModifyRequest.getProjectId());
+ dssOrchestratorInfo.setComment(orchestratorModifyRequest.getDescription());
+ dssOrchestratorInfo.setSecondaryType(orchestratorModifyRequest.getOrchestratorWays().toString());
+ String workspaceName = projectInfoVo.getWorkspaceName();
+
+ orchestratorUpdateRequestRef.setUserName(username);
+ orchestratorUpdateRequestRef.setWorkspaceName(workspaceName);
+ orchestratorUpdateRequestRef.setDssOrchestratorInfo(dssOrchestratorInfo);
+ orchestratorUpdateRequestRef.setDSSLabels(dssLabels);
+
+ //根据label获取对应label的创建operation
+ RefUpdateOperation updateOperation = getRefCreationOperation(dssLabels).getRefUpdateOperation();
+ //调用orchestrator服务 更新编排模式、编排模式版本
+ LOGGER.info("----orchestratorUpdateRequestRef---> {}", orchestratorUpdateRequestRef);
+ CommonResponseRef responseRef = (CommonResponseRef)updateOperation.updateRef(orchestratorUpdateRequestRef);
+ LOGGER.info("operation ends to updateOrchestrator ref, UpdateResult is {},ErrorMsg is {}", responseRef.getResult(),responseRef.getErrorMsg());
+
+ //保存编排模式
+ orchestratorService.updateOrchestrator(orchestratorModifyRequest, username);
+ } catch (final Exception e) {
+ DSSExceptionUtils.dealErrorException(60034, "failed to create orchestrator", e, DSSProjectErrorException.class);
+ }
+ return orchestratorVo;
+ }
+
+ @Override
+ public CommonOrchestratorVo deleteOrchestrator(String username, OrchestratorDeleteRequest orchestratorDeleteRequest, Workspace workspace) throws Exception {
+ //判断工程是否存在,并且取出工程名称和空间名称
+ ProjectInfoVo projectInfoVo = projectService.getProjectInfoById(orchestratorDeleteRequest.getProjectId());
+ if (projectInfoVo == null) {
+ DSSExceptionUtils.dealErrorException(ProjectServerResponse.PROJECT_NOT_EXIST.getCode(),
+ ProjectServerResponse.PROJECT_NOT_EXIST.getMsg(), DSSProjectErrorException.class);
+ }
+
+ DSSOrchestrator orchestrator = orchestratorService.getOrchestratorById(orchestratorDeleteRequest.getId());
+ //1.去orchestratorFramework创建编排模式
+ //2.将工程和orchestrator的关系存储到的数据库中
+ LOGGER.info("{} begins to delete a orchestrator {}", username, orchestratorDeleteRequest);
+ //新建编排模式需要将编排模式的类型等内容提交给OrchestratorFramework
+ CommonOrchestratorVo orchestratorVo = new CommonOrchestratorVo();
+ try {
+ String uuid = orchestratorMapper.getUUID(orchestrator.getOrchestratorId());
+ if(StringUtils.isBlank(uuid)){
+ DSSExceptionUtils.dealErrorException(60035,"工作流不存在", DSSProjectErrorException.class);
+ }
+ List dssLabels = Arrays.asList(new EnvDSSLabel(orchestratorDeleteRequest.getLabels().getRoute()));
+ WorkflowOrchestratoDeleteRequestRef orchestratorDeleteRequestRef = new WorkflowOrchestratoDeleteRequestRef();
+ String workspaceName = projectInfoVo.getWorkspaceName();
+ String projectName = projectInfoVo.getProjectName();
+ orchestratorDeleteRequestRef.setUserName(username);
+ orchestratorDeleteRequestRef.setWorkspaceName(workspaceName);
+ orchestratorDeleteRequestRef.setProjectName(projectName);
+ orchestratorDeleteRequestRef.setDSSLabels(dssLabels);
+ orchestratorDeleteRequestRef.setOrcId(orchestrator.getOrchestratorId());
+ RefDeletionOperation refDeletionOperation =
+ getRefCreationOperation(dssLabels).getRefDeletionOperation();
+
+ deleteOperation(refDeletionOperation, orchestratorDeleteRequestRef, uuid);
+
+ //删除编排模式
+ orchestratorService.deleteOrchestrator(orchestratorDeleteRequest, username);
+ } catch (final Exception e) {
+ DSSExceptionUtils.dealErrorException(60035, "failed to delete orchestrator", e, DSSProjectErrorException.class);
+ }
+ return orchestratorVo;
+ }
+
+ protected void deleteOperation(RefDeletionOperation refDeletionOperation,
+ WorkflowOrchestratoDeleteRequestRef orchestratorDeleteRequestRef, String uuid) throws ExternalOperationFailedException {
+ //调用orchestrator服务 创建编排模式、编排模式版本
+ refDeletionOperation.deleteRef(orchestratorDeleteRequestRef);
+ LOGGER.info("Operation deleteOrchestrator[DEV] for uuid {} success.", uuid);
+ }
+
+ /**
+ * 获取更新的operation
+ *
+ * @param dssLabels 根据label获取对应label的创建operation
+ * todo 目前已经写死
+ * @return
+ * @throws Exception
+ */
+ public RefCRUDService getRefCreationOperation(List dssLabels) throws Exception {
+ OrchestratorFrameworkAppConn orcAppConn = AppConnManager.getAppConnManager().getAppConn(OrchestratorFrameworkAppConn.class);
+
+ if (orcAppConn == null) {
+ LOGGER.error("orcAppConn is null, will not go on creating orchestrator");
+ DSSExceptionUtils.dealErrorException(60028, "orcAppConn is null", DSSProjectErrorException.class);
+ }
+
+ DevelopmentIntegrationStandard standard = ((OnlyDevelopmentAppConn)orcAppConn).getOrCreateDevelopmentStandard();
+ if (standard == null) {
+ LOGGER.error("standard is null, will not go on creating orchestrator");
+ DSSExceptionUtils.dealErrorException(60028, "standard is null", DSSProjectErrorException.class);
+ }
+ AppInstance appInstance = orcAppConn.getAppDesc().getAppInstancesByLabels(dssLabels).get(0);
+
+ RefCRUDService service = standard.getRefCRUDService(appInstance);
+ return service;
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/impl/DSSFrameworkProjectServiceImpl.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/impl/DSSFrameworkProjectServiceImpl.java
new file mode 100644
index 0000000000..fd1f2b6bf8
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/impl/DSSFrameworkProjectServiceImpl.java
@@ -0,0 +1,226 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.service.impl;
+
+import com.webank.wedatasphere.dss.appconn.core.AppConn;
+import com.webank.wedatasphere.dss.appconn.core.ext.OnlyStructureAppConn;
+import com.webank.wedatasphere.dss.appconn.manager.AppConnManager;
+import com.webank.wedatasphere.dss.common.utils.DSSExceptionUtils;
+import com.webank.wedatasphere.dss.framework.project.contant.ProjectServerResponse;
+import com.webank.wedatasphere.dss.framework.project.entity.DSSProjectDO;
+import com.webank.wedatasphere.dss.framework.project.entity.request.ProjectCreateRequest;
+import com.webank.wedatasphere.dss.framework.project.entity.request.ProjectModifyRequest;
+import com.webank.wedatasphere.dss.framework.project.entity.vo.DSSProjectDetailVo;
+import com.webank.wedatasphere.dss.framework.project.entity.vo.DSSProjectVo;
+import com.webank.wedatasphere.dss.framework.project.exception.DSSProjectErrorException;
+import com.webank.wedatasphere.dss.framework.project.exception.LambdaWarnException;
+import com.webank.wedatasphere.dss.framework.project.service.DSSFrameworkProjectService;
+import com.webank.wedatasphere.dss.framework.project.service.DSSProjectService;
+import com.webank.wedatasphere.dss.framework.project.service.DSSProjectUserService;
+import com.webank.wedatasphere.dss.standard.app.sso.Workspace;
+import com.webank.wedatasphere.dss.standard.app.structure.StructureIntegrationStandard;
+import com.webank.wedatasphere.dss.standard.app.structure.project.ProjectCreationOperation;
+import com.webank.wedatasphere.dss.standard.app.structure.project.ProjectDeletionOperation;
+import com.webank.wedatasphere.dss.standard.app.structure.project.ProjectRequestRef;
+import com.webank.wedatasphere.dss.standard.app.structure.project.ProjectRequestRefImpl;
+import com.webank.wedatasphere.dss.standard.app.structure.project.ProjectResponseRef;
+import com.webank.wedatasphere.dss.standard.app.structure.project.ProjectService;
+import com.webank.wedatasphere.dss.standard.app.structure.project.ProjectUpdateOperation;
+import com.webank.wedatasphere.dss.standard.common.desc.AppInstance;
+import com.webank.wedatasphere.dss.standard.common.exception.operation.ExternalOperationFailedException;
+import com.webank.wedatasphere.linkis.common.conf.CommonVars;
+import java.util.HashMap;
+import java.util.Map;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+
+
+@Component
+public class DSSFrameworkProjectServiceImpl implements DSSFrameworkProjectService {
+ private static final Logger LOGGER = LoggerFactory.getLogger(DSSFrameworkProjectServiceImpl.class);
+ @Autowired
+ private DSSProjectService projectService;
+ @Autowired
+ private DSSProjectUserService projectUserService;
+
+ public static final String MODE_SPLIT = ",";
+
+ private static final boolean STRICT_PROJECT_CREATE_MODE = CommonVars.apply("wds.dss.project.strict.mode", false).getValue();
+
+ @Override
+ public DSSProjectDetailVo getProjectSettings(Long projectId) {
+ return null;
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public DSSProjectVo createProject(ProjectCreateRequest projectCreateRequest, String username, Workspace workspace) throws Exception {
+ //1.新建DSS工程,这样才能进行回滚,如果后面去DSS工程,可能会由于DSS工程建立失败了,但是仍然无法去回滚第三方系统的工程
+ //2.开始创建appconn的相关的工程,如果失败了,抛异常,然后进行数据库进行回滚
+
+ //判断工程是否存在相同的名称
+ DSSProjectDO dbProject = projectService.getProjectByName(projectCreateRequest.getName());
+ if (dbProject != null) {
+ DSSExceptionUtils.dealErrorException(60022, String.format("project name already has the same name %s ", projectCreateRequest.getName()), DSSProjectErrorException.class);
+ }
+ //todo 创建appconn的相关的工程 还没有调试通过
+ Map projectMap = createAppConnProject(projectCreateRequest, username, workspace);
+ if (null == projectMap) {
+ LOGGER.error("projectMap is null, it means some appConns create project failed");
+ throw new DSSProjectErrorException(71000, "projectMap is null, create project in appconn failed");
+ }
+ //3.保存dss_project
+ DSSProjectDO project = projectService.createProject(username, projectCreateRequest);
+ //4.保存dss_project_user 工程与用户关系
+ projectUserService.saveProjectUser(project.getId(), username, projectCreateRequest);
+ //5.保存dss工程与其他工程的对应关系,应该都是以id来作为标识
+ if (null != projectMap && projectMap.size() > 0) {
+ projectService.saveProjectRelation(project, projectMap);
+ }
+ DSSProjectVo dssProjectVo = new DSSProjectVo();
+ dssProjectVo.setDescription(project.getDescription());
+ dssProjectVo.setId(project.getId());
+ dssProjectVo.setName(project.getName());
+ return dssProjectVo;
+ }
+
+
+ @Override
+ public void modifyProject(ProjectModifyRequest projectModifyRequest, String username) throws Exception {
+ DSSProjectDO dbProject = projectService.getProjectById(projectModifyRequest.getId());
+ //如果不是工程的创建人,则校验是否管理员
+ if (!username.equalsIgnoreCase(dbProject.getCreateBy())) {
+ boolean isAdmin = projectUserService.isAdminByUsername(projectModifyRequest.getWorkspaceId(), username);
+ //非管理员
+ if (!isAdmin) {
+ DSSExceptionUtils.dealErrorException(ProjectServerResponse.PROJECT_IS_NOT_ADMIN.getCode(), ProjectServerResponse.PROJECT_IS_NOT_ADMIN.getMsg(), DSSProjectErrorException.class);
+ }
+ }
+ //工程不存在
+ if (dbProject == null) {
+ LOGGER.error("{} project id is null, can not modify", projectModifyRequest.getName());
+ DSSExceptionUtils.dealErrorException(60021,
+ String.format("%s project id is null, can not modify", projectModifyRequest.getName()), DSSProjectErrorException.class);
+ }
+ //不允许修改工程名称
+ if (!dbProject.getName().toUpperCase().equals(projectModifyRequest.getName().toUpperCase())) {
+ DSSExceptionUtils.dealErrorException(ProjectServerResponse.PROJECT_NOT_EDIT_NAME.getCode(), ProjectServerResponse.PROJECT_NOT_EDIT_NAME.getMsg(), DSSProjectErrorException.class);
+ }
+ //1.统一修改各个接入的第三方的系统的工程状态信息
+ //todo 第三方的工程修改接口还是没有调试通过
+// modifyThirdProject(projectModifyRequest, username);
+ //2.修改dss_project DSS基本工程信息
+ projectService.modifyProject(username, projectModifyRequest);
+ try {
+ //todo 3.修改dss_project_user 工程与用户关系 这一步还没有调试通过
+ projectUserService.modifyProjectUser(dbProject, projectModifyRequest, username);
+ } catch (Exception e) {
+ LOGGER.error("modifyProjectUserError:", e);
+ }
+ }
+
+ //统一修改各个接入的第三方的系统的工程状态信息 修改dss_project调用
+ private void modifyThirdProject(ProjectModifyRequest projectModifyRequest, String username) {
+ for (AppConn appConn : AppConnManager.getAppConnManager().listAppConns()) {
+ ProjectRequestRef projectRequestRef = new ProjectRequestRefImpl();
+ projectRequestRef.setDescription(projectModifyRequest.getDescription());
+ projectRequestRef.setUpdateBy(username);
+ projectRequestRef.setName(projectModifyRequest.getName());
+ if (appConn instanceof OnlyStructureAppConn) {
+ StructureIntegrationStandard appStandard = ((OnlyStructureAppConn) appConn).getOrCreateStructureStandard();
+ for (AppInstance appInstance : appConn.getAppDesc().getAppInstances()) {
+ ProjectService projectService = appStandard.getProjectService(appInstance);
+ ProjectUpdateOperation operation = projectService.getProjectUpdateOperation();
+ try {
+ ProjectResponseRef responseRef = operation.updateProject(projectRequestRef);
+ } catch (ExternalOperationFailedException e) {
+ DSSExceptionUtils.dealWarnException(60015,
+ String.format("failed to update project %s", projectModifyRequest.getName()), e, LambdaWarnException.class);
+ }
+ }
+ }
+ }
+ }
+
+ //1.新建DSS工程,这样才能进行回滚,如果后面去DSS工程,可能会由于DSS工程建立失败了,但是仍然无法去回滚第三方系统的工程 新增dss_project调用
+ private Map createAppConnProject(ProjectCreateRequest dssProjectCreateRequest, String username,
+ Workspace workspace) throws DSSProjectErrorException {
+ Map projectMap = new HashMap<>(16);
+ Map successAppConns = new HashMap<>(16);
+ boolean createFailed = false;
+ ProjectRequestRefImpl requestRef = new ProjectRequestRefImpl();
+ requestRef.setName(dssProjectCreateRequest.getName());
+ requestRef.setCreateBy(username);
+ requestRef.setDescription(dssProjectCreateRequest.getDescription());
+ requestRef.setWorkspaceName(dssProjectCreateRequest.getWorkspaceName());
+ requestRef.setWorkspace(workspace);
+ for (AppConn appConn : AppConnManager.getAppConnManager().listAppConns()) {
+ if (appConn instanceof OnlyStructureAppConn) {
+ OnlyStructureAppConn onlyStructureAppConn = (OnlyStructureAppConn) appConn;
+ StructureIntegrationStandard appStandard = onlyStructureAppConn.getOrCreateStructureStandard();
+ //如果该AppConn是有structureIntegrationStandard的话,那么所有的appinstance都要进行新建工程
+ for (AppInstance appInstance : appConn.getAppDesc().getAppInstances()) {
+ ProjectService projectService = appStandard.getProjectService(appInstance);
+ if(projectService == null) {
+ continue;
+ }
+ ProjectCreationOperation projectCreationOperation = projectService.getProjectCreationOperation();
+ try {
+ LOGGER.info("Begin to create project {} in {}", dssProjectCreateRequest.getName(), appConn.getAppDesc().getAppName());
+ ProjectResponseRef responseRef = projectCreationOperation.createProject(requestRef);
+ LOGGER.info("End to create project {} in {}, response projectId is {} ",
+ dssProjectCreateRequest.getName(), appConn.getAppDesc().getAppName(), responseRef.getProjectRefId());
+ successAppConns.put(appConn, responseRef);
+ Long projectRefId = responseRef.getProjectRefId();
+ projectMap.put(appInstance, projectRefId);
+ } catch (final Exception e) {
+ LOGGER.error("Failed to create project {} in {}", dssProjectCreateRequest.getName(), appConn.getAppDesc().getAppInstances(), e);
+ createFailed = true;
+ //break;
+ }
+ }
+ }
+ }
+ //如果创建失败并且是严格创建模式
+ if (createFailed && STRICT_PROJECT_CREATE_MODE) {
+ //如果一个AppInstance实例是失败的,那么我们将所有已经建的工程给撤销掉
+ for (AppConn appConn : successAppConns.keySet()) {
+ StructureIntegrationStandard appStandard = null;
+ if (appConn instanceof OnlyStructureAppConn) {
+ OnlyStructureAppConn onlyStructureAppConn = (OnlyStructureAppConn) appConn;
+ appStandard = onlyStructureAppConn.getOrCreateStructureStandard();
+ for (AppInstance appInstance : appConn.getAppDesc().getAppInstances()) {
+ ProjectService projectService = appStandard.getProjectService(appInstance);
+ ProjectDeletionOperation operation = projectService.getProjectDeletionOperation();
+ try {
+ operation.deleteProject(requestRef);
+ } catch (ExternalOperationFailedException e) {
+ LOGGER.error("Failed to delete project {} in {}",
+ requestRef.getName(), appConn.getAppDesc().getAppName(), e);
+ //TODO 如果删除不了,可以先不管
+ }
+ }
+ }
+ }
+ projectMap = null;
+ }
+ return projectMap;
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/impl/DSSOrchestratorServiceImpl.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/impl/DSSOrchestratorServiceImpl.java
new file mode 100644
index 0000000000..d301a718f5
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/impl/DSSOrchestratorServiceImpl.java
@@ -0,0 +1,306 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.webank.wedatasphere.dss.framework.common.exception.DSSFrameworkErrorException;
+import com.webank.wedatasphere.dss.framework.project.contant.OrchestratorTypeEnum;
+import com.webank.wedatasphere.dss.framework.project.contant.ProjectServerResponse;
+import com.webank.wedatasphere.dss.framework.project.dao.DSSOrchestratorMapper;
+import com.webank.wedatasphere.dss.framework.project.dao.DSSProjectMapper;
+import com.webank.wedatasphere.dss.framework.project.entity.DSSOrchestrator;
+import com.webank.wedatasphere.dss.framework.project.entity.DSSProjectDO;
+import com.webank.wedatasphere.dss.framework.project.entity.DSSProjectUser;
+import com.webank.wedatasphere.dss.framework.project.entity.request.OrchestratorCreateRequest;
+import com.webank.wedatasphere.dss.framework.project.entity.request.OrchestratorDeleteRequest;
+import com.webank.wedatasphere.dss.framework.project.entity.request.OrchestratorModifyRequest;
+import com.webank.wedatasphere.dss.framework.project.entity.request.OrchestratorRequest;
+import com.webank.wedatasphere.dss.framework.project.entity.vo.OrchestratorBaseInfo;
+import com.webank.wedatasphere.dss.framework.project.exception.DSSProjectErrorException;
+import com.webank.wedatasphere.dss.framework.project.service.DSSOrchestratorService;
+import com.webank.wedatasphere.dss.framework.project.service.DSSProjectUserService;
+import com.webank.wedatasphere.dss.framework.project.utils.ProjectStringUtils;
+import com.webank.wedatasphere.dss.orchestrator.common.protocol.RequestProjectImportOrchestrator;
+import com.webank.wedatasphere.dss.orchestrator.common.ref.OrchestratorCreateResponseRef;
+import com.webank.wedatasphere.dss.sender.service.DSSSenderServiceFactory;
+import com.webank.wedatasphere.linkis.rpc.Sender;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+
+@Service
+public class DSSOrchestratorServiceImpl extends ServiceImpl implements DSSOrchestratorService {
+ private static final Logger LOGGER = LoggerFactory.getLogger(DSSOrchestratorServiceImpl.class);
+ public static final String MODE_SPLIT = ",";
+ @Autowired
+ private DSSOrchestratorMapper orchestratorMapper;
+ @Autowired
+ private DSSProjectUserService projectUserService;
+ @Autowired
+ private DSSProjectMapper dssProjectMapper;
+
+ private final Sender orcSender = DSSSenderServiceFactory.getOrCreateServiceInstance().getScheduleOrcSender();
+
+ /**
+ * 保存编排模式
+ *
+ * @param orchestratorCreateRequest
+ * @param responseRef
+ * @param username
+ * @throws DSSFrameworkErrorException
+ * @throws DSSProjectErrorException
+ */
+ @Override
+ public void saveOrchestrator(OrchestratorCreateRequest orchestratorCreateRequest, OrchestratorCreateResponseRef responseRef, String username) throws DSSFrameworkErrorException, DSSProjectErrorException {
+ //todo 使用工程的权限关系来限定 校验当前登录用户是否含有修改权限
+ projectUserService.isEditProjectAuth(orchestratorCreateRequest.getProjectId(), username);
+ DSSOrchestrator orchestrator = new DSSOrchestrator();
+ orchestrator.setWorkspaceId(orchestratorCreateRequest.getWorkspaceId());
+ orchestrator.setProjectId(orchestratorCreateRequest.getProjectId());
+ //编排模式id(工作流,调用orchestrator服务返回的orchestratorId)
+ orchestrator.setOrchestratorId(responseRef.getOrcId());
+ //编排模式版本id(工作流,调用orchestrator服务返回的orchestratorVersionId)
+ orchestrator.setOrchestratorVersionId(responseRef.getOrchestratorVersionId());
+ //编排模式-名称
+ orchestrator.setOrchestratorName(orchestratorCreateRequest.getOrchestratorName());
+ //编排模式-类型
+ orchestrator.setOrchestratorMode(orchestratorCreateRequest.getOrchestratorMode());
+ //编排模式-方式
+ orchestrator.setOrchestratorWay(ProjectStringUtils.getModeStr(orchestratorCreateRequest.getOrchestratorWays()));
+ //编排模式-用途
+ orchestrator.setUses(orchestratorCreateRequest.getUses());
+ //编排模式-描述
+ orchestrator.setDescription(orchestratorCreateRequest.getDescription());
+ //编排模式-创建人
+ orchestrator.setCreateUser(username);
+ orchestrator.setCreateTime(new Date());
+ orchestrator.setUpdateTime(new Date());
+ this.save(orchestrator);
+ }
+
+ /**
+ * 更新编排模式
+ *
+ * @param orchestratorModifRequest
+ * @param username
+ * @throws DSSFrameworkErrorException
+ * @throws DSSProjectErrorException
+ */
+ @Override
+ public void updateOrchestrator(OrchestratorModifyRequest orchestratorModifRequest, String username) throws DSSFrameworkErrorException, DSSProjectErrorException {
+ //todo 使用工程的权限关系来限定 校验当前登录用户是否含有修改权限
+ projectUserService.isEditProjectAuth(orchestratorModifRequest.getProjectId(), username);
+
+ DSSOrchestrator orchestrator = new DSSOrchestrator();
+ orchestrator.setId(orchestratorModifRequest.getId());
+ //编排模式-名称
+ orchestrator.setOrchestratorName(orchestratorModifRequest.getOrchestratorName());
+ //编排模式
+ orchestrator.setOrchestratorMode(orchestratorModifRequest.getOrchestratorMode());
+ //编排模式-方式
+ orchestrator.setOrchestratorWay(ProjectStringUtils.getModeStr(orchestratorModifRequest.getOrchestratorWays()));
+ //编排模式-用途
+ orchestrator.setUses(orchestratorModifRequest.getUses());
+ //编排模式-描述
+ orchestrator.setDescription(orchestratorModifRequest.getDescription());
+ //编排模式-更新人
+ orchestrator.setUpdateUser(username);
+ //编排模式-更新时间
+ orchestrator.setUpdateTime(new Date());
+ this.updateById(orchestrator);
+ }
+
+ //新建前是否存在相同的编排名称
+ @Override
+ public void isExistSameNameBeforeCreate(Long workspaceId, Long projectId, String arrangeName) throws DSSFrameworkErrorException {
+ QueryWrapper queryWrapper = new QueryWrapper();
+ queryWrapper.eq("workspace_id", workspaceId);
+ queryWrapper.eq("project_id", projectId);
+ queryWrapper.eq("orchestrator_name", arrangeName);
+ List list = this.list(queryWrapper);
+ if (!CollectionUtils.isEmpty(list)) {
+ DSSFrameworkErrorException.dealErrorException(60000, "编排名称已经存在");
+ }
+ }
+
+ //是否存在相同的编排名称,如果不存在相同的编排名称則返回编排id
+ @Override
+ public Long isExistSameNameBeforeUpdate(OrchestratorModifyRequest orchestratorModifRequest) throws DSSFrameworkErrorException {
+ QueryWrapper queryWrapper = new QueryWrapper();
+ queryWrapper.eq("workspace_id", orchestratorModifRequest.getWorkspaceId());
+ queryWrapper.eq("project_id", orchestratorModifRequest.getProjectId());
+ queryWrapper.eq("id", orchestratorModifRequest.getId());
+ List list = this.list(queryWrapper);
+ if (CollectionUtils.isEmpty(list)) {
+ DSSFrameworkErrorException.dealErrorException(60000, "编排模式ID=" + orchestratorModifRequest.getId() + "不存在");
+ }
+ //是否存在相同的编排名称
+ if (!orchestratorModifRequest.getOrchestratorName().equals(list.get(0).getOrchestratorName())) {
+ isExistSameNameBeforeCreate(orchestratorModifRequest.getWorkspaceId(), orchestratorModifRequest.getProjectId(), orchestratorModifRequest.getOrchestratorName());
+ }
+ return list.get(0).getOrchestratorId();
+ }
+
+
+ /**
+ * 查询编排模式
+ *
+ * @param orchestratorRequest
+ * @param username
+ * @return
+ */
+ @Override
+ public List getListByPage(OrchestratorRequest orchestratorRequest, String username) {
+ QueryWrapper queryWrapper = new QueryWrapper();
+ queryWrapper.eq("workspace_id", orchestratorRequest.getWorkspaceId());
+ queryWrapper.eq("project_id", orchestratorRequest.getProjectId());
+ if (StringUtils.isNotBlank(orchestratorRequest.getOrchestratorMode())) {
+ queryWrapper.eq("orchestrator_mode", orchestratorRequest.getOrchestratorMode());
+ }
+ List list = this.list(queryWrapper);
+ List retList = new ArrayList(list.size());
+ if (!CollectionUtils.isEmpty(list)) {
+ //获取工程的权限等级
+ List projectUserList = projectUserService.getEditProjectList(orchestratorRequest.getProjectId(), username);
+ //获取最大权限
+
+ Integer priv = CollectionUtils.isEmpty(projectUserList) ? null : projectUserList.stream().mapToInt(DSSProjectUser::getPriv).max().getAsInt();
+ OrchestratorBaseInfo orchestratorBaseInfo = null;
+ for (DSSOrchestrator orchestrator : list) {
+ orchestratorBaseInfo = new OrchestratorBaseInfo();
+ BeanUtils.copyProperties(orchestrator, orchestratorBaseInfo);
+ orchestratorBaseInfo.setOrchestratorWays(ProjectStringUtils.convertList(orchestrator.getOrchestratorWay()));
+ orchestratorBaseInfo.setPriv(priv);
+ retList.add(orchestratorBaseInfo);
+ }
+ }
+ return retList;
+ }
+
+ /**
+ * 删除编排模式
+ *
+ * @param orchestratorDeleteRequest
+ * @param username
+ * @return
+ * @throws DSSProjectErrorException
+ */
+ @Override
+ @SuppressWarnings("all")
+ public boolean deleteOrchestrator(OrchestratorDeleteRequest orchestratorDeleteRequest, String username) throws DSSProjectErrorException {
+ //todo 使用工程的权限关系来限定 校验当前登录用户是否含有修改权限
+ projectUserService.isEditProjectAuth(orchestratorDeleteRequest.getProjectId(), username);
+
+ UpdateWrapper updateWrapper = new UpdateWrapper();
+ updateWrapper.eq("workspace_id", orchestratorDeleteRequest.getWorkspaceId());
+ updateWrapper.eq("project_id", orchestratorDeleteRequest.getProjectId());
+ updateWrapper.eq("id", orchestratorDeleteRequest.getId());
+ return this.remove(updateWrapper);
+ }
+
+ @Override
+ public DSSOrchestrator getOrchestratorById(Long id) {
+ return this.getById(id);
+ }
+
+ @Override
+ public Long importOrchestrator(RequestProjectImportOrchestrator orchestratorInfo) throws Exception {
+ DSSProjectDO projectDO = dssProjectMapper.selectById(orchestratorInfo.getProjectId());
+ if (projectDO == null) {
+ DSSFrameworkErrorException.dealErrorException(ProjectServerResponse.PROJECT_NOT_EXIST.getCode(),
+ ProjectServerResponse.PROJECT_NOT_EXIST.getMsg());
+ }
+ //校验参数
+ String type = orchestratorInfo.getType();
+ if (StringUtils.isEmpty(type)) {
+ DSSFrameworkErrorException.dealErrorException(60000, "编排模式类型不能为不存在");
+ }
+ Long orcId = orchestratorInfo.getId();
+ String orchestratorMode = OrchestratorTypeEnum.getKeyByOrcType(type);
+ String orchestratorWay = orchestratorInfo.getSecondaryType();
+ if (StringUtils.isNotBlank(orchestratorWay)) {
+ orchestratorWay = orchestratorWay.replace("[", ",").replace("]", ",");
+ }
+ //查询是否存在相同的编排模式
+ QueryWrapper queryWrapper = new QueryWrapper();
+ queryWrapper.eq("orchestrator_id", orcId);
+ queryWrapper.eq("project_id", projectDO.getId());
+ List list = this.list(queryWrapper);
+ //如果存在即更新既可以
+ if (!CollectionUtils.isEmpty(list)) {
+ //导入更新
+ return updateOrcByImport(list.get(0), orchestratorMode,orchestratorWay,orchestratorInfo);
+ } else {
+ //导入新增
+ return insertOrcByImport(projectDO,orchestratorMode,orchestratorWay,orchestratorInfo);
+ }
+ }
+
+ //导入更新
+ public Long updateOrcByImport(DSSOrchestrator dbEntity, String orchestratorMode, String orchestratorWay, RequestProjectImportOrchestrator orchestratorInfo) {
+ DSSOrchestrator updateEntity = new DSSOrchestrator();
+ BeanUtils.copyProperties(dbEntity, updateEntity);
+ //更新字段
+ updateEntity.setOrchestratorName(orchestratorInfo.getName());
+ updateEntity.setOrchestratorMode(orchestratorMode);
+ updateEntity.setOrchestratorWay(orchestratorWay);
+ updateEntity.setDescription(orchestratorInfo.getDesc());
+ updateEntity.setUpdateUser(orchestratorInfo.getCreator());
+ updateEntity.setUpdateTime(new Date());
+ //数据库更新
+ this.updateById(updateEntity);
+ return 0L;
+ }
+
+ //导入新增
+ public Long insertOrcByImport(DSSProjectDO projectDO, String orchestratorMode, String orchestratorWay, RequestProjectImportOrchestrator orchestratorInfo)
+ throws DSSFrameworkErrorException {
+ //新增,查看是否含有同名的编排模式
+ /* QueryWrapper queryNameWrapper = new QueryWrapper();
+ queryNameWrapper.eq("workspace_id", projectDO.getWorkspaceId());
+ queryNameWrapper.eq("project_id", orchestratorInfo.getProjectId());
+ queryNameWrapper.eq("orchestrator_name", orchestratorInfo.getName());
+ List sameNameList = this.list(queryNameWrapper);
+ if (!CollectionUtils.isEmpty(sameNameList)) {
+ DSSFrameworkErrorException.dealErrorException(60000, "编排名称已经存在");
+ }*/
+ DSSOrchestrator orchestrator = new DSSOrchestrator();
+ orchestrator.setProjectId(projectDO.getId());
+ orchestrator.setOrchestratorId(orchestratorInfo.getId());
+ orchestrator.setOrchestratorVersionId(orchestratorInfo.getVersionId());
+ orchestrator.setOrchestratorName(orchestratorInfo.getName());
+ orchestrator.setOrchestratorMode(orchestratorMode);
+ orchestrator.setOrchestratorWay(orchestratorWay);
+ orchestrator.setDescription(orchestratorInfo.getDesc());
+ orchestrator.setCreateUser(orchestratorInfo.getCreator());
+ orchestrator.setCreateTime(new Date());
+ orchestrator.setUpdateTime(new Date());
+ orchestrator.setWorkspaceId(projectDO.getWorkspaceId());
+ this.save(orchestrator);
+ return orchestrator.getId();
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/impl/DSSProjectServiceImpl.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/impl/DSSProjectServiceImpl.java
new file mode 100644
index 0000000000..9a64e66f27
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/impl/DSSProjectServiceImpl.java
@@ -0,0 +1,259 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.webank.wedatasphere.dss.appconn.core.AppConn;
+import com.webank.wedatasphere.dss.appconn.core.ext.OnlyStructureAppConn;
+import com.webank.wedatasphere.dss.appconn.manager.AppConnManager;
+import com.webank.wedatasphere.dss.common.exception.DSSErrorException;
+import com.webank.wedatasphere.dss.common.label.DSSLabel;
+import com.webank.wedatasphere.dss.common.utils.DSSExceptionUtils;
+import com.webank.wedatasphere.dss.framework.project.conf.ProjectConf;
+import com.webank.wedatasphere.dss.framework.project.contant.ProjectUserPrivEnum;
+import com.webank.wedatasphere.dss.framework.project.dao.DSSProjectMapper;
+import com.webank.wedatasphere.dss.framework.project.entity.DSSProjectDO;
+import com.webank.wedatasphere.dss.framework.project.entity.po.ProjectRelationPo;
+import com.webank.wedatasphere.dss.framework.project.entity.request.ProjectCreateRequest;
+import com.webank.wedatasphere.dss.framework.project.entity.request.ProjectDeleteRequest;
+import com.webank.wedatasphere.dss.framework.project.entity.request.ProjectModifyRequest;
+import com.webank.wedatasphere.dss.framework.project.entity.request.ProjectQueryRequest;
+import com.webank.wedatasphere.dss.framework.project.entity.response.ProjectResponse;
+import com.webank.wedatasphere.dss.framework.project.entity.vo.ProjectInfoVo;
+import com.webank.wedatasphere.dss.framework.project.entity.vo.QueryProjectVo;
+import com.webank.wedatasphere.dss.framework.project.exception.DSSProjectErrorException;
+import com.webank.wedatasphere.dss.framework.project.service.DSSOrchestratorService;
+import com.webank.wedatasphere.dss.framework.project.service.DSSProjectService;
+import com.webank.wedatasphere.dss.framework.project.service.DSSProjectUserService;
+import com.webank.wedatasphere.dss.framework.project.utils.ProjectStringUtils;
+import com.webank.wedatasphere.dss.orchestrator.common.protocol.RequestProjectImportOrchestrator;
+import com.webank.wedatasphere.dss.standard.app.sso.Workspace;
+import com.webank.wedatasphere.dss.standard.app.structure.project.ProjectDeletionOperation;
+import com.webank.wedatasphere.dss.standard.app.structure.project.ProjectRequestRef;
+import com.webank.wedatasphere.dss.standard.app.structure.project.ProjectRequestRefImpl;
+import com.webank.wedatasphere.dss.standard.app.structure.project.ProjectService;
+import com.webank.wedatasphere.dss.standard.common.desc.AppInstance;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+
+public class DSSProjectServiceImpl extends ServiceImpl implements DSSProjectService {
+ private static final Logger LOGGER = LoggerFactory.getLogger(DSSProjectServiceImpl.class);
+ @Autowired
+ private DSSProjectMapper projectMapper;
+ @Autowired
+ private DSSProjectUserService projectUserService;
+ @Autowired
+ private DSSOrchestratorService orchestratorService;
+ public static final String MODE_SPLIT = ",";
+ public static final String KEY_SPLIT = "-";
+ private final String SUPPORT_ABILITY = ProjectConf.SUPPORT_ABILITY.getValue();
+
+ @Override
+ public DSSProjectDO createProject(String username, ProjectCreateRequest projectCreateRequest) {
+ DSSProjectDO project = new DSSProjectDO();
+ project.setName(projectCreateRequest.getName());
+ project.setWorkspaceId(projectCreateRequest.getWorkspaceId());
+ project.setCreateBy(username);
+ project.setUsername(username);
+ project.setCreateTime(new Date());
+ project.setBusiness(projectCreateRequest.getBusiness());
+ project.setProduct(projectCreateRequest.getProduct());
+ project.setUpdateTime(new Date());
+ project.setDescription(projectCreateRequest.getDescription());
+ project.setApplicationArea(projectCreateRequest.getApplicationArea());
+ //开发流程,编排模式组拼接 前后进行英文逗号接口
+ project.setDevProcess(ProjectStringUtils.getModeStr(projectCreateRequest.getDevProcessList()));
+ project.setOrchestratorMode(ProjectStringUtils.getModeStr(projectCreateRequest.getOrchestratorModeList()));
+ projectMapper.insert(project);
+ return project;
+ }
+
+ //修改dss_project工程字段
+ @Override
+ public void modifyProject(String username, ProjectModifyRequest projectModifyRequest) throws DSSProjectErrorException {
+ //校验当前登录用户是否含有修改权限
+ projectUserService.isEditProjectAuth(projectModifyRequest.getId(), username);
+ DSSProjectDO project = new DSSProjectDO();
+ //修改的字段
+ project.setDescription(projectModifyRequest.getDescription());
+ project.setUpdateTime(new Date());
+ project.setUpdateByStr(username);
+ project.setDevProcess(ProjectStringUtils.getModeStr(projectModifyRequest.getDevProcessList()));
+ if (StringUtils.isNotBlank(projectModifyRequest.getApplicationArea())) {
+ project.setApplicationArea(Integer.valueOf(projectModifyRequest.getApplicationArea()));
+ }
+ project.setOrchestratorMode(ProjectStringUtils.getModeStr(projectModifyRequest.getOrchestratorModeList()));
+ project.setBusiness(projectModifyRequest.getBusiness());
+ project.setProduct(projectModifyRequest.getProduct());
+
+ UpdateWrapper updateWrapper = new UpdateWrapper();
+ updateWrapper.eq("id", projectModifyRequest.getId());
+ updateWrapper.eq("workspace_id", projectModifyRequest.getWorkspaceId());
+ projectMapper.update(project, updateWrapper);
+ }
+
+ @Override
+ public DSSProjectDO getProjectByName(String name) {
+ QueryWrapper projectQueryWrapper = new QueryWrapper();
+ projectQueryWrapper.eq("name", name);
+ List projectList = projectMapper.selectList(projectQueryWrapper);
+ return CollectionUtils.isEmpty(projectList) ? null : projectList.get(0);
+ }
+
+ @Override
+ public DSSProjectDO getProjectById(Long id) {
+ return projectMapper.selectById(id);
+ }
+
+ @Override
+ public List getListByParam(ProjectQueryRequest projectRequest) {
+ //根据dss_project、dss_project_user查询出所在空间登录用户相关的工程
+ List list = projectMapper.getListByParam(projectRequest);
+ if (CollectionUtils.isEmpty(list)) {
+ return new ArrayList<>();
+ }
+
+ List projectResponseList = new ArrayList<>();
+ ProjectResponse projectResponse = null;
+ for (QueryProjectVo projectVo : list) {
+ if (projectVo.getVisible() == 0) {
+ continue;
+ }
+ projectResponse = new ProjectResponse();
+ projectResponse.setApplicationArea(projectVo.getApplicationArea());
+ projectResponse.setId(projectVo.getId());
+ projectResponse.setBusiness(projectVo.getBusiness());
+ projectResponse.setCreateBy(projectVo.getCreateBy());
+ projectResponse.setDescription(projectVo.getDescription());
+ projectResponse.setName(projectVo.getName());
+ projectResponse.setProduct(projectVo.getProduct());
+ projectResponse.setSource(projectVo.getSource());
+ projectResponse.setArchive(projectVo.getArchive());
+ projectResponse.setCreateTime(projectVo.getCreateTime());
+ projectResponse.setUpdateTime(projectVo.getUpdateTime());
+ projectResponse.setDevProcessList(ProjectStringUtils.convertList(projectVo.getDevProcess()));
+ projectResponse.setOrchestratorModeList(ProjectStringUtils.convertList(projectVo.getOrchestratorMode()));
+ projectResponseList.add(projectResponse);
+ /**
+ * 拆分有projectId +"-" + priv + "-" + username的拼接而成的字段,
+ * 从而得到:查看权限用户、编辑权限用户、发布权限用户
+ */
+ String pusername = projectVo.getPusername();
+ if (StringUtils.isEmpty(pusername)) {
+ continue;
+ }
+ Map> userPricMap = new HashMap<>();
+ String[] tempstrArr = pusername.split(MODE_SPLIT);
+
+ for (String s : tempstrArr) {
+ String[] strArr = s.split(KEY_SPLIT);
+ String key = strArr[0] + KEY_SPLIT + strArr[1];
+ userPricMap.computeIfAbsent(key, k -> new ArrayList<>());
+ userPricMap.get(key).add(strArr[2]);
+ }
+ List accessUsers = userPricMap.get(projectVo.getId() + KEY_SPLIT + ProjectUserPrivEnum.PRIV_ACCESS.getRank());
+ List editUsers = userPricMap.get(projectVo.getId() + KEY_SPLIT + ProjectUserPrivEnum.PRIV_EDIT.getRank());
+ List releaseUsers = userPricMap.get(projectVo.getId() + KEY_SPLIT + ProjectUserPrivEnum.PRIV_RELEASE.getRank());
+ projectResponse.setAccessUsers(CollectionUtils.isEmpty(accessUsers) ? new ArrayList<>() : accessUsers.stream().distinct().collect(Collectors.toList()));
+ projectResponse.setEditUsers(CollectionUtils.isEmpty(editUsers) ? new ArrayList<>() : editUsers.stream().distinct().collect(Collectors.toList()));
+ projectResponse.setReleaseUsers(CollectionUtils.isEmpty(releaseUsers) ? new ArrayList<>() : releaseUsers.stream().distinct().collect(Collectors.toList()));
+ }
+ return projectResponseList;
+ }
+
+ @Override
+ public ProjectInfoVo getProjectInfoById(Long id) {
+ return projectMapper.getProjectInfoById(id);
+ }
+
+
+ @Override
+ public void saveProjectRelation(DSSProjectDO project, Map projectMap) {
+ List relationPos = new ArrayList<>();
+ projectMap.forEach((k, v) -> {
+ relationPos.add(new ProjectRelationPo(project.getId(), k.getId(), v));
+ });
+ projectMapper.saveProjectRelation(relationPos);
+ }
+
+
+ @Override
+ public Long getAppConnProjectId(Long dssProjectId, String appConnName, List dssLabels) throws Exception {
+ AppConn appConn = AppConnManager.getAppConnManager().getAppConn(appConnName);
+ List appInstances = appConn.getAppDesc().getAppInstancesByLabels(dssLabels);
+ if (appInstances.get(0) != null) {
+ Long appInstanceId = appInstances.get(0).getId();
+ return projectMapper.getAppConnProjectId(appInstanceId, dssProjectId);
+ } else {
+ LOGGER.error("appInstances is null {}", appInstances);
+ return null;
+ }
+ }
+
+ @Override
+ public void deleteProject(String username, ProjectDeleteRequest projectDeleteRequest, Workspace workspace) throws Exception {
+ LOGGER.warn("user {} begins to delete project {}.", username, projectDeleteRequest);
+ DSSProjectDO DSSProjectDO = projectMapper.selectById(projectDeleteRequest.getId());
+ if (DSSProjectDO == null) {
+ throw new DSSErrorException(600001, "工程不存在" );
+ }
+ if(projectDeleteRequest.isIfDelOtherSys()) {
+ ProjectRequestRef projectRequestRef = new ProjectRequestRefImpl();
+ projectRequestRef.setName(DSSProjectDO.getName());
+ projectRequestRef.setWorkspace(workspace);
+ AppConnManager.getAppConnManager().listAppConns().stream().filter(appConn -> appConn instanceof OnlyStructureAppConn).forEach(appConn -> {
+ OnlyStructureAppConn structureAppConn = (OnlyStructureAppConn) appConn;
+ appConn.getAppDesc().getAppInstances().forEach(DSSExceptionUtils.handling(appInstance -> {
+ ProjectService projectService = structureAppConn.getOrCreateStructureStandard().getProjectService(appInstance);
+ if(projectService != null) {
+ ProjectDeletionOperation projectDeletionOperation = projectService.getProjectDeletionOperation();
+ if(projectDeletionOperation != null) {
+ projectDeletionOperation.deleteProject(projectRequestRef);
+ }
+ }
+ }));
+ });
+ }
+ projectMapper.deleteProject(projectDeleteRequest.getId());
+ LOGGER.warn("User {} deleted project {}.", username, DSSProjectDO.getName());
+ }
+
+ @Override
+ public List getProjectAbilities(String username) {
+ LOGGER.info("{} begins to get project ability", username);
+ return Arrays.asList(SUPPORT_ABILITY.trim().split(","));
+ }
+
+ @Override
+ public Long importOrchestrator(RequestProjectImportOrchestrator orchestratorInfo) throws Exception {
+ return orchestratorService.importOrchestrator(orchestratorInfo);
+ }
+
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/impl/DSSProjectUserServiceImpl.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/impl/DSSProjectUserServiceImpl.java
new file mode 100644
index 0000000000..b3103736e2
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/service/impl/DSSProjectUserServiceImpl.java
@@ -0,0 +1,188 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.webank.wedatasphere.dss.common.utils.DSSExceptionUtils;
+import com.webank.wedatasphere.dss.framework.project.contant.ProjectServerResponse;
+import com.webank.wedatasphere.dss.framework.project.contant.ProjectUserPrivEnum;
+import com.webank.wedatasphere.dss.framework.project.dao.DSSProjectUserMapper;
+import com.webank.wedatasphere.dss.framework.project.entity.DSSProjectDO;
+import com.webank.wedatasphere.dss.framework.project.entity.DSSProjectUser;
+import com.webank.wedatasphere.dss.framework.project.entity.request.ProjectCreateRequest;
+import com.webank.wedatasphere.dss.framework.project.entity.request.ProjectModifyRequest;
+import com.webank.wedatasphere.dss.framework.project.exception.DSSProjectErrorException;
+import com.webank.wedatasphere.dss.framework.project.server.service.BMLService;
+import com.webank.wedatasphere.dss.framework.project.service.DSSProjectUserService;
+import com.webank.wedatasphere.dss.framework.project.utils.ProjectUserUtils;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+import org.apache.commons.collections.CollectionUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+
+
+public class DSSProjectUserServiceImpl implements DSSProjectUserService {
+
+ protected final Logger LOGGER = LoggerFactory.getLogger(getClass());
+
+ @Autowired
+ private DSSProjectUserMapper projectUserMapper;
+ @Autowired
+ @Qualifier("projectServerBMLService")
+ private BMLService bmlService;
+
+ /**
+ * 是否有修改工程权限
+ * @param projectId
+ * @param username
+ * @return
+ */
+ @Override
+ public boolean isEditProjectAuth(Long projectId, String username) throws DSSProjectErrorException {
+ //校验当前登录用户是否含有修改权限
+ QueryWrapper queryWrapper = new QueryWrapper();
+ queryWrapper.eq("project_id",projectId);
+ queryWrapper.eq("username",username);
+ queryWrapper.ge("priv",ProjectUserPrivEnum.PRIV_EDIT.getRank());//编辑权限
+ long count = projectUserMapper.selectCount(queryWrapper);
+ if(count == 0){
+ DSSExceptionUtils.dealErrorException(ProjectServerResponse.PROJECT_NOT_EDIT_AUTH.getCode(),ProjectServerResponse.PROJECT_NOT_EDIT_AUTH.getMsg(), DSSProjectErrorException.class);
+ }
+ return true;
+ }
+ /**
+ * 根据用户名和工程id获取工程权限
+ * @param projectId
+ * @param username
+ * @return
+ */
+ @Override
+ public List getEditProjectList(Long projectId, String username){
+ QueryWrapper queryWrapper = new QueryWrapper();
+ queryWrapper.eq("project_id",projectId);
+ queryWrapper.eq("username",username);
+ return projectUserMapper.selectList(queryWrapper);
+ }
+
+ /**
+ * 保存工程与用户关系
+ * @param projectID
+ * @param request
+ */
+ @Override
+ public void saveProjectUser(Long projectID,String username, ProjectCreateRequest request)throws Exception{
+ //將创建人默认为发布权限
+ List releaseUsers = request.getReleaseUsers();
+ if(!request.getEditUsers().contains(username)){
+ request.getEditUsers().add(username);
+ }
+ if(releaseUsers == null){
+ releaseUsers = new ArrayList<>();
+ }
+ if(!releaseUsers.contains(username)){
+ releaseUsers.add(username);
+ }
+
+ //批量保存
+ saveBatch(request.getWorkspaceId(),projectID,releaseUsers,request.getEditUsers(),request.getAccessUsers());
+
+ //获取所有编辑权限的用户
+ List sumEditUsers = ProjectUserUtils.getEditUserList(releaseUsers, request.getEditUsers());
+ //去bml建一个工程
+ bmlService.createBmlProject(username, request.getName(), sumEditUsers, request.getAccessUsers());
+ }
+
+ /**
+ * 修改工程与用户关系
+ * @param dbProject
+ * @param modifyRequest
+ */
+ @Override
+ public void modifyProjectUser(DSSProjectDO dbProject, ProjectModifyRequest modifyRequest, String loginuser) throws Exception{
+ projectUserMapper.deleteAllPriv(dbProject.getId());
+ //將创建人默认为发布权限
+ List releaseUsers = modifyRequest.getReleaseUsers();
+ String username = dbProject.getCreateBy();
+ if(!modifyRequest.getEditUsers().contains(username)){
+ modifyRequest.getEditUsers().add(username);
+ }
+ if(releaseUsers == null){
+ releaseUsers = new ArrayList<>();
+ }
+ if(!releaseUsers.contains(username)){
+ releaseUsers.add(username);
+ }
+
+ //批量保存
+ saveBatch(modifyRequest.getWorkspaceId(),dbProject.getId(),releaseUsers,modifyRequest.getEditUsers(),modifyRequest.getAccessUsers());
+
+ //获取所有编辑权限的用户
+ List sumEditUsers = ProjectUserUtils.getEditUserList(releaseUsers, modifyRequest.getEditUsers());
+ //更新底层的权限
+ bmlService.updateProjectPriv(dbProject.getName(), username, sumEditUsers, modifyRequest.getAccessUsers());
+ }
+
+
+
+ @Override
+ public List getListByParam(Long workspaceId, String username) {
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+ queryWrapper.eq("workspace_id",workspaceId);
+ queryWrapper.eq("username",username);
+ queryWrapper.ge("priv",ProjectUserPrivEnum.PRIV_ACCESS.getRank());
+ List DSSProjectUserList = projectUserMapper.selectList(queryWrapper);
+ return DSSProjectUserList;
+ }
+
+ //批量保存
+ public void saveBatch(Long workspaceId,Long projectID,List releaseUsers,List editUsers,List accessUsers){
+ List realReleaseUsers = releaseUsers.stream().distinct().collect(Collectors.toList());
+ List realEditUsers = editUsers.stream().distinct().collect(Collectors.toList());
+ List realAccessUsers = accessUsers.stream().distinct().collect(Collectors.toList());
+ List addList = new ArrayList<>();
+ addList.addAll(ProjectUserUtils.createPUser(workspaceId,projectID,realReleaseUsers,ProjectUserPrivEnum.PRIV_RELEASE.getRank()));
+ addList.addAll(ProjectUserUtils.createPUser(workspaceId,projectID,realEditUsers, ProjectUserPrivEnum.PRIV_EDIT.getRank()));
+ addList.addAll(ProjectUserUtils.createPUser(workspaceId,projectID,realAccessUsers,ProjectUserPrivEnum.PRIV_ACCESS.getRank()));
+ if(CollectionUtils.isEmpty(addList)){
+ return;
+ }
+ //分批插入
+ List tempAddList = new ArrayList<>();
+ for (int i = 0; i < addList.size(); i++) {
+ tempAddList.add(addList.get(i));
+ if (i > 0 && i % 200 == 0) {
+ projectUserMapper.insertBatchProjectUser(tempAddList);
+ tempAddList.clear();
+ }
+ }
+ if (tempAddList.size() > 0) {
+ projectUserMapper.insertBatchProjectUser(tempAddList);
+ }
+ }
+
+ @Override
+ public boolean isAdminByUsername(Long workspaceId, String username) {
+ //管理员ID,这里写死
+ int roleId = 1;
+ return projectUserMapper.isAdminByUsername(workspaceId, username, roleId).longValue() > 0;
+ }
+
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/utils/ApplicationArea.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/utils/ApplicationArea.java
new file mode 100644
index 0000000000..a06799f607
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/utils/ApplicationArea.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.utils;
+
+
+public enum ApplicationArea {
+ // Operational optimization, risk management, marketing recommendation, trend prediction, customer management
+ // 运营优化,风险管理,营销推荐,趋势预测,客户管理;
+ OO("运营优化","Operational Optimization",0),
+ RM("风险管理","Risk Management",1),
+ MR("营销推荐","Marketing Recommendation",2),
+ TP("趋势预测","Trend Prediction",3),
+ CM("客户管理","Customer Management",4);
+
+
+ private int id;
+ private String name;
+ private String enName;
+
+ ApplicationArea(String name, String enName, int id) {
+ this.name = name;
+ this.enName = enName;
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public int getId(){
+ return this.id;
+ }
+
+ public String getEnName(){
+ return this.enName;
+ }
+
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/utils/LambdaHelper.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/utils/LambdaHelper.java
new file mode 100644
index 0000000000..234d1bdad0
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/utils/LambdaHelper.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.utils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.function.Consumer;
+
+
+
+public class LambdaHelper {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(LambdaHelper.class);
+
+ public static Consumer consumerWrapper(Consumer consumer){
+ return t -> {
+ try{
+ consumer.accept(t);
+ }catch(Exception e){
+ LOGGER.error("Failed to do with {} ", t, e);
+ }
+ };
+ }
+
+
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/utils/ProjectStringUtils.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/utils/ProjectStringUtils.java
new file mode 100644
index 0000000000..4bbe902733
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/utils/ProjectStringUtils.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.utils;
+
+
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.*;
+import java.util.stream.Collectors;
+
+public class ProjectStringUtils {
+
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(ProjectStringUtils.class);
+
+ private static final String REDIRECT_FORMAT = "%s?redirect=%s&dssurl=${dssurl}&cookies=${cookies}";
+
+ public static final String MODE_SPLIT = ",";
+ public static final String KEY_SPLIT = "-";
+
+ public static List convertList(String str){
+ if(org.apache.commons.lang.StringUtils.isEmpty(str)){
+ return new ArrayList<>();
+ }
+ return Arrays.stream(str.split(MODE_SPLIT)).map(String::trim).filter((s)-> StringUtils.isNotBlank(s)).distinct().collect(Collectors.toList());
+ }
+
+ //拼接 前后使用英文逗号结尾
+ public static String getModeStr(List strList){
+ if(CollectionUtils.isEmpty(strList)){
+ return null;
+ }
+ return strList.stream().map(String::trim).filter((s)-> StringUtils.isNotBlank(s)).distinct().collect(Collectors.joining(MODE_SPLIT,MODE_SPLIT,MODE_SPLIT));
+ }
+
+ private static String URLEndoder(String str){
+ try {
+ return URLEncoder.encode(str,"utf-8");
+ } catch (UnsupportedEncodingException e) {
+ LOGGER.warn("endoe failed:",e);
+ return str;
+ }
+ }
+
+ public static String redirectUrlFormat(String redirectUrl,String url){
+ return String.format(REDIRECT_FORMAT,redirectUrl,URLEndoder(url));
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/utils/ProjectUserUtils.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/utils/ProjectUserUtils.java
new file mode 100644
index 0000000000..2fe2ac2535
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/utils/ProjectUserUtils.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.utils;
+
+import com.webank.wedatasphere.dss.framework.project.entity.DSSProjectUser;
+import org.apache.commons.collections.CollectionUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class ProjectUserUtils {
+
+
+ public static List createPUser(Long wid, Long pid, List users, int priv){
+ List retList = new ArrayList<>();
+ if(CollectionUtils.isEmpty(users)){
+ return retList;
+ }
+ users.forEach(tname->{
+ DSSProjectUser DSSProjectUser = new DSSProjectUser(wid, pid, tname,priv);
+ retList.add(DSSProjectUser);
+ });
+ return retList;
+ }
+
+
+ public static List getEditUserList(List releaseUsers, List editUsers){
+ List sumEditUsers = new ArrayList<>();
+ if (!CollectionUtils.isEmpty(releaseUsers)) {
+ sumEditUsers.addAll(releaseUsers);
+ }
+ if (!CollectionUtils.isEmpty(editUsers)) {
+ sumEditUsers.addAll(editUsers);
+ }
+ return sumEditUsers.stream().distinct().collect(Collectors.toList());
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/utils/RestfulUtils.java b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/utils/RestfulUtils.java
new file mode 100644
index 0000000000..ad0115397f
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/java/com/webank/wedatasphere/dss/framework/project/utils/RestfulUtils.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.utils;
+
+import com.webank.wedatasphere.linkis.server.Message;
+import org.apache.commons.math3.util.Pair;
+
+import javax.ws.rs.core.Response;
+import java.util.Arrays;
+
+
+public class RestfulUtils {
+
+ public static Response dealError(String reason){
+ Message message = Message.error(reason);
+ return Message.messageToResponse(message);
+ }
+
+ public static Response dealOk(String msg){
+ Message message = Message.ok(msg);
+ return Message.messageToResponse(message);
+ }
+
+ @SafeVarargs
+ public static Response dealOk(String msg, Pair... data){
+ Message message = Message.ok(msg);
+ Arrays.stream(data).forEach(p -> message.data(p.getKey(), p.getValue()));
+ return Message.messageToResponse(message);
+ }
+
+
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/scala/com/webank/wedatasphere/dss/framework/project/server/DSSProjectServerApplication.scala b/dss-framework/dss-framework-project-server/src/main/scala/com/webank/wedatasphere/dss/framework/project/server/DSSProjectServerApplication.scala
new file mode 100644
index 0000000000..3e801a0666
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/scala/com/webank/wedatasphere/dss/framework/project/server/DSSProjectServerApplication.scala
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.server
+import com.webank.wedatasphere.dss.common.utils.DSSMainHelper
+import com.webank.wedatasphere.linkis.DataWorkCloudApplication
+import com.webank.wedatasphere.linkis.common.utils.{Logging, Utils}
+
+
+object DSSProjectServerApplication extends Logging {
+
+ val userName: String = System.getProperty("user.name")
+ val hostName: String = Utils.getComputerName
+
+ def main(args: Array[String]): Unit = {
+ val serviceName = System.getProperty("serviceName")//ProjectConf.SERVICE_NAME.getValue
+ DSSMainHelper.formatPropertyFiles(serviceName)
+ val allArgs = args ++ DSSMainHelper.getExtraSpringOptions
+ System.setProperty("hostName", hostName)
+ System.setProperty("userName", userName)
+ info(s"Ready to start $serviceName with args: ${allArgs.toList}.")
+ println(s"Test Ready to start $serviceName with args: ${allArgs.toList}.")
+ DataWorkCloudApplication.main(allArgs)
+ }
+}
\ No newline at end of file
diff --git a/dss-framework/dss-framework-project-server/src/main/scala/com/webank/wedatasphere/dss/framework/project/server/rpc/ProjectReceiver.scala b/dss-framework/dss-framework-project-server/src/main/scala/com/webank/wedatasphere/dss/framework/project/server/rpc/ProjectReceiver.scala
new file mode 100644
index 0000000000..1d0d3e89fe
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/scala/com/webank/wedatasphere/dss/framework/project/server/rpc/ProjectReceiver.scala
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.server.rpc
+
+import java.util
+
+import com.webank.wedatasphere.dss.common.entity.project.DSSProject
+import com.webank.wedatasphere.dss.common.protocol.project.{ProjectInfoRequest, ProjectRelationRequest, ProjectRelationResponse}
+import com.webank.wedatasphere.dss.framework.project.entity.DSSProjectDO
+import com.webank.wedatasphere.dss.framework.project.service.DSSProjectService
+import com.webank.wedatasphere.dss.framework.workspace.service.DSSWorkspaceUserService
+import com.webank.wedatasphere.dss.orchestrator.common.entity.DSSOrchestratorInfo
+import com.webank.wedatasphere.dss.orchestrator.common.protocol.RequestProjectImportOrchestrator
+import com.webank.wedatasphere.linkis.protocol.usercontrol.{RequestUserListFromWorkspace, RequestUserWorkspace, ResponseUserWorkspace, ResponseWorkspaceUserList}
+import com.webank.wedatasphere.linkis.rpc.{Receiver, Sender}
+import org.springframework.beans.BeanUtils
+import org.springframework.beans.factory.annotation.Autowired
+import org.springframework.stereotype.Component
+
+import scala.collection.JavaConversions._
+import scala.concurrent.duration.Duration
+
+
+@Component
+class ProjectReceiver(projectService: DSSProjectService) extends Receiver {
+
+ @Autowired
+ var dssWorkspaceUserService:DSSWorkspaceUserService = _
+
+
+ override def receive(message: Any, sender: Sender): Unit = {
+
+ }
+
+ override def receiveAndReply(message: Any, sender: Sender): Any = {
+ message match {
+ case projectRelationRequest: ProjectRelationRequest =>
+ val dssProjectId = projectRelationRequest.getDssProjectId
+ val dssLabels = projectRelationRequest.getDssLabels
+ val appConnName = projectRelationRequest.getAppconnName
+ val appConnProjectId = projectService.getAppConnProjectId(dssProjectId, appConnName, dssLabels)
+ new ProjectRelationResponse(dssProjectId, appConnName, dssLabels, appConnProjectId)
+ case requestUserWorkspace:RequestUserWorkspace =>
+ val userWorkspaceIds: util.List[Integer] = dssWorkspaceUserService.getUserWorkspaceIds(requestUserWorkspace.getUserName)
+ new ResponseUserWorkspace(userWorkspaceIds)
+
+ case requestUserListFromWorkspace: RequestUserListFromWorkspace=>
+ val userList = requestUserListFromWorkspace.getUserWorkspaceIds.flatMap(id => dssWorkspaceUserService.getAllWorkspaceUsers(id)).distinct
+ new ResponseWorkspaceUserList(userList)
+
+ case projectInfoRequest: ProjectInfoRequest =>
+ val dssProjectDO: DSSProjectDO = projectService.getProjectById(projectInfoRequest.getProjectId)
+ val DSSProject = new DSSProject()
+ BeanUtils.copyProperties(dssProjectDO, DSSProject)
+ DSSProject
+
+ case projectImportOrchestrator: RequestProjectImportOrchestrator =>
+ projectService.importOrchestrator(projectImportOrchestrator)
+ }
+ }
+
+
+ override def receiveAndReply(message: Any, duration: Duration, sender: Sender): Any = {
+ null
+ }
+}
diff --git a/dss-framework/dss-framework-project-server/src/main/scala/com/webank/wedatasphere/dss/framework/project/server/rpc/ProjectReceiverChooser.scala b/dss-framework/dss-framework-project-server/src/main/scala/com/webank/wedatasphere/dss/framework/project/server/rpc/ProjectReceiverChooser.scala
new file mode 100644
index 0000000000..350722ce8e
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/scala/com/webank/wedatasphere/dss/framework/project/server/rpc/ProjectReceiverChooser.scala
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.server.rpc
+
+import com.webank.wedatasphere.dss.common.protocol.project.ProjectRelationRequest
+import com.webank.wedatasphere.dss.framework.project.service.DSSProjectService
+import com.webank.wedatasphere.linkis.rpc.{RPCMessageEvent, Receiver, ReceiverChooser}
+import javax.annotation.PostConstruct
+import org.springframework.beans.factory.annotation.Autowired
+import org.springframework.stereotype.Component
+
+
+@Component
+class ProjectReceiverChooser extends ReceiverChooser {
+
+
+ @Autowired
+ var projectService: DSSProjectService = _
+
+ private var receiver: Option[ProjectReceiver] = _
+
+ @PostConstruct
+ def init(): Unit = receiver = Some(new ProjectReceiver(projectService))
+
+ override def chooseReceiver(event: RPCMessageEvent): Option[Receiver] = event.message match {
+ case _: ProjectRelationRequest => receiver
+ case _ => None
+ }
+}
+
+
+
+
diff --git a/dss-framework/dss-framework-project-server/src/main/scala/com/webank/wedatasphere/dss/framework/project/server/service/BMLService.scala b/dss-framework/dss-framework-project-server/src/main/scala/com/webank/wedatasphere/dss/framework/project/server/service/BMLService.scala
new file mode 100644
index 0000000000..3a5d837da7
--- /dev/null
+++ b/dss-framework/dss-framework-project-server/src/main/scala/com/webank/wedatasphere/dss/framework/project/server/service/BMLService.scala
@@ -0,0 +1,183 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.project.server.service
+
+import java.io.{ByteArrayInputStream, InputStream}
+import java.util
+import java.util.UUID
+
+import com.webank.wedatasphere.dss.common.exception.DSSErrorException
+import com.webank.wedatasphere.dss.common.utils.IoUtils
+import com.webank.wedatasphere.linkis.bml.client.{BmlClient, BmlClientFactory}
+import com.webank.wedatasphere.linkis.bml.protocol.{BmlDownloadResponse, BmlUpdateResponse, BmlUploadResponse}
+import com.webank.wedatasphere.linkis.common.utils.{JavaLog, Logging, Utils}
+import org.apache.commons.io.IOUtils
+import org.springframework.stereotype.Component
+
+import scala.collection.JavaConversions._
+
+
+@Component("projectServerBMLService")
+class BMLService extends Logging{
+
+ def upload(userName: String, content: String, fileName: String, projectName:String): util.Map[String, Object] = {
+ val inputStream = new ByteArrayInputStream(content.getBytes("utf-8"))
+ val client: BmlClient = createBMLClient(userName)
+ val resource: BmlUploadResponse = client.uploadShareResource(userName, projectName, fileName, inputStream)
+ if (!resource.isSuccess) throw new DSSErrorException(911113, "上传失败")
+ val map = new util.HashMap[String, Object]
+ map += "resourceId" -> resource.resourceId
+ map += "version" -> resource.version
+ }
+
+ def upload(userName: String, inputStream: InputStream, fileName: String, projectName:String): util.Map[String, Object] = {
+ val client: BmlClient = createBMLClient(userName)
+ val resource: BmlUploadResponse = client.uploadShareResource(userName, projectName, fileName, inputStream)
+ if (!resource.isSuccess) throw new DSSErrorException(911113, "上传失败")
+ val map = new util.HashMap[String, Object]
+ map += "resourceId" -> resource.resourceId
+ map += "version" -> resource.version
+ }
+
+ def update(userName: String, resourceId: String, inputStream: InputStream): util.Map[String, Object] = {
+ val client: BmlClient = createBMLClient(userName)
+ val resource: BmlUpdateResponse = client.updateShareResource(userName, resourceId, "", inputStream)
+ if (!resource.isSuccess) throw new DSSErrorException(911114, "更新失败")
+ val map = new util.HashMap[String, Object]
+ map += "resourceId" -> resource.resourceId
+ map += "version" -> resource.version
+ }
+
+ def update(userName: String, resourceId: String, content: String): util.Map[String, Object] = {
+ val inputStream = new ByteArrayInputStream(content.getBytes("utf-8"))
+ val client: BmlClient = createBMLClient(userName)
+ val resource: BmlUpdateResponse = client.updateShareResource(userName, resourceId, UUID.randomUUID().toString+".json", inputStream)
+ if (!resource.isSuccess) throw new DSSErrorException(911114, "更新失败")
+ val map = new util.HashMap[String, Object]
+ map += "resourceId" -> resource.resourceId
+ map += "version" -> resource.version
+ }
+
+ def query(userName: String, resourceId: String, version: String): util.Map[String, Object] = {
+ val client: BmlClient = createBMLClient(userName)
+ var resource: BmlDownloadResponse = null
+ if (version == null) {
+ resource = client.downloadShareResource(userName, resourceId)
+ } else {
+ resource = client.downloadShareResource(userName, resourceId, version)
+ }
+ if (!resource.isSuccess) throw new DSSErrorException(911115, "下载失败")
+ val map = new util.HashMap[String, Object]
+ map += "path" -> resource.fullFilePath
+ map += "string" -> inputstremToString(resource.inputStream)
+ }
+
+ def download(userName: String, resourceId: String, version: String): util.Map[String, Object] = {
+ val client: BmlClient = createBMLClient(userName)
+ var resource: BmlDownloadResponse = null
+ if (version == null) {
+ resource = client.downloadShareResource(userName, resourceId)
+ } else {
+ resource = client.downloadShareResource(userName, resourceId, version)
+ }
+ if (!resource.isSuccess) throw new DSSErrorException(911115, "下载失败")
+ val map = new util.HashMap[String, Object]
+ map += "path" -> resource.fullFilePath
+ map += "is" -> resource.inputStream
+ }
+
+ def downloadToLocalPath(userName: String, resourceId: String, version: String, path: String): String = {
+ val result = download(userName,resourceId,version)
+ val is = result.get("is").asInstanceOf[InputStream]
+ val os = IoUtils.generateExportOutputStream(path)
+ Utils.tryFinally(IOUtils.copy(is,os)){
+ IOUtils.closeQuietly(os)
+ IOUtils.closeQuietly(is)
+ }
+ path
+ }
+
+ def downloadAndGetFlowJson(userName: String, resourceId: String, version: String, path: String): String = {
+ downloadToLocalPath(userName,resourceId,version,path)
+ //因为下载到指定目录后返回的resource的Stream为null,只能从文件重新读取。
+ val is = IoUtils.generateInputInputStream(path)
+ Utils.tryFinally(inputstremToString(is))(IOUtils.closeQuietly(is))
+ }
+
+ def readLocalResourceFile(userName: String,readPath: String): InputStream ={
+ IoUtils.generateInputInputStream(readPath)
+ }
+
+ def readLocalFlowJsonFile(userName: String,readPath: String): String ={
+ var inputStream:InputStream = null
+ var flowJson:String = null
+ Utils.tryFinally{
+ inputStream = IoUtils.generateInputInputStream(readPath)
+ flowJson = inputstremToString(inputStream)
+ }{
+ IOUtils.closeQuietly(inputStream)
+ }
+ flowJson
+ }
+
+ private def inputstremToString(inputStream: InputStream): String = {
+ scala.io.Source.fromInputStream(inputStream).mkString
+ }
+
+ private def createBMLClient(userName: String): BmlClient = {
+ if (userName == null)
+ BmlClientFactory.createBmlClient()
+ else
+ BmlClientFactory.createBmlClient(userName)
+ }
+
+ def createBmlProject(username:String, projectName:String, editUsers:util.List[String],
+ accessUsers:util.List[String] ): Unit ={
+ val client = createBMLClient(username)
+ val response = client.createBmlProject(username, projectName, accessUsers, editUsers)
+ if (response.isSuccess){
+ logger.info(s"for user $username create bml project $projectName success")
+ }else{
+ logger.error(s"for user $username create bml project $projectName failed")
+ }
+ }
+
+ def attachResourceAndProject(username:String, projectName:String, resourceId:String):Unit = {
+ val client = createBMLClient(username)
+ val response = client.attachResourceAndProject(projectName, resourceId)
+ if (response.isSuccess){
+ logger.info(s"attach $username and $projectName success")
+ }else{
+ logger.error(s"attach $username and $projectName failed")
+ }
+ }
+
+
+ def updateProjectPriv(projectName:String, username:String, editUsers:util.List[String],
+ accessUsers:util.List[String]): Unit ={
+ val client = createBMLClient(username)
+ val response = client.updateProjectPriv(username, projectName, editUsers, accessUsers)
+ if (response.isSuccess){
+ logger.info(s"attach $username and $projectName success")
+ }else{
+ logger.error(s"attach $username and $projectName failed")
+ }
+ }
+
+
+
+}
diff --git a/dss-framework/dss-framework-workspace-server/bin/start-dss-framework-workspace-server.sh b/dss-framework/dss-framework-workspace-server/bin/start-dss-framework-workspace-server.sh
new file mode 100644
index 0000000000..971d93d9ed
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/bin/start-dss-framework-workspace-server.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+cd `dirname $0`
+cd ..
+HOME=`pwd`
+export DWS_ENGINE_MANAGER_HOME=$HOME
+
+export DWS_ENGINE_MANAGER_PID=$HOME/bin/linkis.pid
+
+if [[ -f "${DWS_ENGINE_MANAGER_PID}" ]]; then
+ pid=$(cat ${DWS_ENGINE_MANAGER_PID})
+ if kill -0 ${pid} >/dev/null 2>&1; then
+ echo "DSS SERVER is already running."
+ return 0;
+ fi
+fi
+
+export DWS_ENGINE_MANAGER_LOG_PATH=$HOME/logs
+export DWS_ENGINE_MANAGER_HEAP_SIZE="1G"
+
+export DWS_ENGINE_MANAGER_JAVA_OPTS="-Xms$DWS_ENGINE_MANAGER_HEAP_SIZE -Xmx$DWS_ENGINE_MANAGER_HEAP_SIZE -XX:+UseG1GC -XX:MaxPermSize=500m -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=20014"
+
+#export DWS_ENGINE_MANAGER_JAVA_OPTS="-Xms$DWS_ENGINE_MANAGER_HEAP_SIZE -Xmx$DWS_ENGINE_MANAGER_HEAP_SIZE -XX:+UseG1GC -XX:MaxPermSize=500m"
+
+nohup java $DWS_ENGINE_MANAGER_JAVA_OPTS -cp $HOME/conf:$HOME/lib/* com.webank.wedatasphere.linkis.DataWorkCloudApplication 2>&1 > $DWS_ENGINE_MANAGER_LOG_PATH/linkis.out &
+pid=$!
+if [[ -z "${pid}" ]]; then
+ echo "DSS SERVER start failed!"
+ sleep 1
+ exit 1
+else
+ echo "DSS SERVER start succeeded!"
+ echo $pid > $DWS_ENGINE_MANAGER_PID
+ sleep 1
+fi
+exit 1
\ No newline at end of file
diff --git a/dss-framework/dss-framework-workspace-server/bin/stop-dss-framework-workspace-server.sh b/dss-framework/dss-framework-workspace-server/bin/stop-dss-framework-workspace-server.sh
new file mode 100644
index 0000000000..2ca464de62
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/bin/stop-dss-framework-workspace-server.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+cd `dirname $0`
+cd ..
+HOME=`pwd`
+
+export FLOW_ENTRANCE_HOME_PID=$HOME/bin/linkis.pid
+
+function wait_for_FLOW_ENTRANCE_HOME_to_die() {
+ local pid
+ local count
+ pid=$1
+ timeout=$2
+ count=0
+ timeoutTime=$(date "+%s")
+ let "timeoutTime+=$timeout"
+ currentTime=$(date "+%s")
+ forceKill=1
+
+ while [[ $currentTime -lt $timeoutTime ]]; do
+ $(kill ${pid} > /dev/null 2> /dev/null)
+ if kill -0 ${pid} > /dev/null 2>&1; then
+ sleep 3
+ else
+ forceKill=0
+ break
+ fi
+ currentTime=$(date "+%s")
+ done
+
+ if [[ forceKill -ne 0 ]]; then
+ $(kill -9 ${pid} > /dev/null 2> /dev/null)
+ fi
+}
+
+if [[ ! -f "${FLOW_ENTRANCE_HOME_PID}" ]]; then
+ echo "DSS SERVER is not running"
+else
+ pid=$(cat ${FLOW_ENTRANCE_HOME_PID})
+ if [[ -z "${pid}" ]]; then
+ echo "DSS SERVER is not running"
+ else
+ wait_for_FLOW_ENTRANCE_HOME_to_die $pid 40
+ $(rm -f ${FLOW_ENTRANCE_HOME_PID})
+ echo "DSS SERVER is stopped."
+ fi
+fi
\ No newline at end of file
diff --git a/dss-framework/dss-framework-workspace-server/pom.xml b/dss-framework/dss-framework-workspace-server/pom.xml
new file mode 100644
index 0000000000..5541740e31
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/pom.xml
@@ -0,0 +1,133 @@
+
+
+
+
+
+ dss
+ com.webank.wedatasphere.dss
+ 1.0.0
+
+
+ 4.0.0
+
+ dss-framework-workspace-server
+
+
+
+
+ com.webank.wedatasphere.linkis
+ linkis-module
+ ${linkis.version}
+ provided
+
+
+
+
+ com.webank.wedatasphere.dss
+ dss-common
+ ${dss.version}
+ provided
+
+
+
+ org.apache.commons
+ commons-lang3
+ ${commons.lang3.version}
+ provided
+
+
+ com.webank.wedatasphere.linkis
+ linkis-httpclient
+ ${linkis.version}
+
+
+ linkis-common
+ com.webank.wedatasphere.linkis
+
+
+
+
+
+ com.webank.wedatasphere.dss
+ dss-framework-common
+ ${dss.version}
+
+
+ com.webank.wedatasphere.linkis
+ linkis-mybatis
+ ${linkis.version}
+ provided
+
+
+
+ org.apache.commons
+ commons-math3
+ provided
+
+
+ com.webank.wedatasphere.dss
+ dss-appconn-manager-client
+ ${dss.version}
+ provided
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+
+
+
+ net.alchim31.maven
+ scala-maven-plugin
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+
+ 8
+
+
+
+
+
+ src/main/java
+
+ **/*.xml
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dss-framework/dss-framework-workspace-server/src/main/assembly/distribution.xml b/dss-framework/dss-framework-workspace-server/src/main/assembly/distribution.xml
new file mode 100644
index 0000000000..5303b0f554
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/assembly/distribution.xml
@@ -0,0 +1,320 @@
+
+
+
+ dss-framework-workspace-server
+
+ zip
+
+ true
+ dss-framework-workspace-server
+
+
+
+
+
+ lib
+ true
+ true
+ false
+ true
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ${basedir}/src/main/resources
+
+ *
+
+ 0777
+ conf
+ unix
+
+
+ ${basedir}/bin
+
+ *
+
+ 0777
+ bin
+ unix
+
+
+ .
+
+ */**
+
+ logs
+
+
+
+
+
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/annotation/DSSWorkspaceUM.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/annotation/DSSWorkspaceUM.java
new file mode 100644
index 0000000000..74e80506d4
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/annotation/DSSWorkspaceUM.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.METHOD})
+public @interface DSSWorkspaceUM {
+ String value() default "";
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/annotation/WorkspaceIdChecker.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/annotation/WorkspaceIdChecker.java
new file mode 100644
index 0000000000..3de0c1ef9d
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/annotation/WorkspaceIdChecker.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.METHOD})
+public @interface WorkspaceIdChecker {
+ String value() default "";
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/aop/DSSPrivCheckerAspect.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/aop/DSSPrivCheckerAspect.java
new file mode 100644
index 0000000000..ff8e4b8188
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/aop/DSSPrivCheckerAspect.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.aop;
+
+import org.aspectj.lang.annotation.Aspect;
+import org.springframework.stereotype.Component;
+
+
+@Aspect
+@Component
+public class DSSPrivCheckerAspect {
+
+
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/aop/DSSUWorkspaceIdCheckerAspect.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/aop/DSSUWorkspaceIdCheckerAspect.java
new file mode 100644
index 0000000000..3f09b9f162
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/aop/DSSUWorkspaceIdCheckerAspect.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.aop;
+
+import org.aspectj.lang.annotation.Aspect;
+import org.springframework.stereotype.Component;
+
+
+@Aspect
+@Component
+public class DSSUWorkspaceIdCheckerAspect {
+
+
+
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/aop/DSSWorkspaceUMAspect.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/aop/DSSWorkspaceUMAspect.java
new file mode 100644
index 0000000000..e42e2b6a95
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/aop/DSSWorkspaceUMAspect.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.aop;
+
+import org.aspectj.lang.annotation.Aspect;
+import org.springframework.stereotype.Component;
+
+
+@Aspect
+@Component
+public class DSSWorkspaceUMAspect {
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/BaseEntity.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/BaseEntity.java
new file mode 100644
index 0000000000..0f99605604
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/BaseEntity.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean;
+
+import java.util.Date;
+
+
+public class BaseEntity {
+
+ private String createBy;
+
+ private Date createTime = new Date();
+
+ private Date lastUpdateTime = new Date();
+
+ private String lastUpdateUser;
+
+ public String getCreateBy() {
+ return createBy;
+ }
+
+ public void setCreateBy(String createBy) {
+ this.createBy = createBy;
+ }
+
+ public Date getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(Date createTime) {
+ this.createTime = createTime;
+ }
+
+ public Date getLastUpdateTime() {
+ return lastUpdateTime;
+ }
+
+ public void setLastUpdateTime(Date lastUpdateTime) {
+ this.lastUpdateTime = lastUpdateTime;
+ }
+
+ public String getLastUpdateUser() {
+ return lastUpdateUser;
+ }
+
+ public void setLastUpdateUser(String lastUpdateUser) {
+ this.lastUpdateUser = lastUpdateUser;
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSApplication.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSApplication.java
new file mode 100644
index 0000000000..a7b214b2d9
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSApplication.java
@@ -0,0 +1,169 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+
+
+@TableName(value = "dss_application")
+public class DSSApplication implements Serializable {
+
+ private static final long serialVersionUID=1L;
+
+ @TableId(value = "id", type = IdType.AUTO)
+ private Integer id;
+
+ private String name;
+
+ private String url;
+
+ private Boolean isUserNeedInit;
+
+ private Integer level;
+
+ private String userInitUrl;
+
+ private Boolean existsProjectService;
+
+ private String projectUrl;
+
+ private String enhanceJson;
+
+ private Boolean ifIframe;
+
+ private String homepageUrl;
+
+ private String redirectUrl;
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public Boolean getUserNeedInit() {
+ return isUserNeedInit;
+ }
+
+ public void setUserNeedInit(Boolean userNeedInit) {
+ isUserNeedInit = userNeedInit;
+ }
+
+ public Integer getLevel() {
+ return level;
+ }
+
+ public void setLevel(Integer level) {
+ this.level = level;
+ }
+
+ public String getUserInitUrl() {
+ return userInitUrl;
+ }
+
+ public void setUserInitUrl(String userInitUrl) {
+ this.userInitUrl = userInitUrl;
+ }
+
+ public Boolean getExistsProjectService() {
+ return existsProjectService;
+ }
+
+ public void setExistsProjectService(Boolean existsProjectService) {
+ this.existsProjectService = existsProjectService;
+ }
+
+ public String getProjectUrl() {
+ return projectUrl;
+ }
+
+ public void setProjectUrl(String projectUrl) {
+ this.projectUrl = projectUrl;
+ }
+
+ public String getEnhanceJson() {
+ return enhanceJson;
+ }
+
+ public void setEnhanceJson(String enhanceJson) {
+ this.enhanceJson = enhanceJson;
+ }
+
+ public Boolean getIfIframe() {
+ return ifIframe;
+ }
+
+ public void setIfIframe(Boolean ifIframe) {
+ this.ifIframe = ifIframe;
+ }
+
+ public String getHomepageUrl() {
+ return homepageUrl;
+ }
+
+ public void setHomepageUrl(String homepageUrl) {
+ this.homepageUrl = homepageUrl;
+ }
+
+ public String getRedirectUrl() {
+ return redirectUrl;
+ }
+
+ public void setRedirectUrl(String redirectUrl) {
+ this.redirectUrl = redirectUrl;
+ }
+
+ @Override
+ public String toString() {
+ return "DssApplication{" +
+ "id=" + id +
+ ", name='" + name + '\'' +
+ ", url='" + url + '\'' +
+ ", isUserNeedInit=" + isUserNeedInit +
+ ", level=" + level +
+ ", userInitUrl='" + userInitUrl + '\'' +
+ ", existsProjectService=" + existsProjectService +
+ ", projectUrl='" + projectUrl + '\'' +
+ ", enhanceJson='" + enhanceJson + '\'' +
+ ", ifIframe=" + ifIframe +
+ ", homepageUrl='" + homepageUrl + '\'' +
+ ", redirectUrl='" + redirectUrl + '\'' +
+ '}';
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSApplicationBean.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSApplicationBean.java
new file mode 100644
index 0000000000..c0ead44315
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSApplicationBean.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean;
+
+
+public class DSSApplicationBean {
+ private Integer id;
+ private String name;
+ private String homepageUrl;
+ private String projectUrl;
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getHomepageUrl() {
+ return homepageUrl;
+ }
+
+ public void setHomepageUrl(String homepageUrl) {
+ this.homepageUrl = homepageUrl;
+ }
+
+ public String getProjectUrl() {
+ return projectUrl;
+ }
+
+ public void setProjectUrl(String projectUrl) {
+ this.projectUrl = projectUrl;
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSComponentRole.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSComponentRole.java
new file mode 100644
index 0000000000..9cac8a2681
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSComponentRole.java
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+@TableName(value = "dss_component_role")
+public class DSSComponentRole implements Serializable {
+ private static final long serialVersionUID=1L;
+
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ private Long workspaceId;
+
+ private Integer componentId;
+
+ private Integer roleId;
+
+ private Integer priv;
+
+ private Date updateTime;
+
+ private String updateby;
+
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public Long getWorkspaceId() {
+ return workspaceId;
+ }
+
+ public void setWorkspaceId(Long workspaceId) {
+ this.workspaceId = workspaceId;
+ }
+
+ public Integer getComponentId() {
+ return componentId;
+ }
+
+ public void setComponentId(Integer componentId) {
+ this.componentId = componentId;
+ }
+
+ public Integer getRoleId() {
+ return roleId;
+ }
+
+ public void setRoleId(Integer roleId) {
+ this.roleId = roleId;
+ }
+
+ public Integer getPriv() {
+ return priv;
+ }
+
+ public void setPriv(Integer priv) {
+ this.priv = priv;
+ }
+
+ public Date getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(Date updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public String getUpdateby() {
+ return updateby;
+ }
+
+ public void setUpdateby(String updateby) {
+ this.updateby = updateby;
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSDictionary.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSDictionary.java
new file mode 100644
index 0000000000..6214e75b48
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSDictionary.java
@@ -0,0 +1,304 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+@TableName(value = "dss_dictionary")
+public class DSSDictionary implements Serializable {
+
+ private static final long serialVersionUID=1L;
+
+ /**
+ * 主键ID,默认为0,所有空间都有
+ */
+ @TableId(value = "id", type = IdType.AUTO)
+ private Integer id;
+
+ /**
+ * 空间ID,默认为0,所有空间都有
+ */
+ private Integer workspaceId;
+
+ /**
+ * 父key
+ */
+ private String parentKey;
+
+ /**
+ * 名称
+ */
+ private String dicName;
+ /**
+ * 名称(英文)
+ */
+ private String dicNameEn;
+
+ /**
+ * key 相当于编码,空间是w_开头,工程是p_
+ */
+ private String dicKey;
+
+ /**
+ * key对应的值
+ */
+ private String dicValue;
+
+ /**
+ * key对应的值(英文)
+ */
+ private String dicValueEn;
+
+ /**
+ * 标题
+ */
+ private String title;
+
+ /**
+ * 标题(英文)
+ */
+ private String titleEn;
+
+ /**
+ * url
+ */
+ private String url;
+
+ /**
+ * url类型: 0-内部系统,1-外部系统;默认是内部
+ */
+ private Integer urlType;
+
+ /**
+ * 图标
+ */
+ private String icon;
+
+ /**
+ * 序号
+ */
+ private Integer orderNum;
+
+ /**
+ * 备注
+ */
+ private String remark;
+
+ /**
+ * 创建人
+ */
+ private String createUser;
+
+ /**
+ * 创建时间
+ */
+ private Date createTime;
+
+ /**
+ * 更新人
+ */
+ private String updateUser;
+
+ /**
+ * 更新时间
+ */
+ private Date updateTime;
+
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public Integer getWorkspaceId() {
+ return workspaceId;
+ }
+
+ public void setWorkspaceId(Integer workspaceId) {
+ this.workspaceId = workspaceId;
+ }
+
+ public String getParentKey() {
+ return parentKey;
+ }
+
+ public void setParentKey(String parentKey) {
+ this.parentKey = parentKey;
+ }
+
+ public String getDicName() {
+ return dicName;
+ }
+
+ public void setDicName(String dicName) {
+ this.dicName = dicName;
+ }
+
+ public String getDicKey() {
+ return dicKey;
+ }
+
+ public void setDicKey(String dicKey) {
+ this.dicKey = dicKey;
+ }
+
+ public String getDicValue() {
+ return dicValue;
+ }
+
+ public void setDicValue(String dicValue) {
+ this.dicValue = dicValue;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public Integer getUrlType() {
+ return urlType;
+ }
+
+ public void setUrlType(Integer urlType) {
+ this.urlType = urlType;
+ }
+
+ public String getIcon() {
+ return icon;
+ }
+
+ public void setIcon(String icon) {
+ this.icon = icon;
+ }
+
+ public Integer getOrderNum() {
+ return orderNum;
+ }
+
+ public void setOrderNum(Integer orderNum) {
+ this.orderNum = orderNum;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ public String getCreateUser() {
+ return createUser;
+ }
+
+ public void setCreateUser(String createUser) {
+ this.createUser = createUser;
+ }
+
+ public Date getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(Date createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getUpdateUser() {
+ return updateUser;
+ }
+
+ public void setUpdateUser(String updateUser) {
+ this.updateUser = updateUser;
+ }
+
+ public Date getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(Date updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public String getDicNameEn() {
+ return dicNameEn;
+ }
+
+ public void setDicNameEn(String dicNameEn) {
+ this.dicNameEn = dicNameEn;
+ }
+
+ public String getDicValueEn() {
+ return dicValueEn;
+ }
+
+ public void setDicValueEn(String dicValueEn) {
+ this.dicValueEn = dicValueEn;
+ }
+
+ public String getTitleEn() {
+ return titleEn;
+ }
+
+ public void setTitleEn(String titleEn) {
+ this.titleEn = titleEn;
+ }
+
+ @Override
+ public String toString() {
+ return "DSSDictionary{" +
+ "id=" + id +
+ ", workspaceId=" + workspaceId +
+ ", parentKey='" + parentKey + '\'' +
+ ", dicName='" + dicName + '\'' +
+ ", dicNameEn='" + dicNameEn + '\'' +
+ ", dicKey='" + dicKey + '\'' +
+ ", dicValue='" + dicValue + '\'' +
+ ", dicValueEn='" + dicValueEn + '\'' +
+ ", title='" + title + '\'' +
+ ", titleEn='" + titleEn + '\'' +
+ ", url='" + url + '\'' +
+ ", urlType=" + urlType +
+ ", icon='" + icon + '\'' +
+ ", orderNum=" + orderNum +
+ ", remark='" + remark + '\'' +
+ ", createUser='" + createUser + '\'' +
+ ", createTime=" + createTime +
+ ", updateUser='" + updateUser + '\'' +
+ ", updateTime=" + updateTime +
+ '}';
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSFavorite.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSFavorite.java
new file mode 100644
index 0000000000..40f691d8cf
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSFavorite.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package com.webank.wedatasphere.dss.framework.workspace.bean;
+
+
+public class DSSFavorite extends BaseEntity{
+
+ private Long id;
+
+ private String username;
+
+ private Long workspaceId;
+
+ private Long menuApplicationId;
+
+ private Integer order;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public Long getWorkspaceId() {
+ return workspaceId;
+ }
+
+ public void setWorkspaceId(Long workspaceId) {
+ this.workspaceId = workspaceId;
+ }
+
+ public Long getMenuApplicationId() {
+ return menuApplicationId;
+ }
+
+ public void setMenuApplicationId(Long menuApplicationId) {
+ this.menuApplicationId = menuApplicationId;
+ }
+
+ public Integer getOrder() {
+ return order;
+ }
+
+ public void setOrder(Integer order) {
+ this.order = order;
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSHomepage.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSHomepage.java
new file mode 100644
index 0000000000..48ab10de3c
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSHomepage.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean;
+
+
+public class DSSHomepage {
+ private int id;
+ private String name;
+ private String url;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSMenu.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSMenu.java
new file mode 100644
index 0000000000..d3c1ba28fb
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSMenu.java
@@ -0,0 +1,169 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.google.common.base.Objects;
+
+import java.io.Serializable;
+
+
+@TableName(value = "dss_menu")
+public class DSSMenu implements Serializable {
+ private static final long serialVersionUID=1L;
+ @TableId(value = "id", type = IdType.AUTO)
+ private Integer id;
+ private String name;
+ private int level;
+ private int upperMenuId;
+ private String frontName;
+ private String comment;
+ private String description;
+ private boolean isActive;
+ private boolean isComponent;
+ @TableField(exist = false)
+ private String url;
+ private String icon;
+ private int applicationId;
+
+ public String getComment() {
+ return comment;
+ }
+
+ public void setComment(String comment) {
+ this.comment = comment;
+ }
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public int getLevel() {
+ return level;
+ }
+
+ public void setLevel(int level) {
+ this.level = level;
+ }
+
+ public int getUpperMenuId() {
+ return upperMenuId;
+ }
+
+ public void setUpperMenuId(int upperMenuId) {
+ this.upperMenuId = upperMenuId;
+ }
+
+ public String getFrontName() {
+ return frontName;
+ }
+
+ public void setFrontName(String frontName) {
+ this.frontName = frontName;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public boolean isActive() {
+ return isActive;
+ }
+
+ public void setActive(boolean active) {
+ isActive = active;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public boolean isComponent() {
+ return isComponent;
+ }
+
+ public void setComponent(boolean component) {
+ isComponent = component;
+ }
+
+ public String getIcon() {
+ return icon;
+ }
+
+ public void setIcon(String icon) {
+ this.icon = icon;
+ }
+
+ public int getApplicationId() {
+ return applicationId;
+ }
+
+ public void setApplicationId(int applicationId) {
+ this.applicationId = applicationId;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ DSSMenu dssMenu = (DSSMenu) o;
+ return id == dssMenu.id &&
+ level == dssMenu.level &&
+ upperMenuId == dssMenu.upperMenuId &&
+ isActive == dssMenu.isActive &&
+ isComponent == dssMenu.isComponent &&
+ applicationId == dssMenu.applicationId &&
+ Objects.equal(name, dssMenu.name) &&
+ Objects.equal(frontName, dssMenu.frontName) &&
+ Objects.equal(description, dssMenu.description) &&
+ Objects.equal(url, dssMenu.url) &&
+ Objects.equal(icon, dssMenu.icon);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(id, name, level, upperMenuId, frontName, description, isActive, isComponent, url, icon, applicationId);
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSMenuRole.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSMenuRole.java
new file mode 100644
index 0000000000..69dca39def
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSMenuRole.java
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+@TableName(value = "dss_menu_role")
+public class DSSMenuRole implements Serializable {
+
+ private static final long serialVersionUID=1L;
+
+ @TableId(value = "id", type = IdType.AUTO)
+ private Integer id;
+
+ private Integer workspaceId;
+
+ private Integer menuId;
+
+ private Integer roleId;
+
+ private Integer priv;
+
+ private Date updateTime;
+
+ private String updateby;
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public Integer getWorkspaceId() {
+ return workspaceId;
+ }
+
+ public void setWorkspaceId(Integer workspaceId) {
+ this.workspaceId = workspaceId;
+ }
+
+ public Integer getMenuId() {
+ return menuId;
+ }
+
+ public void setMenuId(Integer menuId) {
+ this.menuId = menuId;
+ }
+
+ public Integer getRoleId() {
+ return roleId;
+ }
+
+ public void setRoleId(Integer roleId) {
+ this.roleId = roleId;
+ }
+
+ public Integer getPriv() {
+ return priv;
+ }
+
+ public void setPriv(Integer priv) {
+ this.priv = priv;
+ }
+
+ public Date getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(Date updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public String getUpdateby() {
+ return updateby;
+ }
+
+ public void setUpdateby(String updateby) {
+ this.updateby = updateby;
+ }
+
+ @Override
+ public String toString() {
+ return "DssMenuRole{" +
+ "id=" + id +
+ ", workspaceId=" + workspaceId +
+ ", menuId=" + menuId +
+ ", roleId=" + roleId +
+ ", priv=" + priv +
+ ", updateTime=" + updateTime +
+ ", updateby='" + updateby + '\'' +
+ '}';
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSRole.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSRole.java
new file mode 100644
index 0000000000..152fe05734
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSRole.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean;
+
+import java.util.Date;
+
+
+public class DSSRole {
+ private int id;
+ private int workspaceId;
+ private String name;
+ private String frontName;
+ private Date createTime;
+ private String description;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public int getWorkspaceId() {
+ return workspaceId;
+ }
+
+ public void setWorkspaceId(int workspaceId) {
+ this.workspaceId = workspaceId;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getFrontName() {
+ return frontName;
+ }
+
+ public void setFrontName(String frontName) {
+ this.frontName = frontName;
+ }
+
+ public Date getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(Date createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ @Override
+ public String toString() {
+ return "DSSRole{" +
+ "id=" + id +
+ ", workspaceId=" + workspaceId +
+ ", name='" + name + '\'' +
+ ", frontName='" + frontName + '\'' +
+ ", createTime=" + createTime +
+ ", description='" + description + '\'' +
+ '}';
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSUser.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSUser.java
new file mode 100644
index 0000000000..4820b7c299
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSUser.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+
+
+@TableName(value = "dss_user")
+public class DSSUser implements Serializable {
+
+ private static final long serialVersionUID = -5404077122214161197L;
+
+ @TableId(type = IdType.AUTO)
+ private Long id;
+
+ private String username;
+
+ private String name;
+
+ private Boolean isFirstLogin;
+
+ private Boolean isAdmin;
+
+ public DSSUser() {
+ }
+
+ public DSSUser(Long id, String username, String name, Boolean isFirstLogin, Boolean isAdmin) {
+ this.id = id;
+ this.username = username;
+ this.name = name;
+ this.isFirstLogin = isFirstLogin;
+ this.isAdmin = isAdmin;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Boolean getFirstLogin() {
+ return isFirstLogin;
+ }
+
+ public void setFirstLogin(Boolean firstLogin) {
+ isFirstLogin = firstLogin;
+ }
+
+ public Boolean getAdmin() {
+ return isAdmin;
+ }
+
+ public void setAdmin(Boolean admin) {
+ isAdmin = admin;
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspace.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspace.java
new file mode 100644
index 0000000000..d0731b7b68
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspace.java
@@ -0,0 +1,124 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean;
+
+import java.util.Date;
+
+
+public class DSSWorkspace {
+ private int id;
+ private String name;
+ private String label;
+ private String description;
+ private String createBy;
+ private Date createTime;
+ private String department;
+ private String product;
+ private String source;
+ private Date lastUpdateTime;
+ private String lastUpdateUser;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public void setLabel(String label) {
+ this.label = label;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getCreateBy() {
+ return createBy;
+ }
+
+ public void setCreateBy(String createBy) {
+ this.createBy = createBy;
+ }
+
+ public Date getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(Date createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getDepartment() {
+ return department;
+ }
+
+ public void setDepartment(String department) {
+ this.department = department;
+ }
+
+ public String getProduct() {
+ return product;
+ }
+
+ public void setProduct(String product) {
+ this.product = product;
+ }
+
+ public String getSource() {
+ return source;
+ }
+
+ public void setSource(String source) {
+ this.source = source;
+ }
+
+ public Date getLastUpdateTime() {
+ return lastUpdateTime;
+ }
+
+ public void setLastUpdateTime(Date lastUpdateTime) {
+ this.lastUpdateTime = lastUpdateTime;
+ }
+
+ public String getLastUpdateUser() {
+ return lastUpdateUser;
+ }
+
+ public void setLastUpdateUser(String lastUpdateUser) {
+ this.lastUpdateUser = lastUpdateUser;
+ }
+
+
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceComponent.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceComponent.java
new file mode 100644
index 0000000000..39e791a45d
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceComponent.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean;
+
+
+public class DSSWorkspaceComponent {
+ private int id;
+ private String componentName;
+ private String homepageUrl;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getComponentName() {
+ return componentName;
+ }
+
+ public void setComponentName(String componentName) {
+ this.componentName = componentName;
+ }
+
+ public String getHomepageUrl() {
+ return homepageUrl;
+ }
+
+ public void setHomepageUrl(String homepageUrl) {
+ this.homepageUrl = homepageUrl;
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceComponentInfo.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceComponentInfo.java
new file mode 100644
index 0000000000..d7040c83b6
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceComponentInfo.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean;
+
+
+import java.util.List;
+
+
+public class DSSWorkspaceComponentInfo {
+ private String title;
+
+ private String icon;
+
+ private String desc;
+
+ private String buttonText;
+/*
+ private List statistics;*/
+
+ private String componentUrl;
+
+ private String userManualUrl;
+
+ private String indicatorUrl;
+
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getIcon() {
+ return icon;
+ }
+
+ public void setIcon(String icon) {
+ this.icon = icon;
+ }
+
+ public String getDesc() {
+ return desc;
+ }
+
+ public void setDesc(String desc) {
+ this.desc = desc;
+ }
+
+ public String getButtonText() {
+ return buttonText;
+ }
+
+ public void setButtonText(String buttonText) {
+ this.buttonText = buttonText;
+ }
+
+/*
+ public List getStatistics() {
+ return statistics;
+ }
+
+ public void setStatistics(List statistics) {
+ this.statistics = statistics;
+ }
+*/
+
+ public String getComponentUrl() {
+ return componentUrl;
+ }
+
+ public void setComponentUrl(String componentUrl) {
+ this.componentUrl = componentUrl;
+ }
+
+ public String getUserManualUrl() {
+ return userManualUrl;
+ }
+
+ public void setUserManualUrl(String userManualUrl) {
+ this.userManualUrl = userManualUrl;
+ }
+
+ public String getIndicatorUrl() {
+ return indicatorUrl;
+ }
+
+ public void setIndicatorUrl(String indicatorUrl) {
+ this.indicatorUrl = indicatorUrl;
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceComponentPriv.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceComponentPriv.java
new file mode 100644
index 0000000000..3b05f00376
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceComponentPriv.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean;
+
+import java.util.Date;
+
+
+public class DSSWorkspaceComponentPriv {
+
+ private int id;
+ private int workspaceId;
+ private int roleId;
+ private int componentId;
+ private int priv;
+ private Date updateTime;
+ private String updateBy;
+
+
+ public DSSWorkspaceComponentPriv() {
+ }
+
+ public DSSWorkspaceComponentPriv(int workspaceId, int roleId, int componentId, int priv, Date updateTime, String updateBy) {
+ this.workspaceId = workspaceId;
+ this.roleId = roleId;
+ this.componentId = componentId;
+ this.priv = priv;
+ this.updateTime = updateTime;
+ this.updateBy = updateBy;
+ }
+
+ public int getComponentId() {
+ return componentId;
+ }
+
+ public void setComponentId(int componentId) {
+ this.componentId = componentId;
+ }
+
+ public int getPriv() {
+ return priv;
+ }
+
+ public void setPriv(int priv) {
+ this.priv = priv;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public int getWorkspaceId() {
+ return workspaceId;
+ }
+
+ public void setWorkspaceId(int workspaceId) {
+ this.workspaceId = workspaceId;
+ }
+
+ public int getRoleId() {
+ return roleId;
+ }
+
+ public void setRoleId(int roleId) {
+ this.roleId = roleId;
+ }
+
+ public Date getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(Date updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public String getUpdateBy() {
+ return updateBy;
+ }
+
+ public void setUpdateBy(String updateBy) {
+ this.updateBy = updateBy;
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceComponentRolePriv.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceComponentRolePriv.java
new file mode 100644
index 0000000000..87fdd4a7ea
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceComponentRolePriv.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean;
+
+import com.google.common.base.Objects;
+
+import java.util.Date;
+
+
+public class DSSWorkspaceComponentRolePriv {
+ private Integer id;
+ private Integer workspaceId;
+ private Integer componentId;
+ private Integer roleId;
+ private Integer priv;
+ private Date lastUpdateTime;
+ private String updateBy;
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public Integer getWorkspaceId() {
+ return workspaceId;
+ }
+
+ public void setWorkspaceId(Integer workspaceId) {
+ this.workspaceId = workspaceId;
+ }
+
+ public Integer getComponentId() {
+ return componentId;
+ }
+
+ public void setComponentId(Integer componentId) {
+ this.componentId = componentId;
+ }
+
+ public Integer getRoleId() {
+ return roleId;
+ }
+
+ public void setRoleId(Integer roleId) {
+ this.roleId = roleId;
+ }
+
+ public Integer getPriv() {
+ return priv;
+ }
+
+ public void setPriv(Integer priv) {
+ this.priv = priv;
+ }
+
+ public Date getLastUpdateTime() {
+ return lastUpdateTime;
+ }
+
+ public void setLastUpdateTime(Date lastUpdateTime) {
+ this.lastUpdateTime = lastUpdateTime;
+ }
+
+ public String getUpdateBy() {
+ return updateBy;
+ }
+
+ public void setUpdateBy(String updateBy) {
+ this.updateBy = updateBy;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ DSSWorkspaceComponentRolePriv that = (DSSWorkspaceComponentRolePriv) o;
+ return Objects.equal(componentId, that.componentId) &&
+ Objects.equal(roleId, that.roleId);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(componentId, roleId);
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceHomepage.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceHomepage.java
new file mode 100644
index 0000000000..22e218cd51
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceHomepage.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+
+
+@TableName(value = "dss_workspace_homepage")
+public class DSSWorkspaceHomepage {
+ private static final long serialVersionUID=1L;
+ @TableId(value = "id", type = IdType.AUTO)
+ private Integer id;
+ private Integer workspaceId;
+ private Integer roleId;
+ private String homepageUrl;
+ private Date updateTime;
+
+
+ public DSSWorkspaceHomepage(){
+
+ }
+
+ public DSSWorkspaceHomepage(Integer workspaceId, Integer roleId, String homepageUrl, Date updateTime) {
+ this.workspaceId = workspaceId;
+ this.roleId = roleId;
+ this.homepageUrl = homepageUrl;
+ this.updateTime = updateTime;
+ }
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public Integer getWorkspaceId() {
+ return workspaceId;
+ }
+
+ public void setWorkspaceId(Integer workspaceId) {
+ this.workspaceId = workspaceId;
+ }
+
+ public Integer getRoleId() {
+ return roleId;
+ }
+
+ public void setRoleId(Integer roleId) {
+ this.roleId = roleId;
+ }
+
+ public String getHomepageUrl() {
+ return homepageUrl;
+ }
+
+ public void setHomepageUrl(String homepageUrl) {
+ this.homepageUrl = homepageUrl;
+ }
+
+ public Date getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(Date updateTime) {
+ this.updateTime = updateTime;
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceHomepageSetting.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceHomepageSetting.java
new file mode 100644
index 0000000000..899741f72c
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceHomepageSetting.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean;
+
+import java.util.Date;
+
+
+public class DSSWorkspaceHomepageSetting {
+ private Integer id;
+ private Integer workspaceId;
+ private Integer roleId;
+ private String homepageUrl;
+ private Date updateTime;
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public Integer getWorkspaceId() {
+ return workspaceId;
+ }
+
+ public void setWorkspaceId(Integer workspaceId) {
+ this.workspaceId = workspaceId;
+ }
+
+ public Integer getRoleId() {
+ return roleId;
+ }
+
+ public void setRoleId(Integer roleId) {
+ this.roleId = roleId;
+ }
+
+ public String getHomepageUrl() {
+ return homepageUrl;
+ }
+
+ public void setHomepageUrl(String homepageUrl) {
+ this.homepageUrl = homepageUrl;
+ }
+
+ public Date getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(Date updateTime) {
+ this.updateTime = updateTime;
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceMenuComponentUrl.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceMenuComponentUrl.java
new file mode 100644
index 0000000000..23348c5bf0
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceMenuComponentUrl.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean;
+
+import java.util.Date;
+
+
+public class DSSWorkspaceMenuComponentUrl {
+ private int id;
+ private int menuId;
+ private int dssApplicationId;
+ private String url;
+ private String manulUrl;
+ private String operationUrl;
+ private Date updateTime;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public int getMenuId() {
+ return menuId;
+ }
+
+ public void setMenuId(int menuId) {
+ this.menuId = menuId;
+ }
+
+ public int getDssApplicationId() {
+ return dssApplicationId;
+ }
+
+ public void setDssApplicationId(int dssApplicationId) {
+ this.dssApplicationId = dssApplicationId;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public String getManulUrl() {
+ return manulUrl;
+ }
+
+ public void setManulUrl(String manulUrl) {
+ this.manulUrl = manulUrl;
+ }
+
+ public String getOperationUrl() {
+ return operationUrl;
+ }
+
+ public void setOperationUrl(String operationUrl) {
+ this.operationUrl = operationUrl;
+ }
+
+ public Date getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(Date updateTime) {
+ this.updateTime = updateTime;
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceMenuRole.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceMenuRole.java
new file mode 100644
index 0000000000..74c51704fb
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceMenuRole.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean;
+
+import java.util.Date;
+
+
+public class DSSWorkspaceMenuRole {
+ private int id;
+ private int workspaceId;
+ private int menuId;
+ private int roleId;
+ private int priv;
+ private Date updateTime;
+ private String updateBy;
+
+ public DSSWorkspaceMenuRole(int workspaceId, int menuId, int roleId, int priv, Date updateTime, String updateBy) {
+ this.workspaceId = workspaceId;
+ this.menuId = menuId;
+ this.roleId = roleId;
+ this.priv = priv;
+ this.updateTime = updateTime;
+ this.updateBy = updateBy;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public int getWorkspaceId() {
+ return workspaceId;
+ }
+
+ public void setWorkspaceId(int workspaceId) {
+ this.workspaceId = workspaceId;
+ }
+
+ public int getMenuId() {
+ return menuId;
+ }
+
+ public void setMenuId(int menuId) {
+ this.menuId = menuId;
+ }
+
+ public int getRoleId() {
+ return roleId;
+ }
+
+ public void setRoleId(int roleId) {
+ this.roleId = roleId;
+ }
+
+ public int getPriv() {
+ return priv;
+ }
+
+ public void setPriv(int priv) {
+ this.priv = priv;
+ }
+
+ public Date getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(Date updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public String getUpdateBy() {
+ return updateBy;
+ }
+
+ public void setUpdateBy(String updateBy) {
+ this.updateBy = updateBy;
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceMenuRolePriv.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceMenuRolePriv.java
new file mode 100644
index 0000000000..f380e54498
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceMenuRolePriv.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean;
+
+import java.util.Date;
+
+
+public class DSSWorkspaceMenuRolePriv {
+ private int id;
+ private int workspaceId;
+ private int menuId;
+ private int roleId;
+ private int priv;
+ private Date updateTime;
+ private String updateBy;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public int getWorkspaceId() {
+ return workspaceId;
+ }
+
+ public void setWorkspaceId(int workspaceId) {
+ this.workspaceId = workspaceId;
+ }
+
+ public int getMenuId() {
+ return menuId;
+ }
+
+ public void setMenuId(int menuId) {
+ this.menuId = menuId;
+ }
+
+ public int getRoleId() {
+ return roleId;
+ }
+
+ public void setRoleId(int roleId) {
+ this.roleId = roleId;
+ }
+
+ public int getPriv() {
+ return priv;
+ }
+
+ public void setPriv(int priv) {
+ this.priv = priv;
+ }
+
+ public Date getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(Date updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public String getUpdateBy() {
+ return updateBy;
+ }
+
+ public void setUpdateBy(String updateBy) {
+ this.updateBy = updateBy;
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceUser.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceUser.java
new file mode 100644
index 0000000000..8f57569089
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/DSSWorkspaceUser.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean;
+
+import java.util.Date;
+
+
+public class DSSWorkspaceUser {
+
+ private String username;
+
+ private int workspaceId;
+
+ private String creator;
+
+ private Date joinTime;
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public int getWorkspaceId() {
+ return workspaceId;
+ }
+
+ public void setWorkspaceId(int workspaceId) {
+ this.workspaceId = workspaceId;
+ }
+
+ public String getCreator() {
+ return creator;
+ }
+
+ public void setCreator(String creator) {
+ this.creator = creator;
+ }
+
+ public Date getJoinTime() {
+ return joinTime;
+ }
+
+ public void setJoinTime(Date joinTime) {
+ this.joinTime = joinTime;
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/LinkisUser.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/LinkisUser.java
new file mode 100644
index 0000000000..ec6aa9c9b7
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/LinkisUser.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean;
+
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.util.Date;
+
+@TableName(value = "linkis_user")
+public class LinkisUser {
+ @TableId(type = IdType.AUTO)
+ private Long id;
+ private String username;
+ private String name;
+ private Boolean isFirstLogin;
+ private Date updateTime;
+ private Date createTime;
+
+ public Date getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(Date createTime) {
+ this.createTime = createTime;
+ }
+
+ public Date getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(Date updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Boolean getFirstLogin() {
+ return isFirstLogin;
+ }
+
+ public void setFirstLogin(Boolean firstLogin) {
+ isFirstLogin = firstLogin;
+ }
+
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/Sidebar.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/Sidebar.java
new file mode 100644
index 0000000000..8a743fdd6c
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/Sidebar.java
@@ -0,0 +1,185 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+@TableName(value = "dss_sidebar")
+public class Sidebar implements Serializable {
+
+ private static final long serialVersionUID = -5404077122214161197L;
+
+ @TableId(type = IdType.AUTO)
+ private Integer id;
+
+ //名称
+ private String name;
+
+ //名称(英文)
+ private String nameEn;
+
+ //标题
+ private String title;
+
+ //标题(英文)
+ private String titleEn;
+
+ //类型: 0-知识库,1-菜单,2-常见问题
+ private Integer type;
+
+ //序号
+ private Integer orderNum;
+
+ //备注
+ private String remark;
+
+ //创建人
+ private String createUser;
+
+ //创建时间
+ private Date createTime;
+
+ //更新人
+ private String updateUser;
+
+ //更新时间
+ private Date updateTime;
+
+
+ public Sidebar() {
+ }
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public Integer getType() {
+ return type;
+ }
+
+ public void setType(Integer type) {
+ this.type = type;
+ }
+
+ public Integer getOrderNum() {
+ return orderNum;
+ }
+
+ public void setOrderNum(Integer orderNum) {
+ this.orderNum = orderNum;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ public String getCreateUser() {
+ return createUser;
+ }
+
+ public void setCreateUser(String createUser) {
+ this.createUser = createUser;
+ }
+
+ public Date getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(Date createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getUpdateUser() {
+ return updateUser;
+ }
+
+ public void setUpdateUser(String updateUser) {
+ this.updateUser = updateUser;
+ }
+
+ public Date getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(Date updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public String getNameEn() {
+ return nameEn;
+ }
+
+ public void setNameEn(String nameEn) {
+ this.nameEn = nameEn;
+ }
+
+ public String getTitleEn() {
+ return titleEn;
+ }
+
+ public void setTitleEn(String titleEn) {
+ this.titleEn = titleEn;
+ }
+
+ @Override
+ public String toString() {
+ return "Sidebar{" +
+ "id=" + id +
+ ", name='" + name + '\'' +
+ ", nameEn='" + nameEn + '\'' +
+ ", title='" + title + '\'' +
+ ", titleEn='" + titleEn + '\'' +
+ ", type=" + type +
+ ", orderNum=" + orderNum +
+ ", remark='" + remark + '\'' +
+ ", createUser='" + createUser + '\'' +
+ ", createTime=" + createTime +
+ ", updateUser='" + updateUser + '\'' +
+ ", updateTime=" + updateTime +
+ '}';
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/SidebarContent.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/SidebarContent.java
new file mode 100644
index 0000000000..100ba03bb1
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/SidebarContent.java
@@ -0,0 +1,223 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+@TableName(value = "dss_sidebar_content")
+public class SidebarContent implements Serializable {
+
+ private static final long serialVersionUID = -5404077122214161197L;
+
+ @TableId(type = IdType.AUTO)
+ private Integer id;
+
+ //侧边栏ID
+ private Integer sidebarId;
+
+ //名称
+ private String name;
+
+ //名称(英文)
+ private String nameEn;
+
+ //标题
+ private String title;
+
+ //标题(英文)
+ private String titleEn;
+
+ //url
+ private String url;
+
+ /**
+ * url类型: 0-内部系统,1-外部系统;默认是内部
+ */
+ private Integer urlType;
+
+ //icon
+ private String icon;
+
+ //序号
+ private Integer orderNum;
+
+ //备注
+ private String remark;
+
+ //创建人
+ private String createUser;
+
+ //创建时间
+ private Date createTime;
+
+ //更新人
+ private String updateUser;
+
+ //更新时间
+ private Date updateTime;
+
+
+ public SidebarContent() {
+ }
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public Integer getSidebarId() {
+ return sidebarId;
+ }
+
+ public void setSidebarId(Integer sidebarId) {
+ this.sidebarId = sidebarId;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public Integer getUrlType() {
+ return urlType;
+ }
+
+ public void setUrlType(Integer urlType) {
+ this.urlType = urlType;
+ }
+
+ public String getIcon() {
+ return icon;
+ }
+
+ public void setIcon(String icon) {
+ this.icon = icon;
+ }
+
+ public Integer getOrderNum() {
+ return orderNum;
+ }
+
+ public void setOrderNum(Integer orderNum) {
+ this.orderNum = orderNum;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ public String getCreateUser() {
+ return createUser;
+ }
+
+ public void setCreateUser(String createUser) {
+ this.createUser = createUser;
+ }
+
+ public Date getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(Date createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getUpdateUser() {
+ return updateUser;
+ }
+
+ public void setUpdateUser(String updateUser) {
+ this.updateUser = updateUser;
+ }
+
+ public Date getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(Date updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public String getNameEn() {
+ return nameEn;
+ }
+
+ public void setNameEn(String nameEn) {
+ this.nameEn = nameEn;
+ }
+
+ public String getTitleEn() {
+ return titleEn;
+ }
+
+ public void setTitleEn(String titleEn) {
+ this.titleEn = titleEn;
+ }
+
+ @Override
+ public String toString() {
+ return "SidebarContent{" +
+ "id=" + id +
+ ", sidebarId=" + sidebarId +
+ ", name='" + name + '\'' +
+ ", nameEn='" + nameEn + '\'' +
+ ", title='" + title + '\'' +
+ ", titleEn='" + titleEn + '\'' +
+ ", url='" + url + '\'' +
+ ", urlType=" + urlType +
+ ", icon='" + icon + '\'' +
+ ", orderNum=" + orderNum +
+ ", remark='" + remark + '\'' +
+ ", createUser='" + createUser + '\'' +
+ ", createTime=" + createTime +
+ ", updateUser='" + updateUser + '\'' +
+ ", updateTime=" + updateTime +
+ '}';
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/StaffInfo.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/StaffInfo.java
new file mode 100644
index 0000000000..7200c12da9
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/StaffInfo.java
@@ -0,0 +1,147 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class StaffInfo {
+ @JsonProperty(value = "ID")
+ private String id;
+ @JsonProperty(value = "StaffID")
+ private String staffId;
+ @JsonProperty(value = "OID")
+ private String oId;
+ @JsonProperty(value = "ChineseName")
+ private String chineseName;
+ @JsonProperty(value = "EnglishName")
+ private String englishName;
+ @JsonProperty(value = "FullName")
+ private String fullName;
+ @JsonProperty(value = "OrgName")
+ private String orgName;
+ @JsonProperty(value = "OrgFullName")
+ private String orgFullName;
+ @JsonProperty(value = "Status")
+ private String status;
+ @JsonProperty(value = "PersonGroup")
+ private String personGroup;
+
+ public StaffInfo(String id,String englishName, String orgFullName){
+ this.id = id;
+ this.englishName = englishName;
+ this.orgFullName = orgFullName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getStaffId() {
+ return staffId;
+ }
+
+ public void setStaffId(String staffId) {
+ this.staffId = staffId;
+ }
+
+ public String getoId() {
+ return oId;
+ }
+
+ public void setoId(String oId) {
+ this.oId = oId;
+ }
+
+ public String getChineseName() {
+ return chineseName;
+ }
+
+ public void setChineseName(String chineseName) {
+ this.chineseName = chineseName;
+ }
+
+ public String getEnglishName() {
+ return englishName;
+ }
+
+ public void setEnglishName(String englishName) {
+ this.englishName = englishName;
+ }
+
+ public String getFullName() {
+ return fullName;
+ }
+
+ public void setFullName(String fullName) {
+ this.fullName = fullName;
+ }
+
+ public String getOrgName() {
+ return orgName;
+ }
+
+ public void setOrgName(String orgName) {
+ this.orgName = orgName;
+ }
+
+ public String getOrgFullName() {
+ return orgFullName;
+ }
+
+ public void setOrgFullName(String orgFullName) {
+ this.orgFullName = orgFullName;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ public String getPersonGroup() {
+ return personGroup;
+ }
+
+ public void setPersonGroup(String personGroup) {
+ this.personGroup = personGroup;
+ }
+
+ @Override
+ public String toString() {
+ return "StaffInfo{" +
+ "id='" + id + '\'' +
+ ", staffId='" + staffId + '\'' +
+ ", oId='" + oId + '\'' +
+ ", chineseName='" + chineseName + '\'' +
+ ", englishName='" + englishName + '\'' +
+ ", fullName='" + fullName + '\'' +
+ ", orgName='" + orgName + '\'' +
+ ", orgFullName='" + orgFullName + '\'' +
+ ", status='" + status + '\'' +
+ ", personGroup='" + personGroup + '\'' +
+ '}';
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/WorkSpaceUserAndRole.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/WorkSpaceUserAndRole.java
new file mode 100644
index 0000000000..d2fef62de7
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/WorkSpaceUserAndRole.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean;
+
+import java.util.Date;
+
+
+public class WorkSpaceUserAndRole {
+
+ private int id;
+ private int roleId;
+ private int workspaceId;
+ private Long userID;
+ private String creator;
+ private Date date;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public int getRoleId() {
+ return roleId;
+ }
+
+ public void setRoleId(int roleId) {
+ this.roleId = roleId;
+ }
+
+ public int getWorkspaceId() {
+ return workspaceId;
+ }
+
+ public void setWorkspaceId(int workspaceId) {
+ this.workspaceId = workspaceId;
+ }
+
+ public Long getUserID() {
+ return userID;
+ }
+
+ public void setUserID(Long userID) {
+ this.userID = userID;
+ }
+
+ public String getCreator() {
+ return creator;
+ }
+
+ public void setCreator(String creator) {
+ this.creator = creator;
+ }
+
+ public Date getDate() {
+ return date;
+ }
+
+ public void setDate(Date date) {
+ this.date = date;
+ }
+
+
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/dto/response/HomepageDemoInstanceVo.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/dto/response/HomepageDemoInstanceVo.java
new file mode 100644
index 0000000000..2845aba13a
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/dto/response/HomepageDemoInstanceVo.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package com.webank.wedatasphere.dss.framework.workspace.bean.dto.response;
+
+
+public class HomepageDemoInstanceVo {
+
+ private Long id;
+ private Long menuId;
+ private String name;
+ private String url;
+ private String title;
+ private String description;
+ private String icon;
+ private Integer order;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public Long getMenuId() {
+ return menuId;
+ }
+
+ public void setMenuId(Long menuId) {
+ this.menuId = menuId;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getIcon() {
+ return icon;
+ }
+
+ public void setIcon(String icon) {
+ this.icon = icon;
+ }
+
+ public Integer getOrder() {
+ return order;
+ }
+
+ public void setOrder(Integer order) {
+ this.order = order;
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/dto/response/HomepageDemoMenuVo.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/dto/response/HomepageDemoMenuVo.java
new file mode 100644
index 0000000000..04b7558c58
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/dto/response/HomepageDemoMenuVo.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package com.webank.wedatasphere.dss.framework.workspace.bean.dto.response;
+
+import java.util.List;
+
+
+public class HomepageDemoMenuVo {
+
+ private Long id;
+ private String name;
+ private String title;
+ private String description;
+ private String icon;
+ private Integer order;
+ private List demoInstances;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getIcon() {
+ return icon;
+ }
+
+ public void setIcon(String icon) {
+ this.icon = icon;
+ }
+
+ public Integer getOrder() {
+ return order;
+ }
+
+ public void setOrder(Integer order) {
+ this.order = order;
+ }
+
+ public List getDemoInstances() {
+ return demoInstances;
+ }
+
+ public void setDemoInstances(List demoInstances) {
+ this.demoInstances = demoInstances;
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/dto/response/HomepageVideoVo.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/dto/response/HomepageVideoVo.java
new file mode 100644
index 0000000000..956c039f43
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/dto/response/HomepageVideoVo.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package com.webank.wedatasphere.dss.framework.workspace.bean.dto.response;
+
+
+public class HomepageVideoVo {
+
+ private Long id;
+ private String name;
+ private String url;
+ private String title;
+ private String description;
+ private Integer order;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Integer getOrder() {
+ return order;
+ }
+
+ public void setOrder(Integer order) {
+ this.order = order;
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/dto/response/OnestopMenuAppInstanceVo.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/dto/response/OnestopMenuAppInstanceVo.java
new file mode 100644
index 0000000000..6f093bf025
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/dto/response/OnestopMenuAppInstanceVo.java
@@ -0,0 +1,158 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package com.webank.wedatasphere.dss.framework.workspace.bean.dto.response;
+
+import java.util.Map;
+
+
+public class OnestopMenuAppInstanceVo {
+ private Long id;
+ private String title;
+ private String description;
+ private String labels;
+ private String accessButton;
+ private String accessButtonUrl;
+ private String manualButton;
+ private String manualButtonUrl;
+ private String projectUrl;
+ private String name;
+ private Boolean isActive;
+ private String icon;
+ private Integer order;
+ private Map nameAndUrls;
+ //图片
+ private String image;
+
+ public String getImage() {
+ return image;
+ }
+
+ public void setImage(String image) {
+ this.image = image;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getLabels() {
+ return labels;
+ }
+
+ public void setLabels(String labels) {
+ this.labels = labels;
+ }
+
+ public String getAccessButton() {
+ return accessButton;
+ }
+
+ public void setAccessButton(String accessButton) {
+ this.accessButton = accessButton;
+ }
+
+ public String getAccessButtonUrl() {
+ return accessButtonUrl;
+ }
+
+ public void setAccessButtonUrl(String accessButtonUrl) {
+ this.accessButtonUrl = accessButtonUrl;
+ }
+
+ public String getManualButton() {
+ return manualButton;
+ }
+
+ public void setManualButton(String manualButton) {
+ this.manualButton = manualButton;
+ }
+
+ public String getManualButtonUrl() {
+ return manualButtonUrl;
+ }
+
+ public void setManualButtonUrl(String manualButtonUrl) {
+ this.manualButtonUrl = manualButtonUrl;
+ }
+
+ public String getIcon() {
+ return icon;
+ }
+
+ public void setIcon(String icon) {
+ this.icon = icon;
+ }
+
+ public Integer getOrder() {
+ return order;
+ }
+
+ public void setOrder(Integer order) {
+ this.order = order;
+ }
+
+ public String getProjectUrl() {
+ return projectUrl;
+ }
+
+ public void setProjectUrl(String projectUrl) {
+ this.projectUrl = projectUrl;
+ }
+
+ public Boolean getActive() {
+ return isActive;
+ }
+
+ public void setActive(Boolean active) {
+ isActive = active;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Map getNameAndUrls() {
+ return nameAndUrls;
+ }
+
+ public void setNameAndUrls(Map nameAndUrls) {
+ this.nameAndUrls = nameAndUrls;
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/dto/response/OnestopMenuVo.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/dto/response/OnestopMenuVo.java
new file mode 100644
index 0000000000..e9dadd0cbb
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/dto/response/OnestopMenuVo.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean.dto.response;
+
+import java.util.List;
+
+
+public class OnestopMenuVo {
+ private Long id;
+ private String title;
+ private Integer order;
+ private List appInstances;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public Integer getOrder() {
+ return order;
+ }
+
+ public void setOrder(Integer order) {
+ this.order = order;
+ }
+
+ public List getAppInstances() {
+ return appInstances;
+ }
+
+ public void setAppInstances(List appInstances) {
+ this.appInstances = appInstances;
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/dto/response/WorkspaceDepartmentVo.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/dto/response/WorkspaceDepartmentVo.java
new file mode 100644
index 0000000000..fb96389d70
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/dto/response/WorkspaceDepartmentVo.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean.dto.response;
+
+
+public class WorkspaceDepartmentVo {
+
+ private Long id;
+
+ private String name;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/dto/response/WorkspaceFavoriteVo.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/dto/response/WorkspaceFavoriteVo.java
new file mode 100644
index 0000000000..af7d354bca
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/dto/response/WorkspaceFavoriteVo.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean.dto.response;
+
+import com.google.common.base.Objects;
+
+
+public class WorkspaceFavoriteVo {
+ private Long id;
+
+ private Long menuApplicationId;
+
+ private String name;
+
+ private String url;
+
+ private String icon;
+
+ private String title;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Long getMenuApplicationId() {
+ return menuApplicationId;
+ }
+
+ public void setMenuApplicationId(Long menuApplicationId) {
+ this.menuApplicationId = menuApplicationId;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public String getIcon() {
+ return icon;
+ }
+
+ public void setIcon(String icon) {
+ this.icon = icon;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ WorkspaceFavoriteVo that = (WorkspaceFavoriteVo) o;
+ return Objects.equal(name, that.name);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(name);
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/AbstractDSSVO.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/AbstractDSSVO.java
new file mode 100644
index 0000000000..a18bdfd4c7
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/AbstractDSSVO.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean.vo;
+
+
+public abstract class AbstractDSSVO {
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSDatasourceVO.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSDatasourceVO.java
new file mode 100644
index 0000000000..7121142f42
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSDatasourceVO.java
@@ -0,0 +1,123 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean.vo;
+
+import java.util.Arrays;
+
+
+public class DSSDatasourceVO {
+ private int id;
+ private String name;
+ private String type;
+ private String createTime;
+ private String env;
+ private String creator;
+ private String responser;
+ private String lastUpdater;
+ private String lastUpdateTime;
+
+ public DSSDatasourceVO() {
+ }
+
+ public DSSDatasourceVO(int id, String name, String type, String createTime, String env, String creator, String responser, String lastUpdater, String lastUpdateTime) {
+ this.id = id;
+ this.name = name;
+ this.type = type;
+ this.createTime = createTime;
+ this.env = env;
+ this.creator = creator;
+ this.responser = responser;
+ this.lastUpdater = lastUpdater;
+ this.lastUpdateTime = lastUpdateTime;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(String createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getEnv() {
+ return env;
+ }
+
+ public void setEnv(String env) {
+ this.env = env;
+ }
+
+ public String getCreator() {
+ return creator;
+ }
+
+ public void setCreator(String creator) {
+ this.creator = creator;
+ }
+
+ public String getResponser() {
+ return responser;
+ }
+
+ public void setResponser(String responser) {
+ this.responser = responser;
+ }
+
+ public String getLastUpdater() {
+ return lastUpdater;
+ }
+
+ public void setLastUpdater(String lastUpdater) {
+ this.lastUpdater = lastUpdater;
+ }
+
+ public String getLastUpdateTime() {
+ return lastUpdateTime;
+ }
+
+ public void setLastUpdateTime(String lastUpdateTime) {
+ this.lastUpdateTime = lastUpdateTime;
+ }
+
+
+
+
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSDictionaryRequestVO.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSDictionaryRequestVO.java
new file mode 100644
index 0000000000..2d15d34cb5
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSDictionaryRequestVO.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean.vo;
+
+import java.io.Serializable;
+import java.util.List;
+
+public class DSSDictionaryRequestVO {
+
+ private Integer workspaceId;
+
+ private String dicKey;
+
+ private String parentKey;
+
+ public Integer getWorkspaceId() {
+ return workspaceId;
+ }
+
+ public void setWorkspaceId(Integer workspaceId) {
+ this.workspaceId = workspaceId;
+ }
+
+ public String getDicKey() {
+ return dicKey;
+ }
+
+ public void setDicKey(String dicKey) {
+ this.dicKey = dicKey;
+ }
+
+ public String getParentKey() {
+ return parentKey;
+ }
+
+ public void setParentKey(String parentKey) {
+ this.parentKey = parentKey;
+ }
+}
\ No newline at end of file
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSPersonalWorkflowVO.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSPersonalWorkflowVO.java
new file mode 100644
index 0000000000..2909ce4600
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSPersonalWorkflowVO.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean.vo;
+
+import java.util.Arrays;
+import java.util.List;
+
+
+public class DSSPersonalWorkflowVO extends AbstractDSSVO{
+ private int workflowId;
+ private String name;
+ private String json;
+ private String description;
+ private List tags;
+
+ public DSSPersonalWorkflowVO() {
+ }
+
+ public DSSPersonalWorkflowVO(int workflowId, String name, String json, String description, List tags) {
+ this.workflowId = workflowId;
+ this.name = name;
+ this.json = json;
+ this.description = description;
+ this.tags = tags;
+ }
+
+ public int getWorkflowId() {
+ return workflowId;
+ }
+
+ public void setWorkflowId(int workflowId) {
+ this.workflowId = workflowId;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getJson() {
+ return json;
+ }
+
+ public void setJson(String json) {
+ this.json = json;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public List getTags() {
+ return tags;
+ }
+
+ public void setTags(List tags) {
+ this.tags = tags;
+ }
+
+
+
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSProjectUserVo.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSProjectUserVo.java
new file mode 100644
index 0000000000..9318f5261c
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSProjectUserVo.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean.vo;
+
+import java.util.Date;
+
+
+public class DSSProjectUserVo {
+ private int id;
+ private int projectId;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public int getProjectId() {
+ return projectId;
+ }
+
+ public void setProjectId(int projectId) {
+ this.projectId = projectId;
+ }
+
+ public int getUserId() {
+ return userId;
+ }
+
+ public void setUserId(int userId) {
+ this.userId = userId;
+ }
+
+ public String getWorkspaceId() {
+ return workspaceId;
+ }
+
+ public void setWorkspaceId(String workspaceId) {
+ this.workspaceId = workspaceId;
+ }
+
+
+
+ public Date getLastUpdateTime() {
+ return lastUpdateTime;
+ }
+
+ public void setLastUpdateTime(Date lastUpdateTime) {
+ this.lastUpdateTime = lastUpdateTime;
+ }
+
+ private int userId;
+ private String workspaceId;
+
+ public int getPriv_param() {
+ return priv_param;
+ }
+
+ public void setPriv_param(int priv_param) {
+ this.priv_param = priv_param;
+ }
+
+ private int priv_param;
+ private Date lastUpdateTime;
+
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSPublicTableVO.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSPublicTableVO.java
new file mode 100644
index 0000000000..563972575c
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSPublicTableVO.java
@@ -0,0 +1,123 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean.vo;
+
+import java.util.Arrays;
+
+
+public class DSSPublicTableVO extends AbstractDSSVO{
+ private int id;
+ private String name;
+ private String status;
+ private String type;
+ private Boolean isPartitionTable;
+ private String creator;
+ private String authority;
+ private String lastOperator;
+ private String lastOperateTime;
+
+ public DSSPublicTableVO() {
+ }
+
+ public DSSPublicTableVO(int id, String name, String status, String type, Boolean isPartitionTable, String creator, String authority, String lastOperator, String lastOperateTime) {
+ this.id = id;
+ this.name = name;
+ this.status = status;
+ this.type = type;
+ this.isPartitionTable = isPartitionTable;
+ this.creator = creator;
+ this.authority = authority;
+ this.lastOperator = lastOperator;
+ this.lastOperateTime = lastOperateTime;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public Boolean getPartitionTable() {
+ return isPartitionTable;
+ }
+
+ public void setPartitionTable(Boolean partitionTable) {
+ isPartitionTable = partitionTable;
+ }
+
+ public String getCreator() {
+ return creator;
+ }
+
+ public void setCreator(String creator) {
+ this.creator = creator;
+ }
+
+ public String getAuthority() {
+ return authority;
+ }
+
+ public void setAuthority(String authority) {
+ this.authority = authority;
+ }
+
+ public String getLastOperator() {
+ return lastOperator;
+ }
+
+ public void setLastOperator(String lastOperator) {
+ this.lastOperator = lastOperator;
+ }
+
+ public String getLastOperateTime() {
+ return lastOperateTime;
+ }
+
+ public void setLastOperateTime(String lastOperateTime) {
+ this.lastOperateTime = lastOperateTime;
+ }
+
+
+
+
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSScheduledWorkFlow.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSScheduledWorkFlow.java
new file mode 100644
index 0000000000..6fb7e9b7d7
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSScheduledWorkFlow.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean.vo;
+
+
+public class DSSScheduledWorkFlow {
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSScheduledWorkFlowVO.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSScheduledWorkFlowVO.java
new file mode 100644
index 0000000000..0afa182337
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSScheduledWorkFlowVO.java
@@ -0,0 +1,131 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean.vo;
+
+import java.util.Date;
+
+
+public class DSSScheduledWorkFlowVO extends AbstractDSSVO{
+ private String workflowName;
+ private String project;
+ private Date scheduledTime;
+ private String newestVersion;
+ private String lastScheduledStatus;
+ private String committer;
+ private String lastOperator;
+ private Date lastOperateTime;
+ private String workflowJson;
+ private int workflowId;
+ public DSSScheduledWorkFlowVO() {
+ }
+
+ public DSSScheduledWorkFlowVO(String workflowName, String project, Date scheduledTime, String newestVersion,
+ String lastScheduledStatus, String committer, String lastOperator, Date lastOperateTime) {
+ this.workflowName = workflowName;
+ this.project = project;
+ this.scheduledTime = scheduledTime;
+ this.newestVersion = newestVersion;
+ this.lastScheduledStatus = lastScheduledStatus;
+ this.committer = committer;
+ this.lastOperator = lastOperator;
+ this.lastOperateTime = lastOperateTime;
+ }
+
+ public String getWorkflowName() {
+ return workflowName;
+ }
+
+ public void setWorkflowName(String workflowName) {
+ this.workflowName = workflowName;
+ }
+
+ public String getProject() {
+ return project;
+ }
+
+ public void setProject(String project) {
+ this.project = project;
+ }
+
+ public Date getScheduledTime() {
+ return scheduledTime;
+ }
+
+ public void setScheduledTime(Date scheduledTime) {
+ this.scheduledTime = scheduledTime;
+ }
+
+ public String getNewestVersion() {
+ return newestVersion;
+ }
+
+ public void setNewestVersion(String newestVersion) {
+ this.newestVersion = newestVersion;
+ }
+
+ public String getLastScheduledStatus() {
+ return lastScheduledStatus;
+ }
+
+ public void setLastScheduledStatus(String lastScheduledStatus) {
+ this.lastScheduledStatus = lastScheduledStatus;
+ }
+
+ public String getCommitter() {
+ return committer;
+ }
+
+ public void setCommitter(String committer) {
+ this.committer = committer;
+ }
+
+ public String getLastOperator() {
+ return lastOperator;
+ }
+
+ public void setLastOperator(String lastOperator) {
+ this.lastOperator = lastOperator;
+ }
+
+ public Date getLastOperateTime() {
+ return lastOperateTime;
+ }
+
+ public void setLastOperateTime(Date lastOperateTime) {
+ this.lastOperateTime = lastOperateTime;
+ }
+
+ public String getWorkflowJson() {
+ return workflowJson;
+ }
+
+ public void setWorkflowJson(String workflowJson) {
+ this.workflowJson = workflowJson;
+ }
+
+ public int getWorkflowId() {
+ return workflowId;
+ }
+
+ public void setWorkflowId(int workflowId) {
+ this.workflowId = workflowId;
+ }
+
+
+
+
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkflowVersionVO.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkflowVersionVO.java
new file mode 100644
index 0000000000..5d13aa5a02
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkflowVersionVO.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean.vo;
+
+import java.util.Arrays;
+import java.util.List;
+
+
+public class DSSWorkflowVersionVO {
+ private int workflowId;
+ private String version;
+ private String creator;
+ private String comment;
+ private String createTime;
+ private String workflowJson;
+
+ public DSSWorkflowVersionVO() {
+ }
+
+ public DSSWorkflowVersionVO(int workflowId, String version, String creator, String comment, String createTime, String workflowJson) {
+ this.workflowId = workflowId;
+ this.version = version;
+ this.creator = creator;
+ this.comment = comment;
+ this.createTime = createTime;
+ this.workflowJson = workflowJson;
+ }
+
+ public int getWorkflowId() {
+ return workflowId;
+ }
+
+ public void setWorkflowId(int workflowId) {
+ this.workflowId = workflowId;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public String getCreator() {
+ return creator;
+ }
+
+ public void setCreator(String creator) {
+ this.creator = creator;
+ }
+
+ public String getComment() {
+ return comment;
+ }
+
+ public void setComment(String comment) {
+ this.comment = comment;
+ }
+
+ public String getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(String createTime) {
+ this.createTime = createTime;
+ }
+
+ public String getWorkflowJson() {
+ return workflowJson;
+ }
+
+ public void setWorkflowJson(String workflowJson) {
+ this.workflowJson = workflowJson;
+ }
+
+
+
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkspaceComponentPrivVO.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkspaceComponentPrivVO.java
new file mode 100644
index 0000000000..7e217f7fee
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkspaceComponentPrivVO.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean.vo;
+
+import java.io.Serializable;
+import java.util.Map;
+
+
+public class DSSWorkspaceComponentPrivVO extends AbstractDSSVO implements Serializable {
+ private static final long serialVersionUID=1L;
+
+ private int id;
+ private String name;
+ private Map componentPrivs;
+
+
+ public DSSWorkspaceComponentPrivVO() {
+ }
+
+ public DSSWorkspaceComponentPrivVO(int id, String name, Map componentPrivs) {
+ this.id = id;
+ this.name = name;
+ this.componentPrivs = componentPrivs;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Map getComponentPrivs() {
+ return componentPrivs;
+ }
+
+ public void setComponentPrivs(Map componentPrivs) {
+ this.componentPrivs = componentPrivs;
+ }
+
+ @Override
+ public String toString() {
+ return "DSSWorkspaceComponentPrivVO{" +
+ "id=" + id +
+ ", name='" + name + '\'' +
+ ", componentPrivs=" + componentPrivs +
+ '}';
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkspaceHomePageVO.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkspaceHomePageVO.java
new file mode 100644
index 0000000000..35591554ec
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkspaceHomePageVO.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean.vo;
+
+
+public class DSSWorkspaceHomePageVO {
+ private int workspaceId;
+ private String roleName;
+ private String homePageUrl;
+
+ public DSSWorkspaceHomePageVO() {
+ }
+
+ public DSSWorkspaceHomePageVO(int workspaceId, String roleName, String username, String homePageUrl) {
+ this.workspaceId = workspaceId;
+ this.roleName = roleName;
+ this.homePageUrl = homePageUrl;
+ }
+
+
+ public int getWorkspaceId() {
+ return workspaceId;
+ }
+
+ public void setWorkspaceId(int workspaceId) {
+ this.workspaceId = workspaceId;
+ }
+
+ public String getRoleName() {
+ return roleName;
+ }
+
+ public void setRoleName(String roleName) {
+ this.roleName = roleName;
+ }
+
+
+
+ public String getHomePageUrl() {
+ return homePageUrl;
+ }
+
+ public void setHomePageUrl(String homePageUrl) {
+ this.homePageUrl = homePageUrl;
+ }
+
+
+
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkspaceHomepageSettingVO.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkspaceHomepageSettingVO.java
new file mode 100644
index 0000000000..180e0da6df
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkspaceHomepageSettingVO.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean.vo;
+
+import java.util.List;
+import java.util.Map;
+
+
+public class DSSWorkspaceHomepageSettingVO {
+
+ public static class RoleHomepage{
+ private String roleName;
+ private String homepageName;
+ private String homepageUrl;
+ private int roleId;
+ private String roleFrontName;
+
+
+ public String getRoleName() {
+ return roleName;
+ }
+
+ public void setRoleName(String roleName) {
+ this.roleName = roleName;
+ }
+
+ public String getHomepageName() {
+ return homepageName;
+ }
+
+ public void setHomepageName(String homepageName) {
+ this.homepageName = homepageName;
+ }
+
+ public String getHomepageUrl() {
+ return homepageUrl;
+ }
+
+ public void setHomepageUrl(String homepageUrl) {
+ this.homepageUrl = homepageUrl;
+ }
+
+
+ public int getRoleId() {
+ return roleId;
+ }
+
+ public void setRoleId(int roleId) {
+ this.roleId = roleId;
+ }
+
+ public String getRoleFrontName() {
+ return roleFrontName;
+ }
+
+ public void setRoleFrontName(String roleFrontName) {
+ this.roleFrontName = roleFrontName;
+ }
+ }
+
+ private List roleHomepages;
+
+ public List getRoleHomepages() {
+ return roleHomepages;
+ }
+
+ public void setRoleHomepages(List roleHomepages) {
+ this.roleHomepages = roleHomepages;
+ }
+
+
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkspaceMenuPrivVO.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkspaceMenuPrivVO.java
new file mode 100644
index 0000000000..ed4c866204
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkspaceMenuPrivVO.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean.vo;
+
+import java.io.Serializable;
+import java.util.Map;
+
+
+public class DSSWorkspaceMenuPrivVO extends AbstractDSSVO implements Serializable {
+ private static final long serialVersionUID=1L;
+ private int id;
+ private String name;
+ private Map menuPrivs;
+
+ public DSSWorkspaceMenuPrivVO() {
+ }
+
+ public DSSWorkspaceMenuPrivVO(int id, String name, Map menuPrivs) {
+ this.id = id;
+ this.name = name;
+ this.menuPrivs = menuPrivs;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Map getMenuPrivs() {
+ return menuPrivs;
+ }
+
+ public void setMenuPrivs(Map menuPrivs) {
+ this.menuPrivs = menuPrivs;
+ }
+
+ @Override
+ public String toString() {
+ return "DSSWorkspaceMenuPrivVO{" +
+ "id=" + id +
+ ", name='" + name + '\'' +
+ ", menuPrivs=" + menuPrivs +
+ '}';
+ }
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkspaceMenuPrivsVO.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkspaceMenuPrivsVO.java
new file mode 100644
index 0000000000..85e513b749
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkspaceMenuPrivsVO.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean.vo;
+
+
+public class DSSWorkspaceMenuPrivsVO {
+ public int getRoleId() {
+ return roleId;
+ }
+
+ public void setRoleId(int roleId) {
+ this.roleId = roleId;
+ }
+
+ public String getRoleName() {
+ return roleName;
+ }
+
+ public void setRoleName(String roleName) {
+ this.roleName = roleName;
+ }
+
+ public Boolean getVisable() {
+ return isVisable;
+ }
+
+ public void setVisable(Boolean visable) {
+ isVisable = visable;
+ }
+
+ private int roleId;
+ private String roleName;
+ private Boolean isVisable;
+}
diff --git a/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkspaceMenuVO.java b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkspaceMenuVO.java
new file mode 100644
index 0000000000..22055243b1
--- /dev/null
+++ b/dss-framework/dss-framework-workspace-server/src/main/java/com/webank/wedatasphere/dss/framework/workspace/bean/vo/DSSWorkspaceMenuVO.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2019 WeBank
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.webank.wedatasphere.dss.framework.workspace.bean.vo;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+public class DSSWorkspaceMenuVO {
+ private int id;
+ private String name;
+ private String icon;
+ private List