diff --git a/assembly/pom.xml b/assembly/pom.xml index 2b930b76b..3aa0e2d9a 100644 --- a/assembly/pom.xml +++ b/assembly/pom.xml @@ -22,7 +22,7 @@ dss com.webank.wedatasphere.dss - 0.8.0 + 0.9.0 4.0.0 diff --git a/conf/config.sh b/conf/config.sh index 7fc8e9e4e..c6d910aca 100644 --- a/conf/config.sh +++ b/conf/config.sh @@ -77,4 +77,4 @@ AZKABAN_ADRESS_PORT=8081 QUALITIS_ADRESS_IP=127.0.0.1 QUALITIS_ADRESS_PORT=8090 -DSS_VERSION=0.8.0 +DSS_VERSION=0.9.0 diff --git a/datachecker-appjoint/pom.xml b/datachecker-appjoint/pom.xml index 706f88359..9d36a02ae 100644 --- a/datachecker-appjoint/pom.xml +++ b/datachecker-appjoint/pom.xml @@ -22,7 +22,7 @@ dss com.webank.wedatasphere.dss - 0.8.0 + 0.9.0 4.0.0 diff --git a/db/dss_ddl.sql b/db/dss_ddl.sql index 5c016e0b1..cdaf8fb1a 100644 --- a/db/dss_ddl.sql +++ b/db/dss_ddl.sql @@ -154,6 +154,7 @@ CREATE TABLE `dss_project` ( `name` varchar(200) COLLATE utf8_bin DEFAULT NULL, `source` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT 'Source of the dss_project', `description` text COLLATE utf8_bin, + `workspace_id` bigint(20) DEFAULT 1, `user_id` bigint(20) DEFAULT NULL, `create_time` datetime DEFAULT NULL, `create_by` bigint(20) DEFAULT NULL, @@ -294,3 +295,156 @@ CREATE TABLE `event_status` ( `msg_id` int(11) NOT NULL COMMENT '消息的最大消费id', PRIMARY KEY (`receiver`,`topic`,`msg_name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='消息消费状态表'; + + +-- ---------------------------- +-- Table structure for dss_workspace +-- ---------------------------- +DROP TABLE IF EXISTS `dss_workspace`; +CREATE TABLE `dss_workspace` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `description` varchar(255) DEFAULT NULL, + `department` varchar(255) DEFAULT NULL, + `product` varchar(255) DEFAULT NULL, + `source` varchar(255) DEFAULT NULL, + `create_by` varchar(255) DEFAULT NULL, + `create_time` datetime DEFAULT NULL, + `last_update_time` datetime DEFAULT NULL, + `last_update_user` varchar(30) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Table structure for dss_onestop_menu +-- ---------------------------- +DROP TABLE IF EXISTS `dss_onestop_menu`; +CREATE TABLE `dss_onestop_menu` ( + `id` int(20) NOT NULL AUTO_INCREMENT, + `name` varchar(64) DEFAULT NULL, + `title_en` varchar(64) DEFAULT NULL, + `title_cn` varchar(64) DEFAULT NULL, + `description` varchar(255) DEFAULT NULL, + `is_active` tinyint(1) DEFAULT 1, + `icon` varchar(255) DEFAULT NULL, + `order` int(2) DEFAULT NULL, + `create_by` varchar(255) DEFAULT NULL, + `create_time` datetime DEFAULT NULL, + `last_update_time` datetime DEFAULT NULL, + `last_update_user` varchar(30) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Table structure for dss_onestop_menu_application +-- ---------------------------- +DROP TABLE IF EXISTS `dss_onestop_menu_application`; +CREATE TABLE `dss_onestop_menu_application` ( + `id` int(20) NOT NULL AUTO_INCREMENT, + `application_id` int(20) DEFAULT NULL, + `onestop_menu_id` int(20) NOT NULL, + `title_en` varchar(64) DEFAULT NULL, + `title_cn` varchar(64) DEFAULT NULL, + `desc_en` varchar(255) DEFAULT NULL, + `desc_cn` varchar(255) DEFAULT NULL, + `labels_en` varchar(255) DEFAULT NULL, + `labels_cn` varchar(255) DEFAULT NULL, + `is_active` tinyint(1) DEFAULT NULL, + `access_button_en` varchar(64) DEFAULT NULL, + `access_button_cn` varchar(64) DEFAULT NULL, + `manual_button_en` varchar(64) DEFAULT NULL, + `manual_button_cn` varchar(64) DEFAULT NULL, + `manual_button_url` varchar(255) DEFAULT NULL, + `icon` varchar(255) DEFAULT NULL, + `order` int(2) DEFAULT NULL, + `create_by` varchar(255) DEFAULT NULL, + `create_time` datetime DEFAULT NULL, + `last_update_time` datetime DEFAULT NULL, + `last_update_user` varchar(30) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Table structure for dss_onestop_user_favorites +-- ---------------------------- +DROP TABLE IF EXISTS `dss_onestop_user_favorites`; +CREATE TABLE `dss_onestop_user_favorites` ( + `id` int(20) NOT NULL AUTO_INCREMENT, + `username` varchar(64) DEFAULT NULL, + `workspace_id` bigint(20) DEFAULT 1, + `menu_application_id` int(20) DEFAULT NULL, + `order` int(2) DEFAULT NULL, + `create_by` varchar(255) DEFAULT NULL, + `create_time` datetime DEFAULT NULL, + `last_update_time` datetime DEFAULT NULL, + `last_update_user` varchar(30) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Table structure for dss_homepage_demo_menu +-- ---------------------------- +DROP TABLE IF EXISTS `dss_homepage_demo_menu`; +CREATE TABLE `dss_homepage_demo_menu` ( + `id` int(20) NOT NULL AUTO_INCREMENT, + `name` varchar(64) DEFAULT NULL, + `title_en` varchar(64) DEFAULT NULL, + `title_cn` varchar(64) DEFAULT NULL, + `description` varchar(255) DEFAULT NULL, + `is_active` tinyint(1) DEFAULT 1, + `icon` varchar(255) DEFAULT NULL, + `order` int(2) DEFAULT NULL, + `create_by` varchar(255) DEFAULT NULL, + `create_time` datetime DEFAULT NULL, + `last_update_time` datetime DEFAULT NULL, + `last_update_user` varchar(30) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Table structure for dss_homepage_demo_instance +-- ---------------------------- +DROP TABLE IF EXISTS `dss_homepage_demo_instance`; +CREATE TABLE `dss_homepage_demo_instance` ( + `id` int(20) NOT NULL AUTO_INCREMENT, + `menu_id` int(20) DEFAULT NULL, + `name` varchar(64) DEFAULT NULL, + `url` varchar(128) DEFAULT NULL, + `title_en` varchar(64) DEFAULT NULL, + `title_cn` varchar(64) DEFAULT NULL, + `description` varchar(255) DEFAULT NULL, + `is_active` tinyint(1) DEFAULT 1, + `icon` varchar(255) DEFAULT NULL, + `order` int(2) DEFAULT NULL, + `click_num` int(11) DEFAULT 0, + `create_by` varchar(255) DEFAULT NULL, + `create_time` datetime DEFAULT NULL, + `last_update_time` datetime DEFAULT NULL, + `last_update_user` varchar(30) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Table structure for dss_homepage_video +-- ---------------------------- +DROP TABLE IF EXISTS `dss_homepage_video`; +CREATE TABLE `dss_homepage_video` ( + `id` int(20) NOT NULL AUTO_INCREMENT, + `name` varchar(64) DEFAULT NULL, + `url` varchar(128) DEFAULT NULL, + `title_en` varchar(64) DEFAULT NULL, + `title_cn` varchar(64) DEFAULT NULL, + `description` varchar(255) DEFAULT NULL, + `is_active` tinyint(1) DEFAULT 1, + `icon` varchar(255) DEFAULT NULL, + `order` int(2) DEFAULT NULL, + `play_num` int(11) DEFAULT 0, + `create_by` varchar(255) DEFAULT NULL, + `create_time` datetime DEFAULT NULL, + `last_update_time` datetime DEFAULT NULL, + `last_update_user` varchar(30) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + diff --git a/db/dss_dml.sql b/db/dss_dml.sql index 79de16e9a..78bf09bd4 100644 --- a/db/dss_dml.sql +++ b/db/dss_dml.sql @@ -68,3 +68,41 @@ SELECT @tree_id1:=t.id from linkis_config_tree t LEFT JOIN linkis_application a insert into `linkis_config_key_tree` VALUES(NULL,@key_id1,@tree_id1); insert into `linkis_config_key_tree` VALUES(NULL,@key_id2,@tree_id1); insert into `linkis_config_key_tree` VALUES(NULL,@key_id3,@tree_id1); + +INSERT INTO dss_workspace (id, name, label, description, department, product, source, create_by, create_time, last_update_time, last_update_user) VALUES (1, 'default', 'default', 'default user workspace', NULL, NULL, 'create by user', 'root', NULL, NULL, 'root'); + +INSERT INTO dss_homepage_demo_instance (id, menu_id, name, url, title_en, title_cn, description, is_active, icon, `order`, click_num, create_by, create_time, last_update_time, last_update_user) VALUES (NULL, 1, '工作流编辑执行', 'https://github.com/WeBankFinTech/DataSphereStudio', 'workflow edit execution', '工作流编辑执行', '工作流编辑执行', 1, NULL, 1, 0, NULL, NULL, NULL, NULL); +INSERT INTO dss_homepage_demo_instance (id, menu_id, name, url, title_en, title_cn, description, is_active, icon, `order`, click_num, create_by, create_time, last_update_time, last_update_user) VALUES (NULL, 1, '工作流串联可视化', 'https://github.com/WeBankFinTech/DataSphereStudio', 'workflow series visualization', '工作流串联可视化', '工作流串联可视化', 1, NULL, 2, 0, NULL, NULL, NULL, NULL); +INSERT INTO dss_homepage_demo_instance (id, menu_id, name, url, title_en, title_cn, description, is_active, icon, `order`, click_num, create_by, create_time, last_update_time, last_update_user) VALUES (NULL, 1, '工作流调度执行跑批', 'https://github.com/WeBankFinTech/DataSphereStudio', 'workflow scheduling execution run batch', '工作流调度执行跑批', '工作流调度执行跑批', 1, NULL, 3, 0, NULL, NULL, NULL, NULL); +INSERT INTO dss_homepage_demo_instance (id, menu_id, name, url, title_en, title_cn, description, is_active, icon, `order`, click_num, create_by, create_time, last_update_time, last_update_user) VALUES (NULL, 2, '某业务日常运营报表', 'https://github.com/WeBankFinTech/DataSphereStudio', 'business daily operation report', '某业务日常运营报表', '某业务日常运营报表', 1, NULL, 1, 0, NULL, NULL, NULL, NULL); +INSERT INTO dss_homepage_demo_instance (id, menu_id, name, url, title_en, title_cn, description, is_active, icon, `order`, click_num, create_by, create_time, last_update_time, last_update_user) VALUES (NULL, 2, '某业务机器学习建模预测', 'https://github.com/WeBankFinTech/DataSphereStudio', 'business machine learning modeling prediction', '某业务机器学习建模预测', '某业务机器学习建模预测', 1, NULL, 2, 0, NULL, NULL, NULL, NULL); +INSERT INTO dss_homepage_demo_instance (id, menu_id, name, url, title_en, title_cn, description, is_active, icon, `order`, click_num, create_by, create_time, last_update_time, last_update_user) VALUES (NULL, 2, '某业务导出营销用户列表', 'https://github.com/WeBankFinTech/DataSphereStudio', 'business export marketing user list', '某业务导出营销用户列表', '某业务导出营销用户列表', 1, NULL, 3, 0, NULL, NULL, NULL, NULL); +INSERT INTO dss_homepage_demo_instance (id, menu_id, name, url, title_en, title_cn, description, is_active, icon, `order`, click_num, create_by, create_time, last_update_time, last_update_user) VALUES (NULL, 3, '数据大屏体验', 'https://github.com/WeBankFinTech/DataSphereStudio', 'data big screen experience', '数据大屏体验', '数据大屏体验', 1, NULL, 1, 0, NULL, NULL, NULL, NULL); +INSERT INTO dss_homepage_demo_instance (id, menu_id, name, url, title_en, title_cn, description, is_active, icon, `order`, click_num, create_by, create_time, last_update_time, last_update_user) VALUES (NULL, 3, '数据仪表盘体验', 'https://github.com/WeBankFinTech/DataSphereStudio', 'data dashboard experience', '数据仪表盘体验', '数据仪表盘体验', 1, NULL, 2, 0, NULL, NULL, NULL, NULL); +INSERT INTO dss_homepage_demo_instance (id, menu_id, name, url, title_en, title_cn, description, is_active, icon, `order`, click_num, create_by, create_time, last_update_time, last_update_user) VALUES (NULL, 3, '可视化挂件快速体验', 'https://github.com/WeBankFinTech/DataSphereStudio', 'visual widgets quick experience', '可视化挂件快速体验', '可视化挂件快速体验', 1, NULL, 3, 0, NULL, NULL, NULL, NULL); + +INSERT INTO dss_homepage_demo_menu (id, name, title_en, title_cn, description, is_active, icon, `order`, create_by, create_time, last_update_time, last_update_user) VALUES (1, 'workflow', 'workflow', '工作流', '工作流', 1, NULL, 1, NULL, NULL, NULL, NULL); +INSERT INTO dss_homepage_demo_menu (id, name, title_en, title_cn, description, is_active, icon, `order`, create_by, create_time, last_update_time, last_update_user) VALUES (2, 'application', 'application', '应用场景', '应用场景', 1, NULL, 2, NULL, NULL, NULL, NULL); +INSERT INTO dss_homepage_demo_menu (id, name, title_en, title_cn, description, is_active, icon, `order`, create_by, create_time, last_update_time, last_update_user) VALUES (3, 'visualization', 'visualization', '可视化', '可视化', 1, NULL, 3, NULL, NULL, NULL, NULL); + +INSERT INTO dss_homepage_video (id, name, url, title_en, title_cn, description, is_active, icon, `order`, play_num, create_by, create_time, last_update_time, last_update_user) VALUES (NULL, '10秒教你搭建工作流', 'https://sandbox.webank.com/wds/dss/videos/1.mp4', '10 sec how to build workflow', '10秒教你搭建工作流', '10秒教你搭建工作流', 1, NULL, 1, 0, NULL, NULL, NULL, NULL); +INSERT INTO dss_homepage_video (id, name, url, title_en, title_cn, description, is_active, icon, `order`, play_num, create_by, create_time, last_update_time, last_update_user) VALUES (NULL, '10秒教你发邮件', 'https://sandbox.webank.com/wds/dss/videos/1.mp4', '10 sec how to send email', '10秒教你发邮件', '10秒教你发邮件', 1, NULL, 2, 0, NULL, NULL, NULL, NULL); + +INSERT INTO dss_onestop_menu (id, name, title_en, title_cn, description, is_active, icon, `order`, create_by, create_time, last_update_time, last_update_user) VALUES (1, '应用开发', 'application development', '应用开发', '应用开发描述', 1, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO dss_onestop_menu (id, name, title_en, title_cn, description, is_active, icon, `order`, create_by, create_time, last_update_time, last_update_user) VALUES (2, '数据分析', 'data analysis', '数据分析', '数据分析描述', 1, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO dss_onestop_menu (id, name, title_en, title_cn, description, is_active, icon, `order`, create_by, create_time, last_update_time, last_update_user) VALUES (3, '生产运维', 'production operation', '生产运维', '生产运维描述', 1, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO dss_onestop_menu (id, name, title_en, title_cn, description, is_active, icon, `order`, create_by, create_time, last_update_time, last_update_user) VALUES (4, '数据质量', 'data quality', '数据质量', '数据质量描述', 1, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO dss_onestop_menu (id, name, title_en, title_cn, description, is_active, icon, `order`, create_by, create_time, last_update_time, last_update_user) VALUES (5, '管理员功能', 'administrator function', '管理员功能', '管理员功能描述', 0, NULL, NULL, NULL, NULL, NULL, NULL); + +INSERT INTO dss_onestop_menu_application (id, application_id, onestop_menu_id, title_en, title_cn, desc_en, desc_cn, labels_en, labels_cn, is_active, access_button_en, access_button_cn, manual_button_en, manual_button_cn, manual_button_url, icon, `order`, create_by, create_time, last_update_time, last_update_user) VALUES (NULL, NULL, 1, 'workflow development', '工作流开发', 'Workflow development is a data application development tool created by WeDataSphere with Linkis as the kernel.', '工作流开发是微众银行微数域(WeDataSphere)打造的数据应用开发工具,以任意桥(Linkis)做为内核,将满足从数据交换、脱敏清洗、分析挖掘、质量检测、可视化展现、定时调度到数据输出等数据应用开发全流程场景需求。', 'workflow, data warehouse development', '工作流,数仓开发', 1, 'enter workflow development', '进入工作流开发', 'user manual', '用户手册', 'https://github.com/WeBankFinTech/DataSphereStudio', 'fi-workflow|rgb(102, 102, 255)', NULL, NULL, NULL, NULL, NULL); +INSERT INTO dss_onestop_menu_application (id, application_id, onestop_menu_id, title_en, title_cn, desc_en, desc_cn, labels_en, labels_cn, is_active, access_button_en, access_button_cn, manual_button_en, manual_button_cn, manual_button_url, icon, `order`, create_by, create_time, last_update_time, last_update_user) VALUES (NULL, NULL, 1, 'StreamSQL development', 'StreamSQL开发', 'Real-time application development is a streaming solution jointly built by WeDataSphere, Boss big data team and China Telecom ctcloud Big data team.', '实时应用开发是微众银行微数域(WeDataSphere)、Boss直聘大数据团队 和 中国电信天翼云大数据团队 社区联合共建的流式解决方案,以 Linkis 做为内核,基于 Flink Engine 构建的批流统一的 Flink SQL,助力实时化转型。', 'streaming, realtime', '流式,实时', 0, 'under union construction', '联合共建中', 'related information', '相关资讯', 'https://github.com/WeBankFinTech/DataSphereStudio', 'fi-scriptis|rgb(102, 102, 255)', NULL, NULL, NULL, NULL, NULL); +INSERT INTO dss_onestop_menu_application (id, application_id, onestop_menu_id, title_en, title_cn, desc_en, desc_cn, labels_en, labels_cn, is_active, access_button_en, access_button_cn, manual_button_en, manual_button_cn, manual_button_url, icon, `order`, create_by, create_time, last_update_time, last_update_user) VALUES (NULL, NULL, 1, 'Data service development', '数据服务开发', 'Data service is a unified API service jointly built by WeDataSphere and Ihome Big data Team. With Linkis and DataSphere Studio as the kernel.', '数据服务是微众银行微数域(WeDataSphere)与 艾佳生活大数据团队 社区联合共建的统一API服务,以 Linkis 和 DataSphere Studio 做为内核,提供快速将 Scriptis 脚本生成数据API的能力,协助企业统一管理对内对外的API服务。', 'API, data service', 'API,数据服务', 0, 'under union construction', '联合共建中', 'related information', '相关资讯', 'https://github.com/WeBankFinTech/DataSphereStudio', 'fi-scriptis|rgb(102, 102, 255)', NULL, NULL, NULL, NULL, NULL); +INSERT INTO dss_onestop_menu_application (id, application_id, onestop_menu_id, title_en, title_cn, desc_en, desc_cn, labels_en, labels_cn, is_active, access_button_en, access_button_cn, manual_button_en, manual_button_cn, manual_button_url, icon, `order`, create_by, create_time, last_update_time, last_update_user) VALUES (NULL, NULL, 2, 'Scriptis', 'Scriptis', 'Scriptis is a one-stop interactive data exploration analysis tool built by WeDataSphere, uses Linkis as the kernel.', 'Scriptis是微众银行微数域(WeDataSphere)打造的一站式交互式数据探索分析工具,以任意桥(Linkis)做为内核,提供多种计算存储引擎(如Spark、Hive、TiSpark等)、Hive数据库管理功能、资源(如Yarn资源、服务器资源)管理、应用管理和各种用户资源(如UDF、变量等)管理的能力。', 'scripts development,IDE', '脚本开发,IDE', 1, 'enter Scriptis', '进入Scriptis', 'user manual', '用户手册', 'https://github.com/WeBankFinTech/DataSphereStudio', 'fi-scriptis|rgb(102, 102, 255)', NULL, NULL, NULL, NULL, NULL); +INSERT INTO dss_onestop_menu_application (id, application_id, onestop_menu_id, title_en, title_cn, desc_en, desc_cn, labels_en, labels_cn, is_active, access_button_en, access_button_cn, manual_button_en, manual_button_cn, manual_button_url, icon, `order`, create_by, create_time, last_update_time, last_update_user) VALUES (NULL, NULL, 2, 'Visualis', 'Visualis', 'Visualis is a data visualization BI tool based on Davinci, with Linkis as the kernel, it supports the analysis mode of data development exploration.', 'Visualis是基于宜信开源项目Davinci开发的数据可视化BI工具,以任意桥(Linkis)做为内核,支持拖拽式报表定义、图表联动、钻取、全局筛选、多维分析、实时查询等数据开发探索的分析模式,并做了水印、数据质量校验等金融级增强。', 'visualization, statement', '可视化,报表', 1, 'enter Visualis', '进入Visualis', 'user manual', '用户手册', 'https://github.com/WeBankFinTech/DataSphereStudio', 'fi-visualis|rgb(0, 153, 255)', NULL, NULL, NULL, NULL, NULL); +INSERT INTO dss_onestop_menu_application (id, application_id, onestop_menu_id, title_en, title_cn, desc_en, desc_cn, labels_en, labels_cn, is_active, access_button_en, access_button_cn, manual_button_en, manual_button_cn, manual_button_url, icon, `order`, create_by, create_time, last_update_time, last_update_user) VALUES (NULL, NULL, 3, 'Schedulis', 'Schedulis', 'Description for Schedulis.', 'Schedulis描述', 'scheduling, workflow', '调度,工作流', 1, 'enter Schedulis', '进入Schedulis', 'user manual', '用户手册', 'https://github.com/WeBankFinTech/DataSphereStudio', 'fi-schedule|rgb(102, 102, 204)', NULL, NULL, NULL, NULL, NULL); +INSERT INTO dss_onestop_menu_application (id, application_id, onestop_menu_id, title_en, title_cn, desc_en, desc_cn, labels_en, labels_cn, is_active, access_button_en, access_button_cn, manual_button_en, manual_button_cn, manual_button_url, icon, `order`, create_by, create_time, last_update_time, last_update_user) VALUES (NULL, NULL, 3, 'Application operation center', '应用运维中心', 'Description for Application operation center.', '应用运维中心描述', 'production, operation', '生产,运维', 0, 'enter application operation center', '进入应用运维中心', 'user manual', '用户手册', 'https://github.com/WeBankFinTech/DataSphereStudio', 'fi-scriptis|rgb(102, 102, 255)', NULL, NULL, NULL, NULL, NULL); +INSERT INTO dss_onestop_menu_application (id, application_id, onestop_menu_id, title_en, title_cn, desc_en, desc_cn, labels_en, labels_cn, is_active, access_button_en, access_button_cn, manual_button_en, manual_button_cn, manual_button_url, icon, `order`, create_by, create_time, last_update_time, last_update_user) VALUES (NULL, NULL, 4, 'Qualitis', 'Qualitis', 'Qualitis is a financial and one-stop data quality management platform that provides data quality model definition, visualization and monitoring of data quality results', 'Qualitis是一套金融级、一站式的数据质量管理平台,提供了数据质量模型定义,数据质量结果可视化、可监控等功能,并用一整套统一的流程来定义和检测数据集的质量并及时报告问题。', 'product, operations', '生产,运维', 1, 'enter Qualitis', '进入Qualitis', 'user manual', '用户手册', 'https://github.com/WeBankFinTech/DataSphereStudio', 'fi-qualitis|rgb(51, 153, 153)', NULL, NULL, NULL, NULL, NULL); +INSERT INTO dss_onestop_menu_application (id, application_id, onestop_menu_id, title_en, title_cn, desc_en, desc_cn, labels_en, labels_cn, is_active, access_button_en, access_button_cn, manual_button_en, manual_button_cn, manual_button_url, icon, `order`, create_by, create_time, last_update_time, last_update_user) VALUES (NULL, NULL, 4, 'Exchangis', 'Exchangis', 'Exchangis is a lightweight, high scalability, data exchange platform, support for structured and unstructured data transmission between heterogeneous data sources.', 'Exchangis是一个轻量级的、高扩展性的数据交换平台,支持对结构化及无结构化的异构数据源之间的数据传输,在应用层上具有数据权限管控、节点服务高可用和多租户资源隔离等业务特性,而在数据层上又具有传输架构多样化、模块插件化和组件低耦合等架构特点。', 'user manual', '生产,运维', 1, 'enter Exchangis', '进入Exchangis', 'user manual', '用户手册', 'https://github.com/WeBankFinTech/DataSphereStudio', 'fi-exchange|(102, 102, 255)', NULL, NULL, NULL, NULL, NULL); +INSERT INTO dss_onestop_menu_application (id, application_id, onestop_menu_id, title_en, title_cn, desc_en, desc_cn, labels_en, labels_cn, is_active, access_button_en, access_button_cn, manual_button_en, manual_button_cn, manual_button_url, icon, `order`, create_by, create_time, last_update_time, last_update_user) VALUES (NULL, NULL, 5, 'Workspace management', '工作空间管理', NULL, NULL, NULL, NULL, 1, 'workspace management', '工作空间管理', null, null, null, 'fi-scriptis|rgb(102, 102, 255)', null, null, null, null, null); +INSERT INTO dss_onestop_menu_application (id, application_id, onestop_menu_id, title_en, title_cn, desc_en, desc_cn, labels_en, labels_cn, is_active, access_button_en, access_button_cn, manual_button_en, manual_button_cn, manual_button_url, icon, `order`, create_by, create_time, last_update_time, last_update_user) VALUES (NULL, NULL, 5, 'User resources management', '用户资源管理', NULL, NULL, NULL, NULL, 1, 'user resource management', '用户资源管理', null, null, null, 'fi-scriptis|rgb(102, 102, 255)', null, null, null, null, null); + diff --git a/docs/en_US/ch1/DataSphereStudio_Compile_Manual.md b/docs/en_US/ch1/DataSphereStudio_Compile_Manual.md index 46b95c406..598ff158b 100644 --- a/docs/en_US/ch1/DataSphereStudio_Compile_Manual.md +++ b/docs/en_US/ch1/DataSphereStudio_Compile_Manual.md @@ -6,7 +6,7 @@ ```xml - 0.8.0 + 0.9.0 0.9.4 2.11.8 1.8 diff --git a/docs/en_US/ch2/DSS_0.9.0_upgrade_notes.md b/docs/en_US/ch2/DSS_0.9.0_upgrade_notes.md new file mode 100644 index 000000000..cee4ec591 --- /dev/null +++ b/docs/en_US/ch2/DSS_0.9.0_upgrade_notes.md @@ -0,0 +1,16 @@ +# DSS 0.9.0 upgrade notes + +In DSS-0.9.0, the concept “workspace” is added. If you upgrade from DSS 0.7 or DSS 0.8 to DSS0.9.0. After completing platform deployment, the following adjustments are needed to be made: field `application_id` of table `dss_onestop_menu_application` is NULL by default., which is a foreign key references field `id` of table `dss_application`. So the field `application_id` of table `dss_onestop_menu_application` needed to be filled choosing from field `id` of table `dss_application`, which accords to the actual situation of business system, so as to connect workspace with each application. +E.g: +``` +-- Update application_id corresponding to workflow application +UPDATE dss_onestop_menu_application SET application_id = 2 WHERE id = 1; +-- Update application_id corresponding to Scriptis application +UPDATE dss_onestop_menu_application SET application_id = 1 WHERE id = 4; +``` +In addition, for users who have deployed DSS with edition 0.8.0 or below, the following adjustments are required: +Since field `workspace_id` is added to table `dss_project`, which is a foreign key references field `id` of table `dss_workspace`. The following command needs to be executed: +``` +ALTER TABLE dss_project ADD workspace_id bigint(20) DEFAULT 1; +``` +By default, original projects belongs to default workspace(workspace_id=1), users may add more workspace according to actual situation, and adjust the workspace of original projects as needed. diff --git "a/docs/zh_CN/ch1/DSS\347\274\226\350\257\221\346\226\207\346\241\243.md" "b/docs/zh_CN/ch1/DSS\347\274\226\350\257\221\346\226\207\346\241\243.md" index fe0b0b000..6ac3ece63 100644 --- "a/docs/zh_CN/ch1/DSS\347\274\226\350\257\221\346\226\207\346\241\243.md" +++ "b/docs/zh_CN/ch1/DSS\347\274\226\350\257\221\346\226\207\346\241\243.md" @@ -6,7 +6,7 @@ ```xml - 0.8.0 + 0.9.0 0.9.4 2.11.8 1.8 diff --git "a/docs/zh_CN/ch2/DSS_0.9.0_\345\215\207\347\272\247\350\257\264\346\230\216.md" "b/docs/zh_CN/ch2/DSS_0.9.0_\345\215\207\347\272\247\350\257\264\346\230\216.md" new file mode 100644 index 000000000..619959583 --- /dev/null +++ "b/docs/zh_CN/ch2/DSS_0.9.0_\345\215\207\347\272\247\350\257\264\346\230\216.md" @@ -0,0 +1,16 @@ +# DSS-0.9.0升级说明 + +本次DSS-0.9.0版本新增用户工作空间(workspace)概念,如果您是从 DSS0.7 或 DSS0.8 升级到 DSS0.9.0,在完成平台部署后,需对数据库表做一些调整需作如下调整: +dss_onestop_menu_application表中的application_id字段默认为空,该字段与dss_application表的id字段关联,需根据用户业务系统的实际情况与dss_application表进行关联,将用户工作空间与各应用打通。例如: +``` +-- 更新workflow应用对应的application_id +UPDATE dss_onestop_menu_application SET application_id = 2 WHERE id = 1; +-- 更新Scriptis应用对应的application_id +UPDATE dss_onestop_menu_application SET application_id = 1 WHERE id = 4; +``` +此外,对于已部署DSS-0.8.0及以下版本的用户,还需做如下调整: +dss_project表新增workspace_id字段,该字段与dss_workspace表的id字段关联,需在数据库执行如下命令: +``` +ALTER TABLE dss_project ADD workspace_id bigint(20) DEFAULT 1; +``` +默认情况下,所有原有项目都将归属默认工作空间(workspace_id=1),用户可根据实际情况新增用户空间,并调整原有项目的所属工作空间。 \ No newline at end of file diff --git a/docs/zh_CN/ch3/DSS_User_Tests1_Scala.md b/docs/zh_CN/ch3/DSS_User_Tests1_Scala.md new file mode 100644 index 000000000..70c0b0331 --- /dev/null +++ b/docs/zh_CN/ch3/DSS_User_Tests1_Scala.md @@ -0,0 +1,82 @@ +# DSS用户测试样例1:Scala + +DSS用户测试样例的目的是为平台新用户提供一组测试样例,用于熟悉DSS的常见操作,并验证DSS平台的正确性 + +![image-20200408211243941](../../../images/zh_CN/chapter3/tests/home.png) + +## 1.1 Spark Core(入口函数sc) + +在Scriptis中,已经默认为您注册了SparkContext,所以直接使用sc即可: + +### 1.1.1 单Value算子(Map算子为例) + +```scala +val rddMap = sc.makeRDD(Array((1,"a"),(1,"d"),(2,"b"),(3,"c")),4) +val res = rddMap.mapValues(data=>{data+"||||"}) +res.collect().foreach(data=>println(data._1+","+data._2)) +``` + +### 1.1.2 双Value算子(union算子为例) + +```scala +val rdd1 = sc.makeRDD(1 to 5) +val rdd2 = sc.makeRDD(6 to 10) +val rddCustom = rdd1.union(rdd2) +rddCustom.collect().foreach(println) +``` + +### 1.1.3 K-V算子(reduceByKey算子为例子) + +```scala +val rdd1 = sc.makeRDD(List(("female",1),("male",2),("female",3),("male",4))) +val rdd2 = rdd1.reduceByKey((x,y)=>x+y) +rdd2.collect().foreach(println) +``` + +### 1.1.4 执行算子(以上collect算子为例) + +### 1.1.5 从hdfs上读取文件并做简单执行 + +```scala +case class Person(name:String,age:String) +val file = sc.textFile("/test.txt") +val person = file.map(line=>{ + val values=line.split(",") + + Person(values(0),values(1)) +}) +val df = person.toDF() +df.select($"name").show() +``` + + + +## 1.2 UDF函数测试 + +### 1.2.1 函数定义 + + + +```scala +def ScalaUDF3(str: String): String = "hello, " + str + "this is a third attempt" +``` + +### 1.2.2 注册函数 + +函数-》个人函数-》右击新增spark函数=》注册方式同常规spark开发 + + ![img](../../../images/zh_CN/chapter3/tests/udf1.png) + +## 1.3 UDAF函数测试 + +### 1.3.1 Jar包上传 + + idea上开发一个求平均值的udaf函数,打成jar(wordcount)包,上传dss jar文件夹。 + + ![img](../../../images/zh_CN/chapter3/tests/udf2.png) + +### 1.3.2 注册函数 + +函数-》个人函数-》右击新增普通函数=》注册方式同常规spark开发 + + ![img](../../../images/zh_CN/chapter3/tests/udf-3.png) \ No newline at end of file diff --git a/docs/zh_CN/ch3/DSS_User_Tests2_Hive.md b/docs/zh_CN/ch3/DSS_User_Tests2_Hive.md new file mode 100644 index 000000000..800277ca0 --- /dev/null +++ b/docs/zh_CN/ch3/DSS_User_Tests2_Hive.md @@ -0,0 +1,148 @@ +# DSS用户测试样例2:Hive + +DSS用户测试样例的目的是为平台新用户提供一组测试样例,用于熟悉DSS的常见操作,并验证DSS平台的正确性 + +![image-20200408211243941](../../../images/zh_CN/chapter3/tests/home.png) + +## 2.1 数仓建表 + + 进入“数据库”页面,点击“+”,依次输入表信息、表结构和分区信息即可创建数据库表: + + + + ![img](../../../images/zh_CN/chapter3/tests/hive2.png) + + 通过以上流程,分别创建部门表dept、员工表emp和分区员工表emp_partition,建表语句如下: + +```sql +create external table if not exists default.dept( + deptno int, + dname string, + loc int +) +row format delimited fields terminated by '\t'; + +create external table if not exists default.emp( + empno int, + ename string, + job string, + mgr int, + hiredate string, + sal double, + comm double, + deptno int +) +row format delimited fields terminated by '\t'; + +create table if not exists emp_partition( + empno int, + ename string, + job string, + mgr int, + hiredate string, + sal double, + comm double, + deptno int +) +partitioned by (month string) +row format delimited fields terminated by '\t'; +``` + +**导入数据** + +目前需要通过后台手动批量导入数据,可以通过insert方法从页面插入数据 + +```sql +load data local inpath 'dept.txt' into table default.dept; +load data local inpath 'emp.txt' into table default.emp; +load data local inpath 'emp1.txt' into table default.emp_partition; +load data local inpath 'emp2.txt' into table default.emp_partition; +load data local inpath 'emp2.txt' into table default.emp_partition; +``` + +其它数据按照上述语句导入,样例数据文件路径在:`examples\ch3` + +## 2.2 基本SQL语法测试 + +### 2.2.1 简单查询 + +```sql +select * from dept; +``` + +### 2.2.2 Join连接 + +```sql +select * from emp +left join dept +on emp.deptno = dept.deptno; +``` + +### 2.2.3 聚合函数 + +```sql +select dept.dname, avg(sal) as avg_salary +from emp left join dept +on emp.deptno = dept.deptno +group by dept.dname; +``` + +### 2.2.4 内置函数 + +```sql +select ename, job,sal, +rank() over(partition by job order by sal desc) sal_rank +from emp; +``` + +### 2.2.5 分区表简单查询 + +```sql +show partitions emp_partition; +select * from emp_partition where month='202001'; +``` + +### 2.2.6 分区表联合查询 + +```sql +select * from emp_partition where month='202001' +union +select * from emp_partition where month='202002' +union +select * from emp_partition where month='202003' +``` + +## 2.3 UDF函数测试 + +### 2.3.1 Jar包上传 + +进入Scriptis页面后,右键目录路径上传jar包: + + ![img](../../../images/zh_CN/chapter3/tests/hive3.png) + +测试样例jar包在`examples\ch3\rename.jar` + +### 4.3.2 自定义函数 + +进入“UDF函数”选项(如1),右击“个人函数”目录,选择“新增函数”: + + + +输入函数名称、选择jar包、并填写注册格式、输入输出格式即可创建函数: + + ![img](../../../images/zh_CN/chapter3/tests/hive5.png) + + + +获得的函数如下: + + ![img](../../../images/zh_CN/chapter3/tests/hive7.png) + +### 4.3.3 利用自定义函数进行SQL查询 + +完成函数注册后,可进入工作空间页面创建.hql文件使用函数: + +```sql +select deptno,ename, rename(ename) as new_name +from emp; +``` diff --git a/docs/zh_CN/ch3/DSS_User_Tests3_SparkSQL.md b/docs/zh_CN/ch3/DSS_User_Tests3_SparkSQL.md new file mode 100644 index 000000000..aaf2fb44d --- /dev/null +++ b/docs/zh_CN/ch3/DSS_User_Tests3_SparkSQL.md @@ -0,0 +1,61 @@ +# DSS用户测试样例3:SparkSQL + +DSS用户测试样例的目的是为平台新用户提供一组测试样例,用于熟悉DSS的常见操作,并验证DSS平台的正确性 + +![image-20200408211243941](../../../images/zh_CN/chapter3/tests/home.png) + +## 3.1RDD与DataFrame转换 + +### 3.1.1 RDD转为DataFrame + +```scala +case class MyList(id:Int) + +val lis = List(1,2,3,4) + +val listRdd = sc.makeRDD(lis) +import spark.implicits._ +val df = listRdd.map(value => MyList(value)).toDF() + +df.show() +``` + +### 3.1.2 DataFrame转为RDD + +```scala +case class MyList(id:Int) + +val lis = List(1,2,3,4) +val listRdd = sc.makeRDD(lis) +import spark.implicits._ +val df = listRdd.map(value => MyList(value)).toDF() +println("------------------") + +val dfToRdd = df.rdd + +dfToRdd.collect().foreach(print(_)) +``` + +## 3.2 DSL语法风格实现 + +```scala +val df = df1.union(df2) +val dfSelect = df.select($"department") +dfSelect.show() +``` + +## 3.3 SQL语法风格实现(入口函数sqlContext) + +```scala +val df = df1.union(df2) + +df.createOrReplaceTempView("dfTable") +val innerSql = """ + SELECT department + FROM dfTable + """ +val sqlDF = sqlContext.sql(innerSql) +sqlDF.show() +``` + + \ No newline at end of file diff --git "a/docs/zh_CN/ch4/DSS\345\267\245\347\250\213\345\217\221\345\270\203\350\260\203\345\272\246\347\263\273\347\273\237\346\236\266\346\236\204\350\256\276\350\256\241.md" "b/docs/zh_CN/ch4/DSS\345\267\245\347\250\213\345\217\221\345\270\203\350\260\203\345\272\246\347\263\273\347\273\237\346\236\266\346\236\204\350\256\276\350\256\241.md" index 14dbccac5..1dc37857d 100644 --- "a/docs/zh_CN/ch4/DSS\345\267\245\347\250\213\345\217\221\345\270\203\350\260\203\345\272\246\347\263\273\347\273\237\346\236\266\346\236\204\350\256\276\350\256\241.md" +++ "b/docs/zh_CN/ch4/DSS\345\267\245\347\250\213\345\217\221\345\270\203\350\260\203\345\272\246\347\263\273\347\273\237\346\236\266\346\236\204\350\256\276\350\256\241.md" @@ -17,10 +17,10 @@ (1)从数据库读取最新版本的工程、工作流信息,获取所有的保存在BML库工作流JSON文件。 -(2)将上面的数据库内容,JSON文件内容分别转成DSS中的DWSProject,DWSFlow,如果存在子flow,则需要一并设置到flow中,保持原来的层级关系和依赖关系,构建好DWSProject,其中包含了工程下所有的DWSFlow。 +(2)将上面的数据库内容,JSON文件内容分别转成DSS中的DSSProject,DSSFlow,如果存在子flow,则需要一并设置到flow中,保持原来的层级关系和依赖关系,构建好DSSProject,其中包含了工程下所有的DSSFlow。 一个工作流JSON包含了所有节点的定义,并存储了节点之间的依赖关系,以及工作流自身的属性信息。 -(3)将DWSProject经过工程转换器转成SchedulerProject,转成SchedulerProject的过程中,同时完成了DWSJSONFlow到SchedulerFlow的转换,也完成了DWSNode到SchedulerNode的转换。 +(3)将DSSProject经过工程转换器转成SchedulerProject,转成SchedulerProject的过程中,同时完成了DSSJSONFlow到SchedulerFlow的转换,也完成了DSSNode到SchedulerNode的转换。 (4)使用ProjectTuning对整个SchedulerProject工程进行tuning操作,用于完成工程发布前的整体调整操作,在Azkaban的实现中主要完成了工程的路径设置和工作流的存储路径设置。 diff --git a/dss-appjoint-auth/pom.xml b/dss-appjoint-auth/pom.xml index fc09399d0..941a120d1 100644 --- a/dss-appjoint-auth/pom.xml +++ b/dss-appjoint-auth/pom.xml @@ -22,7 +22,7 @@ dss com.webank.wedatasphere.dss - 0.8.0 + 0.9.0 4.0.0 diff --git a/dss-appjoint-core/pom.xml b/dss-appjoint-core/pom.xml index b27a98f70..6ee707c4d 100644 --- a/dss-appjoint-core/pom.xml +++ b/dss-appjoint-core/pom.xml @@ -22,7 +22,7 @@ dss com.webank.wedatasphere.dss - 0.8.0 + 0.9.0 4.0.0 diff --git a/dss-appjoint-loader/pom.xml b/dss-appjoint-loader/pom.xml index 3134933be..b36ab5d79 100644 --- a/dss-appjoint-loader/pom.xml +++ b/dss-appjoint-loader/pom.xml @@ -22,12 +22,12 @@ dss com.webank.wedatasphere.dss - 0.8.0 + 0.9.0 4.0.0 dss-appjoint-loader - 0.8.0 + 0.9.0 diff --git a/dss-application/pom.xml b/dss-application/pom.xml index 2c9fdc039..54583b123 100644 --- a/dss-application/pom.xml +++ b/dss-application/pom.xml @@ -23,7 +23,7 @@ dss com.webank.wedatasphere.dss - 0.8.0 + 0.9.0 dss-application diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/DWSUserMapper.java b/dss-application/src/main/java/com/webank/wedatasphere/dss/application/dao/DSSApplicationUserMapper.java similarity index 63% rename from dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/DWSUserMapper.java rename to dss-application/src/main/java/com/webank/wedatasphere/dss/application/dao/DSSApplicationUserMapper.java index 25daa48ac..f2f59e06b 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/DWSUserMapper.java +++ b/dss-application/src/main/java/com/webank/wedatasphere/dss/application/dao/DSSApplicationUserMapper.java @@ -15,13 +15,17 @@ * */ -package com.webank.wedatasphere.dss.server.dao; +package com.webank.wedatasphere.dss.application.dao; -import org.apache.ibatis.annotations.Mapper; +import com.webank.wedatasphere.dss.application.entity.DSSUser; +/** + * Created by chaogefeng on 2019/10/11. + */ +public interface DSSApplicationUserMapper { + DSSUser getUserByName(String username); -public interface DWSUserMapper { - Long getUserID(String userName); + void registerDssUser(DSSUser userDb); - String getuserName(Long userID); + void updateUserFirstLogin(Long userId); } diff --git a/dss-application/src/main/java/com/webank/wedatasphere/dss/application/dao/impl/DSSUserMapper.xml b/dss-application/src/main/java/com/webank/wedatasphere/dss/application/dao/impl/DSSApplicationUserMapper.xml similarity index 94% rename from dss-application/src/main/java/com/webank/wedatasphere/dss/application/dao/impl/DSSUserMapper.xml rename to dss-application/src/main/java/com/webank/wedatasphere/dss/application/dao/impl/DSSApplicationUserMapper.xml index ff731d7c6..040cb3eb0 100644 --- a/dss-application/src/main/java/com/webank/wedatasphere/dss/application/dao/impl/DSSUserMapper.xml +++ b/dss-application/src/main/java/com/webank/wedatasphere/dss/application/dao/impl/DSSApplicationUserMapper.xml @@ -19,7 +19,7 @@ - + id,`username`,`name`,`is_first_login` @@ -29,7 +29,7 @@ select * from dss_user where `username` = #{username} - + INSERT INTO dss_user() VALUES (#{id},#{username},#{name},#{isFirstLogin}) diff --git a/dss-application/src/main/java/com/webank/wedatasphere/dss/application/handler/UserFirstLoginHandler.java b/dss-application/src/main/java/com/webank/wedatasphere/dss/application/handler/UserFirstLoginHandler.java index 5c5a93c77..f902c5ba3 100644 --- a/dss-application/src/main/java/com/webank/wedatasphere/dss/application/handler/UserFirstLoginHandler.java +++ b/dss-application/src/main/java/com/webank/wedatasphere/dss/application/handler/UserFirstLoginHandler.java @@ -18,7 +18,7 @@ package com.webank.wedatasphere.dss.application.handler; import com.webank.wedatasphere.dss.application.entity.DSSUser; -import com.webank.wedatasphere.dss.application.service.DSSUserService; +import com.webank.wedatasphere.dss.application.service.DSSApplicationUserService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -33,7 +33,7 @@ public class UserFirstLoginHandler implements Handler { private Logger logger = LoggerFactory.getLogger(this.getClass()); @Autowired - private DSSUserService dssUserService; + private DSSApplicationUserService dssApplicationUserService; @Override public int getOrder() { @@ -44,7 +44,7 @@ public int getOrder() { public void handle(DSSUser user) { logger.info("UserFirstLoginHandler:"); synchronized (user.getUsername().intern()){ - DSSUser userDb = dssUserService.getUserByName(user.getUsername()); + DSSUser userDb = dssApplicationUserService.getUserByName(user.getUsername()); if(userDb == null){ logger.info("User first enter dss, insert table dss_user"); userDb = new DSSUser(); @@ -52,7 +52,7 @@ public void handle(DSSUser user) { userDb.setName(user.getName()); userDb.setFirstLogin(true); userDb.setId(user.getId()); - dssUserService.registerDSSUser(userDb); + dssApplicationUserService.registerDssUser(userDb); } // TODO: 2019/11/29 update firstLogin user = userDb; diff --git a/dss-application/src/main/java/com/webank/wedatasphere/dss/application/restful/ApplicationRestfulApi.java b/dss-application/src/main/java/com/webank/wedatasphere/dss/application/restful/ApplicationRestfulApi.java index c0fa33962..2842487a1 100644 --- a/dss-application/src/main/java/com/webank/wedatasphere/dss/application/restful/ApplicationRestfulApi.java +++ b/dss-application/src/main/java/com/webank/wedatasphere/dss/application/restful/ApplicationRestfulApi.java @@ -22,7 +22,7 @@ import com.webank.wedatasphere.dss.application.entity.DSSUserVO; import com.webank.wedatasphere.dss.application.handler.ApplicationHandlerChain; import com.webank.wedatasphere.dss.application.service.ApplicationService; -import com.webank.wedatasphere.dss.application.service.DSSUserService; +import com.webank.wedatasphere.dss.application.service.DSSApplicationUserService; import com.webank.wedatasphere.dss.application.util.ApplicationUtils; import com.webank.wedatasphere.linkis.server.Message; import com.webank.wedatasphere.linkis.server.security.SecurityFilter; @@ -51,7 +51,7 @@ public class ApplicationRestfulApi { @Autowired private ApplicationService applicationService; @Autowired - private DSSUserService dataworkisUserService; + private DSSApplicationUserService dataworkisUserService; @Autowired private ApplicationHandlerChain applicationHandlerChain; diff --git a/dss-application/src/main/java/com/webank/wedatasphere/dss/application/service/DSSUserService.java b/dss-application/src/main/java/com/webank/wedatasphere/dss/application/service/DSSApplicationUserService.java similarity index 90% rename from dss-application/src/main/java/com/webank/wedatasphere/dss/application/service/DSSUserService.java rename to dss-application/src/main/java/com/webank/wedatasphere/dss/application/service/DSSApplicationUserService.java index 3333fd4ff..a798dc435 100644 --- a/dss-application/src/main/java/com/webank/wedatasphere/dss/application/service/DSSUserService.java +++ b/dss-application/src/main/java/com/webank/wedatasphere/dss/application/service/DSSApplicationUserService.java @@ -22,11 +22,11 @@ /** * Created by chaogefeng on 2019/10/11. */ -public interface DSSUserService { +public interface DSSApplicationUserService { DSSUser getUserByName(String username); - void registerDSSUser(DSSUser userDb); + void registerDssUser(DSSUser userDb); void updateUserFirstLogin(Long id); } diff --git a/dss-application/src/main/java/com/webank/wedatasphere/dss/application/service/impl/DSSUserServiceImpl.java b/dss-application/src/main/java/com/webank/wedatasphere/dss/application/service/impl/DSSApplicationUserServiceImpl.java similarity index 66% rename from dss-application/src/main/java/com/webank/wedatasphere/dss/application/service/impl/DSSUserServiceImpl.java rename to dss-application/src/main/java/com/webank/wedatasphere/dss/application/service/impl/DSSApplicationUserServiceImpl.java index 71db0e5df..c8fae7a63 100644 --- a/dss-application/src/main/java/com/webank/wedatasphere/dss/application/service/impl/DSSUserServiceImpl.java +++ b/dss-application/src/main/java/com/webank/wedatasphere/dss/application/service/impl/DSSApplicationUserServiceImpl.java @@ -17,9 +17,9 @@ package com.webank.wedatasphere.dss.application.service.impl; -import com.webank.wedatasphere.dss.application.dao.DSSUserMapper; +import com.webank.wedatasphere.dss.application.dao.DSSApplicationUserMapper; import com.webank.wedatasphere.dss.application.entity.DSSUser; -import com.webank.wedatasphere.dss.application.service.DSSUserService; +import com.webank.wedatasphere.dss.application.service.DSSApplicationUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -27,23 +27,23 @@ * Created by chaogefeng on 2019/10/11. */ @Service -public class DSSUserServiceImpl implements DSSUserService { +public class DSSApplicationUserServiceImpl implements DSSApplicationUserService { @Autowired - private DSSUserMapper dssUserMapper; + private DSSApplicationUserMapper dssApplicationUserMapper; @Override public DSSUser getUserByName(String username) { - return dssUserMapper.getUserByName(username); + return dssApplicationUserMapper.getUserByName(username); } @Override - public void registerDSSUser(DSSUser userDb) { - dssUserMapper.registerDSSUser( userDb); + public void registerDssUser(DSSUser userDb) { + dssApplicationUserMapper.registerDssUser( userDb); } @Override public void updateUserFirstLogin(Long id) { - dssUserMapper.updateUserFirstLogin(id); + dssApplicationUserMapper.updateUserFirstLogin(id); } } diff --git a/dss-application/src/main/java/com/webank/wedatasphere/dss/application/service/impl/LinkisUserServiceImpl.java b/dss-application/src/main/java/com/webank/wedatasphere/dss/application/service/impl/LinkisUserServiceImpl.java index 60f11bdf3..f40f286ec 100644 --- a/dss-application/src/main/java/com/webank/wedatasphere/dss/application/service/impl/LinkisUserServiceImpl.java +++ b/dss-application/src/main/java/com/webank/wedatasphere/dss/application/service/impl/LinkisUserServiceImpl.java @@ -16,7 +16,7 @@ */ package com.webank.wedatasphere.dss.application.service.impl; -import com.webank.wedatasphere.dss.application.dao.DSSUserMapper; +import com.webank.wedatasphere.dss.application.dao.DSSApplicationUserMapper; import com.webank.wedatasphere.dss.application.dao.LinkisUserMapper; import com.webank.wedatasphere.dss.application.entity.DSSUser; import com.webank.wedatasphere.dss.application.entity.LinkisUser; @@ -33,7 +33,7 @@ public class LinkisUserServiceImpl implements LinkisUserService { @Autowired private LinkisUserMapper linkisUserMapper; @Autowired - private DSSUserMapper dssUserMapper; + private DSSApplicationUserMapper dssApplicationUserMapper; @Override public LinkisUser getUserByName(String username) { @@ -55,6 +55,6 @@ public void registerDSSUser(LinkisUser userDb) { dssUser.setName(userDb.getName()); dssUser.setUsername(userDb.getUserName()); dssUser.setFirstLogin(userDb.getFirstLogin()); - dssUserMapper.registerDSSUser(dssUser); + dssApplicationUserMapper.registerDssUser(dssUser); } } diff --git a/dss-azkaban-scheduler-appjoint/pom.xml b/dss-azkaban-scheduler-appjoint/pom.xml index b9110cd5a..f7a82d555 100644 --- a/dss-azkaban-scheduler-appjoint/pom.xml +++ b/dss-azkaban-scheduler-appjoint/pom.xml @@ -22,7 +22,7 @@ dss com.webank.wedatasphere.dss - 0.8.0 + 0.9.0 4.0.0 diff --git a/dss-azkaban-scheduler-appjoint/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/azkaban/hooks/LinkisAzkabanNodePublishHook.java b/dss-azkaban-scheduler-appjoint/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/azkaban/hooks/LinkisAzkabanNodePublishHook.java index 852f9a817..702275f40 100644 --- a/dss-azkaban-scheduler-appjoint/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/azkaban/hooks/LinkisAzkabanNodePublishHook.java +++ b/dss-azkaban-scheduler-appjoint/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/azkaban/hooks/LinkisAzkabanNodePublishHook.java @@ -59,7 +59,7 @@ public void postPublish(SchedulerNode schedulerNode) { } private void writeNodeResourcesToLocal(SchedulerNode schedulerNode) throws DSSErrorException { - List nodeResources = schedulerNode.getDWSNode().getResources(); + List nodeResources = schedulerNode.getDssNode().getResources(); if(nodeResources == null || nodeResources.isEmpty()) {return;} FileOutputStream os = null; try { diff --git a/dss-azkaban-scheduler-appjoint/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/azkaban/hooks/LinkisAzkabanProjectPublishHook.java b/dss-azkaban-scheduler-appjoint/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/azkaban/hooks/LinkisAzkabanProjectPublishHook.java index e6eb9dd62..40effab61 100644 --- a/dss-azkaban-scheduler-appjoint/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/azkaban/hooks/LinkisAzkabanProjectPublishHook.java +++ b/dss-azkaban-scheduler-appjoint/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/azkaban/hooks/LinkisAzkabanProjectPublishHook.java @@ -75,7 +75,7 @@ private void removeProjectStoreDirAndzip(AzkabanSchedulerProject publishProject) } private void writeProjectResourcesToLocal(AzkabanSchedulerProject publishProject)throws DSSErrorException { - List resources = publishProject.getDWSProject().getProjectResources(); + List resources = publishProject.getDssProject().getProjectResources(); FileOutputStream os = null; try { String storePath = publishProject.getStorePath(); diff --git a/dss-azkaban-scheduler-appjoint/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/azkaban/linkisjob/LinkisJobConverter.java b/dss-azkaban-scheduler-appjoint/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/azkaban/linkisjob/LinkisJobConverter.java index b13044c6d..ef6f3f3b1 100644 --- a/dss-azkaban-scheduler-appjoint/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/azkaban/linkisjob/LinkisJobConverter.java +++ b/dss-azkaban-scheduler-appjoint/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/azkaban/linkisjob/LinkisJobConverter.java @@ -79,7 +79,7 @@ private void convertHead(LinkisAzkabanSchedulerNode schedulerNode,LinkisJob job) } private void convertDependencies(LinkisAzkabanSchedulerNode schedulerNode,LinkisJob job){ - List dependencys = schedulerNode.getDWSNode().getDependencys(); + List dependencys = schedulerNode.getDssNode().getDependencys(); if(dependencys != null && !dependencys.isEmpty()) { StringBuilder dependencies = new StringBuilder(); dependencys.forEach(d ->dependencies.append(d + ",")); @@ -88,12 +88,12 @@ private void convertDependencies(LinkisAzkabanSchedulerNode schedulerNode,Linkis } private void convertProxyUser(LinkisAzkabanSchedulerNode schedulerNode,LinkisJob job){ - String userProxy = schedulerNode.getDWSNode().getUserProxy(); + String userProxy = schedulerNode.getDssNode().getUserProxy(); if(!StringUtils.isEmpty(userProxy)) job.setProxyUser(userProxy); } private void convertConfiguration(LinkisAzkabanSchedulerNode schedulerNode,LinkisJob job){ - Map params = schedulerNode.getDWSNode().getParams(); + Map params = schedulerNode.getDssNode().getParams(); if (params != null && !params.isEmpty()) { Object configuration = params.get("configuration"); String confprefix = "node.conf."; @@ -103,7 +103,7 @@ private void convertConfiguration(LinkisAzkabanSchedulerNode schedulerNode,Linki } private void convertJobCommand(LinkisAzkabanSchedulerNode schedulerNode,LinkisJob job){ - Map jobContent = schedulerNode.getDWSNode().getJobContent(); + Map jobContent = schedulerNode.getDssNode().getJobContent(); if(jobContent != null) { jobContent.remove("jobParams"); job.setCommand(new Gson().toJson(jobContent)); diff --git a/dss-azkaban-scheduler-appjoint/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/azkaban/parser/AzkabanFlowParser.java b/dss-azkaban-scheduler-appjoint/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/azkaban/parser/AzkabanFlowParser.java index 3da66206d..0fe735083 100644 --- a/dss-azkaban-scheduler-appjoint/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/azkaban/parser/AzkabanFlowParser.java +++ b/dss-azkaban-scheduler-appjoint/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/azkaban/parser/AzkabanFlowParser.java @@ -3,7 +3,7 @@ import com.webank.wedatasphere.dss.appjoint.scheduler.parser.AbstractFlowParser; import com.webank.wedatasphere.dss.appjoint.scheduler.parser.NodeParser; import com.webank.wedatasphere.dss.appjoint.scheduler.azkaban.entity.AzkabanSchedulerFlow; -import com.webank.wedatasphere.dss.common.entity.flow.DWSJSONFlow; +import com.webank.wedatasphere.dss.common.entity.flow.DSSJSONFlow; import com.webank.wedatasphere.dss.appjoint.scheduler.entity.SchedulerFlow; import java.util.ArrayList; @@ -30,7 +30,7 @@ public void setNodeParsers(NodeParser[] nodeParsers) { } @Override - public Boolean ifFlowCanParse(DWSJSONFlow flow) { + public Boolean ifFlowCanParse(DSSJSONFlow flow) { return true; } diff --git a/dss-azkaban-scheduler-appjoint/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/azkaban/parser/LinkisAzkabanNodeParser.java b/dss-azkaban-scheduler-appjoint/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/azkaban/parser/LinkisAzkabanNodeParser.java index dcbd92d0f..e9c8b86a9 100644 --- a/dss-azkaban-scheduler-appjoint/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/azkaban/parser/LinkisAzkabanNodeParser.java +++ b/dss-azkaban-scheduler-appjoint/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/azkaban/parser/LinkisAzkabanNodeParser.java @@ -1,7 +1,7 @@ package com.webank.wedatasphere.dss.appjoint.scheduler.azkaban.parser; import com.webank.wedatasphere.dss.appjoint.scheduler.azkaban.entity.LinkisAzkabanSchedulerNode; -import com.webank.wedatasphere.dss.common.entity.node.DWSNode; +import com.webank.wedatasphere.dss.common.entity.node.DSSNode; import com.webank.wedatasphere.dss.appjoint.scheduler.entity.SchedulerNode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -12,14 +12,14 @@ public class LinkisAzkabanNodeParser extends AzkabanNodeParser { @Override - public SchedulerNode parseNode(DWSNode dwsNode) { + public SchedulerNode parseNode(DSSNode dssNode) { LinkisAzkabanSchedulerNode schedulerNode = new LinkisAzkabanSchedulerNode(); - schedulerNode.setDWSNode(dwsNode); + schedulerNode.setDssNode(dssNode); return schedulerNode; } @Override - public Boolean ifNodeCanParse(DWSNode dwsNode) { + public Boolean ifNodeCanParse(DSSNode dssNode) { //预留 return true; } diff --git a/dss-azkaban-scheduler-appjoint/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/azkaban/tuning/AzkabanProjectTuning.java b/dss-azkaban-scheduler-appjoint/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/azkaban/tuning/AzkabanProjectTuning.java index 55f0ddf59..b4cec7a03 100644 --- a/dss-azkaban-scheduler-appjoint/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/azkaban/tuning/AzkabanProjectTuning.java +++ b/dss-azkaban-scheduler-appjoint/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/azkaban/tuning/AzkabanProjectTuning.java @@ -60,7 +60,7 @@ private void assignStorePath(AzkabanSchedulerProject azkabanSchedulerProject) { SimpleDateFormat dateFormat = new SimpleDateFormat(AzkabanSchedulerProject.DATE_FORMAT); Date date = new Date(); String dataStr = dateFormat.format(date); - String userName = azkabanSchedulerProject.getDWSProject().getUserName(); + String userName = azkabanSchedulerProject.getDssProject().getUserName(); String name = azkabanSchedulerProject.getName(); String storePath = AzkabanConf.DEFAULT_STORE_PATH.getValue() + File.separator + userName + File.separator + dataStr + File.separator +name; diff --git a/dss-azkaban-scheduler-appjoint/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/azkaban/tuning/LinkisAzkabanFlowTuning.java b/dss-azkaban-scheduler-appjoint/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/azkaban/tuning/LinkisAzkabanFlowTuning.java index 4f218ce7d..42c9962f1 100644 --- a/dss-azkaban-scheduler-appjoint/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/azkaban/tuning/LinkisAzkabanFlowTuning.java +++ b/dss-azkaban-scheduler-appjoint/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/azkaban/tuning/LinkisAzkabanFlowTuning.java @@ -9,7 +9,7 @@ import com.webank.wedatasphere.dss.appjoint.scheduler.entity.SchedulerNode; import com.webank.wedatasphere.dss.appjoint.scheduler.tuning.AbstractFlowTuning; import com.webank.wedatasphere.dss.appjoint.scheduler.tuning.NodeTuning; -import com.webank.wedatasphere.dss.common.entity.node.DWSNodeDefault; +import com.webank.wedatasphere.dss.common.entity.node.DSSNodeDefault; import java.io.File; import java.util.ArrayList; import java.util.List; @@ -58,7 +58,7 @@ public Boolean ifFlowCanTuning(SchedulerFlow schedulerFlow) { } private SchedulerFlow addEndNodeForFlowName(SchedulerFlow flow) { - DWSNodeDefault endNode = new DWSNodeDefault(); + DSSNodeDefault endNode = new DSSNodeDefault(); List endNodeList = getFlowEndJobList(flow); endNode.setId(flow.getName() + "_"); endNode.setName(flow.getName() + "_"); @@ -70,7 +70,7 @@ private SchedulerFlow addEndNodeForFlowName(SchedulerFlow flow) { endNodeList.forEach(tmpNode -> endNode.addDependency(tmpNode.getName())); } LinkisAzkabanSchedulerNode azkabanSchedulerNode = new LinkisAzkabanSchedulerNode(); - azkabanSchedulerNode.setDWSNode(endNode); + azkabanSchedulerNode.setDssNode(endNode); flow.getSchedulerNodes().add((azkabanSchedulerNode)); return flow; } @@ -80,7 +80,7 @@ private List getFlowEndJobList(SchedulerFlow flow) { for (SchedulerNode job : flow.getSchedulerNodes()) { int flag = 0; for (SchedulerEdge link : flow.getSchedulerEdges()) { - if (job.getId().equals(link.getDWSEdge().getSource())) { + if (job.getId().equals(link.getDssEdge().getSource())) { flag = 1; } } diff --git a/dss-common/pom.xml b/dss-common/pom.xml index 778700584..fb77c4dad 100644 --- a/dss-common/pom.xml +++ b/dss-common/pom.xml @@ -23,7 +23,7 @@ dss com.webank.wedatasphere.dss - 0.8.0 + 0.9.0 dss-common diff --git a/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/flow/DWSFlow.java b/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/flow/DSSFlow.java similarity index 86% rename from dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/flow/DWSFlow.java rename to dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/flow/DSSFlow.java index 15ca42b8c..ff768f791 100644 --- a/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/flow/DWSFlow.java +++ b/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/flow/DSSFlow.java @@ -24,7 +24,7 @@ /** * Created by enjoyyin on 2019/5/14. */ -public class DWSFlow implements Flow { +public class DSSFlow implements Flow { private Long id; private String name; private Boolean state; //0,1代表发布过和未发布过 @@ -38,11 +38,11 @@ public class DWSFlow implements Flow { private Boolean hasSaved;//0disable 1 enable 0表示工作流从来没存过,发布的时候忽略 private String uses; - private List versions; //为了前台不做修改,还是使用versions 而不使用flowVersions的变量名 - private List children; + private List versions; //为了前台不做修改,还是使用versions 而不使用flowVersions的变量名 + private List children; private String flowType; - private DWSFlowVersion latestVersion; + private DSSFlowVersion latestVersion; public Integer getRank() { @@ -86,27 +86,27 @@ public void setDescription(String description) { @Override public void addFlowVersion(FlowVersion flowVersion) { - this.versions.add((DWSFlowVersion) flowVersion); + this.versions.add((DSSFlowVersion) flowVersion); } @Override - public List extends DWSFlow> getChildren() { + public List extends DSSFlow> getChildren() { return children; } @Override public void setChildren(List extends Flow> children) { - this.children = children.stream().map(f ->(DWSFlow)f).collect(Collectors.toList()); + this.children = children.stream().map(f ->(DSSFlow)f).collect(Collectors.toList()); } @Override - public List getFlowVersions() { + public List getFlowVersions() { return this.versions; } @Override public void setFlowVersions(List extends FlowVersion> flowVersions) { - this.versions = flowVersions.stream().map(f ->(DWSFlowVersion)f).collect(Collectors.toList()); + this.versions = flowVersions.stream().map(f ->(DSSFlowVersion)f).collect(Collectors.toList()); } @Override @@ -176,11 +176,11 @@ public void setHasSaved(Boolean hasSaved) { this.hasSaved = hasSaved; } - public DWSFlowVersion getLatestVersion() { + public DSSFlowVersion getLatestVersion() { return latestVersion; } - public void setLatestVersion(DWSFlowVersion latestVersion) { + public void setLatestVersion(DSSFlowVersion latestVersion) { this.latestVersion = latestVersion; } diff --git a/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/flow/DWSFlowPublishHistory.java b/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/flow/DSSFlowPublishHistory.java similarity index 94% rename from dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/flow/DWSFlowPublishHistory.java rename to dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/flow/DSSFlowPublishHistory.java index e9c4537b6..7fe3e9ad4 100644 --- a/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/flow/DWSFlowPublishHistory.java +++ b/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/flow/DSSFlowPublishHistory.java @@ -20,5 +20,5 @@ /** * Created by enjoyyin on 2019/9/19. */ -public class DWSFlowPublishHistory { +public class DSSFlowPublishHistory { } diff --git a/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/flow/DWSFlowVersion.java b/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/flow/DSSFlowVersion.java similarity index 92% rename from dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/flow/DWSFlowVersion.java rename to dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/flow/DSSFlowVersion.java index 43c319541..ce8559097 100644 --- a/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/flow/DWSFlowVersion.java +++ b/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/flow/DSSFlowVersion.java @@ -22,7 +22,7 @@ /** * Created by enjoyyin on 2019/9/19. */ -public class DWSFlowVersion implements FlowVersion, Comparable { +public class DSSFlowVersion implements FlowVersion, Comparable { private Long id; private Long flowID; private String source; @@ -31,7 +31,7 @@ public class DWSFlowVersion implements FlowVersion, Comparable { private Date updateTime; private Long updatorID; private String version; - private DWSFlowPublishHistory publishHistory; + private DSSFlowPublishHistory publishHistory; private String json; private String updator; private Boolean isNotPublished; //true 未发过版,false已经过版 @@ -146,16 +146,16 @@ public void setUpdatorID(Long updatorID) { this.updatorID = updatorID; } - public DWSFlowPublishHistory getPublishHistory() { + public DSSFlowPublishHistory getPublishHistory() { return publishHistory; } - public void setPublishHistory(DWSFlowPublishHistory publishHistory) { + public void setPublishHistory(DSSFlowPublishHistory publishHistory) { this.publishHistory = publishHistory; } @Override - public int compareTo(DWSFlowVersion o) { + public int compareTo(DSSFlowVersion o) { Integer v1 = Integer.valueOf(this.version.substring(1, version.length())); Integer v2 = Integer.valueOf(o.version.substring(1,o.version.length())); return v2 - v1; diff --git a/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/flow/DWSJSONFlow.java b/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/flow/DSSJSONFlow.java similarity index 84% rename from dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/flow/DWSJSONFlow.java rename to dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/flow/DSSJSONFlow.java index 1c6e42cc6..ae9b98631 100644 --- a/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/flow/DWSJSONFlow.java +++ b/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/flow/DSSJSONFlow.java @@ -23,10 +23,10 @@ /** * Created by enjoyyin on 2019/5/14. */ -public class DWSJSONFlow extends DWSFlow { +public class DSSJSONFlow extends DSSFlow { private String json; - private List children; + private List children; public String getJson() { return json; @@ -38,11 +38,11 @@ public void setJson(String json) { @Override public void setChildren(List extends Flow> children) { - this.children = children.stream().map(f ->(DWSJSONFlow)f).collect(Collectors.toList()); + this.children = children.stream().map(f ->(DSSJSONFlow)f).collect(Collectors.toList()); } @Override - public List getChildren() { + public List getChildren() { return children; } } diff --git a/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/node/DWSEdge.java b/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/node/DSSEdge.java similarity index 97% rename from dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/node/DWSEdge.java rename to dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/node/DSSEdge.java index e255d2a91..c4b30593a 100644 --- a/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/node/DWSEdge.java +++ b/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/node/DSSEdge.java @@ -20,7 +20,7 @@ /** * Created by enjoyyin on 2019/5/14. */ -public interface DWSEdge { +public interface DSSEdge { String getSource(); diff --git a/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/node/DWSEdgeDefault.java b/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/node/DSSEdgeDefault.java similarity index 96% rename from dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/node/DWSEdgeDefault.java rename to dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/node/DSSEdgeDefault.java index 4cf094bb4..3e6bc8b13 100644 --- a/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/node/DWSEdgeDefault.java +++ b/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/node/DSSEdgeDefault.java @@ -20,7 +20,7 @@ /** * Created by enjoyyin on 2019/5/14. */ -public class DWSEdgeDefault implements DWSEdge { +public class DSSEdgeDefault implements DSSEdge { private String source; private String target; private String sourceLocation; @@ -68,7 +68,7 @@ public void setTargetLocation(String targetLocation) { @Override public String toString() { - return "DWSEdge{" + + return "DSSEdge{" + "source='" + source + '\'' + ", target='" + target + '\'' + ", sourceLocation='" + sourceLocation + '\'' + diff --git a/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/node/DWSNode.java b/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/node/DSSNode.java similarity index 96% rename from dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/node/DWSNode.java rename to dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/node/DSSNode.java index d7fa7e870..8f6575c83 100644 --- a/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/node/DWSNode.java +++ b/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/node/DSSNode.java @@ -25,7 +25,7 @@ /** * Created by enjoyyin on 2019/5/14. */ -public interface DWSNode extends Node { +public interface DSSNode extends Node { Layout getLayout(); diff --git a/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/node/DWSNodeDefault.java b/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/node/DSSNodeDefault.java similarity index 98% rename from dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/node/DWSNodeDefault.java rename to dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/node/DSSNodeDefault.java index b7748016f..2d416dfb0 100644 --- a/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/node/DWSNodeDefault.java +++ b/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/node/DSSNodeDefault.java @@ -26,7 +26,7 @@ /** * Created by enjoyyin on 2019/5/14. */ -public class DWSNodeDefault implements DWSNode { +public class DSSNodeDefault implements DSSNode { private Layout layout; private String id; private String jobType; diff --git a/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/project/DWSJSONProject.java b/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/project/DSSJSONProject.java similarity index 69% rename from dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/project/DWSJSONProject.java rename to dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/project/DSSJSONProject.java index 05202dac4..ffd9026fc 100644 --- a/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/project/DWSJSONProject.java +++ b/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/project/DSSJSONProject.java @@ -17,8 +17,8 @@ package com.webank.wedatasphere.dss.common.entity.project; -import com.webank.wedatasphere.dss.common.entity.flow.DWSFlow; -import com.webank.wedatasphere.dss.common.entity.flow.DWSJSONFlow; +import com.webank.wedatasphere.dss.common.entity.flow.DSSFlow; +import com.webank.wedatasphere.dss.common.entity.flow.DSSJSONFlow; import java.util.List; import java.util.stream.Collectors; @@ -26,16 +26,16 @@ /** * Created by allenlliu on 2019/9/16. */ -public class DWSJSONProject extends DWSProject { - private List flows; +public class DSSJSONProject extends DSSProject { + private List flows; @Override - public List getFlows() { + public List getFlows() { return this.flows; } @Override - public void setFlows(List extends DWSFlow> flows) { - this.flows = flows.stream().map(f ->(DWSJSONFlow)f).collect(Collectors.toList()); + public void setFlows(List extends DSSFlow> flows) { + this.flows = flows.stream().map(f ->(DSSJSONFlow)f).collect(Collectors.toList()); } } diff --git a/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/project/DWSProject.java b/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/project/DSSProject.java similarity index 88% rename from dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/project/DWSProject.java rename to dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/project/DSSProject.java index 3f7ad9c2e..4454362d8 100644 --- a/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/project/DWSProject.java +++ b/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/project/DSSProject.java @@ -18,7 +18,7 @@ package com.webank.wedatasphere.dss.common.entity.project; import com.webank.wedatasphere.dss.common.entity.Resource; -import com.webank.wedatasphere.dss.common.entity.flow.DWSFlow; +import com.webank.wedatasphere.dss.common.entity.flow.DSSFlow; import java.util.Date; import java.util.List; @@ -27,7 +27,7 @@ /** * Created by enjoyyin on 2019/9/16. */ -public class DWSProject implements Project { +public class DSSProject implements Project { private Long id; private String name; @@ -48,14 +48,15 @@ public class DWSProject implements Project { private String product; private Integer applicationArea; private String business; + private Long workspaceId; - private DWSProjectVersion latestVersion; + private DSSProjectVersion latestVersion; private Boolean isNotPublish; private String userName; private String projectGroup; private List projectVersions; - private List flows; + private List flows; private List projectResources; public List getProjectResources() { @@ -66,12 +67,12 @@ public void setProjectResources(List projectResources) { this.projectResources = projectResources; } - public List extends DWSFlow> getFlows() { + public List extends DSSFlow> getFlows() { return flows; } - public void setFlows(List extends DWSFlow> flows) { - this.flows = flows.stream().map(f -> (DWSFlow) f).collect(Collectors.toList()); + public void setFlows(List extends DSSFlow> flows) { + this.flows = flows.stream().map(f -> (DSSFlow) f).collect(Collectors.toList()); } public String getUserName() { @@ -122,11 +123,11 @@ public void setInitialOrgID(Long initialOrgID) { this.initialOrgID = initialOrgID; } - public DWSProjectVersion getLatestVersion() { + public DSSProjectVersion getLatestVersion() { return latestVersion; } - public void setLatestVersion(DWSProjectVersion latestVersion) { + public void setLatestVersion(DSSProjectVersion latestVersion) { this.latestVersion = latestVersion; } @@ -174,13 +175,13 @@ public List getProjectVersions() { @Override public void setProjectVersions(List extends ProjectVersion> projectVersions) { - this.projectVersions = projectVersions.stream().map(f -> (DWSProjectVersion) f).collect(Collectors.toList()); + this.projectVersions = projectVersions.stream().map(f -> (DSSProjectVersion) f).collect(Collectors.toList()); } @Override public void addProjectVersion(ProjectVersion projectVersion) { - this.projectVersions.add((DWSProjectVersion) projectVersion); + this.projectVersions.add((DSSProjectVersion) projectVersion); } @Override @@ -282,4 +283,12 @@ public String getBusiness() { public void setBusiness(String business) { this.business = business; } + + public Long getWorkspaceId() { + return workspaceId; + } + + public void setWorkspaceId(Long workspaceId) { + this.workspaceId = workspaceId; + } } diff --git a/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/project/DWSProjectPublishHistory.java b/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/project/DSSProjectPublishHistory.java similarity index 98% rename from dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/project/DWSProjectPublishHistory.java rename to dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/project/DSSProjectPublishHistory.java index 7ea9b1ee0..dca93dd48 100644 --- a/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/project/DWSProjectPublishHistory.java +++ b/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/project/DSSProjectPublishHistory.java @@ -22,7 +22,7 @@ /** * Created by enjoyyin on 2019/5/14. */ -public class DWSProjectPublishHistory { +public class DSSProjectPublishHistory { private Long id; private Long projectVersionID; private Date createTime; diff --git a/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/project/DWSProjectVersion.java b/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/project/DSSProjectVersion.java similarity index 91% rename from dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/project/DWSProjectVersion.java rename to dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/project/DSSProjectVersion.java index 534a9631f..5731ecf8e 100644 --- a/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/project/DWSProjectVersion.java +++ b/dss-common/src/main/java/com/webank/wedatasphere/dss/common/entity/project/DSSProjectVersion.java @@ -22,7 +22,7 @@ /** * Created by enjoyyin on 2019/9/18. */ -public class DWSProjectVersion implements ProjectVersion { +public class DSSProjectVersion implements ProjectVersion { private Long id; private Long projectID; @@ -33,9 +33,7 @@ public class DWSProjectVersion implements ProjectVersion { private Integer lock; private String updator; private Boolean isNotPublish; - private DWSProjectPublishHistory publishHistory; - - + private DSSProjectPublishHistory publishHistory; @Override public String getVersion() { @@ -118,11 +116,11 @@ public void setNotPublish(Boolean notPublish) { isNotPublish = notPublish; } - public DWSProjectPublishHistory getPublishHistory() { + public DSSProjectPublishHistory getPublishHistory() { return publishHistory; } - public void setPublishHistory(DWSProjectPublishHistory publishHistory) { + public void setPublishHistory(DSSProjectPublishHistory publishHistory) { this.publishHistory = publishHistory; } } diff --git a/dss-common/src/main/scala/com/webank/wedatasphere/dss/common/protocol/RequestDWSProject.scala b/dss-common/src/main/scala/com/webank/wedatasphere/dss/common/protocol/RequestDSSProject.scala similarity index 90% rename from dss-common/src/main/scala/com/webank/wedatasphere/dss/common/protocol/RequestDWSProject.scala rename to dss-common/src/main/scala/com/webank/wedatasphere/dss/common/protocol/RequestDSSProject.scala index 92d01f765..b9b3da46a 100644 --- a/dss-common/src/main/scala/com/webank/wedatasphere/dss/common/protocol/RequestDWSProject.scala +++ b/dss-common/src/main/scala/com/webank/wedatasphere/dss/common/protocol/RequestDSSProject.scala @@ -20,6 +20,6 @@ package com.webank.wedatasphere.dss.common.protocol /** * Created by enjoyyin on 2019/11/8. */ -case class RequestDWSProject(flowId:Long,version:String,projectVersionId:Long) +case class RequestDSSProject(flowId:Long, version:String, projectVersionId:Long) case class RequestDSSApplication(name:String) \ No newline at end of file diff --git a/dss-flow-execution-entrance/pom.xml b/dss-flow-execution-entrance/pom.xml index abeccba5c..7e152ced3 100644 --- a/dss-flow-execution-entrance/pom.xml +++ b/dss-flow-execution-entrance/pom.xml @@ -22,7 +22,7 @@ dss com.webank.wedatasphere.dss - 0.8.0 + 0.9.0 4.0.0 diff --git a/dss-flow-execution-entrance/src/main/assembly/distribution.xml b/dss-flow-execution-entrance/src/main/assembly/distribution.xml index d59e84970..bb09aad22 100644 --- a/dss-flow-execution-entrance/src/main/assembly/distribution.xml +++ b/dss-flow-execution-entrance/src/main/assembly/distribution.xml @@ -59,16 +59,16 @@ aopalliance:aopalliance:jar asm:asm:jar cglib:cglib:jar - com.amazonaws:aws-java-sdk-autoscaling:jar - com.amazonaws:aws-java-sdk-core:jar - com.amazonaws:aws-java-sdk-ec2:jar - com.amazonaws:aws-java-sdk-route53:jar - com.amazonaws:aws-java-sdk-sts:jar - com.amazonaws:jmespath-java:jar + + + + + + com.fasterxml.jackson.core:jackson-annotations:jar com.fasterxml.jackson.core:jackson-core:jar com.fasterxml.jackson.core:jackson-databind:jar - com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:jar + com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar @@ -264,7 +264,7 @@ org.springframework:spring-web:jar org.springframework:spring-webmvc:jar org.yaml:snakeyaml:jar - software.amazon.ion:ion-java:jar + xmlpull:xmlpull:jar xpp3:xpp3_min:jar diff --git a/dss-flow-execution-entrance/src/main/java/com/webank/wedatasphere/dss/flow/execution/entrance/job/FlowExecutionAppJointSignalSharedJob.java b/dss-flow-execution-entrance/src/main/java/com/webank/wedatasphere/dss/flow/execution/entrance/job/FlowExecutionAppJointSignalSharedJob.java index 6cfcf877b..d0d556aad 100644 --- a/dss-flow-execution-entrance/src/main/java/com/webank/wedatasphere/dss/flow/execution/entrance/job/FlowExecutionAppJointSignalSharedJob.java +++ b/dss-flow-execution-entrance/src/main/java/com/webank/wedatasphere/dss/flow/execution/entrance/job/FlowExecutionAppJointSignalSharedJob.java @@ -17,7 +17,6 @@ package com.webank.wedatasphere.dss.flow.execution.entrance.job; -import com.webank.wedatasphere.dss.common.entity.node.DWSNode; import com.webank.wedatasphere.dss.flow.execution.entrance.conf.FlowExecutionEntranceConfiguration; import com.webank.wedatasphere.dss.linkis.node.execution.job.JobSignalKeyCreator; import com.webank.wedatasphere.dss.linkis.node.execution.job.SignalSharedJob; diff --git a/dss-flow-execution-entrance/src/main/java/com/webank/wedatasphere/dss/flow/execution/entrance/parser/FlowExecutionFlowParser.java b/dss-flow-execution-entrance/src/main/java/com/webank/wedatasphere/dss/flow/execution/entrance/parser/FlowExecutionFlowParser.java index 66388106e..fbd8bdd76 100644 --- a/dss-flow-execution-entrance/src/main/java/com/webank/wedatasphere/dss/flow/execution/entrance/parser/FlowExecutionFlowParser.java +++ b/dss-flow-execution-entrance/src/main/java/com/webank/wedatasphere/dss/flow/execution/entrance/parser/FlowExecutionFlowParser.java @@ -19,7 +19,7 @@ import com.webank.wedatasphere.dss.appjoint.scheduler.parser.AbstractFlowParser; import com.webank.wedatasphere.dss.appjoint.scheduler.parser.NodeParser; -import com.webank.wedatasphere.dss.common.entity.flow.DWSJSONFlow; +import com.webank.wedatasphere.dss.common.entity.flow.DSSJSONFlow; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -36,7 +36,7 @@ public void setNodeParsers(NodeParser[] nodeParsers) { } @Override - public Boolean ifFlowCanParse(DWSJSONFlow flow) { + public Boolean ifFlowCanParse(DSSJSONFlow flow) { return true; } diff --git a/dss-flow-execution-entrance/src/main/java/com/webank/wedatasphere/dss/flow/execution/entrance/parser/FlowExecutionNodeParser.java b/dss-flow-execution-entrance/src/main/java/com/webank/wedatasphere/dss/flow/execution/entrance/parser/FlowExecutionNodeParser.java index 379aa14e5..97c5824b9 100644 --- a/dss-flow-execution-entrance/src/main/java/com/webank/wedatasphere/dss/flow/execution/entrance/parser/FlowExecutionNodeParser.java +++ b/dss-flow-execution-entrance/src/main/java/com/webank/wedatasphere/dss/flow/execution/entrance/parser/FlowExecutionNodeParser.java @@ -19,7 +19,7 @@ import com.webank.wedatasphere.dss.appjoint.scheduler.entity.SchedulerNode; import com.webank.wedatasphere.dss.appjoint.scheduler.parser.AbstractNodeParser; -import com.webank.wedatasphere.dss.common.entity.node.DWSNode; +import com.webank.wedatasphere.dss.common.entity.node.DSSNode; import com.webank.wedatasphere.dss.flow.execution.entrance.entity.FlowExecutionNode; import org.springframework.stereotype.Component; @@ -31,14 +31,14 @@ public class FlowExecutionNodeParser extends AbstractNodeParser { @Override - public SchedulerNode parseNode(DWSNode dwsNode) { + public SchedulerNode parseNode(DSSNode dssNode) { FlowExecutionNode node = new FlowExecutionNode(); - node.setDWSNode(dwsNode); + node.setDssNode(dssNode); return node; } @Override - public Boolean ifNodeCanParse(DWSNode dwsNode) { + public Boolean ifNodeCanParse(DSSNode dssNode) { return true; } diff --git a/dss-flow-execution-entrance/src/main/java/com/webank/wedatasphere/dss/flow/execution/entrance/parser/FlowExecutionReadNodeParser.java b/dss-flow-execution-entrance/src/main/java/com/webank/wedatasphere/dss/flow/execution/entrance/parser/FlowExecutionReadNodeParser.java index 29f964c5d..1c04fdfd2 100644 --- a/dss-flow-execution-entrance/src/main/java/com/webank/wedatasphere/dss/flow/execution/entrance/parser/FlowExecutionReadNodeParser.java +++ b/dss-flow-execution-entrance/src/main/java/com/webank/wedatasphere/dss/flow/execution/entrance/parser/FlowExecutionReadNodeParser.java @@ -20,7 +20,7 @@ import com.webank.wedatasphere.dss.appjoint.scheduler.entity.ReadNode; import com.webank.wedatasphere.dss.appjoint.scheduler.entity.SchedulerNode; import com.webank.wedatasphere.dss.appjoint.scheduler.parser.AbstractReadNodeParser; -import com.webank.wedatasphere.dss.common.entity.node.DWSNode; +import com.webank.wedatasphere.dss.common.entity.node.DSSNode; import com.webank.wedatasphere.dss.flow.execution.entrance.entity.FlowExecutionNode; import com.webank.wedatasphere.dss.flow.execution.entrance.entity.FlowExecutonReadNode; import com.webank.wedatasphere.dss.flow.execution.entrance.utils.FlowExecutionUtils; @@ -39,8 +39,8 @@ public int getOrder() { } @Override - public Boolean ifNodeCanParse(DWSNode dwsNode) { - return FlowExecutionUtils.isReadNode(dwsNode.getNodeType()); + public Boolean ifNodeCanParse(DSSNode dssNode) { + return FlowExecutionUtils.isReadNode(dssNode.getNodeType()); } @Override diff --git a/dss-flow-execution-entrance/src/main/scala/com/webank/wedatasphere/dss/flow/execution/entrance/FlowContext.scala b/dss-flow-execution-entrance/src/main/scala/com/webank/wedatasphere/dss/flow/execution/entrance/FlowContext.scala index b0192fb54..f03081a5e 100644 --- a/dss-flow-execution-entrance/src/main/scala/com/webank/wedatasphere/dss/flow/execution/entrance/FlowContext.scala +++ b/dss-flow-execution-entrance/src/main/scala/com/webank/wedatasphere/dss/flow/execution/entrance/FlowContext.scala @@ -53,7 +53,7 @@ object FlowContext { def changedNodeState(fromMap: util.Map[String, NodeRunner], toMap: util.Map[String, NodeRunner], node: SchedulerNode,info:String): Unit = { - val nodeName = node.getDWSNode.getName + val nodeName = node.getDssNode.getName if (fromMap.containsKey(nodeName)) { val runner = fromMap.get(nodeName) runner.setNodeExecutedInfo(info) diff --git a/dss-flow-execution-entrance/src/main/scala/com/webank/wedatasphere/dss/flow/execution/entrance/execution/DefaultFlowExecution.scala b/dss-flow-execution-entrance/src/main/scala/com/webank/wedatasphere/dss/flow/execution/entrance/execution/DefaultFlowExecution.scala index d5a9cbf79..c1164c9d3 100644 --- a/dss-flow-execution-entrance/src/main/scala/com/webank/wedatasphere/dss/flow/execution/entrance/execution/DefaultFlowExecution.scala +++ b/dss-flow-execution-entrance/src/main/scala/com/webank/wedatasphere/dss/flow/execution/entrance/execution/DefaultFlowExecution.scala @@ -61,7 +61,7 @@ class DefaultFlowExecution extends FlowExecution with Logging { // submit node runner runningNodes.add(runner) } else { - info(s"This node ${runner.getNode.getDWSNode.getName} Skipped in execution") + info(s"This node ${runner.getNode.getDssNode.getName} Skipped in execution") runner.fromScheduledTunToState(NodeExecutionState.Skipped) } } diff --git a/dss-flow-execution-entrance/src/main/scala/com/webank/wedatasphere/dss/flow/execution/entrance/job/FlowEntranceJob.scala b/dss-flow-execution-entrance/src/main/scala/com/webank/wedatasphere/dss/flow/execution/entrance/job/FlowEntranceJob.scala index 225492781..42bf395d4 100644 --- a/dss-flow-execution-entrance/src/main/scala/com/webank/wedatasphere/dss/flow/execution/entrance/job/FlowEntranceJob.scala +++ b/dss-flow-execution-entrance/src/main/scala/com/webank/wedatasphere/dss/flow/execution/entrance/job/FlowEntranceJob.scala @@ -18,7 +18,7 @@ package com.webank.wedatasphere.dss.flow.execution.entrance.job import com.webank.wedatasphere.dss.appjoint.scheduler.entity.{SchedulerFlow, SchedulerNode} -import com.webank.wedatasphere.dss.common.entity.project.DWSProject +import com.webank.wedatasphere.dss.common.entity.project.DSSProject import com.webank.wedatasphere.dss.flow.execution.entrance.exception.FlowExecutionErrorException import com.webank.wedatasphere.dss.flow.execution.entrance.{FlowContext, FlowContextImpl} import com.webank.wedatasphere.dss.flow.execution.entrance.listener.NodeRunnerListener @@ -44,7 +44,7 @@ class FlowEntranceJob extends EntranceExecutionJob with NodeRunnerListener { private val flowContext: FlowContext = new FlowContextImpl - @BeanProperty var dwsProject: DWSProject = _ + @BeanProperty var dwsProject: DSSProject = _ def setFlow(flow: SchedulerFlow): Unit = this.flow = flow @@ -80,7 +80,7 @@ class FlowEntranceJob extends EntranceExecutionJob with NodeRunnerListener { override def onStatusChanged(fromState: NodeExecutionState, toState: NodeExecutionState, node: SchedulerNode): Unit = { - val nodeName = node.getDWSNode.getName + val nodeName = node.getDssNode.getName toState match { case NodeExecutionState.Failed => printLog(s"Failed to execute node($nodeName),prepare to kill flow job", "ERROR") diff --git a/dss-flow-execution-entrance/src/main/scala/com/webank/wedatasphere/dss/flow/execution/entrance/job/parser/FlowJobFlowParser.scala b/dss-flow-execution-entrance/src/main/scala/com/webank/wedatasphere/dss/flow/execution/entrance/job/parser/FlowJobFlowParser.scala index 5c5bf8ede..a088e146f 100644 --- a/dss-flow-execution-entrance/src/main/scala/com/webank/wedatasphere/dss/flow/execution/entrance/job/parser/FlowJobFlowParser.scala +++ b/dss-flow-execution-entrance/src/main/scala/com/webank/wedatasphere/dss/flow/execution/entrance/job/parser/FlowJobFlowParser.scala @@ -18,8 +18,8 @@ package com.webank.wedatasphere.dss.flow.execution.entrance.job.parser import com.webank.wedatasphere.dss.appjoint.scheduler.entity.{AbstractSchedulerProject, SchedulerFlow} -import com.webank.wedatasphere.dss.common.entity.project.DWSProject -import com.webank.wedatasphere.dss.common.protocol.RequestDWSProject +import com.webank.wedatasphere.dss.common.entity.project.DSSProject +import com.webank.wedatasphere.dss.common.protocol.RequestDSSProject import com.webank.wedatasphere.dss.flow.execution.entrance.conf.FlowExecutionEntranceConfiguration import com.webank.wedatasphere.dss.flow.execution.entrance.entity.FlowExecutionCode import com.webank.wedatasphere.dss.flow.execution.entrance.job.FlowEntranceJob @@ -52,8 +52,8 @@ class FlowJobFlowParser extends FlowEntranceJobParser with Logging { val code = flowEntranceJob.jobToExecuteRequest().code val flowExecutionCode = LinkisJobExecutionUtils.gson.fromJson(code, classOf[FlowExecutionCode]) - getDWSProjectByCode(flowExecutionCode) match { - case dwsProject: DWSProject => + getDSSProjectByCode(flowExecutionCode) match { + case dwsProject: DSSProject => val project = this.flowExecutionProjectParser.parseProject(dwsProject) @@ -76,8 +76,8 @@ class FlowJobFlowParser extends FlowEntranceJobParser with Logging { info(s"${flowEntranceJob.getId} finished to parse flow") } - private def getDWSProjectByCode(flowExecutionCode: FlowExecutionCode) = { - val req = new RequestDWSProject(flowExecutionCode.getFlowId, flowExecutionCode.getVersion, flowExecutionCode.getProjectVersionId) + private def getDSSProjectByCode(flowExecutionCode: FlowExecutionCode) = { + val req = new RequestDSSProject(flowExecutionCode.getFlowId, flowExecutionCode.getVersion, flowExecutionCode.getProjectVersionId) Sender.getSender(FlowExecutionEntranceConfiguration.SCHEDULER_APPLICATION.getValue).ask(req) } diff --git a/dss-flow-execution-entrance/src/main/scala/com/webank/wedatasphere/dss/flow/execution/entrance/job/parser/FlowJobNodeParser.scala b/dss-flow-execution-entrance/src/main/scala/com/webank/wedatasphere/dss/flow/execution/entrance/job/parser/FlowJobNodeParser.scala index 6447e45eb..2f18486fa 100644 --- a/dss-flow-execution-entrance/src/main/scala/com/webank/wedatasphere/dss/flow/execution/entrance/job/parser/FlowJobNodeParser.scala +++ b/dss-flow-execution-entrance/src/main/scala/com/webank/wedatasphere/dss/flow/execution/entrance/job/parser/FlowJobNodeParser.scala @@ -53,7 +53,7 @@ class FlowJobNodeParser extends FlowEntranceJobParser with Logging{ val nodeName = node.getName val propsMap = new util.HashMap[String, String]() - val proxyUser = if (node.getDWSNode.getUserProxy == null) flowEntranceJob.getUser else node.getDWSNode.getUserProxy + val proxyUser = if (node.getDssNode.getUserProxy == null) flowEntranceJob.getUser else node.getDssNode.getUserProxy propsMap.put(PROJECT_NAME, project.getName) propsMap.put(FLOW_NAME, flow.getName) propsMap.put(JOB_ID, nodeName) @@ -62,12 +62,12 @@ class FlowJobNodeParser extends FlowEntranceJobParser with Logging{ propsMap.put(LinkisJobExecutionConfiguration.LINKIS_TYPE, node.getNodeType) propsMap.put(PROXY_USER, proxyUser) - propsMap.put(COMMAND, LinkisJobExecutionUtils.gson.toJson(node.getDWSNode.getJobContent)) + propsMap.put(COMMAND, LinkisJobExecutionUtils.gson.toJson(node.getDssNode.getJobContent)) - var params = node.getDWSNode.getParams + var params = node.getDssNode.getParams if (params == null) { params = new util.HashMap[String,AnyRef]() - node.getDWSNode.setParams(params) + node.getDssNode.setParams(params) } val flowVar = new util.HashMap[String, AnyRef]() val properties = flow.getFlowProperties diff --git a/dss-flow-execution-entrance/src/main/scala/com/webank/wedatasphere/dss/flow/execution/entrance/node/AppJointJobBuilder.scala b/dss-flow-execution-entrance/src/main/scala/com/webank/wedatasphere/dss/flow/execution/entrance/node/AppJointJobBuilder.scala index 440e6a4aa..f8173adfb 100644 --- a/dss-flow-execution-entrance/src/main/scala/com/webank/wedatasphere/dss/flow/execution/entrance/node/AppJointJobBuilder.scala +++ b/dss-flow-execution-entrance/src/main/scala/com/webank/wedatasphere/dss/flow/execution/entrance/node/AppJointJobBuilder.scala @@ -139,12 +139,12 @@ object AppJointJobBuilder { } override protected def fillLinkisJobInfo(linkisJob: LinkisJob): Unit = { - this.node.getDWSNode.getParams.get(FlowExecutionEntranceConfiguration.NODE_CONFIGURATION_KEY) match { + this.node.getDssNode.getParams.get(FlowExecutionEntranceConfiguration.NODE_CONFIGURATION_KEY) match { case configuration:util.Map[String, AnyRef] => linkisJob.setConfiguration(configuration) case _ => } - this.node.getDWSNode.getParams.remove(FlowExecutionEntranceConfiguration.FLOW_VAR_MAP) match { + this.node.getDssNode.getParams.remove(FlowExecutionEntranceConfiguration.FLOW_VAR_MAP) match { case flowVar:util.Map[String, AnyRef] => linkisJob.setVariables(flowVar) case _ => @@ -153,13 +153,13 @@ object AppJointJobBuilder { } override protected def fillCommonLinkisJobInfo(linkisAppjointJob: CommonLinkisJob): Unit = { - linkisAppjointJob.setJobResourceList(FlowExecutionUtils.resourcesAdaptation(this.node.getDWSNode.getResources)) - this.node.getDWSNode.getParams.remove(FlowExecutionEntranceConfiguration.PROJECT_RESOURCES) match { + linkisAppjointJob.setJobResourceList(FlowExecutionUtils.resourcesAdaptation(this.node.getDssNode.getResources)) + this.node.getDssNode.getParams.remove(FlowExecutionEntranceConfiguration.PROJECT_RESOURCES) match { case projectResources:util.List[Resource] => linkisAppjointJob.setProjectResourceList(FlowExecutionUtils.resourcesAdaptation(projectResources)) case _ => } - this.node.getDWSNode.getParams.remove(FlowExecutionEntranceConfiguration.FLOW_RESOURCES) match { + this.node.getDssNode.getParams.remove(FlowExecutionEntranceConfiguration.FLOW_RESOURCES) match { case flowResources:util.HashMap[String, util.List[BMLResource]] => linkisAppjointJob.setFlowNameAndResources(flowResources) case _ => diff --git a/dss-flow-execution-entrance/src/main/scala/com/webank/wedatasphere/dss/flow/execution/entrance/node/DefaultNodeRunner.scala b/dss-flow-execution-entrance/src/main/scala/com/webank/wedatasphere/dss/flow/execution/entrance/node/DefaultNodeRunner.scala index ad2526f03..fbd13c849 100644 --- a/dss-flow-execution-entrance/src/main/scala/com/webank/wedatasphere/dss/flow/execution/entrance/node/DefaultNodeRunner.scala +++ b/dss-flow-execution-entrance/src/main/scala/com/webank/wedatasphere/dss/flow/execution/entrance/node/DefaultNodeRunner.scala @@ -103,7 +103,7 @@ class DefaultNodeRunner extends NodeRunner with Logging { override def run(): Unit = { info(s"start to run node of ${node.getName}") try { - val jobProps = node.getDWSNode.getParams.remove(FlowExecutionEntranceConfiguration.PROPS_MAP) match { + val jobProps = node.getDssNode.getParams.remove(FlowExecutionEntranceConfiguration.PROPS_MAP) match { case propsMap: util.Map[String, String] => propsMap case _ => new util.HashMap[String, String]() } diff --git a/dss-linkis-node-execution/pom.xml b/dss-linkis-node-execution/pom.xml index 29fd8ae27..0e8eb4e82 100644 --- a/dss-linkis-node-execution/pom.xml +++ b/dss-linkis-node-execution/pom.xml @@ -24,7 +24,7 @@ dss com.webank.wedatasphere.dss - 0.8.0 + 0.9.0 dss-linkis-node-execution diff --git a/dss-scheduler-appjoint-core/pom.xml b/dss-scheduler-appjoint-core/pom.xml index 42a5bc856..979a90903 100644 --- a/dss-scheduler-appjoint-core/pom.xml +++ b/dss-scheduler-appjoint-core/pom.xml @@ -22,7 +22,7 @@ dss com.webank.wedatasphere.dss - 0.8.0 + 0.9.0 4.0.0 diff --git a/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/entity/AbstractSchedulerNode.java b/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/entity/AbstractSchedulerNode.java index 167d61fda..a5139d7d9 100644 --- a/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/entity/AbstractSchedulerNode.java +++ b/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/entity/AbstractSchedulerNode.java @@ -17,7 +17,7 @@ package com.webank.wedatasphere.dss.appjoint.scheduler.entity; -import com.webank.wedatasphere.dss.common.entity.node.DWSNode; +import com.webank.wedatasphere.dss.common.entity.node.DSSNode; import java.util.List; @@ -26,65 +26,65 @@ */ public abstract class AbstractSchedulerNode implements SchedulerNode { - private DWSNode dwsNode; + private DSSNode dssNode; @Override - public DWSNode getDWSNode() { - return this.dwsNode; + public DSSNode getDssNode() { + return this.dssNode; } @Override - public void setDWSNode(DWSNode dwsNode) { - this.dwsNode = dwsNode; + public void setDssNode(DSSNode dssNode) { + this.dssNode = dssNode; } @Override public String getId() { - return dwsNode.getId(); + return dssNode.getId(); } @Override public void setId(String id) { - dwsNode.setId(id); + dssNode.setId(id); } @Override public String getNodeType() { - return dwsNode.getNodeType(); + return dssNode.getNodeType(); } @Override public void setNodeType(String nodeType) { - dwsNode.setNodeType(nodeType); + dssNode.setNodeType(nodeType); } @Override public String getName() { - return dwsNode.getName(); + return dssNode.getName(); } @Override public void setName(String name) { - dwsNode.setName(name); + dssNode.setName(name); } @Override public void addDependency(String nodeName) { - dwsNode.addDependency(nodeName); + dssNode.addDependency(nodeName); } @Override public void setDependency(List dependency) { - dwsNode.setDependency(dependency); + dssNode.setDependency(dependency); } @Override public void removeDependency(String nodeName) { - dwsNode.removeDependency(nodeName); + dssNode.removeDependency(nodeName); } @Override public List getDependencys() { - return dwsNode.getDependencys(); + return dssNode.getDependencys(); } } diff --git a/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/entity/AbstractSchedulerProject.java b/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/entity/AbstractSchedulerProject.java index 6cfd51647..3a8ad55eb 100644 --- a/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/entity/AbstractSchedulerProject.java +++ b/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/entity/AbstractSchedulerProject.java @@ -17,7 +17,7 @@ package com.webank.wedatasphere.dss.appjoint.scheduler.entity; -import com.webank.wedatasphere.dss.common.entity.project.DWSProject; +import com.webank.wedatasphere.dss.common.entity.project.DSSProject; import com.webank.wedatasphere.dss.common.entity.project.ProjectVersion; import java.util.List; @@ -32,7 +32,7 @@ public abstract class AbstractSchedulerProject implements SchedulerProject { private String name; private String description; - private DWSProject dwsProject; + private DSSProject dssProject; private List schedulerFlows; private List projectVersions; @@ -101,12 +101,12 @@ public void addProjectVersion(ProjectVersion projectVersion) { } @Override - public DWSProject getDWSProject() { - return this.dwsProject; + public DSSProject getDssProject() { + return this.dssProject; } @Override - public void setDWSProject(DWSProject dwsProject) { - this.dwsProject = dwsProject; + public void setDssProject(DSSProject dssProject) { + this.dssProject = dssProject; } } diff --git a/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/entity/SchedulerEdge.java b/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/entity/SchedulerEdge.java index 582f0a4fb..aee1e7229 100644 --- a/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/entity/SchedulerEdge.java +++ b/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/entity/SchedulerEdge.java @@ -17,13 +17,13 @@ package com.webank.wedatasphere.dss.appjoint.scheduler.entity; -import com.webank.wedatasphere.dss.common.entity.node.DWSEdge; +import com.webank.wedatasphere.dss.common.entity.node.DSSEdge; /** * Created by enjoyyin on 2019/9/7. */ public interface SchedulerEdge { - DWSEdge getDWSEdge(); + DSSEdge getDssEdge(); - void setDWSEdge(DWSEdge dwsEdge); + void setDssEdge(DSSEdge dssEdge); } diff --git a/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/entity/SchedulerEdgeDefault.java b/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/entity/SchedulerEdgeDefault.java index b9f9fb960..db663fe54 100644 --- a/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/entity/SchedulerEdgeDefault.java +++ b/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/entity/SchedulerEdgeDefault.java @@ -17,22 +17,22 @@ package com.webank.wedatasphere.dss.appjoint.scheduler.entity; -import com.webank.wedatasphere.dss.common.entity.node.DWSEdge; +import com.webank.wedatasphere.dss.common.entity.node.DSSEdge; /** * Created by allenlliu on 2019/9/19. */ public class SchedulerEdgeDefault implements SchedulerEdge { - private DWSEdge dwsEdge; + private DSSEdge dssEdge; @Override - public DWSEdge getDWSEdge() { - return dwsEdge; + public DSSEdge getDssEdge() { + return dssEdge; } @Override - public void setDWSEdge(DWSEdge dwsEdge) { - this.dwsEdge = dwsEdge; + public void setDssEdge(DSSEdge dssEdge) { + this.dssEdge = dssEdge; } } diff --git a/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/entity/SchedulerNode.java b/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/entity/SchedulerNode.java index 1d756efdd..612c2e25d 100644 --- a/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/entity/SchedulerNode.java +++ b/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/entity/SchedulerNode.java @@ -18,14 +18,14 @@ package com.webank.wedatasphere.dss.appjoint.scheduler.entity; -import com.webank.wedatasphere.dss.common.entity.node.DWSNode; +import com.webank.wedatasphere.dss.common.entity.node.DSSNode; import com.webank.wedatasphere.dss.common.entity.node.Node; /** * Created by enjoyyin on 2019/9/7. */ public interface SchedulerNode extends Node { - DWSNode getDWSNode(); + DSSNode getDssNode(); - void setDWSNode(DWSNode dwsNode); + void setDssNode(DSSNode dssNode); } diff --git a/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/entity/SchedulerProject.java b/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/entity/SchedulerProject.java index ca3d8362e..d4158b0f4 100644 --- a/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/entity/SchedulerProject.java +++ b/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/entity/SchedulerProject.java @@ -17,13 +17,13 @@ package com.webank.wedatasphere.dss.appjoint.scheduler.entity; -import com.webank.wedatasphere.dss.common.entity.project.DWSProject; +import com.webank.wedatasphere.dss.common.entity.project.DSSProject; import com.webank.wedatasphere.dss.common.entity.project.Project; /** * Created by enjoyyin on 2019/9/16. */ public interface SchedulerProject extends Project { - DWSProject getDWSProject(); - void setDWSProject(DWSProject dwsProject); + DSSProject getDssProject(); + void setDssProject(DSSProject dssProject); } diff --git a/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/parser/AbstractFlowParser.java b/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/parser/AbstractFlowParser.java index 546cb32ed..96a9f2aed 100644 --- a/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/parser/AbstractFlowParser.java +++ b/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/parser/AbstractFlowParser.java @@ -27,12 +27,12 @@ import com.webank.wedatasphere.dss.appjoint.scheduler.entity.SchedulerNode; import com.webank.wedatasphere.dss.common.entity.Resource; import com.webank.wedatasphere.dss.appjoint.scheduler.entity.SchedulerFlow; -import com.webank.wedatasphere.dss.common.entity.flow.DWSJSONFlow; +import com.webank.wedatasphere.dss.common.entity.flow.DSSJSONFlow; import com.webank.wedatasphere.dss.common.entity.flow.Flow; -import com.webank.wedatasphere.dss.common.entity.node.DWSEdge; -import com.webank.wedatasphere.dss.common.entity.node.DWSEdgeDefault; -import com.webank.wedatasphere.dss.common.entity.node.DWSNode; -import com.webank.wedatasphere.dss.common.entity.node.DWSNodeDefault; +import com.webank.wedatasphere.dss.common.entity.node.DSSEdge; +import com.webank.wedatasphere.dss.common.entity.node.DSSEdgeDefault; +import com.webank.wedatasphere.dss.common.entity.node.DSSNode; +import com.webank.wedatasphere.dss.common.entity.node.DSSNodeDefault; import org.springframework.beans.BeanUtils; import java.util.*; @@ -64,39 +64,39 @@ protected void dealFlowResources(){} protected void dealFlowProperties(Flow flow){} @Override - public SchedulerFlow parseFlow(DWSJSONFlow flow) { + public SchedulerFlow parseFlow(DSSJSONFlow flow) { downloadFlowResources(); dealFlowResources(); dealFlowProperties(flow); - return resolveDWSJSONFlow(flow); + return resolveDSSJSONFlow(flow); } - // 解析DWSJSONFlow,生成DWSNode - public SchedulerFlow resolveDWSJSONFlow(DWSJSONFlow jsonFlow){ + // 解析DSSJSONFlow,生成DSSNode + public SchedulerFlow resolveDSSJSONFlow(DSSJSONFlow jsonFlow){ SchedulerFlow schedulerFlow = createSchedulerFlow(); BeanUtils.copyProperties(jsonFlow,schedulerFlow,"children"); JsonParser parser = new JsonParser(); JsonObject jsonObject = parser.parse(jsonFlow.getJson()).getAsJsonObject(); JsonArray nodeJsonArray = jsonObject.getAsJsonArray("nodes"); Gson gson = new Gson(); - List dwsNodes = gson.fromJson(nodeJsonArray, new TypeToken>() { + List dssNodes = gson.fromJson(nodeJsonArray, new TypeToken>() { }.getType()); List schedulerNodeList = new ArrayList<>(); List schedulerEdgeList = new ArrayList<>(); - for (DWSNode dwsNode : dwsNodes) { + for (DSSNode dssNode : dssNodes) { Optional firstNodeParser = Arrays.stream(getNodeParsers()) - .filter(p -> p.ifNodeCanParse(dwsNode)) + .filter(p -> p.ifNodeCanParse(dssNode)) .sorted((p1, p2) -> p2.getOrder() - p1.getOrder()) .findFirst(); - SchedulerNode schedulerNode = firstNodeParser.orElseThrow(()->new IllegalArgumentException("NodeParser个数应该大于0")).parseNode(dwsNode); + SchedulerNode schedulerNode = firstNodeParser.orElseThrow(()->new IllegalArgumentException("NodeParser个数应该大于0")).parseNode(dssNode); schedulerNodeList.add(schedulerNode); } JsonArray edgeJsonArray = jsonObject.getAsJsonArray("edges"); - List dwsEdges = gson.fromJson(edgeJsonArray, new TypeToken>() { + List dssEdges = gson.fromJson(edgeJsonArray, new TypeToken>() { }.getType()); - for (DWSEdge dwsEdge : dwsEdges) { + for (DSSEdge dssEdge : dssEdges) { SchedulerEdge schedulerEdge = new SchedulerEdgeDefault(); - schedulerEdge.setDWSEdge(dwsEdge); + schedulerEdge.setDssEdge(dssEdge); schedulerEdgeList.add(schedulerEdge); } diff --git a/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/parser/AbstractProjectParser.java b/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/parser/AbstractProjectParser.java index 27ef1c1c2..a7d481d24 100644 --- a/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/parser/AbstractProjectParser.java +++ b/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/parser/AbstractProjectParser.java @@ -21,10 +21,10 @@ import com.webank.wedatasphere.dss.appjoint.scheduler.entity.SchedulerProjectVersionForFlows; import com.webank.wedatasphere.dss.appjoint.scheduler.entity.SchedulerFlow; import com.webank.wedatasphere.dss.appjoint.scheduler.entity.SchedulerProject; -import com.webank.wedatasphere.dss.common.entity.flow.DWSFlow; -import com.webank.wedatasphere.dss.common.entity.flow.DWSJSONFlow; -import com.webank.wedatasphere.dss.common.entity.project.DWSJSONProject; -import com.webank.wedatasphere.dss.common.entity.project.DWSProject; +import com.webank.wedatasphere.dss.common.entity.flow.DSSFlow; +import com.webank.wedatasphere.dss.common.entity.flow.DSSJSONFlow; +import com.webank.wedatasphere.dss.common.entity.project.DSSProject; +import com.webank.wedatasphere.dss.common.entity.project.DSSJSONProject; import com.webank.wedatasphere.dss.common.entity.project.ProjectVersionForFlows; import org.springframework.beans.BeanUtils; @@ -50,27 +50,27 @@ public FlowParser[] getFlowParsers() { return flowParsers; } - public DWSJSONProject parseToDWSJSONProject(DWSProject dwsProject){ - DWSJSONProject dwsjsonProject = new DWSJSONProject(); - BeanUtils.copyProperties(dwsProject,dwsjsonProject,"flows","projectVersions"); - List extends DWSFlow> dwsFlows = dwsProject.getFlows(); - List dwsjsonFlows = dwsFlows.stream().map(this::toDWSJsonFlow).collect(Collectors.toList()); - dwsjsonProject.setFlows(dwsjsonFlows); - return dwsjsonProject; + public DSSJSONProject parseToDssJsonProject(DSSProject dssProject){ + DSSJSONProject dssJsonProject = new DSSJSONProject(); + BeanUtils.copyProperties(dssProject, dssJsonProject,"flows","projectVersions"); + List extends DSSFlow> dwsFlows = dssProject.getFlows(); + List dssJsonFlows = dwsFlows.stream().map(this::toDssJsonFlow).collect(Collectors.toList()); + dssJsonProject.setFlows(dssJsonFlows); + return dssJsonProject; } - private DWSJSONFlow toDWSJsonFlow(DWSFlow dwsFlow){ - DWSJSONFlow dwsjsonFlow = new DWSJSONFlow(); - BeanUtils.copyProperties(dwsFlow,dwsjsonFlow,"children","flowVersions"); - dwsjsonFlow.setJson(dwsFlow.getLatestVersion().getJson()); - if(dwsFlow.getChildren() != null){ - dwsjsonFlow.setChildren(dwsFlow.getChildren().stream().map(this::toDWSJsonFlow).collect(Collectors.toList())); + private DSSJSONFlow toDssJsonFlow(DSSFlow dssFlow){ + DSSJSONFlow dssJsonFlow = new DSSJSONFlow(); + BeanUtils.copyProperties(dssFlow, dssJsonFlow,"children","flowVersions"); + dssJsonFlow.setJson(dssFlow.getLatestVersion().getJson()); + if(dssFlow.getChildren() != null){ + dssJsonFlow.setChildren(dssFlow.getChildren().stream().map(this::toDssJsonFlow).collect(Collectors.toList())); } - return dwsjsonFlow; + return dssJsonFlow; } - public SchedulerProject parseProject(DWSJSONProject project){ + public SchedulerProject parseProject(DSSJSONProject project){ AbstractSchedulerProject schedulerProject = createSchedulerProject(); SchedulerProjectVersionForFlows projectVersionForFlows = new SchedulerProjectVersionForFlows(); schedulerProject.setProjectVersions(new ArrayList()); @@ -81,23 +81,23 @@ public SchedulerProject parseProject(DWSJSONProject project){ return schedulerProject; } - private SchedulerFlow invokeFlowParser(ProjectVersionForFlows projectVersionForFlows, DWSJSONFlow dwsjsonFlow, FlowParser[] flowParsers){ - List flowParsersF = Arrays.stream(flowParsers).filter(f -> f.ifFlowCanParse(dwsjsonFlow)).collect(Collectors.toList()); + private SchedulerFlow invokeFlowParser(ProjectVersionForFlows projectVersionForFlows, DSSJSONFlow dssJsonFlow, FlowParser[] flowParsers){ + List flowParsersF = Arrays.stream(flowParsers).filter(f -> f.ifFlowCanParse(dssJsonFlow)).collect(Collectors.toList()); // TODO: 2019/9/25 如果flowParsers数量>1 ||<=0抛出异常 - SchedulerFlow schedulerFlow = flowParsersF.get(0).parseFlow(dwsjsonFlow); + SchedulerFlow schedulerFlow = flowParsersF.get(0).parseFlow(dssJsonFlow); //收集所有的不分层级的flow? projectVersionForFlows.addFlow(schedulerFlow); - if(dwsjsonFlow.getChildren() != null){ - List schedulerFlows = dwsjsonFlow.getChildren().stream().map(f -> invokeFlowParser(projectVersionForFlows,f, flowParsers)).collect(Collectors.toList()); + if(dssJsonFlow.getChildren() != null){ + List schedulerFlows = dssJsonFlow.getChildren().stream().map(f -> invokeFlowParser(projectVersionForFlows,f, flowParsers)).collect(Collectors.toList()); schedulerFlow.setChildren(schedulerFlows); } return schedulerFlow; } @Override - public SchedulerProject parseProject(DWSProject dwsProject) { - SchedulerProject schedulerProject = parseProject(parseToDWSJSONProject(dwsProject)); - schedulerProject.setDWSProject(dwsProject); + public SchedulerProject parseProject(DSSProject dssProject) { + SchedulerProject schedulerProject = parseProject(parseToDssJsonProject(dssProject)); + schedulerProject.setDssProject(dssProject); return schedulerProject; } diff --git a/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/parser/AbstractReadNodeParser.java b/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/parser/AbstractReadNodeParser.java index 6cd767f72..68e8d970e 100644 --- a/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/parser/AbstractReadNodeParser.java +++ b/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/parser/AbstractReadNodeParser.java @@ -18,7 +18,7 @@ package com.webank.wedatasphere.dss.appjoint.scheduler.parser; import com.webank.wedatasphere.dss.appjoint.scheduler.entity.SchedulerNode; -import com.webank.wedatasphere.dss.common.entity.node.DWSNode; +import com.webank.wedatasphere.dss.common.entity.node.DSSNode; import com.webank.wedatasphere.dss.appjoint.scheduler.entity.ReadNode; import java.util.Arrays; @@ -32,7 +32,7 @@ public abstract class AbstractReadNodeParser implements ContextNodeParser { @Override public String[] getShareNodeIds(SchedulerNode node) { //需根据节点的参数进行解析生成 - Map jobParams = node.getDWSNode().getParams(); + Map jobParams = node.getDssNode().getParams(); if(jobParams == null) return null; Map configuration =(Map) jobParams.get("configuration"); Map runtime = (Map) configuration.get("runtime"); @@ -57,16 +57,16 @@ public void setReadNodeContext(SchedulerNode node) { @Override public ReadNode parseNode(SchedulerNode node) { ReadNode readNode = createReadNode(); - readNode.setDWSNode(node.getDWSNode()); + readNode.setDssNode(node.getDssNode()); readNode.setSchedulerNode(node); readNode.setShareNodeIds(getShareNodeIds(node)); return readNode; } @Override - public SchedulerNode parseNode(DWSNode dwsNode) { + public SchedulerNode parseNode(DSSNode dssNode) { SchedulerNode schedulerNode = createSchedulerNode(); - schedulerNode.setDWSNode(dwsNode); + schedulerNode.setDssNode(dssNode); return parseNode(schedulerNode); } diff --git a/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/parser/FlowParser.java b/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/parser/FlowParser.java index b6b49897c..85369debc 100644 --- a/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/parser/FlowParser.java +++ b/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/parser/FlowParser.java @@ -19,18 +19,18 @@ import com.webank.wedatasphere.dss.appjoint.scheduler.entity.SchedulerFlow; -import com.webank.wedatasphere.dss.common.entity.flow.DWSJSONFlow; +import com.webank.wedatasphere.dss.common.entity.flow.DSSJSONFlow; /** * Created by enjoyyin on 2019/9/7. */ public interface FlowParser { - SchedulerFlow parseFlow(DWSJSONFlow flow); + SchedulerFlow parseFlow(DSSJSONFlow flow); void setNodeParsers(NodeParser[] nodeParsers); NodeParser[] getNodeParsers(); - Boolean ifFlowCanParse(DWSJSONFlow flow); + Boolean ifFlowCanParse(DSSJSONFlow flow); } diff --git a/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/parser/NodeParser.java b/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/parser/NodeParser.java index 602d38623..ebba917a1 100644 --- a/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/parser/NodeParser.java +++ b/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/parser/NodeParser.java @@ -18,14 +18,14 @@ package com.webank.wedatasphere.dss.appjoint.scheduler.parser; import com.webank.wedatasphere.dss.appjoint.scheduler.entity.SchedulerNode; -import com.webank.wedatasphere.dss.common.entity.node.DWSNode; +import com.webank.wedatasphere.dss.common.entity.node.DSSNode; import com.webank.wedatasphere.dss.appjoint.scheduler.order.Order; /** * Created by enjoyyin on 2019/9/7. */ public interface NodeParser extends Order { - SchedulerNode parseNode(DWSNode dwsNode); + SchedulerNode parseNode(DSSNode dssNode); - Boolean ifNodeCanParse(DWSNode dwsNode); + Boolean ifNodeCanParse(DSSNode dssNode); } diff --git a/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/parser/ProjectParser.java b/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/parser/ProjectParser.java index 13ffd4362..db00db311 100644 --- a/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/parser/ProjectParser.java +++ b/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/parser/ProjectParser.java @@ -18,13 +18,13 @@ package com.webank.wedatasphere.dss.appjoint.scheduler.parser; import com.webank.wedatasphere.dss.appjoint.scheduler.entity.SchedulerProject; -import com.webank.wedatasphere.dss.common.entity.project.DWSProject; +import com.webank.wedatasphere.dss.common.entity.project.DSSProject; /** * Created by enjoyyin on 2019/9/16. */ public interface ProjectParser { - SchedulerProject parseProject(DWSProject dwsProject); + SchedulerProject parseProject(DSSProject dssProject); void setFlowParsers(FlowParser[] flowParser); FlowParser[] getFlowParsers(); diff --git a/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/parser/SendEmailNodeParser.java b/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/parser/SendEmailNodeParser.java index f4511a8d3..1bd3606f0 100644 --- a/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/parser/SendEmailNodeParser.java +++ b/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/parser/SendEmailNodeParser.java @@ -18,7 +18,7 @@ package com.webank.wedatasphere.dss.appjoint.scheduler.parser; import com.webank.wedatasphere.dss.appjoint.scheduler.constant.SchedulerAppJointConstant; -import com.webank.wedatasphere.dss.common.entity.node.DWSNode; +import com.webank.wedatasphere.dss.common.entity.node.DSSNode; import java.util.Map; @@ -28,9 +28,9 @@ public abstract class SendEmailNodeParser extends AbstractReadNodeParser { @Override - public Boolean ifNodeCanParse(DWSNode dwsNode) { + public Boolean ifNodeCanParse(DSSNode dssNode) { //判断是sendemail 并且category是node - Map params = dwsNode.getParams(); + Map params = dssNode.getParams(); if(params != null && !params.isEmpty()){ Object configuration = params.get(SchedulerAppJointConstant.CONFIGURATION); if(configuration instanceof Map){ @@ -38,7 +38,7 @@ public Boolean ifNodeCanParse(DWSNode dwsNode) { if(runtime instanceof Map){ Object category = ((Map) runtime).get(SchedulerAppJointConstant.CATEGORY); if(category != null && SchedulerAppJointConstant.NODE.equals(category.toString())){ - return SchedulerAppJointConstant.SENDEMAIL_NODE_TYPE.equals(dwsNode.getNodeType()); + return SchedulerAppJointConstant.SENDEMAIL_NODE_TYPE.equals(dssNode.getNodeType()); } } } diff --git a/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/tuning/AbstractFlowTuning.java b/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/tuning/AbstractFlowTuning.java index f55ca135c..42423a69d 100644 --- a/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/tuning/AbstractFlowTuning.java +++ b/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/tuning/AbstractFlowTuning.java @@ -75,8 +75,8 @@ private void setDependencies(SchedulerNode node,List schedulerNod private List resolveDependencys(SchedulerNode node,List schedulerNodes, List flowEdges) { List dependencys = new ArrayList<>(); flowEdges.forEach(edge -> { - if (edge.getDWSEdge().getTarget().equals(node.getId())) { - dependencys.add(schedulerNodes.stream().filter(n ->edge.getDWSEdge().getSource().equals(n.getId())).findFirst().get().getName()); + if (edge.getDssEdge().getTarget().equals(node.getId())) { + dependencys.add(schedulerNodes.stream().filter(n ->edge.getDssEdge().getSource().equals(n.getId())).findFirst().get().getName()); } }); @@ -112,7 +112,7 @@ private String getProxyUser(SchedulerFlow schedulerFlow) { private void setProxyUser(SchedulerFlow schedulerFlow) { String proxyUser = getProxyUser(schedulerFlow); if(StringUtils.isNotBlank(proxyUser)) { - schedulerFlow.getSchedulerNodes().forEach(node -> node.getDWSNode().setUserProxy(proxyUser)); + schedulerFlow.getSchedulerNodes().forEach(node -> node.getDssNode().setUserProxy(proxyUser)); schedulerFlow.setUserProxy(proxyUser); } } diff --git a/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/tuning/AbstractShareNodeFlowTuning.java b/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/tuning/AbstractShareNodeFlowTuning.java index 7a1cb8bce..81dc0d5d3 100644 --- a/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/tuning/AbstractShareNodeFlowTuning.java +++ b/dss-scheduler-appjoint-core/src/main/java/com/webank/wedatasphere/dss/appjoint/scheduler/tuning/AbstractShareNodeFlowTuning.java @@ -83,7 +83,7 @@ public Map getShareNodes(SchedulerFlow flow, ReadNode[] read if(schedulerNode != null) { int shareTimes = (nameAndNumMap.get(key)).intValue(); ShareNode shareNode = createShareNode(); - shareNode.setDWSNode(schedulerNode.getDWSNode()); + shareNode.setDssNode(schedulerNode.getDssNode()); shareNode.setSchedulerNode(schedulerNode); shareNode.setShareTimes(shareTimes); res.put(shareNode, shareTimes); diff --git a/dss-server/pom.xml b/dss-server/pom.xml index 4408aa02d..c3ec0ed38 100644 --- a/dss-server/pom.xml +++ b/dss-server/pom.xml @@ -22,7 +22,7 @@ dss com.webank.wedatasphere.dss - 0.8.0 + 0.9.0 4.0.0 @@ -145,7 +145,7 @@ com.webank.wedatasphere.dss dss-scheduler-appjoint-core - 0.8.0 + 0.9.0 diff --git a/dss-server/src/main/assembly/distribution.xml b/dss-server/src/main/assembly/distribution.xml index cba104e83..0c7f789ee 100644 --- a/dss-server/src/main/assembly/distribution.xml +++ b/dss-server/src/main/assembly/distribution.xml @@ -41,16 +41,16 @@ aopalliance:aopalliance:jar asm:asm:jar cglib:cglib:jar - com.amazonaws:aws-java-sdk-autoscaling:jar - com.amazonaws:aws-java-sdk-core:jar - com.amazonaws:aws-java-sdk-ec2:jar - com.amazonaws:aws-java-sdk-route53:jar - com.amazonaws:aws-java-sdk-sts:jar - com.amazonaws:jmespath-java:jar + + + + + + com.fasterxml.jackson.core:jackson-annotations:jar com.fasterxml.jackson.core:jackson-core:jar com.fasterxml.jackson.core:jackson-databind:jar - com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:jar + com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar @@ -281,7 +281,7 @@ org.springframework:spring-webmvc:jar org.tukaani:xz:jar org.yaml:snakeyaml:jar - software.amazon.ion:ion-java:jar + xerces:xercesImpl:jar xmlenc:xmlenc:jar xmlpull:xmlpull:jar diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/constant/DSSServerConstant.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/constant/DSSServerConstant.java index 3aebc8592..95ab68308 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/constant/DSSServerConstant.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/constant/DSSServerConstant.java @@ -19,12 +19,13 @@ public class DSSServerConstant { - public static final String DWS_PROJECT_FIRST_VERSION = "v000001"; - public static final String DWS_PROJECT_FIRST_VERSION_COMMENT = "first version"; - public static final String DWS_PROJECT_SOURCE = "create by user"; + public static final String DSS_PROJECT_FIRST_VERSION = "v000001"; + public static final String DSS_PROJECT_FIRST_VERSION_COMMENT = "first version"; + public static final String DSS_PROJECT_SOURCE = "create by user"; + public static final String DSS_WORKSPACE_SOURCE = "create by user"; public static final String PROJECT_VERSION_ID = "projectVersionID"; public static final String PUBLISH_FLOW_REPORT_FORMATE = "工作流名:%s,版本号:%s,工作流内容为空,请自行修改或者删除"; - public static final String EMVEDDEDFLOWID ="\"embeddedFlowId\":" ; + public static final String EMVEDDEDFLOWID = "\"embeddedFlowId\":"; public static final String VERSION_FORMAT = "%06d"; public static final String VERSION_PREFIX = "v"; } diff --git a/dss-application/src/main/java/com/webank/wedatasphere/dss/application/dao/DSSUserMapper.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/DSSUserMapper.java similarity index 86% rename from dss-application/src/main/java/com/webank/wedatasphere/dss/application/dao/DSSUserMapper.java rename to dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/DSSUserMapper.java index fe81ae46a..31d4974e1 100644 --- a/dss-application/src/main/java/com/webank/wedatasphere/dss/application/dao/DSSUserMapper.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/DSSUserMapper.java @@ -15,14 +15,15 @@ * */ -package com.webank.wedatasphere.dss.application.dao; +package com.webank.wedatasphere.dss.server.dao; import com.webank.wedatasphere.dss.application.entity.DSSUser; -/** - * Created by chaogefeng on 2019/10/11. - */ public interface DSSUserMapper { + Long getUserID(String userName); + + String getuserName(Long userID); + DSSUser getUserByName(String username); void registerDSSUser(DSSUser userDb); diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/FlowMapper.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/FlowMapper.java index 52fa6fb2b..ea830d7cf 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/FlowMapper.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/FlowMapper.java @@ -18,8 +18,8 @@ package com.webank.wedatasphere.dss.server.dao; -import com.webank.wedatasphere.dss.common.entity.flow.DWSFlow; -import com.webank.wedatasphere.dss.common.entity.flow.DWSFlowVersion; +import com.webank.wedatasphere.dss.common.entity.flow.DSSFlow; +import com.webank.wedatasphere.dss.common.entity.flow.DSSFlowVersion; import org.apache.ibatis.annotations.Param; import org.springframework.dao.DuplicateKeyException; @@ -27,23 +27,23 @@ public interface FlowMapper { - DWSFlow selectFlowByID(Long id); + DSSFlow selectFlowByID(Long id); - List listFlowByTaxonomyID(@Param("projectID") Long projectID, @Param("taxonomyID") Long taxonomyID, @Param("isRootFlow") Boolean isRootFlow); + List listFlowByTaxonomyID(@Param("projectID") Long projectID, @Param("taxonomyID") Long taxonomyID, @Param("isRootFlow") Boolean isRootFlow); - List listFlowVersionsByFlowID(@Param("flowID") Long flowID, @Param("projectVersionID") Long projectVersionID); + List listFlowVersionsByFlowID(@Param("flowID") Long flowID, @Param("projectVersionID") Long projectVersionID); - void insertFlow(DWSFlow dwsFlow) throws DuplicateKeyException; + void insertFlow(DSSFlow dssFlow) throws DuplicateKeyException; - void insertFlowVersion(DWSFlowVersion version); + void insertFlowVersion(DSSFlowVersion version); - void batchInsertFlowVersion(@Param("flowVersions") List flowVersions); + void batchInsertFlowVersion(@Param("flowVersions") List flowVersions); void insertFlowRelation(@Param("flowID") Long flowID, @Param("parentFlowID") Long parentFlowID); - DWSFlowVersion selectVersionByFlowID(@Param("flowID") Long flowID, @Param("version") String version, @Param("projectVersionID") Long projectVersionID); + DSSFlowVersion selectVersionByFlowID(@Param("flowID") Long flowID, @Param("version") String version, @Param("projectVersionID") Long projectVersionID); - void updateFlowBaseInfo(DWSFlow dwsFlow) throws DuplicateKeyException; + void updateFlowBaseInfo(DSSFlow dssFlow) throws DuplicateKeyException; List selectSubFlowIDByParentFlowID(Long parentFlowID); @@ -55,17 +55,17 @@ public interface FlowMapper { Long selectParentFlowIDByFlowID(Long flowID); - List listFlowByProjectID(Long projectID); + List listFlowByProjectID(Long projectID); - List listVersionByFlowIDAndProjectVersionID(@Param("flowID") Long flowID, @Param("projectVersionID") Long projectVersionID); + List listVersionByFlowIDAndProjectVersionID(@Param("flowID") Long flowID, @Param("projectVersionID") Long projectVersionID); Boolean noVersions(Long flowID); - List listLastFlowVersionsByProjectVersionID(@Param("projectVersionID") Long projectVersionId); + List listLastFlowVersionsByProjectVersionID(@Param("projectVersionID") Long projectVersionId); - List listLatestRootFlowVersionByProjectVersionID(Long projectVersionID); + List listLatestRootFlowVersionByProjectVersionID(Long projectVersionID); - void batchUpdateFlowVersion(List flowVersions); + void batchUpdateFlowVersion(List flowVersions); Long getParentFlowID(Long flowID); } diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/FlowTaxonomyMapper.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/FlowTaxonomyMapper.java index f5c3dc1ec..640e8b7d0 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/FlowTaxonomyMapper.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/FlowTaxonomyMapper.java @@ -18,7 +18,7 @@ package com.webank.wedatasphere.dss.server.dao; -import com.webank.wedatasphere.dss.server.entity.DWSFlowTaxonomy; +import com.webank.wedatasphere.dss.server.entity.DSSFlowTaxonomy; import org.apache.ibatis.annotations.Param; import org.springframework.dao.DuplicateKeyException; @@ -26,11 +26,11 @@ public interface FlowTaxonomyMapper { - DWSFlowTaxonomy selectFlowTaxonomyByID(Long id); + DSSFlowTaxonomy selectFlowTaxonomyByID(Long id); - void insertFlowTaxonomy(DWSFlowTaxonomy dwsFlowTaxonomy) throws DuplicateKeyException; + void insertFlowTaxonomy(DSSFlowTaxonomy dssFlowTaxonomy) throws DuplicateKeyException; - void updateFlowTaxonomy(DWSFlowTaxonomy dwsFlowTaxonomy) throws DuplicateKeyException; + void updateFlowTaxonomy(DSSFlowTaxonomy dssFlowTaxonomy) throws DuplicateKeyException; Long hasFlows(Long flowTaxonomyID); @@ -47,5 +47,5 @@ public interface FlowTaxonomyMapper { void deleteFlowTaxonomyByProjectID(Long projectID); - List listFlowTaxonomyByProjectID(Long projectID); + List listFlowTaxonomyByProjectID(Long projectID); } diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/ProjectMapper.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/ProjectMapper.java index b5757d1f8..c2ae56786 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/ProjectMapper.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/ProjectMapper.java @@ -18,9 +18,9 @@ package com.webank.wedatasphere.dss.server.dao; -import com.webank.wedatasphere.dss.common.entity.project.DWSProject; -import com.webank.wedatasphere.dss.common.entity.project.DWSProjectPublishHistory; -import com.webank.wedatasphere.dss.common.entity.project.DWSProjectVersion; +import com.webank.wedatasphere.dss.common.entity.project.DSSProject; +import com.webank.wedatasphere.dss.common.entity.project.DSSProjectPublishHistory; +import com.webank.wedatasphere.dss.common.entity.project.DSSProjectVersion; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -28,19 +28,19 @@ public interface ProjectMapper { - DWSProject selectProjectByID(Long id); + DSSProject selectProjectByID(Long id); - DWSProjectVersion selectLatestVersionByProjectID(Long projectID); + DSSProjectVersion selectLatestVersionByProjectID(Long projectID); - DWSProject selectProjectByVersionID(Long projectVersionID); + DSSProject selectProjectByVersionID(Long projectVersionID); - void addProject(DWSProject dwsProject); + void addProject(DSSProject dssProject); - void addProjectVersion(DWSProjectVersion dwsProjectVersion); + void addProjectVersion(DSSProjectVersion dssProjectVersion); void updateDescription(@Param("projectID") Long projectID, @Param("description") String description, @Param("product")String product ,@Param("applicationArea")Integer applicationArea ,@Param("business")String business); - List listProjectVersionsByProjectID(Long projectID); + List listProjectVersionsByProjectID(Long projectID); Boolean noPublished(Long projectID); @@ -48,15 +48,15 @@ public interface ProjectMapper { void deleteProjectBaseInfo(long projectID); - DWSProjectVersion selectProjectVersionByID(Long id); + DSSProjectVersion selectProjectVersionByID(Long id); - DWSProjectVersion selectProjectVersionByProjectIDAndVersionID(@Param("projectID") Long projectId, @Param("version") String version); + DSSProjectVersion selectProjectVersionByProjectIDAndVersionID(@Param("projectID") Long projectId, @Param("version") String version); Integer updateLock(@Param("lock") Integer lock, @Param("projectVersionID") Long projectVersionID); - DWSProjectPublishHistory selectProjectPublishHistoryByProjectVersionID(Long projectVersionID); + DSSProjectPublishHistory selectProjectPublishHistoryByProjectVersionID(Long projectVersionID); - void insertPublishHistory(DWSProjectPublishHistory dwsProjectPublishHistory); + void insertPublishHistory(DSSProjectPublishHistory dssProjectPublishHistory); void updatePublishHistoryState(@Param("projectVersionID") Long projectVersionID, @Param("status") Integer status); diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/ProjectTaxonomyMapper.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/ProjectTaxonomyMapper.java index 3d87bde6b..21fc44e41 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/ProjectTaxonomyMapper.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/ProjectTaxonomyMapper.java @@ -17,8 +17,8 @@ package com.webank.wedatasphere.dss.server.dao; -import com.webank.wedatasphere.dss.server.entity.DWSProjectTaxonomy; -import com.webank.wedatasphere.dss.server.entity.DWSProjectTaxonomyRelation; +import com.webank.wedatasphere.dss.server.entity.DSSProjectTaxonomy; +import com.webank.wedatasphere.dss.server.entity.DSSProjectTaxonomyRelation; import org.apache.ibatis.annotations.Param; import org.springframework.dao.DuplicateKeyException; @@ -26,16 +26,16 @@ public interface ProjectTaxonomyMapper { - DWSProjectTaxonomy selectProjectTaxonomyByID(Long id); - DWSProjectTaxonomyRelation selectProjectTaxonomyRelationByTaxonomyIdOrProjectId(Long taxonomyIdOrProjectId); - List listProjectTaxonomyByUser(String userName); + DSSProjectTaxonomy selectProjectTaxonomyByID(Long id); + DSSProjectTaxonomyRelation selectProjectTaxonomyRelationByTaxonomyIdOrProjectId(Long taxonomyIdOrProjectId); + List listProjectTaxonomyByUser(String userName); //-------------------- List listProjectIDByTaxonomyID(@Param("taxonomyID") Long taxonomyID, @Param("userName") String userName); - void insertProjectTaxonomy(DWSProjectTaxonomy dwsProjectTaxonomy) throws DuplicateKeyException; + void insertProjectTaxonomy(DSSProjectTaxonomy dssProjectTaxonomy) throws DuplicateKeyException; - void updateProjectTaxonomy(DWSProjectTaxonomy dwsProjectTaxonomy) throws DuplicateKeyException; + void updateProjectTaxonomy(DSSProjectTaxonomy dssProjectTaxonomy) throws DuplicateKeyException; Long hasProjects(Long projectTaxonomyID); diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/WorkspaceMapper.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/WorkspaceMapper.java new file mode 100644 index 000000000..c3fbaca22 --- /dev/null +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/WorkspaceMapper.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.server.dao; + +import com.webank.wedatasphere.dss.server.dto.response.*; +import com.webank.wedatasphere.dss.server.entity.*; +import com.webank.wedatasphere.dss.server.dto.response.HomepageDemoInstanceVo; +import com.webank.wedatasphere.dss.server.dto.response.HomepageDemoMenuVo; +import com.webank.wedatasphere.dss.server.dto.response.HomepageVideoVo; +import com.webank.wedatasphere.dss.server.dto.response.WorkspaceFavoriteVo; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * Created by schumiyi on 2020/6/22 + */ +public interface WorkspaceMapper { + + List getWorkspaces(); + + List findByWorkspaceName(String name); + + void addWorkSpace(DSSWorkspace dssWorkspace); + + List getHomepageDemoMenusEn(); + List getHomepageDemoMenusCn(); + + List getHomepageInstancesByMenuIdCn(Long id); + List getHomepageInstancesByMenuIdEn(Long id); + + List getHomepageVideosEn(); + List getHomepageVideosCn(); + + DSSWorkspace getWorkspaceById(Long workspaceId); + + List getManagementMenuCn(); + List getManagementMenuEn(); + + List getApplicationMenuCn(); + List getApplicationMenuEn(); + + List getMenuAppInstancesCn(Long id); + List getMenuAppInstancesEn(Long id); + + List getWorkspaceFavoritesCn(@Param("username") String username, @Param("workspaceId") Long workspaceId); + + List getWorkspaceFavoritesEn(@Param("username") String username, @Param("workspaceId") Long workspaceId); + + void addFavorite(DSSFavorite dssFavorite); + + void deleteFavorite(Long favouritesId); +} diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/impl/dwsUserMapper.xml b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/impl/dwsUserMapper.xml index 65fbd5eb2..ac65dce4f 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/impl/dwsUserMapper.xml +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/impl/dwsUserMapper.xml @@ -19,7 +19,7 @@ - + SELECT id FROM `dss_user` WHERE username = #{userName} diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/impl/flowMapper.xml b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/impl/flowMapper.xml index 38d66f96c..37dae091a 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/impl/flowMapper.xml +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/impl/flowMapper.xml @@ -29,11 +29,11 @@ id,`flow_id`,`source`,`version`,`json_path`,`comment`,`update_time`,`updator_id`,`project_version_id` - + SELECT * FROM `dss_flow` WHERE id = #{id} - + SELECT f.* FROM @@ -44,7 +44,7 @@ AND f.project_id=#{projectID} - - - + SELECT fv.*, bdu.`name` AS 'updator', ISNULL(fph.id) AS 'is_not_published' @@ -86,19 +86,19 @@ - + INSERT INTO dss_flow () VALUES (#{id},#{name},#{state},#{source},#{description},#{createTime},#{creatorID},#{isRootFlow},#{rank},#{projectID},#{hasSaved},#{uses}) - + INSERT INTO dss_flow_version () VALUES (#{id},#{flowID},#{source},#{version},#{jsonPath},#{comment},#{updateTime},#{updatorID},#{projectVersionID}) - + INSERT INTO dss_flow_version ( `flow_id`,`source`,`version`,`json_path`,`comment`,`update_time`,`updator_id`,`project_version_id`) VALUES @@ -107,7 +107,7 @@ - + UPDATE dss_flow_version source= #{fv.source} @@ -127,7 +127,7 @@ (#{flowID},#{parentFlowID}) - + SELECT fv.*, bdu.`name` AS 'updator', ISNULL(fph.id) AS 'is_not_published' @@ -141,7 +141,7 @@ AND fv.project_version_id = #{projectVersionID} - + UPDATE dss_flow name=#{name}, @@ -186,7 +186,7 @@ flow_id = #{flowID} - + SELECT * FROM @@ -195,7 +195,7 @@ project_id = #{projectID} - + SELECT fv.*, bdu.`name` AS 'updator', ISNULL(fph.id) AS 'is_not_published' @@ -218,7 +218,7 @@ LIMIT 1 - + select from dss_flow_version as fv where version = @@ -228,7 +228,7 @@ and fv.flow_id=flow_id ) ; - + SELECT fv.* FROM diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/impl/flowTaxonomyMapper.xml b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/impl/flowTaxonomyMapper.xml index 60b04c3e7..c681f768c 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/impl/flowTaxonomyMapper.xml +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/impl/flowTaxonomyMapper.xml @@ -25,17 +25,17 @@ id, `name`,`description`,`creator_id`,`create_time`,`update_time`,`project_id` - + SELECT * FROM `dss_flow_taxonomy` WHERE id = #{id} - + INSERT INTO dss_flow_taxonomy () VALUES (#{id},#{name},#{description},#{creatorID},#{createTime},#{updateTime},#{projectID}) - + UPDATE dss_flow_taxonomy name=#{name}, @@ -84,7 +84,7 @@ - + SELECT * FROM diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/impl/projectMapper.xml b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/impl/projectMapper.xml index 1ff0893b9..a1bc4ab8c 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/impl/projectMapper.xml +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/impl/projectMapper.xml @@ -22,7 +22,7 @@ - id,`name`,`source`,`description`,`org_id`,`visibility`,`is_transfer`,`initial_org_id`,`user_id`,`create_time`,`create_by`,`product`,`application_area`,`business` + id,`name`,`source`,`description`,`org_id`,`visibility`,`is_transfer`,`initial_org_id`,`user_id`,`create_time`,`create_by`,`product`,`application_area`,`business`,`workspace_id` @@ -33,7 +33,7 @@ id,`project_version_id`,`create_time`,`creator_id`,`update_time`,`comment`,`state`,`version_path`,`expire_time` - + SELECT p.*, MIN(ISNULL(pph.id)) AS 'is_not_publish' FROM @@ -44,11 +44,11 @@ p.id = #{id} - + SELECT * FROM dss_project_version WHERE project_id = #{projectID} ORDER BY id DESC LIMIT 1 - + SELECT wp.* FROM @@ -58,13 +58,13 @@ wpv.id = #{projrctVersionID} - + INSERT INTO dss_project () VALUES - (#{id},#{name},#{source},#{description},#{orgID},#{visibility},#{isTransfer},#{initialOrgID},#{userID},#{createTime},#{createBy},#{product},#{applicationArea},#{business}) + (#{id},#{name},#{source},#{description},#{orgID},#{visibility},#{isTransfer},#{initialOrgID},#{userID},#{createTime},#{createBy},#{product},#{applicationArea},#{business},#{workspaceId}) - + INSERT INTO dss_project_version () VALUES (#{id},#{projectID},#{version},#{comment},#{updateTime},#{updatorID},#{lock}) @@ -76,11 +76,11 @@ WHERE id = #{projectID} - - + SELECT pv.*, u.`name` AS 'updator', ( @@ -126,11 +126,11 @@ id = #{projectID} - + SELECT * from dss_project_version WHERE id = #{id} - + SELECT * from dss_project_version WHERE project_id = #{projectID} and version = #{version} @@ -138,7 +138,7 @@ UPDATE `dss_project_version` set `lock` = `lock` +1 WHERE id= #{projectVersionID} AND `lock` = #{lock} - + SELECT pph.*, u.`name` as 'creator' FROM @@ -148,7 +148,7 @@ pph.project_version_id = #{projectVersionID} - + INSERT INTO dss_project_publish_history () VALUES (#{id},#{projectVersionID},#{createTime},#{createID},#{updateTime},#{comment},#{state},#{versionPath},#{expireTime}) diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/impl/projectTaxonomyMapper.xml b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/impl/projectTaxonomyMapper.xml index 418736c88..9c0333953 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/impl/projectTaxonomyMapper.xml +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/impl/projectTaxonomyMapper.xml @@ -23,16 +23,16 @@ id, `name`,`description`,`creator_id`,`create_time`,`update_time` - + SELECT * FROM `dss_project_taxonomy` WHERE id = #{id} - + SELECT taxonomy_id as taxonomyId , project_id as projectId , creator_id as creatorId FROM `dss_project_taxonomy_relation` WHERE project_id = #{taxonomyIdOrProjectId} - + SELECT pt.* FROM @@ -54,13 +54,13 @@ AND bdu.`name` = #{userName} - + INSERT INTO dss_project_taxonomy () VALUES (#{id},#{name},#{description},#{creatorID},#{createTime},#{updateTime}) - + UPDATE dss_project_taxonomy name=#{name}, diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/impl/workspaceMapper.xml b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/impl/workspaceMapper.xml new file mode 100644 index 000000000..e1fc05ed9 --- /dev/null +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dao/impl/workspaceMapper.xml @@ -0,0 +1,200 @@ + + + + + + + + + id,`name`,`label`,`description`,`department`,`product`,`source`,`create_by`,`create_time`,`last_update_user`,`last_update_time` + + + + m.`id`,m.`title_cn` AS `title`, m.`desc_cn` AS `description`,m.`labels_cn` AS `labels`, + m.`access_button_cn` AS `access_button`,m.`manual_button_cn` AS `manualButton`,m.`is_active`, + m.`manual_button_url`,m.`icon`,m.`order`,app.`homepage_url` AS `access_button_url`,app.project_url, app.`name` + + + m.`id`,m.`title_en` AS `title`, m.`desc_en` AS `description`,m.`labels_en` AS `labels`, + m.`access_button_en` AS `access_button`,m.`manual_button_en` AS `manualButton`,m.`is_active`, + m.`manual_button_url`,m.`icon`,m.`order`,app.`homepage_url` AS `access_button_url`,app.project_url, app.`name` + + + + id,`username`,`workspace_id`,`menu_application_id`,`order`,`create_by`,`create_time`,`last_update_user`,`last_update_time` + + + + SELECT * + FROM dss_workspace + ORDER BY dss_workspace.`create_time` DESC + + + + SELECT * + FROM dss_workspace + WHERE id = #{workspaceId} + + + + SELECT * + FROM dss_workspace + + dss_workspace.`name` = #{name} + + + + + INSERT INTO dss_workspace () + VALUES + (#{id},#{name},#{label},#{description},#{department},#{product},#{source},#{createBy},#{createTime},#{lastUpdateUser},#{lastUpdateTime}) + + + + SELECT `id`,`name`,`title_cn` AS title,`description`,`icon`,`order` + FROM dss_homepage_demo_menu + + `is_active` = 1 + + + + SELECT `id`,`name`,`title_en` AS `title`,`description`,`icon`,`order` + FROM dss_homepage_demo_menu + + `is_active` = 1 + + + + + SELECT `id`,`menu_id`,`name`,`url`,`title_cn` AS `title`,`description`,`icon`,`order` + FROM dss_homepage_demo_instance + + `is_active` = 1 AND `menu_id` = #{id} + + + + + SELECT `id`,`menu_id`,`name`,`url`,`title_en` AS `title`,`description`,`icon`,`order` + FROM dss_homepage_demo_instance + + `is_active` = 1 AND `menu_id` = #{id} + + + + + SELECT `id`,`name`,`title_cn` AS `title`,`url`,`description`,`order` + FROM dss_homepage_video + + `is_active` = 1 + + + + + SELECT `id`,`name`,`title_en` AS `title`,`url`,`description`,`order` + FROM dss_homepage_video + + `is_active` = 1 + + + + + SELECT `id`,`name`,`title_cn` AS `title`,`order` + FROM dss_onestop_menu + + `is_active` = 0 + + + + + SELECT `id`,`name`,`title_en` AS `title`,`order` + FROM dss_onestop_menu + + `is_active` = 0 + + + + + SELECT `id`,`name`,`title_cn` AS `title`,`order` + FROM dss_onestop_menu + + `is_active` = 1 + + + + + SELECT `id`,`name`,`title_en` AS `title`,`order` + FROM dss_onestop_menu + + `is_active` = 1 + + + + + SELECT + FROM dss_onestop_menu_application m + LEFT JOIN dss_application app + ON m.`application_id` = app.`id` + + m.`onestop_menu_id` = #{id} + + + + + SELECT + FROM dss_onestop_menu_application m + LEFT JOIN dss_application app + ON m.`application_id` = app.`id` + + m.`onestop_menu_id` = #{id} + + + + + SELECT dss_onestop_user_favorites.id, dss_onestop_menu_application.id AS menuApplicationId , name, url, icon, title_cn AS title + FROM dss_onestop_user_favorites join dss_onestop_menu_application + on dss_onestop_user_favorites.menu_application_id = dss_onestop_menu_application.id + join dss_application on dss_application.id = dss_onestop_menu_application.application_id + + dss_onestop_user_favorites.`username` = #{username} and `workspace_id` = #{workspaceId} + + + + + SELECT dss_onestop_user_favorites.id, dss_onestop_menu_application.id AS menuApplicationId, name, url, icon, title_en AS `title` + FROM dss_onestop_user_favorites join dss_onestop_menu_application + on dss_onestop_user_favorites.menu_application_id = dss_onestop_menu_application.id + join dss_application on dss_application.id = dss_onestop_menu_application.application_id + + dss_onestop_user_favorites.`username` = #{username} and `workspace_id` = #{workspaceId} + + + + + INSERT INTO dss_onestop_user_favorites () + VALUES + (#{id},#{username},#{workspaceId},#{menuApplicationId},#{order},#{createBy},#{createTime},#{lastUpdateUser},#{lastUpdateTime}) + + + + DELETE + FROM + dss_onestop_user_favorites + WHERE + id = #{favouritesId} + + \ No newline at end of file diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/HomepageDemoInstanceVo.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/HomepageDemoInstanceVo.java new file mode 100644 index 000000000..b880f0f2a --- /dev/null +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/HomepageDemoInstanceVo.java @@ -0,0 +1,96 @@ +/* + * 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.server.dto.response; + +/** + * Created by schumiyi on 2020/6/23 + */ +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-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/HomepageDemoMenuVo.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/HomepageDemoMenuVo.java new file mode 100644 index 000000000..c7d4fdcbd --- /dev/null +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/HomepageDemoMenuVo.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.server.dto.response; + +import java.util.List; + +/** + * Created by schumiyi on 2020/6/23 + */ +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-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/HomepageVideoVo.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/HomepageVideoVo.java new file mode 100644 index 000000000..0f9ce857d --- /dev/null +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/HomepageVideoVo.java @@ -0,0 +1,78 @@ +/* + * 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.server.dto.response; + +/** + * Created by schumiyi on 2020/6/23 + */ +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-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/OnestopMenuAppInstanceVo.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/OnestopMenuAppInstanceVo.java new file mode 100644 index 000000000..f22ca6b33 --- /dev/null +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/OnestopMenuAppInstanceVo.java @@ -0,0 +1,140 @@ +/* + * 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.server.dto.response; + +/** + * Created by schumiyi on 2020/6/24 + */ +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; + + 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; + } +} diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/OnestopMenuVo.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/OnestopMenuVo.java new file mode 100644 index 000000000..214b5d853 --- /dev/null +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/OnestopMenuVo.java @@ -0,0 +1,62 @@ +/* + * 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.server.dto.response; + +import java.util.List; + +/** + * Created by schumiyi on 2020/6/24 + */ +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-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/WorkspaceDepartmentVo.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/WorkspaceDepartmentVo.java new file mode 100644 index 000000000..4fc436a33 --- /dev/null +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/WorkspaceDepartmentVo.java @@ -0,0 +1,44 @@ +/* + * 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.server.dto.response; + +/** + * Created by schumiyi on 2020/6/23 + */ +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-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/WorkspaceFavoriteVo.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/WorkspaceFavoriteVo.java new file mode 100644 index 000000000..f9953d6c5 --- /dev/null +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/dto/response/WorkspaceFavoriteVo.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.server.dto.response; + +/** + * Created by Adamyuanyuan on 2020/6/25 + */ +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; + } +} diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/entity/BaseEntity.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/entity/BaseEntity.java new file mode 100644 index 000000000..d01380d9e --- /dev/null +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/entity/BaseEntity.java @@ -0,0 +1,49 @@ +package com.webank.wedatasphere.dss.server.entity; + +import java.util.Date; + +/** + * Created by schumiyi on 2020/6/22 + */ +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-server/src/main/java/com/webank/wedatasphere/dss/server/entity/DSSFavorite.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/entity/DSSFavorite.java new file mode 100644 index 000000000..9d9956442 --- /dev/null +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/entity/DSSFavorite.java @@ -0,0 +1,73 @@ +/* + * 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.server.entity; + +/** + * Created by Adamyuanyuan on 2020/6/25 + */ +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-server/src/main/java/com/webank/wedatasphere/dss/server/entity/DWSFlowTaxonomy.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/entity/DSSFlowTaxonomy.java similarity index 86% rename from dss-server/src/main/java/com/webank/wedatasphere/dss/server/entity/DWSFlowTaxonomy.java rename to dss-server/src/main/java/com/webank/wedatasphere/dss/server/entity/DSSFlowTaxonomy.java index f5d20f659..314e21ea5 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/entity/DWSFlowTaxonomy.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/entity/DSSFlowTaxonomy.java @@ -17,13 +17,13 @@ package com.webank.wedatasphere.dss.server.entity; -import com.webank.wedatasphere.dss.common.entity.flow.DWSFlow; +import com.webank.wedatasphere.dss.common.entity.flow.DSSFlow; import java.util.Date; import java.util.List; -public class DWSFlowTaxonomy { +public class DSSFlowTaxonomy { private Long id; private String name; private String description; @@ -31,14 +31,14 @@ public class DWSFlowTaxonomy { private Date createTime; private Date updateTime; private Long projectID; - private List dwsFlowList; + private List dssFlowList; - public List getDwsFlowList() { - return dwsFlowList; + public List getDssFlowList() { + return dssFlowList; } - public void setDwsFlowList(List dwsFlowList) { - this.dwsFlowList = dwsFlowList; + public void setDssFlowList(List dssFlowList) { + this.dssFlowList = dssFlowList; } public Long getId() { diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/entity/DWSProjectTaxonomy.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/entity/DSSProjectTaxonomy.java similarity index 84% rename from dss-server/src/main/java/com/webank/wedatasphere/dss/server/entity/DWSProjectTaxonomy.java rename to dss-server/src/main/java/com/webank/wedatasphere/dss/server/entity/DSSProjectTaxonomy.java index eccf702a0..302b80675 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/entity/DWSProjectTaxonomy.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/entity/DSSProjectTaxonomy.java @@ -17,27 +17,27 @@ package com.webank.wedatasphere.dss.server.entity; -import com.webank.wedatasphere.dss.common.entity.project.DWSProject; +import com.webank.wedatasphere.dss.common.entity.project.DSSProject; import java.util.Date; import java.util.List; -public class DWSProjectTaxonomy { +public class DSSProjectTaxonomy { private Long id; private String name; private String description; private Long creatorID; private Date createTime; private Date updateTime; - private List dwsProjectList; + private List dssProjectList; - public List getDwsProjectList() { - return dwsProjectList; + public List getDssProjectList() { + return dssProjectList; } - public void setDwsProjectList(List dwsProjectList) { - this.dwsProjectList = dwsProjectList; + public void setDssProjectList(List dssProjectList) { + this.dssProjectList = dssProjectList; } public Long getId() { diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/entity/DWSProjectTaxonomyRelation.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/entity/DSSProjectTaxonomyRelation.java similarity index 96% rename from dss-server/src/main/java/com/webank/wedatasphere/dss/server/entity/DWSProjectTaxonomyRelation.java rename to dss-server/src/main/java/com/webank/wedatasphere/dss/server/entity/DSSProjectTaxonomyRelation.java index 80f38328a..accdf3e4b 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/entity/DWSProjectTaxonomyRelation.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/entity/DSSProjectTaxonomyRelation.java @@ -17,7 +17,7 @@ package com.webank.wedatasphere.dss.server.entity; -public class DWSProjectTaxonomyRelation { +public class DSSProjectTaxonomyRelation { private Long taxonomyId; private Long projectId; private Long creatorId; diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/entity/DSSWorkspace.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/entity/DSSWorkspace.java new file mode 100644 index 000000000..305bffeb4 --- /dev/null +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/entity/DSSWorkspace.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.server.entity; + +/** + * Created by schumiyi on 2020/6/22 + */ +public class DSSWorkspace extends BaseEntity { + + private Long id; + + private String name; + + private String label; + + private String description; + + private String department; + + private String product; + + private String source; + + 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 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 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; + } +} diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/function/FunctionInvoker.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/function/FunctionInvoker.java index be5232f51..d4ef8bc4b 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/function/FunctionInvoker.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/function/FunctionInvoker.java @@ -25,7 +25,7 @@ import com.webank.wedatasphere.dss.appjoint.service.session.Session; import com.webank.wedatasphere.dss.application.entity.Application; import com.webank.wedatasphere.dss.application.service.ApplicationService; -import com.webank.wedatasphere.dss.common.entity.project.DWSProject; +import com.webank.wedatasphere.dss.common.entity.project.DSSProject; import com.webank.wedatasphere.dss.common.entity.project.Project; import com.webank.wedatasphere.dss.server.dao.ProjectMapper; import org.apache.commons.math3.util.Pair; @@ -66,7 +66,7 @@ public Map nodeServiceFunction(String userName, Map> projectServiceAddFunction(DWSProject project, ProjectServiceAddFunction projectServiceAddFunction, List appJoints) throws AppJointErrorException { + public List> projectServiceAddFunction(DSSProject project, ProjectServiceAddFunction projectServiceAddFunction, List appJoints) throws AppJointErrorException { ArrayList> projects = new ArrayList<>(); for (AppJoint appJoint : appJoints) { Project appJointProject = null; @@ -84,7 +84,7 @@ public List> projectServiceAddFunction(DWSProject project, return projects; } - public void projectServiceFunction(DWSProject project, ProjectServiceFunction projectServiceFunction, List appJoints) throws AppJointErrorException { + public void projectServiceFunction(DSSProject project, ProjectServiceFunction projectServiceFunction, List appJoints) throws AppJointErrorException { for (AppJoint appJoint : appJoints) { Session session = null; if(appJoint.getSecurityService() != null){ diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/lock/LockAspect.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/lock/LockAspect.java index b41287ddd..473f224c5 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/lock/LockAspect.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/lock/LockAspect.java @@ -19,7 +19,7 @@ import com.webank.wedatasphere.dss.server.constant.DSSServerConstant; import com.webank.wedatasphere.dss.server.dao.ProjectMapper; -import com.webank.wedatasphere.dss.common.entity.project.DWSProjectVersion; +import com.webank.wedatasphere.dss.common.entity.project.DSSProjectVersion; import com.webank.wedatasphere.dss.common.exception.DSSErrorException; import org.apache.commons.lang.ArrayUtils; import org.aspectj.lang.ProceedingJoinPoint; @@ -70,11 +70,11 @@ public Object around(ProceedingJoinPoint point) throws Throwable { return point.proceed(); } logger.info("projectVersionID为:" + projectVersionID); - DWSProjectVersion dwsProjectVersion = projectMapper.selectProjectVersionByID(projectVersionID); - Integer lock = dwsProjectVersion.getLock(); + DSSProjectVersion dssProjectVersion = projectMapper.selectProjectVersionByID(projectVersionID); + Integer lock = dssProjectVersion.getLock(); try { Object proceed = point.proceed(); - judge(lockAnnotation, dwsProjectVersion, lock, projectVersionID); + judge(lockAnnotation, dssProjectVersion, lock, projectVersionID); return proceed; } catch (Exception e) { logger.info("执行过程出现异常", e); @@ -82,16 +82,16 @@ public Object around(ProceedingJoinPoint point) throws Throwable { } } - private void judge(Lock lockAnnotation, DWSProjectVersion dwsProjectVersion, Integer lock, Long projectVersionID) throws DSSErrorException { + private void judge(Lock lockAnnotation, DSSProjectVersion dssProjectVersion, Integer lock, Long projectVersionID) throws DSSErrorException { if (lockAnnotation.type().equals(LockEnum.ADD)) { logger.info("projectVersion会增加"); - List dwsProjectVersions = projectMapper.listProjectVersionsByProjectID(dwsProjectVersion.getProjectID()); - if (dwsProjectVersions.size() < 2 || !dwsProjectVersions.get(1).getId().equals(projectVersionID)) { + List dssProjectVersions = projectMapper.listProjectVersionsByProjectID(dssProjectVersion.getProjectID()); + if (dssProjectVersions.size() < 2 || !dssProjectVersions.get(1).getId().equals(projectVersionID)) { throw new DSSErrorException(67457, "已经有别的用户对此project进行了版本更新操作,不能进行此操作!"); } } else { logger.info("projectVersion不会增加"); - DWSProjectVersion latest = projectMapper.selectLatestVersionByProjectID(dwsProjectVersion.getProjectID()); + DSSProjectVersion latest = projectMapper.selectLatestVersionByProjectID(dssProjectVersion.getProjectID()); if (!latest.getId().equals(projectVersionID)) { throw new DSSErrorException(67455, "目前project版本已经不是最新,不能进行此操作!"); } diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/operate/AppJointNodeOperate.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/operate/AppJointNodeOperate.java index 5c7dd7ab4..276e99d3e 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/operate/AppJointNodeOperate.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/operate/AppJointNodeOperate.java @@ -20,11 +20,10 @@ import com.webank.wedatasphere.dss.appjoint.exception.AppJointErrorException; import com.webank.wedatasphere.dss.appjoint.execution.core.CommonAppJointNode; -import com.webank.wedatasphere.dss.appjoint.service.NodeService; import com.webank.wedatasphere.dss.server.function.FunctionInvoker; import com.webank.wedatasphere.dss.server.function.FunctionPool; import com.webank.wedatasphere.dss.server.function.NodeServiceFunction; -import com.webank.wedatasphere.dss.server.service.DWSFlowService; +import com.webank.wedatasphere.dss.server.service.DSSFlowService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -41,17 +40,17 @@ public boolean canInvokeOperate(Op op) { } @Override - public void add(DWSFlowService dwsFlowService, Op op) throws AppJointErrorException { + public void add(DSSFlowService dssFlowService, Op op) throws AppJointErrorException { invokeNodeServiceFunction(op,FunctionPool.createNode); } @Override - public void update(DWSFlowService dwsFlowService,Op op) throws AppJointErrorException { + public void update(DSSFlowService dssFlowService, Op op) throws AppJointErrorException { invokeNodeServiceFunction(op,FunctionPool.updateNode); } @Override - public void delete(DWSFlowService dwsFlowService,Op op) throws AppJointErrorException { + public void delete(DSSFlowService dssFlowService, Op op) throws AppJointErrorException { invokeNodeServiceFunction(op, FunctionPool.deleteNode); } @@ -64,7 +63,4 @@ private void invokeNodeServiceFunction(Op op,NodeServiceFunction function) throw node.setNodeType(op.getNodeType()); functionInvoker.nodeServiceFunction(userName,op.getParams(),node,function); } - - - } diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/operate/Operate.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/operate/Operate.java index 75beee6d0..ec44935c8 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/operate/Operate.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/operate/Operate.java @@ -20,7 +20,7 @@ import com.webank.wedatasphere.dss.appjoint.exception.AppJointErrorException; -import com.webank.wedatasphere.dss.server.service.DWSFlowService; +import com.webank.wedatasphere.dss.server.service.DSSFlowService; import com.webank.wedatasphere.dss.common.exception.DSSErrorException; @@ -28,9 +28,9 @@ public interface Operate { boolean canInvokeOperate(Op op); - void add(DWSFlowService dwsFlowService, Op op) throws DSSErrorException, AppJointErrorException; + void add(DSSFlowService dssFlowService, Op op) throws DSSErrorException, AppJointErrorException; - void update(DWSFlowService dwsFlowService, Op op) throws DSSErrorException, AppJointErrorException; + void update(DSSFlowService dssFlowService, Op op) throws DSSErrorException, AppJointErrorException; - void delete(DWSFlowService dwsFlowService, Op op) throws DSSErrorException, AppJointErrorException; + void delete(DSSFlowService dssFlowService, Op op) throws DSSErrorException, AppJointErrorException; } diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/operate/SubFlowOperate.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/operate/SubFlowOperate.java index 96db7ba62..8f3d28661 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/operate/SubFlowOperate.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/operate/SubFlowOperate.java @@ -18,8 +18,8 @@ package com.webank.wedatasphere.dss.server.operate; -import com.webank.wedatasphere.dss.server.service.DWSFlowService; -import com.webank.wedatasphere.dss.common.entity.flow.DWSFlow; +import com.webank.wedatasphere.dss.common.entity.flow.DSSFlow; +import com.webank.wedatasphere.dss.server.service.DSSFlowService; import com.webank.wedatasphere.dss.common.exception.DSSErrorException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -41,33 +41,33 @@ public boolean canInvokeOperate(Op op) { } @Override - public void add(DWSFlowService dwsFlowService, Op op)throws DSSErrorException { - afterOperateSubFlow(dwsFlowService,op); + public void add(DSSFlowService dssFlowService, Op op)throws DSSErrorException { + afterOperateSubFlow(dssFlowService,op); } @Override - public void update(DWSFlowService dwsFlowService,Op op) throws DSSErrorException { + public void update(DSSFlowService dssFlowService, Op op) throws DSSErrorException { logger.info("name:{},description:{}",op.getParams().get("name"),op.getParams().get("description")); - DWSFlow dwsFlow = new DWSFlow(); - dwsFlow.setId(op.getId()); - dwsFlow.setName(op.getParams().get("name").toString()); - dwsFlow.setDescription(op.getParams().get("description").toString()); - dwsFlowService.updateFlowBaseInfo(dwsFlow, Long.valueOf(op.getParams().get("projectVersionID").toString()), null); - afterOperateSubFlow(dwsFlowService,op); + DSSFlow dssFlow = new DSSFlow(); + dssFlow.setId(op.getId()); + dssFlow.setName(op.getParams().get("name").toString()); + dssFlow.setDescription(op.getParams().get("description").toString()); + dssFlowService.updateFlowBaseInfo(dssFlow, Long.valueOf(op.getParams().get("projectVersionID").toString()), null); + afterOperateSubFlow(dssFlowService,op); } @Override - public void delete(DWSFlowService dwsFlowService,Op op) throws DSSErrorException { + public void delete(DSSFlowService dssFlowService, Op op) throws DSSErrorException { logger.info("delete subFlow{}",op.getId()); - dwsFlowService.batchDeleteFlow(Arrays.asList(op.getId()), Long.valueOf(op.getParams().get("projectVersionID").toString())); - afterOperateSubFlow(dwsFlowService,op); + dssFlowService.batchDeleteFlow(Arrays.asList(op.getId()), Long.valueOf(op.getParams().get("projectVersionID").toString())); + afterOperateSubFlow(dssFlowService,op); } - private void afterOperateSubFlow(DWSFlowService dwsFlowService,Op op) throws DSSErrorException { + private void afterOperateSubFlow(DSSFlowService dssFlowService, Op op) throws DSSErrorException { //更新工作流基本信息 - DWSFlow dwsFlow = new DWSFlow(); - dwsFlow.setId(op.getId()); - dwsFlow.setHasSaved(true); - dwsFlowService.updateFlowBaseInfo(dwsFlow, Long.valueOf(op.getParams().get("projectVersionID").toString()), null); + DSSFlow dssFlow = new DSSFlow(); + dssFlow.setId(op.getId()); + dssFlow.setHasSaved(true); + dssFlowService.updateFlowBaseInfo(dssFlow, Long.valueOf(op.getParams().get("projectVersionID").toString()), null); } } diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/publish/PublishJobFactory.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/publish/PublishJobFactory.java index 304fc444e..fff485910 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/publish/PublishJobFactory.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/publish/PublishJobFactory.java @@ -19,7 +19,7 @@ import com.webank.wedatasphere.dss.server.conf.DSSServerConf; -import com.webank.wedatasphere.dss.server.service.DWSProjectService; +import com.webank.wedatasphere.dss.server.service.DSSProjectService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -31,7 +31,7 @@ public class PublishJobFactory { @Autowired private PublishManager publishManager; @Autowired - private DWSProjectService projectService; + private DSSProjectService projectService; public PublishSubmitJob createSubmitPublishJob(Long projectVersionID, String user, String comment){ PublishSubmitJob job = new PublishSubmitJob(projectService, user, comment, projectVersionID); diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/publish/PublishManager.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/publish/PublishManager.java index 60e9205de..c1f29c4e2 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/publish/PublishManager.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/publish/PublishManager.java @@ -18,8 +18,8 @@ package com.webank.wedatasphere.dss.server.publish; -import com.webank.wedatasphere.dss.server.service.DWSProjectService; -import com.webank.wedatasphere.dss.common.entity.project.DWSProjectPublishHistory; +import com.webank.wedatasphere.dss.server.service.DSSProjectService; +import com.webank.wedatasphere.dss.common.entity.project.DSSProjectPublishHistory; import com.webank.wedatasphere.dss.common.exception.DSSErrorException; import com.webank.wedatasphere.linkis.common.utils.Utils; import org.slf4j.Logger; @@ -40,7 +40,7 @@ public class PublishManager implements PublishListner { private Logger logger = LoggerFactory.getLogger(this.getClass()); @Autowired - private DWSProjectService projectService; + private DSSProjectService projectService; private Map cacheMap = new ConcurrentHashMap<>(); @@ -105,7 +105,7 @@ public void addPublishCache(Long projectVersionID, Long creatorID, String commen if (cacheMap.get(projectVersionID) == null) { synchronized (cacheMap) { if (cacheMap.get(projectVersionID) == null) { - DWSProjectPublishHistory history = projectService.getPublishHistoryByID(projectVersionID); + DSSProjectPublishHistory history = projectService.getPublishHistoryByID(projectVersionID); if (history == null) { logger.info("创建一个发布job" + projectVersionID); projectService.createPublishHistory(comment, creatorID, projectVersionID); diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/publish/PublishSubmitJob.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/publish/PublishSubmitJob.java index 769bd9dbf..af04335f5 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/publish/PublishSubmitJob.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/publish/PublishSubmitJob.java @@ -18,16 +18,16 @@ package com.webank.wedatasphere.dss.server.publish; -import com.webank.wedatasphere.dss.server.service.DWSProjectService; +import com.webank.wedatasphere.dss.server.service.DSSProjectService; public class PublishSubmitJob extends PublishJob { - private DWSProjectService projectService; + private DSSProjectService projectService; private String comment; - public PublishSubmitJob(DWSProjectService projectService, String user, String comment, Long projectVersionID) { + public PublishSubmitJob(DSSProjectService projectService, String user, String comment, Long projectVersionID) { this.projectService = projectService; this.user = user; this.comment = comment; diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/restful/FlowRestfulApi.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/restful/FlowRestfulApi.java index 74b852034..102518263 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/restful/FlowRestfulApi.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/restful/FlowRestfulApi.java @@ -19,11 +19,11 @@ import com.webank.wedatasphere.dss.appjoint.exception.AppJointErrorException; -import com.webank.wedatasphere.dss.server.service.DWSFlowService; -import com.webank.wedatasphere.dss.server.service.DWSProjectService; -import com.webank.wedatasphere.dss.server.service.DWSUserService; -import com.webank.wedatasphere.dss.common.entity.flow.DWSFlow; -import com.webank.wedatasphere.dss.common.entity.flow.DWSFlowVersion; +import com.webank.wedatasphere.dss.common.entity.flow.DSSFlow; +import com.webank.wedatasphere.dss.server.service.DSSFlowService; +import com.webank.wedatasphere.dss.server.service.DSSProjectService; +import com.webank.wedatasphere.dss.server.service.DSSUserService; +import com.webank.wedatasphere.dss.common.entity.flow.DSSFlowVersion; import com.webank.wedatasphere.dss.common.exception.DSSErrorException; import com.webank.wedatasphere.dss.server.operate.Op; import com.webank.wedatasphere.dss.server.publish.PublishManager; @@ -54,9 +54,9 @@ public class FlowRestfulApi { @Autowired - private DWSFlowService flowService; + private DSSFlowService flowService; @Autowired - private DWSUserService dwsUserService; + private DSSUserService dssUserService; @Autowired private PublishManager publishManager; @@ -65,7 +65,7 @@ public class FlowRestfulApi { @GET @Path("/listAllFlowVersions") public Response listAllVersions(@Context HttpServletRequest req, @QueryParam("id")Long flowID,@QueryParam("projectVersionID")Long projectVersionID) { - List versions = flowService.listAllFlowVersions(flowID,projectVersionID); + List versions = flowService.listAllFlowVersions(flowID,projectVersionID); return Message.messageToResponse(Message.ok().data("versions",versions)); } @@ -83,30 +83,30 @@ public Response addFlow(@Context HttpServletRequest req, JsonNode json) throws D String uses = json.get("uses") == null?null:json.get("uses").getTextValue(); if(taxonomyID == null && parentFlowID == null) throw new DSSErrorException(90009,"请求选择工作流分类"); publishManager.checkeIsPublishing(projectVersionID); - DWSFlow dwsFlow = new DWSFlow(); - dwsFlow.setProjectID(projectService.getProjectByProjectVersionID(projectVersionID).getId()); - dwsFlow.setName(name); - dwsFlow.setDescription(description); - dwsFlow.setCreatorID(dwsUserService.getUserID(userName)); - dwsFlow.setCreateTime(new Date()); - dwsFlow.setState(false); - dwsFlow.setSource("create by user"); - dwsFlow.setUses(uses); + DSSFlow dssFlow = new DSSFlow(); + dssFlow.setProjectID(projectService.getProjectByProjectVersionID(projectVersionID).getId()); + dssFlow.setName(name); + dssFlow.setDescription(description); + dssFlow.setCreatorID(dssUserService.getUserID(userName)); + dssFlow.setCreateTime(new Date()); + dssFlow.setState(false); + dssFlow.setSource("create by user"); + dssFlow.setUses(uses); if(parentFlowID == null){ - dwsFlow.setRootFlow(true); - dwsFlow.setRank(0); - dwsFlow.setHasSaved(true); - dwsFlow = flowService.addRootFlow(dwsFlow,taxonomyID,projectVersionID); + dssFlow.setRootFlow(true); + dssFlow.setRank(0); + dssFlow.setHasSaved(true); + dssFlow = flowService.addRootFlow(dssFlow,taxonomyID,projectVersionID); }else { - dwsFlow.setRootFlow(false); + dssFlow.setRootFlow(false); Integer rank = flowService.getParentRank(parentFlowID); // TODO: 2019/6/3 并发问题考虑for update - dwsFlow.setRank(rank+1); - dwsFlow.setHasSaved(false); - dwsFlow = flowService.addSubFlow(dwsFlow,parentFlowID,projectVersionID); + dssFlow.setRank(rank+1); + dssFlow.setHasSaved(false); + dssFlow = flowService.addSubFlow(dssFlow,parentFlowID,projectVersionID); } // TODO: 2019/5/16 空值校验,重复名校验 - return Message.messageToResponse(Message.ok().data("flow",dwsFlow)); + return Message.messageToResponse(Message.ok().data("flow", dssFlow)); } @POST @@ -121,12 +121,12 @@ public Response updateFlowBaseInfo(@Context HttpServletRequest req, JsonNode jso publishManager.checkeIsPublishing(projectVersionID); // TODO: 2019/6/13 projectVersionID的更新校验 //这里可以不做事务 - DWSFlow dwsFlow = new DWSFlow(); - dwsFlow.setId(flowID); - dwsFlow.setName(name); - dwsFlow.setDescription(description); - dwsFlow.setUses(uses); - flowService.updateFlowBaseInfo(dwsFlow,projectVersionID,taxonomyID); + DSSFlow dssFlow = new DSSFlow(); + dssFlow.setId(flowID); + dssFlow.setName(name); + dssFlow.setDescription(description); + dssFlow.setUses(uses); + flowService.updateFlowBaseInfo(dssFlow,projectVersionID,taxonomyID); return Message.messageToResponse(Message.ok()); } @@ -134,14 +134,14 @@ public Response updateFlowBaseInfo(@Context HttpServletRequest req, JsonNode jso @Path("/get") public Response get(@Context HttpServletRequest req, @QueryParam("id")Long flowID,@QueryParam("version")String version,@QueryParam("projectVersionID")Long projectVersionID) throws DSSErrorException { // TODO: 2019/5/23 id空值判断 - DWSFlow dwsFlow; + DSSFlow dssFlow; if (StringUtils.isEmpty(version)){ - dwsFlow = flowService.getLatestVersionFlow(flowID,projectVersionID); - dwsFlow.setFlowVersions(Arrays.asList(dwsFlow.getLatestVersion())); + dssFlow = flowService.getLatestVersionFlow(flowID,projectVersionID); + dssFlow.setFlowVersions(Arrays.asList(dssFlow.getLatestVersion())); }else { - dwsFlow = flowService.getOneVersionFlow(flowID, version,projectVersionID); + dssFlow = flowService.getOneVersionFlow(flowID, version,projectVersionID); } - return Message.messageToResponse(Message.ok().data("flow",dwsFlow)); + return Message.messageToResponse(Message.ok().data("flow", dssFlow)); } @POST @@ -175,6 +175,6 @@ public Response saveFlow(@Context HttpServletRequest req, JsonNode json) throws } @Autowired - private DWSProjectService projectService; + private DSSProjectService projectService; } diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/restful/FlowTaxonomyRestfulApi.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/restful/FlowTaxonomyRestfulApi.java index 5e6f3be56..bc43c5ab6 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/restful/FlowTaxonomyRestfulApi.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/restful/FlowTaxonomyRestfulApi.java @@ -18,10 +18,10 @@ package com.webank.wedatasphere.dss.server.restful; -import com.webank.wedatasphere.dss.server.service.DWSFlowTaxonomyService; -import com.webank.wedatasphere.dss.server.service.DWSProjectService; -import com.webank.wedatasphere.dss.server.service.DWSUserService; -import com.webank.wedatasphere.dss.server.entity.DWSFlowTaxonomy; +import com.webank.wedatasphere.dss.server.service.DSSFlowTaxonomyService; +import com.webank.wedatasphere.dss.server.service.DSSProjectService; +import com.webank.wedatasphere.dss.server.service.DSSUserService; +import com.webank.wedatasphere.dss.server.entity.DSSFlowTaxonomy; import com.webank.wedatasphere.dss.common.exception.DSSErrorException; import com.webank.wedatasphere.dss.server.publish.PublishManager; import com.webank.wedatasphere.linkis.server.Message; @@ -48,11 +48,11 @@ public class FlowTaxonomyRestfulApi { @Autowired - private DWSFlowTaxonomyService flowTaxonomyService; + private DSSFlowTaxonomyService flowTaxonomyService; @Autowired - private DWSUserService dwsUserService; + private DSSUserService dssUserService; @Autowired - private DWSProjectService projectService; + private DSSProjectService projectService; @Autowired private PublishManager publishManager; @@ -65,15 +65,15 @@ public Response addFlowTaxonomy(@Context HttpServletRequest req, JsonNode json) Long projectVersionID = json.get("projectVersionID").getLongValue(); publishManager.checkeIsPublishing(projectVersionID); // TODO: 2019/5/16 空值校验,重复名校验 - DWSFlowTaxonomy dwsFlowTaxonomy = new DWSFlowTaxonomy(); + DSSFlowTaxonomy dssFlowTaxonomy = new DSSFlowTaxonomy(); Date date = new Date(); - dwsFlowTaxonomy.setName(name); - dwsFlowTaxonomy.setDescription(description); - dwsFlowTaxonomy.setCreatorID(dwsUserService.getUserID(userName)); - dwsFlowTaxonomy.setCreateTime(date); - dwsFlowTaxonomy.setUpdateTime(date); - dwsFlowTaxonomy.setProjectID(projectService.getProjectByProjectVersionID(projectVersionID).getId()); - flowTaxonomyService.addFlowTaxonomy(dwsFlowTaxonomy,projectVersionID); + dssFlowTaxonomy.setName(name); + dssFlowTaxonomy.setDescription(description); + dssFlowTaxonomy.setCreatorID(dssUserService.getUserID(userName)); + dssFlowTaxonomy.setCreateTime(date); + dssFlowTaxonomy.setUpdateTime(date); + dssFlowTaxonomy.setProjectID(projectService.getProjectByProjectVersionID(projectVersionID).getId()); + flowTaxonomyService.addFlowTaxonomy(dssFlowTaxonomy,projectVersionID); return Message.messageToResponse(Message.ok()); } @POST @@ -86,12 +86,12 @@ public Response updateFlowTaxonomy(@Context HttpServletRequest req, JsonNode jso publishManager.checkeIsPublishing(projectVersionID); // TODO: 2019/6/13 projectVersionID的更新校验 // TODO: 2019/5/16 空值校验,重复名校验 - DWSFlowTaxonomy dwsFlowTaxonomy = new DWSFlowTaxonomy(); - dwsFlowTaxonomy.setId(id); - dwsFlowTaxonomy.setName(name); - dwsFlowTaxonomy.setDescription(description); - dwsFlowTaxonomy.setUpdateTime(new Date()); - flowTaxonomyService.updateFlowTaxonomy(dwsFlowTaxonomy,projectVersionID); + DSSFlowTaxonomy dssFlowTaxonomy = new DSSFlowTaxonomy(); + dssFlowTaxonomy.setId(id); + dssFlowTaxonomy.setName(name); + dssFlowTaxonomy.setDescription(description); + dssFlowTaxonomy.setUpdateTime(new Date()); + flowTaxonomyService.updateFlowTaxonomy(dssFlowTaxonomy,projectVersionID); return Message.messageToResponse(Message.ok()); } diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/restful/NodeRestfulApi.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/restful/NodeRestfulApi.java index 69df32126..ec1c43a22 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/restful/NodeRestfulApi.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/restful/NodeRestfulApi.java @@ -20,7 +20,6 @@ import com.webank.wedatasphere.dss.appjoint.exception.AppJointErrorException; import com.webank.wedatasphere.dss.appjoint.execution.core.CommonAppJointNode; -import com.webank.wedatasphere.dss.appjoint.service.NodeService; import com.webank.wedatasphere.dss.application.entity.Application; import com.webank.wedatasphere.dss.application.service.ApplicationService; import com.webank.wedatasphere.dss.application.util.ApplicationUtils; @@ -28,7 +27,7 @@ import com.webank.wedatasphere.dss.server.function.FunctionInvoker; import com.webank.wedatasphere.dss.server.function.FunctionPool; import com.webank.wedatasphere.dss.server.function.NodeServiceFunction; -import com.webank.wedatasphere.dss.server.service.DWSNodeInfoService; +import com.webank.wedatasphere.dss.server.service.DSSNodeInfoService; import com.webank.wedatasphere.linkis.server.Message; import com.webank.wedatasphere.linkis.server.security.SecurityFilter; import org.slf4j.Logger; @@ -54,7 +53,7 @@ public class NodeRestfulApi { private Logger logger = LoggerFactory.getLogger(this.getClass()); @Autowired - private DWSNodeInfoService nodeInfoService; + private DSSNodeInfoService nodeInfoService; @Autowired private ApplicationService applicationService; diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/restful/ProjectRestfulApi.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/restful/ProjectRestfulApi.java index f8ef9237f..be22ec758 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/restful/ProjectRestfulApi.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/restful/ProjectRestfulApi.java @@ -19,16 +19,16 @@ import com.webank.wedatasphere.dss.appjoint.exception.AppJointErrorException; -import com.webank.wedatasphere.dss.common.entity.project.DWSProject; -import com.webank.wedatasphere.dss.common.entity.project.DWSProjectVersion; +import com.webank.wedatasphere.dss.common.entity.project.DSSProject; +import com.webank.wedatasphere.dss.common.entity.project.DSSProjectVersion; import com.webank.wedatasphere.dss.common.exception.DSSErrorException; -import com.webank.wedatasphere.dss.server.dao.DWSUserMapper; +import com.webank.wedatasphere.dss.server.dao.DSSUserMapper; import com.webank.wedatasphere.dss.server.dao.ProjectMapper; import com.webank.wedatasphere.dss.server.entity.ApplicationArea; import com.webank.wedatasphere.dss.server.publish.*; -import com.webank.wedatasphere.dss.server.service.DWSProjectService; -import com.webank.wedatasphere.dss.server.service.DWSProjectTaxonomyService; -import com.webank.wedatasphere.dss.server.service.DWSUserService; +import com.webank.wedatasphere.dss.server.service.DSSProjectService; +import com.webank.wedatasphere.dss.server.service.DSSProjectTaxonomyService; +import com.webank.wedatasphere.dss.server.service.DSSUserService; import com.webank.wedatasphere.linkis.server.Message; import com.webank.wedatasphere.linkis.server.security.SecurityFilter; import org.codehaus.jackson.JsonNode; @@ -53,11 +53,11 @@ public class ProjectRestfulApi { @Autowired - private DWSProjectTaxonomyService projectTaxonomyService; + private DSSProjectTaxonomyService projectTaxonomyService; @Autowired - private DWSProjectService projectService; + private DSSProjectService projectService; @Autowired - private DWSUserService dwsUserService; + private DSSUserService dssUserService; @Autowired private ProjectMapper projectMapper; @Autowired @@ -66,12 +66,12 @@ public class ProjectRestfulApi { private PublishManager publishManager; @Autowired - private DWSUserMapper dwsUserMapper; + private DSSUserMapper dssUserMapper; @GET @Path("/listAllProjectVersions") public Response listAllVersions(@Context HttpServletRequest req, @QueryParam("id") Long projectID) { - List versions = projectService.listAllProjectVersions(projectID); + List versions = projectService.listAllProjectVersions(projectID); return Message.messageToResponse(Message.ok().data("versions", versions)); } @@ -101,8 +101,9 @@ public Response addProject(@Context HttpServletRequest req, JsonNode json) throw String product = json.get("product").getTextValue(); Integer applicationArea = json.get("applicationArea").getIntValue(); String business = json.get("business").getTextValue(); + Long workspaceId = json.get("workspaceId") == null ? 1 : json.get("workspaceId").getLongValue(); // TODO: 2019/5/16 空值校验,重复名校验 - projectService.addProject(userName, name, description, taxonomyID,product,applicationArea,business); + projectService.addProject(userName, name, description, taxonomyID,product,applicationArea,business, workspaceId); return Message.messageToResponse(Message.ok()); } @@ -144,7 +145,7 @@ public Response copyProject(@Context HttpServletRequest req, JsonNode json) thro String userName = SecurityFilter.getLoginUsername(req); Long projectID = json.get("projectID").getLongValue(); String projectName = json.get("projectName") == null ? null : json.get("projectName").getTextValue(); - DWSProjectVersion maxVersion = projectMapper.selectLatestVersionByProjectID(projectID); + DSSProjectVersion maxVersion = projectMapper.selectLatestVersionByProjectID(projectID); projectService.copyProject( maxVersion.getId(),projectID, projectName, userName); return Message.messageToResponse(Message.ok()); } @@ -154,8 +155,8 @@ public Response copyProject(@Context HttpServletRequest req, JsonNode json) thro public Response copyProjectVersion(@Context HttpServletRequest req, JsonNode json) throws InterruptedException, DSSErrorException { String userName = SecurityFilter.getLoginUsername(req); Long copyprojectVersionID = json.get("projectVersionID").getLongValue(); - DWSProjectVersion currentVersion = projectMapper.selectProjectVersionByID(copyprojectVersionID); - DWSProjectVersion maxVersion = projectMapper.selectLatestVersionByProjectID(currentVersion.getProjectID()); + DSSProjectVersion currentVersion = projectMapper.selectProjectVersionByID(copyprojectVersionID); + DSSProjectVersion maxVersion = projectMapper.selectLatestVersionByProjectID(currentVersion.getProjectID()); projectService.copyProjectVersionMax( maxVersion.getId(), maxVersion,currentVersion,userName,null); return Message.messageToResponse(Message.ok()); @@ -167,8 +168,8 @@ public Response publish(@Context HttpServletRequest req, JsonNode json) throws D String userName = SecurityFilter.getLoginUsername(req); Long projectID = json.get("id").getLongValue(); String comment = json.get("comment").getTextValue(); - DWSProject latestVersionProject = projectService.getLatestVersionProject(projectID); - publishManager.addPublishCache(latestVersionProject.getLatestVersion().getId(),dwsUserService.getUserID(userName),comment); + DSSProject latestVersionProject = projectService.getLatestVersionProject(projectID); + publishManager.addPublishCache(latestVersionProject.getLatestVersion().getId(), dssUserService.getUserID(userName),comment); PublishSubmitJob job = publishJobFactory.createSubmitPublishJob(latestVersionProject.getLatestVersion().getId(), userName, comment); Future> submit = PublishThreadPool.get().submit(job); PublishSubmitJobDeamon deamon = publishJobFactory.createSubmitPublishJobDeamon(submit, job); diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/restful/ProjectTaxonomyRestfulApi.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/restful/ProjectTaxonomyRestfulApi.java index f29e1a147..4852c0fe9 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/restful/ProjectTaxonomyRestfulApi.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/restful/ProjectTaxonomyRestfulApi.java @@ -18,9 +18,9 @@ package com.webank.wedatasphere.dss.server.restful; -import com.webank.wedatasphere.dss.server.service.DWSProjectTaxonomyService; -import com.webank.wedatasphere.dss.server.service.DWSUserService; -import com.webank.wedatasphere.dss.server.entity.DWSProjectTaxonomy; +import com.webank.wedatasphere.dss.server.service.DSSProjectTaxonomyService; +import com.webank.wedatasphere.dss.server.service.DSSUserService; +import com.webank.wedatasphere.dss.server.entity.DSSProjectTaxonomy; import com.webank.wedatasphere.dss.common.exception.DSSErrorException; import com.webank.wedatasphere.linkis.server.Message; import com.webank.wedatasphere.linkis.server.security.SecurityFilter; @@ -46,9 +46,9 @@ public class ProjectTaxonomyRestfulApi { @Autowired - private DWSProjectTaxonomyService projectTaxonomyService; + private DSSProjectTaxonomyService projectTaxonomyService; @Autowired - private DWSUserService dwsUserService; + private DSSUserService dssUserService; @POST @Path("/addProjectTaxonomy") @@ -57,14 +57,14 @@ public Response addProjectTaxonomy(@Context HttpServletRequest req, JsonNode jso String name = json.get("name").getTextValue(); String description = json.get("description").getTextValue(); // TODO: 2019/5/16 空值校验,重复名校验 - DWSProjectTaxonomy dwsProjectTaxonomy = new DWSProjectTaxonomy(); + DSSProjectTaxonomy dssProjectTaxonomy = new DSSProjectTaxonomy(); Date date = new Date(); - dwsProjectTaxonomy.setName(name); - dwsProjectTaxonomy.setDescription(description); - dwsProjectTaxonomy.setCreatorID(dwsUserService.getUserID(userName)); - dwsProjectTaxonomy.setCreateTime(date); - dwsProjectTaxonomy.setUpdateTime(date); - projectTaxonomyService.addProjectTaxonomy(dwsProjectTaxonomy); + dssProjectTaxonomy.setName(name); + dssProjectTaxonomy.setDescription(description); + dssProjectTaxonomy.setCreatorID(dssUserService.getUserID(userName)); + dssProjectTaxonomy.setCreateTime(date); + dssProjectTaxonomy.setUpdateTime(date); + projectTaxonomyService.addProjectTaxonomy(dssProjectTaxonomy); return Message.messageToResponse(Message.ok()); } @POST @@ -74,12 +74,12 @@ public Response updateProjectTaxonomy(@Context HttpServletRequest req, JsonNode String description = json.get("description") == null?null:json.get("description").getTextValue(); Long id = json.get("id").getLongValue(); // TODO: 2019/5/16 空值校验,重复名校验 - DWSProjectTaxonomy dwsProjectTaxonomy = new DWSProjectTaxonomy(); - dwsProjectTaxonomy.setId(id); - dwsProjectTaxonomy.setName(name); - dwsProjectTaxonomy.setDescription(description); - dwsProjectTaxonomy.setUpdateTime(new Date()); - projectTaxonomyService.updateProjectTaxonomy(dwsProjectTaxonomy); + DSSProjectTaxonomy dssProjectTaxonomy = new DSSProjectTaxonomy(); + dssProjectTaxonomy.setId(id); + dssProjectTaxonomy.setName(name); + dssProjectTaxonomy.setDescription(description); + dssProjectTaxonomy.setUpdateTime(new Date()); + projectTaxonomyService.updateProjectTaxonomy(dssProjectTaxonomy); return Message.messageToResponse(Message.ok()); } diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/restful/TreeRestfulApi.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/restful/TreeRestfulApi.java index 1b9d2806b..fde36296e 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/restful/TreeRestfulApi.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/restful/TreeRestfulApi.java @@ -26,13 +26,11 @@ import com.webank.wedatasphere.linkis.server.security.SecurityFilter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.RequestParam; import scala.Enumeration; import javax.servlet.http.HttpServletRequest; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; +import javax.ws.rs.*; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/restful/WorkspaceRestfulApi.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/restful/WorkspaceRestfulApi.java new file mode 100644 index 000000000..4f85a55a4 --- /dev/null +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/restful/WorkspaceRestfulApi.java @@ -0,0 +1,172 @@ +/* + * 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.server.restful; + +import com.webank.wedatasphere.dss.server.dto.response.HomepageDemoMenuVo; +import com.webank.wedatasphere.dss.server.dto.response.HomepageVideoVo; +import com.webank.wedatasphere.dss.server.dto.response.OnestopMenuVo; +import com.webank.wedatasphere.dss.server.entity.DSSWorkspace; +import com.webank.wedatasphere.dss.server.dto.response.WorkspaceDepartmentVo; +import com.webank.wedatasphere.dss.server.dto.response.*; +import com.webank.wedatasphere.dss.server.service.DSSUserService; +import com.webank.wedatasphere.dss.server.service.DSSWorkspaceService; +import com.webank.wedatasphere.linkis.server.Message; +import com.webank.wedatasphere.linkis.server.security.SecurityFilter; +import org.codehaus.jackson.JsonNode; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import javax.servlet.http.HttpServletRequest; +import javax.ws.rs.*; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import java.util.List; + +/** + * Created by schumiyi on 2020/6/19 + */ +@Component +@Path("/dss") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +public class WorkspaceRestfulApi { + + @Autowired + private DSSWorkspaceService dssWorkspaceService; + + @Autowired + private DSSUserService dssUserService; + + @GET + @Path("/workspaces") + public Response getAllWorkspaces(@Context HttpServletRequest req) { + // TODO: Order By time + List workspaces = dssWorkspaceService.getWorkspaces(); + return Message.messageToResponse(Message.ok().data("workspaces", workspaces)); + } + + @GET + @Path("/workspaces/{id}") + public Response getWorkspacesById(@Context HttpServletRequest req, @PathParam("id") Long id) { + DSSWorkspace workspace = dssWorkspaceService.getWorkspacesById(id); + return Message.messageToResponse(Message.ok().data("workspace", workspace)); + } + + @GET + @Path("/workspaces/departments") + public Response getAllWorkspaceDepartments(@Context HttpServletRequest req) { + List departments = dssWorkspaceService.getWorkSpaceDepartments(); + return Message.messageToResponse(Message.ok().data("departments", departments)); + } + + @GET + @Path("/workspaces/exists") + public Response getUsernameExistence(@Context HttpServletRequest req, @QueryParam("name") String name) { + boolean exists = dssWorkspaceService.existWorkspaceName(name); + return Message.messageToResponse(Message.ok().data("workspaceNameExists", exists)); + } + + @POST + @Path("/workspaces") + public Response addWorkspace(@Context HttpServletRequest req, JsonNode json) { + String userName = SecurityFilter.getLoginUsername(req); + String name = json.get("name").getTextValue(); + if (dssWorkspaceService.existWorkspaceName(name)) { + return Message.messageToResponse(Message.error("工作空间名重复")); + } + String department = json.get("department").getTextValue(); + String label = json.get("label").getTextValue(); + String description = json.get("description").getTextValue(); + Long workspaceId = dssWorkspaceService.addWorkspace(userName, name, department, label, description); + return Message.messageToResponse(Message.ok().data("workspaceId", workspaceId)); + } + + @GET + @Path("/workspaces/demos") + public Response getAllHomepageDemos(@Context HttpServletRequest req) { + String header = req.getHeader("Content-language").trim(); + boolean isChinese = "zh-CN".equals(header); + List homepageDemos = dssWorkspaceService.getHomepageDemos(isChinese); + return Message.messageToResponse(Message.ok().data("demos", homepageDemos)); + } + + @GET + @Path("/workspaces/videos") + public Response getAllVideos(@Context HttpServletRequest req) { + String header = req.getHeader("Content-language").trim(); + boolean isChinese = "zh-CN".equals(header); + List homepageVideos = dssWorkspaceService.getHomepageVideos(isChinese); + return Message.messageToResponse(Message.ok().data("videos", homepageVideos)); + } + + @GET + @Path("workspaces/{workspaceId}/managements") + public Response getWorkspaceManagements(@Context HttpServletRequest req, @PathParam("workspaceId") Long workspaceId) { + String header = req.getHeader("Content-language").trim(); + boolean isChinese = "zh-CN".equals(header); + String username = SecurityFilter.getLoginUsername(req); + + List managements = dssWorkspaceService.getWorkspaceManagements(workspaceId, username, isChinese); + return Message.messageToResponse(Message.ok().data("managements", managements)); + } + + @GET + @Path("workspaces/{workspaceId}/applications") + public Response getWorkspaceApplications(@Context HttpServletRequest req, @PathParam("workspaceId") Long workspaceId) { + String header = req.getHeader("Content-language").trim(); + boolean isChinese = "zh-CN".equals(header); + String username = SecurityFilter.getLoginUsername(req); + List applications = dssWorkspaceService.getWorkspaceApplications(workspaceId, username, isChinese); + return Message.messageToResponse(Message.ok().data("applications", applications)); + } + + @GET + @Path("/workspaces/{workspaceId}/favorites") + public Response getWorkspaceFavorites(@Context HttpServletRequest req, @PathParam("workspaceId") Long workspaceId) { + String header = req.getHeader("Content-language").trim(); + boolean isChinese = "zh-CN".equals(header); + String username = SecurityFilter.getLoginUsername(req); + List favorites = dssWorkspaceService.getWorkspaceFavorites(workspaceId, username, isChinese); + return Message.messageToResponse(Message.ok().data("favorites", favorites)); + } + + /** + * 应用加入收藏,返回收藏后id + * + * @param req + * @param json + * @return + */ + @POST + @Path("/workspaces/{workspaceId}/favorites") + public Response addFavorite(@Context HttpServletRequest req, @PathParam("workspaceId") Long workspaceId, JsonNode json) { + String username = SecurityFilter.getLoginUsername(req); + Long menuApplicationId = json.get("menuApplicationId").getLongValue(); + Long favoriteId = dssWorkspaceService.addFavorite(username, workspaceId, menuApplicationId); + return Message.messageToResponse(Message.ok().data("favoriteId", favoriteId)); + } + + @DELETE + @Path("/workspaces/{workspaceId}/favorites/{favouritesId}") + public Response deleteFavorite(@Context HttpServletRequest req, @PathParam("workspaceId") Long workspaceId, @PathParam("favouritesId") Long favouritesId) { + String username = SecurityFilter.getLoginUsername(req); + Long favoriteId = dssWorkspaceService.deleteFavorite(username, favouritesId); + return Message.messageToResponse(Message.ok().data("favoriteId", favoriteId)); + } +} diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DWSFlowService.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DSSFlowService.java similarity index 64% rename from dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DWSFlowService.java rename to dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DSSFlowService.java index 384748ee4..12d0f5770 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DWSFlowService.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DSSFlowService.java @@ -17,52 +17,48 @@ package com.webank.wedatasphere.dss.server.service; - - - - import com.webank.wedatasphere.dss.appjoint.exception.AppJointErrorException; -import com.webank.wedatasphere.dss.common.entity.flow.DWSFlow; -import com.webank.wedatasphere.dss.common.entity.flow.DWSFlowVersion; +import com.webank.wedatasphere.dss.common.entity.flow.DSSFlow; +import com.webank.wedatasphere.dss.common.entity.flow.DSSFlowVersion; import com.webank.wedatasphere.dss.common.exception.DSSErrorException; import com.webank.wedatasphere.dss.server.operate.Op; import java.util.List; -public interface DWSFlowService { - DWSFlow getFlowByID(Long id); +public interface DSSFlowService { + DSSFlow getFlowByID(Long id); - List listAllFlowVersions(Long flowID, Long projectVersionID); + List listAllFlowVersions(Long flowID, Long projectVersionID); - DWSFlow addRootFlow(DWSFlow dwsFlow, Long taxonomyID, Long projectVersionID) throws DSSErrorException; + DSSFlow addRootFlow(DSSFlow dssFlow, Long taxonomyID, Long projectVersionID) throws DSSErrorException; - DWSFlow addSubFlow(DWSFlow dwsFlow, Long parentFlowID, Long projectVersionID) throws DSSErrorException; + DSSFlow addSubFlow(DSSFlow dssFlow, Long parentFlowID, Long projectVersionID) throws DSSErrorException; /** - * 通过flowID获取最新版本的dwsFlow,版本信息在latestVersion + * 通过flowID获取最新版本的DSSFlow,版本信息在latestVersion * @param flowID * @return */ - DWSFlow getLatestVersionFlow(Long flowID, Long projectVersionID) throws DSSErrorException; + DSSFlow getLatestVersionFlow(Long flowID, Long projectVersionID) throws DSSErrorException; /** - * 通过flowID和某个版本号,获取一个dwsFlow,版本信息在versions数组中的第一个元素 + * 通过flowID和某个版本号,获取一个DSSFlow,版本信息在versions数组中的第一个元素 * @param flowID * @return */ - DWSFlow getOneVersionFlow(Long flowID, String version, Long projectVersionID); + DSSFlow getOneVersionFlow(Long flowID, String version, Long projectVersionID); /** - * 通过dwsFlow对象拿到最新的json,其实这里只要个flowID应该就可以了 - * @param dwsFlow + * 通过DSSFlow对象拿到最新的json,其实这里只要个flowID应该就可以了 + * @param dssFlow * @return */ -/* String getLatestJsonByFlow(DWSFlow dwsFlow); +/* String getLatestJsonByFlow(dssFlow dssFlow); - DWSFlow getLatestVersionFlow(Long ProjectID,String flowName);*/ + dssFlow getLatestVersionFlow(Long ProjectID,String flowName);*/ - void updateFlowBaseInfo(DWSFlow dwsFlow, Long projectVersionID, Long taxonomyID) throws DSSErrorException; + void updateFlowBaseInfo(DSSFlow dssFlow, Long projectVersionID, Long taxonomyID) throws DSSErrorException; void updateFlowTaxonomyRelation(Long flowID, Long taxonomyID) throws DSSErrorException; @@ -72,7 +68,7 @@ public interface DWSFlowService { Integer getParentRank(Long flowID); - DWSFlowVersion getLatestVersionByFlowIDAndProjectVersionID(Long flowID, Long projectVersionID); + DSSFlowVersion getLatestVersionByFlowIDAndProjectVersionID(Long flowID, Long projectVersionID); Long getParentFlowID(Long id); } diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DWSFlowTaxonomyService.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DSSFlowTaxonomyService.java similarity index 71% rename from dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DWSFlowTaxonomyService.java rename to dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DSSFlowTaxonomyService.java index db0fcf3a8..f105779a3 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DWSFlowTaxonomyService.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DSSFlowTaxonomyService.java @@ -18,22 +18,22 @@ package com.webank.wedatasphere.dss.server.service; -import com.webank.wedatasphere.dss.server.entity.DWSFlowTaxonomy; +import com.webank.wedatasphere.dss.server.entity.DSSFlowTaxonomy; import com.webank.wedatasphere.dss.common.exception.DSSErrorException; import java.util.List; -public interface DWSFlowTaxonomyService { - DWSFlowTaxonomy getFlowTaxonomyByID(Long id); +public interface DSSFlowTaxonomyService { + DSSFlowTaxonomy getFlowTaxonomyByID(Long id); //--------- - List listAllFlowTaxonomy(Long projectVersionID, Boolean isRootFlow); - List listFlowTaxonomy(Long projectVersionID, Long flowTaxonomyID, Boolean isRootFlow); + List listAllFlowTaxonomy(Long projectVersionID, Boolean isRootFlow); + List listFlowTaxonomy(Long projectVersionID, Long flowTaxonomyID, Boolean isRootFlow); - void addFlowTaxonomy(DWSFlowTaxonomy dwsFlowTaxonomy, Long projectVersionID) throws DSSErrorException; + void addFlowTaxonomy(DSSFlowTaxonomy dssFlowTaxonomy, Long projectVersionID) throws DSSErrorException; - void updateFlowTaxonomy(DWSFlowTaxonomy dwsFlowTaxonomy, Long projectVersionID) throws DSSErrorException; + void updateFlowTaxonomy(DSSFlowTaxonomy dssFlowTaxonomy, Long projectVersionID) throws DSSErrorException; boolean hasFlows(Long flowTaxonomyID); diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DWSNodeInfoService.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DSSNodeInfoService.java similarity index 95% rename from dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DWSNodeInfoService.java rename to dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DSSNodeInfoService.java index 846c69f4b..dc7303f52 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DWSNodeInfoService.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DSSNodeInfoService.java @@ -26,7 +26,7 @@ import java.util.List; -public interface DWSNodeInfoService { +public interface DSSNodeInfoService { List getNodeType(String f); diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DWSProjectService.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DSSProjectService.java similarity index 70% rename from dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DWSProjectService.java rename to dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DSSProjectService.java index 1f40d2088..1cad4fd68 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DWSProjectService.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DSSProjectService.java @@ -17,40 +17,38 @@ package com.webank.wedatasphere.dss.server.service; - - import com.webank.wedatasphere.dss.appjoint.exception.AppJointErrorException; -import com.webank.wedatasphere.dss.common.entity.project.DWSProject; -import com.webank.wedatasphere.dss.common.entity.project.DWSProjectPublishHistory; -import com.webank.wedatasphere.dss.common.entity.project.DWSProjectVersion; +import com.webank.wedatasphere.dss.common.entity.project.DSSProject; +import com.webank.wedatasphere.dss.common.entity.project.DSSProjectPublishHistory; +import com.webank.wedatasphere.dss.common.entity.project.DSSProjectVersion; import com.webank.wedatasphere.dss.common.exception.DSSErrorException; -import com.webank.wedatasphere.dss.common.protocol.RequestDWSProject; +import com.webank.wedatasphere.dss.common.protocol.RequestDSSProject; import java.util.Date; import java.util.List; -public interface DWSProjectService { +public interface DSSProjectService { - DWSProject getProjectByID(Long id); + DSSProject getProjectByID(Long id); - Long addProject(String userName, String name, String description, Long taxonomyID,String product,Integer applicationArea,String business) throws DSSErrorException, AppJointErrorException; + Long addProject(String userName, String name, String description, Long taxonomyID,String product,Integer applicationArea,String business, Long workspaceId) throws DSSErrorException, AppJointErrorException; void updateProject(long projectID, String name, String description, String userName , String product ,Integer applicationArea ,String business) throws AppJointErrorException; void deleteProject(long projectID, String userName, Boolean ifDelScheduler) throws DSSErrorException; - DWSProject getLatestVersionProject(Long projectID); + DSSProject getLatestVersionProject(Long projectID); - DWSProject getProjectByProjectVersionID(Long projectVersionID); + DSSProject getProjectByProjectVersionID(Long projectVersionID); Boolean isPublished(Long projectID); - List listAllProjectVersions(Long projectID); + List listAllProjectVersions(Long projectID); Long copyProject(Long projectVersionID, Long projectID, String projectName, String userName) throws DSSErrorException, InterruptedException, AppJointErrorException; - void copyProjectVersionMax(Long projectVersionID, DWSProjectVersion maxVersion, DWSProjectVersion copyVersion, String userName, Long WTSSprojectID) throws DSSErrorException, InterruptedException; + void copyProjectVersionMax(Long projectVersionID, DSSProjectVersion maxVersion, DSSProjectVersion copyVersion, String userName, Long WTSSprojectID) throws DSSErrorException, InterruptedException; void publish(Long projectVersionID, String userName, String comment) throws DSSErrorException, InterruptedException, AppJointErrorException; @@ -58,9 +56,9 @@ public interface DWSProjectService { void updatePublishHistory(Long projectVersionID, Integer status, Date updateTime); - DWSProjectPublishHistory getPublishHistoryByID(Long projectVersionID); + DSSProjectPublishHistory getPublishHistoryByID(Long projectVersionID); - DWSProject getExecutionDWSProject(RequestDWSProject requestDWSProject) throws DSSErrorException; + DSSProject getExecutionDSSProject(RequestDSSProject requestDSSProject) throws DSSErrorException; Long getAppjointProjectID(Long projectID, String nodeType); diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DWSProjectTaxonomyService.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DSSProjectTaxonomyService.java similarity index 67% rename from dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DWSProjectTaxonomyService.java rename to dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DSSProjectTaxonomyService.java index 77161fac6..cebabbf63 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DWSProjectTaxonomyService.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DSSProjectTaxonomyService.java @@ -17,29 +17,26 @@ package com.webank.wedatasphere.dss.server.service; - - - -import com.webank.wedatasphere.dss.server.entity.DWSProjectTaxonomy; +import com.webank.wedatasphere.dss.server.entity.DSSProjectTaxonomy; import com.webank.wedatasphere.dss.common.exception.DSSErrorException; import java.util.List; -public interface DWSProjectTaxonomyService { +public interface DSSProjectTaxonomyService { - DWSProjectTaxonomy getProjectTaxonomyByID(Long id); + DSSProjectTaxonomy getProjectTaxonomyByID(Long id); - List listProjectTaxonomyByUser(String userName); + List listProjectTaxonomyByUser(String userName); //---------------------- - List listAllProjectTaxonomy(String userName); + List listAllProjectTaxonomy(String userName, Long workspaceId); - List listProjectTaxonomy(Long taxonomyID, String userName); + List listProjectTaxonomy(Long taxonomyID, String userName); - void addProjectTaxonomy(DWSProjectTaxonomy dwsProjectTaxonomy) throws DSSErrorException; + void addProjectTaxonomy(DSSProjectTaxonomy dssProjectTaxonomy) throws DSSErrorException; - void updateProjectTaxonomy(DWSProjectTaxonomy dwsProjectTaxonomy) throws DSSErrorException; + void updateProjectTaxonomy(DSSProjectTaxonomy dssProjectTaxonomy) throws DSSErrorException; boolean hasProjects(Long projectTaxonomyID); diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DWSUserService.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DSSUserService.java similarity index 95% rename from dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DWSUserService.java rename to dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DSSUserService.java index fe279df24..2c2760297 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DWSUserService.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DSSUserService.java @@ -18,6 +18,6 @@ package com.webank.wedatasphere.dss.server.service; -public interface DWSUserService { +public interface DSSUserService { Long getUserID(String userName); } diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DSSWorkspaceService.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DSSWorkspaceService.java new file mode 100644 index 000000000..f88c221ea --- /dev/null +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/DSSWorkspaceService.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.server.service; + +import com.webank.wedatasphere.dss.server.dto.response.HomepageDemoMenuVo; +import com.webank.wedatasphere.dss.server.dto.response.HomepageVideoVo; +import com.webank.wedatasphere.dss.server.dto.response.OnestopMenuVo; +import com.webank.wedatasphere.dss.server.entity.DSSWorkspace; +import com.webank.wedatasphere.dss.server.dto.response.WorkspaceDepartmentVo; +import com.webank.wedatasphere.dss.server.dto.response.*; + +import java.util.List; + +/** + * Created by schumiyi on 2020/6/22 + */ +public interface DSSWorkspaceService { + List getWorkspaces(); + + Long addWorkspace(String userName, String name, String department, String label, String description); + + boolean existWorkspaceName(String name); + + List getWorkSpaceDepartments(); + + List getHomepageDemos(boolean isChinese); + + List getHomepageVideos(boolean isChinese); + + List getWorkspaceManagements(Long workspaceId, String username, boolean isChinese); + + List getWorkspaceApplications(Long workspaceId, String username, boolean isChinese); + + DSSWorkspace getWorkspacesById(Long id); + + /** + * 查询用户收藏的应用,如果是新用户,就在数据库给它插入默认两个收藏:脚本开发与工作流 workflow scriptis + * @param workspaceId + * @param username + * @param isChinese + * @return + */ + List getWorkspaceFavorites(Long workspaceId, String username, boolean isChinese); + + Long addFavorite(String username, Long workspaceId, Long menuApplicationId); + + Long deleteFavorite(String username, Long favouritesId); +} diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DWSFlowServiceImpl.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DSSFlowServiceImpl.java similarity index 70% rename from dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DWSFlowServiceImpl.java rename to dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DSSFlowServiceImpl.java index c4ce9228a..218aacc44 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DWSFlowServiceImpl.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DSSFlowServiceImpl.java @@ -19,18 +19,18 @@ import com.webank.wedatasphere.dss.appjoint.exception.AppJointErrorException; -import com.webank.wedatasphere.dss.common.entity.flow.DWSFlow; -import com.webank.wedatasphere.dss.common.entity.flow.DWSFlowVersion; +import com.webank.wedatasphere.dss.common.entity.flow.DSSFlow; +import com.webank.wedatasphere.dss.common.entity.flow.DSSFlowVersion; import com.webank.wedatasphere.dss.common.exception.DSSErrorException; -import com.webank.wedatasphere.dss.server.dao.DWSUserMapper; +import com.webank.wedatasphere.dss.server.dao.DSSUserMapper; import com.webank.wedatasphere.dss.server.dao.FlowMapper; import com.webank.wedatasphere.dss.server.dao.FlowTaxonomyMapper; import com.webank.wedatasphere.dss.server.lock.Lock; import com.webank.wedatasphere.dss.server.operate.Op; import com.webank.wedatasphere.dss.server.operate.Operate; import com.webank.wedatasphere.dss.server.service.BMLService; -import com.webank.wedatasphere.dss.server.service.DWSFlowService; -import com.webank.wedatasphere.dss.server.service.DWSProjectService; +import com.webank.wedatasphere.dss.server.service.DSSFlowService; +import com.webank.wedatasphere.dss.server.service.DSSProjectService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -43,7 +43,7 @@ @Service -public class DWSFlowServiceImpl implements DWSFlowService { +public class DSSFlowServiceImpl implements DSSFlowService { private Logger logger = LoggerFactory.getLogger(this.getClass()); @@ -52,23 +52,23 @@ public class DWSFlowServiceImpl implements DWSFlowService { @Autowired private FlowTaxonomyMapper flowTaxonomyMapper; @Autowired - private DWSUserMapper dwsUserMapper; + private DSSUserMapper dssUserMapper; @Autowired - private DWSProjectService projectService; + private DSSProjectService projectService; @Autowired private Operate[] operates; @Autowired private BMLService bmlService; @Override - public DWSFlow getFlowByID(Long id) { + public DSSFlow getFlowByID(Long id) { return flowMapper.selectFlowByID(id); } @Override - public List listAllFlowVersions(Long flowID, Long projectVersionID) { - List versions = flowMapper.listFlowVersionsByFlowID(flowID, projectVersionID).stream().sorted((v1, v2) -> { + public List listAllFlowVersions(Long flowID, Long projectVersionID) { + List versions = flowMapper.listFlowVersionsByFlowID(flowID, projectVersionID).stream().sorted((v1, v2) -> { return v1.compareTo(v2); }).collect(Collectors.toList()); return versions; @@ -77,76 +77,76 @@ public List listAllFlowVersions(Long flowID, Long projectVersion @Lock @Transactional(rollbackFor = DSSErrorException.class) @Override - public DWSFlow addRootFlow(DWSFlow dwsFlow, Long taxonomyID, Long projectVersionID) throws DSSErrorException { + public DSSFlow addRootFlow(DSSFlow dssFlow, Long taxonomyID, Long projectVersionID) throws DSSErrorException { try { - flowMapper.insertFlow(dwsFlow); + flowMapper.insertFlow(dssFlow); } catch (DuplicateKeyException e) { logger.info(e.getMessage()); throw new DSSErrorException(90003, "工作流名不能重复"); } //通过resource上传空文件,获取resourceId(jsonPath)和version - Map bmlReturnMap = bmlService.upload(dwsUserMapper.getuserName(dwsFlow.getCreatorID()), "", UUID.randomUUID().toString() + ".json"); + Map bmlReturnMap = bmlService.upload(dssUserMapper.getuserName(dssFlow.getCreatorID()), "", UUID.randomUUID().toString() + ".json"); //数据库中插入版本信息 - DWSFlowVersion version = new DWSFlowVersion(); - version.setFlowID(dwsFlow.getId()); + DSSFlowVersion version = new DSSFlowVersion(); + version.setFlowID(dssFlow.getId()); version.setSource("create by user"); version.setJsonPath(bmlReturnMap.get("resourceId").toString()); version.setVersion(bmlReturnMap.get("version").toString()); version.setUpdateTime(new Date()); - version.setUpdatorID(dwsFlow.getCreatorID()); + version.setUpdatorID(dssFlow.getCreatorID()); // TODO: 2019/6/12 这里应该由前台传入 version.setProjectVersionID(projectVersionID); flowMapper.insertFlowVersion(version); //数据库中插入分类关联信息 - flowTaxonomyMapper.insertFlowTaxonomyRelation(taxonomyID, dwsFlow.getId()); - return dwsFlow; + flowTaxonomyMapper.insertFlowTaxonomyRelation(taxonomyID, dssFlow.getId()); + return dssFlow; } @Lock @Transactional(rollbackFor = DSSErrorException.class) @Override - public DWSFlow addSubFlow(DWSFlow dwsFlow, Long parentFlowID, Long projectVersionID) throws DSSErrorException { + public DSSFlow addSubFlow(DSSFlow dssFlow, Long parentFlowID, Long projectVersionID) throws DSSErrorException { Long taxonomyID = flowTaxonomyMapper.selectTaxonomyIDByFlowID(parentFlowID); - DWSFlow parentFlow = flowMapper.selectFlowByID(parentFlowID); - dwsFlow.setProjectID(parentFlow.getProjectID()); - DWSFlow subFlow = addRootFlow(dwsFlow, taxonomyID, projectVersionID); + DSSFlow parentFlow = flowMapper.selectFlowByID(parentFlowID); + dssFlow.setProjectID(parentFlow.getProjectID()); + DSSFlow subFlow = addRootFlow(dssFlow, taxonomyID, projectVersionID); //数据库中插入关联信息 flowMapper.insertFlowRelation(subFlow.getId(), parentFlowID); return subFlow; } @Override - public DWSFlow getLatestVersionFlow(Long flowID, Long projectVersionID) throws DSSErrorException { - DWSFlow dwsFlow = getFlowByID(flowID); - DWSFlowVersion dwsFlowVersion = getLatestVersionByFlowIDAndProjectVersionID(flowID, projectVersionID); - if (dwsFlowVersion == null) throw new DSSErrorException(90011, "该工作流已经被删除,请重新创建"); - String userName = dwsUserMapper.getuserName(dwsFlowVersion.getUpdatorID()); - Map query = bmlService.query(userName, dwsFlowVersion.getJsonPath(), dwsFlowVersion.getVersion()); - dwsFlowVersion.setJson(query.get("string").toString()); - dwsFlow.setLatestVersion(dwsFlowVersion); - return dwsFlow; + public DSSFlow getLatestVersionFlow(Long flowID, Long projectVersionID) throws DSSErrorException { + DSSFlow dssFlow = getFlowByID(flowID); + DSSFlowVersion dssFlowVersion = getLatestVersionByFlowIDAndProjectVersionID(flowID, projectVersionID); + if (dssFlowVersion == null) throw new DSSErrorException(90011, "该工作流已经被删除,请重新创建"); + String userName = dssUserMapper.getuserName(dssFlowVersion.getUpdatorID()); + Map query = bmlService.query(userName, dssFlowVersion.getJsonPath(), dssFlowVersion.getVersion()); + dssFlowVersion.setJson(query.get("string").toString()); + dssFlow.setLatestVersion(dssFlowVersion); + return dssFlow; } @Override - public DWSFlow getOneVersionFlow(Long flowID, String version, Long projectVersionID) { - DWSFlow dwsFlow = getFlowByID(flowID); - DWSFlowVersion dwsFlowVersion = flowMapper.selectVersionByFlowID(flowID, version, projectVersionID); - String userName = dwsUserMapper.getuserName(dwsFlowVersion.getUpdatorID()); - Map query = bmlService.query(userName, dwsFlowVersion.getJsonPath(), dwsFlowVersion.getVersion()); - dwsFlowVersion.setJson(query.get("string").toString()); - dwsFlow.setFlowVersions(Arrays.asList(dwsFlowVersion)); - dwsFlow.setLatestVersion(dwsFlowVersion); - return dwsFlow; + public DSSFlow getOneVersionFlow(Long flowID, String version, Long projectVersionID) { + DSSFlow dssFlow = getFlowByID(flowID); + DSSFlowVersion dssFlowVersion = flowMapper.selectVersionByFlowID(flowID, version, projectVersionID); + String userName = dssUserMapper.getuserName(dssFlowVersion.getUpdatorID()); + Map query = bmlService.query(userName, dssFlowVersion.getJsonPath(), dssFlowVersion.getVersion()); + dssFlowVersion.setJson(query.get("string").toString()); + dssFlow.setFlowVersions(Arrays.asList(dssFlowVersion)); + dssFlow.setLatestVersion(dssFlowVersion); + return dssFlow; } /* @Override - public String getLatestJsonByFlow(DWSFlow dwsFlow) { - DWSFlow latestVersionFlow = getLatestVersionFlow(dwsFlow.getId()); + public String getLatestJsonByFlow(DSSFlow DSSFlow) { + DSSFlow latestVersionFlow = getLatestVersionFlow(DSSFlow.getId()); return latestVersionFlow.getLatestVersion().getJson(); } @Override - public DWSFlow getLatestVersionFlow(Long ProjectID, String flowName) { + public DSSFlow getLatestVersionFlow(Long ProjectID, String flowName) { Long flowID = flowMapper.selectFlowIDByProjectIDAndFlowName(ProjectID, flowName); return getLatestVersionFlow(flowID); }*/ @@ -154,22 +154,22 @@ public DWSFlow getLatestVersionFlow(Long ProjectID, String flowName) { @Lock @Transactional(rollbackFor = DSSErrorException.class) @Override - public void updateFlowBaseInfo(DWSFlow dwsFlow, Long projectVersionID, Long taxonomyID) throws DSSErrorException { + public void updateFlowBaseInfo(DSSFlow dssFlow, Long projectVersionID, Long taxonomyID) throws DSSErrorException { try { - flowMapper.updateFlowBaseInfo(dwsFlow); + flowMapper.updateFlowBaseInfo(dssFlow); } catch (DuplicateKeyException e) { logger.info(e.getMessage()); throw new DSSErrorException(90003, "工作流名不能重复"); } - if (taxonomyID != null) updateFlowTaxonomyRelation(dwsFlow.getId(), taxonomyID); + if (taxonomyID != null) updateFlowTaxonomyRelation(dssFlow.getId(), taxonomyID); } @Override public void updateFlowTaxonomyRelation(Long flowID, Long taxonomyID) throws DSSErrorException { - DWSFlow dwsFlow = getFlowByID(flowID); + DSSFlow dssFlow = getFlowByID(flowID); Long oldTaxonomyID = flowTaxonomyMapper.selectTaxonomyIDByFlowID(flowID); - if (!dwsFlow.getRootFlow() && (!oldTaxonomyID.equals(taxonomyID))) throw new DSSErrorException(90010, "子工作流不允许更新分类id"); - if (!dwsFlow.getRootFlow() && (oldTaxonomyID.equals(taxonomyID))) return; + if (!dssFlow.getRootFlow() && (!oldTaxonomyID.equals(taxonomyID))) throw new DSSErrorException(90010, "子工作流不允许更新分类id"); + if (!dssFlow.getRootFlow() && (oldTaxonomyID.equals(taxonomyID))) return; //这里也要同时更新子工作流的分类id List subFlowIDList = flowMapper.selectSubFlowIDByParentFlowID(flowID); subFlowIDList.add(flowID); @@ -213,17 +213,17 @@ public String saveFlow(Long flowID, String jsonFlow, String comment, String user String resourceId = getLatestVersionByFlowIDAndProjectVersionID(flowID, projectVersionID).getJsonPath(); //上传文件获取resourceId和version save应该是已经有 Map bmlReturnMap = bmlService.update(userName, resourceId, jsonFlow); - DWSFlowVersion dwsFlowVersion = new DWSFlowVersion(); - dwsFlowVersion.setUpdatorID(dwsUserMapper.getUserID(userName)); - dwsFlowVersion.setUpdateTime(new Date()); - dwsFlowVersion.setVersion(bmlReturnMap.get("version").toString()); - dwsFlowVersion.setJsonPath(resourceId); - dwsFlowVersion.setComment(comment); - dwsFlowVersion.setFlowID(flowID); - dwsFlowVersion.setSource("保存更新"); - dwsFlowVersion.setProjectVersionID(projectVersionID); + DSSFlowVersion dssFlowVersion = new DSSFlowVersion(); + dssFlowVersion.setUpdatorID(dssUserMapper.getUserID(userName)); + dssFlowVersion.setUpdateTime(new Date()); + dssFlowVersion.setVersion(bmlReturnMap.get("version").toString()); + dssFlowVersion.setJsonPath(resourceId); + dssFlowVersion.setComment(comment); + dssFlowVersion.setFlowID(flowID); + dssFlowVersion.setSource("保存更新"); + dssFlowVersion.setProjectVersionID(projectVersionID); //version表中插入数据 - flowMapper.insertFlowVersion(dwsFlowVersion); + flowMapper.insertFlowVersion(dssFlowVersion); return bmlReturnMap.get("version").toString(); } @@ -233,8 +233,8 @@ public Integer getParentRank(Long parentFlowID) { } @Override - public DWSFlowVersion getLatestVersionByFlowIDAndProjectVersionID(Long flowID, Long projectVersionID) { - List versions = flowMapper.listVersionByFlowIDAndProjectVersionID(flowID, projectVersionID) + public DSSFlowVersion getLatestVersionByFlowIDAndProjectVersionID(Long flowID, Long projectVersionID) { + List versions = flowMapper.listVersionByFlowIDAndProjectVersionID(flowID, projectVersionID) .stream().sorted((v1, v2) -> { return v1.compareTo(v2); }).collect(Collectors.toList()); @@ -262,21 +262,21 @@ public void deleteFlow(Long flowId, Long projectVersionID) { deleteFlow(subFlowID, projectVersionID); } for (Long subFlowID : subFlowIDs) { - deleteDWSDB(subFlowID, projectVersionID); + deleteDSSDB(subFlowID, projectVersionID); // TODO: 2019/6/5 wtss发布过的工作流的删除? // TODO: 2019/6/5 json中资源的删除 // TODO: 2019/6/5 事务的保证 } - deleteDWSDB(flowId, projectVersionID); + deleteDSSDB(flowId, projectVersionID); } - private void deleteDWSDB(Long flowID, Long projectVersionID) { + private void deleteDSSDB(Long flowID, Long projectVersionID) { flowMapper.deleteFlowVersions(flowID, projectVersionID); if (projectVersionID == null || (flowMapper.noVersions(flowID) != null && flowMapper.noVersions(flowID))) { flowMapper.deleteFlowBaseInfo(flowID); flowMapper.deleteFlowRelation(flowID); flowTaxonomyMapper.deleteFlowTaxonomyRelation(flowID); } - //第一期没有工作流的发布,所以不需要删除dws工作流的发布表 + //第一期没有工作流的发布,所以不需要删除DSS工作流的发布表 } } diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DWSFlowTaxonomyServiceImpl.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DSSFlowTaxonomyServiceImpl.java similarity index 58% rename from dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DWSFlowTaxonomyServiceImpl.java rename to dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DSSFlowTaxonomyServiceImpl.java index 6d2d4d56b..0cbba745b 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DWSFlowTaxonomyServiceImpl.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DSSFlowTaxonomyServiceImpl.java @@ -17,15 +17,15 @@ package com.webank.wedatasphere.dss.server.service.impl; -import com.webank.wedatasphere.dss.server.service.DWSFlowService; -import com.webank.wedatasphere.dss.server.service.DWSFlowTaxonomyService; -import com.webank.wedatasphere.dss.server.service.DWSProjectService; +import com.webank.wedatasphere.dss.server.service.DSSFlowService; +import com.webank.wedatasphere.dss.server.service.DSSFlowTaxonomyService; +import com.webank.wedatasphere.dss.server.service.DSSProjectService; import com.webank.wedatasphere.dss.server.dao.FlowMapper; import com.webank.wedatasphere.dss.server.dao.FlowTaxonomyMapper; -import com.webank.wedatasphere.dss.server.entity.DWSFlowTaxonomy; -import com.webank.wedatasphere.dss.common.entity.flow.DWSFlow; -import com.webank.wedatasphere.dss.common.entity.flow.DWSFlowVersion; -import com.webank.wedatasphere.dss.common.entity.project.DWSProject; +import com.webank.wedatasphere.dss.server.entity.DSSFlowTaxonomy; +import com.webank.wedatasphere.dss.common.entity.flow.DSSFlow; +import com.webank.wedatasphere.dss.common.entity.flow.DSSFlowVersion; +import com.webank.wedatasphere.dss.common.entity.project.DSSProject; import com.webank.wedatasphere.dss.common.exception.DSSErrorException; import com.webank.wedatasphere.dss.server.lock.Lock; import org.slf4j.Logger; @@ -41,7 +41,7 @@ @Service -public class DWSFlowTaxonomyServiceImpl implements DWSFlowTaxonomyService { +public class DSSFlowTaxonomyServiceImpl implements DSSFlowTaxonomyService { private Logger logger = LoggerFactory.getLogger(this.getClass()); @Autowired @@ -51,60 +51,60 @@ public class DWSFlowTaxonomyServiceImpl implements DWSFlowTaxonomyService { private FlowMapper flowMapper; @Autowired - private DWSProjectService projectService; + private DSSProjectService projectService; @Autowired - private DWSFlowService flowService; + private DSSFlowService flowService; @Override - public DWSFlowTaxonomy getFlowTaxonomyByID(Long id) { + public DSSFlowTaxonomy getFlowTaxonomyByID(Long id) { return flowTaxonomyMapper.selectFlowTaxonomyByID(id); } - private List listFlowByTaxonomyID(Long projectID, Long taxonomyID, Boolean isRootFlow){ + private List listFlowByTaxonomyID(Long projectID, Long taxonomyID, Boolean isRootFlow){ return flowMapper.listFlowByTaxonomyID(projectID,taxonomyID,isRootFlow); } // TODO: 2019/5/16 级联查询返回json序列化好像有问题,暂时只能循环查 @Override - public List listAllFlowTaxonomy(Long projectVersionID,Boolean isRootFlow) { - DWSProject dwsProject = projectService.getProjectByProjectVersionID(projectVersionID); - List dwsFlowTaxonomies = listFlowTaxonomyByProjectID(dwsProject.getId()); - for (DWSFlowTaxonomy dwsFlowTaxonomy : dwsFlowTaxonomies) { - List dwsFlowList = listFlowByTaxonomyID(dwsProject.getId(),dwsFlowTaxonomy.getId(),isRootFlow); - for (DWSFlow dwsFlow : dwsFlowList) { - DWSFlowVersion version = flowService.getLatestVersionByFlowIDAndProjectVersionID(dwsFlow.getId(),projectVersionID); - dwsFlow.setLatestVersion(version); + public List listAllFlowTaxonomy(Long projectVersionID, Boolean isRootFlow) { + DSSProject dssProject = projectService.getProjectByProjectVersionID(projectVersionID); + List dwsFlowTaxonomies = listFlowTaxonomyByProjectID(dssProject.getId()); + for (DSSFlowTaxonomy dssFlowTaxonomy : dwsFlowTaxonomies) { + List dssFlowList = listFlowByTaxonomyID(dssProject.getId(), dssFlowTaxonomy.getId(),isRootFlow); + for (DSSFlow dssFlow : dssFlowList) { + DSSFlowVersion version = flowService.getLatestVersionByFlowIDAndProjectVersionID(dssFlow.getId(),projectVersionID); + dssFlow.setLatestVersion(version); } - dwsFlowTaxonomy.setDwsFlowList(dwsFlowList.stream().filter(f ->f.getLatestVersion() !=null).collect(Collectors.toList())); + dssFlowTaxonomy.setDssFlowList(dssFlowList.stream().filter(f ->f.getLatestVersion() !=null).collect(Collectors.toList())); } return dwsFlowTaxonomies; } - private List listFlowTaxonomyByProjectID(Long projectID) { + private List listFlowTaxonomyByProjectID(Long projectID) { return flowTaxonomyMapper.listFlowTaxonomyByProjectID(projectID); } //有projectID应该可以同时过滤不同用户中的,我的工作流分类下的工作流 @Override - public List listFlowTaxonomy(Long projectVersionID,Long flowTaxonomyID, Boolean isRootFlow) { - DWSFlowTaxonomy flowTaxonomy = getFlowTaxonomyByID(flowTaxonomyID); - DWSProject dwsProject = projectService.getProjectByProjectVersionID(projectVersionID); - List dwsFlowList = listFlowByTaxonomyID(dwsProject.getId(),flowTaxonomyID,isRootFlow); - for (DWSFlow dwsFlow : dwsFlowList) { - DWSFlowVersion version = flowService.getLatestVersionByFlowIDAndProjectVersionID(dwsFlow.getId(),projectVersionID); - dwsFlow.setLatestVersion(version); + public List listFlowTaxonomy(Long projectVersionID, Long flowTaxonomyID, Boolean isRootFlow) { + DSSFlowTaxonomy flowTaxonomy = getFlowTaxonomyByID(flowTaxonomyID); + DSSProject dssProject = projectService.getProjectByProjectVersionID(projectVersionID); + List dssFlowList = listFlowByTaxonomyID(dssProject.getId(),flowTaxonomyID,isRootFlow); + for (DSSFlow dssFlow : dssFlowList) { + DSSFlowVersion version = flowService.getLatestVersionByFlowIDAndProjectVersionID(dssFlow.getId(),projectVersionID); + dssFlow.setLatestVersion(version); } - flowTaxonomy.setDwsFlowList(dwsFlowList.stream().filter(f ->f.getLatestVersion() !=null).collect(Collectors.toList())); + flowTaxonomy.setDssFlowList(dssFlowList.stream().filter(f ->f.getLatestVersion() !=null).collect(Collectors.toList())); return Arrays.asList(flowTaxonomy); } @Lock @Transactional(rollbackFor = DSSErrorException.class) @Override - public void addFlowTaxonomy(DWSFlowTaxonomy dwsFlowTaxonomy,Long projectVersionID) throws DSSErrorException { + public void addFlowTaxonomy(DSSFlowTaxonomy dssFlowTaxonomy, Long projectVersionID) throws DSSErrorException { try { - flowTaxonomyMapper.insertFlowTaxonomy(dwsFlowTaxonomy); + flowTaxonomyMapper.insertFlowTaxonomy(dssFlowTaxonomy); }catch (DuplicateKeyException e){ logger.info(e.getMessage()); throw new DSSErrorException(90005,"工作流名分类名不能重复"); @@ -114,9 +114,9 @@ public void addFlowTaxonomy(DWSFlowTaxonomy dwsFlowTaxonomy,Long projectVersionI @Lock @Transactional(rollbackFor = DSSErrorException.class) @Override - public void updateFlowTaxonomy(DWSFlowTaxonomy dwsFlowTaxonomy,Long projectVersionID) throws DSSErrorException { + public void updateFlowTaxonomy(DSSFlowTaxonomy dssFlowTaxonomy, Long projectVersionID) throws DSSErrorException { try { - flowTaxonomyMapper.updateFlowTaxonomy(dwsFlowTaxonomy); + flowTaxonomyMapper.updateFlowTaxonomy(dssFlowTaxonomy); }catch (DuplicateKeyException e){ logger.info(e.getMessage()); throw new DSSErrorException(90005,"工作流名分类名不能重复"); diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DWSNodeInfoServiceImpl.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DSSNodeInfoServiceImpl.java similarity index 85% rename from dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DWSNodeInfoServiceImpl.java rename to dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DSSNodeInfoServiceImpl.java index bfbdfa5d5..0b9571f26 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DWSNodeInfoServiceImpl.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DSSNodeInfoServiceImpl.java @@ -17,10 +17,9 @@ package com.webank.wedatasphere.dss.server.service.impl; -import com.webank.wedatasphere.dss.application.entity.Application; import com.webank.wedatasphere.dss.server.dao.NodeInfoMapper; import com.webank.wedatasphere.dss.server.entity.NodeInfo; -import com.webank.wedatasphere.dss.server.service.DWSNodeInfoService; +import com.webank.wedatasphere.dss.server.service.DSSNodeInfoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -28,7 +27,7 @@ @Service -public class DWSNodeInfoServiceImpl implements DWSNodeInfoService { +public class DSSNodeInfoServiceImpl implements DSSNodeInfoService { @Autowired private NodeInfoMapper nodeInfoMapper; diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DWSProjectServiceImpl.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DSSProjectServiceImpl.java similarity index 73% rename from dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DWSProjectServiceImpl.java rename to dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DSSProjectServiceImpl.java index 3d0393e0c..9d007cebc 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DWSProjectServiceImpl.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DSSProjectServiceImpl.java @@ -27,25 +27,25 @@ import com.webank.wedatasphere.dss.appjoint.service.ProjectService; import com.webank.wedatasphere.dss.application.entity.Application; import com.webank.wedatasphere.dss.application.service.ApplicationService; -import com.webank.wedatasphere.dss.common.entity.flow.DWSFlow; -import com.webank.wedatasphere.dss.common.entity.flow.DWSFlowVersion; -import com.webank.wedatasphere.dss.common.entity.project.DWSProject; -import com.webank.wedatasphere.dss.common.entity.project.DWSProjectPublishHistory; -import com.webank.wedatasphere.dss.common.entity.project.DWSProjectVersion; +import com.webank.wedatasphere.dss.common.entity.flow.DSSFlow; +import com.webank.wedatasphere.dss.common.entity.flow.DSSFlowVersion; +import com.webank.wedatasphere.dss.common.entity.project.DSSProject; +import com.webank.wedatasphere.dss.common.entity.project.DSSProjectPublishHistory; +import com.webank.wedatasphere.dss.common.entity.project.DSSProjectVersion; import com.webank.wedatasphere.dss.common.entity.project.Project; import com.webank.wedatasphere.dss.common.exception.DSSErrorException; -import com.webank.wedatasphere.dss.common.protocol.RequestDWSProject; +import com.webank.wedatasphere.dss.common.protocol.RequestDSSProject; import com.webank.wedatasphere.dss.common.utils.DSSExceptionUtils; import com.webank.wedatasphere.dss.server.constant.DSSServerConstant; import com.webank.wedatasphere.dss.server.dao.*; -import com.webank.wedatasphere.dss.server.entity.DWSFlowTaxonomy; -import com.webank.wedatasphere.dss.server.entity.DWSProjectTaxonomyRelation; +import com.webank.wedatasphere.dss.server.entity.DSSFlowTaxonomy; +import com.webank.wedatasphere.dss.server.entity.DSSProjectTaxonomyRelation; import com.webank.wedatasphere.dss.server.function.FunctionInvoker; import com.webank.wedatasphere.dss.server.lock.Lock; import com.webank.wedatasphere.dss.server.lock.LockEnum; import com.webank.wedatasphere.dss.server.service.BMLService; -import com.webank.wedatasphere.dss.server.service.DWSFlowService; -import com.webank.wedatasphere.dss.server.service.DWSProjectService; +import com.webank.wedatasphere.dss.server.service.DSSFlowService; +import com.webank.wedatasphere.dss.server.service.DSSProjectService; import com.webank.wedatasphere.dss.server.util.ThreadPoolTool; import org.apache.commons.lang.StringUtils; import org.apache.commons.math3.util.Pair; @@ -63,20 +63,20 @@ @Service -public class DWSProjectServiceImpl implements DWSProjectService { +public class DSSProjectServiceImpl implements DSSProjectService { private Logger logger = LoggerFactory.getLogger(this.getClass()); @Autowired private ProjectTaxonomyMapper projectTaxonomyMapper; @Autowired - private DWSUserMapper dwsUserMapper; + private DSSUserMapper dssUserMapper; @Autowired private FlowMapper flowMapper; @Autowired private FlowTaxonomyMapper flowTaxonomyMapper; @Autowired - private DWSFlowService flowService; + private DSSFlowService flowService; @Autowired private ProjectMapper projectMapper; @@ -90,29 +90,29 @@ public class DWSProjectServiceImpl implements DWSProjectService { private SchedulerAppJoint schedulerAppJoint=null; @Override - public DWSProject getProjectByID(Long id) { + public DSSProject getProjectByID(Long id) { /*JdbcProjectImpl instance = wtssdbConnector.getInjector().getInstance(JdbcProjectImpl.class); Project project = instance.fetchProjectById(id.intValue()); - DWSProject dwsProject = EntityUtils.Project2DWSProject(project);*/ + DSSProject DSSProject = EntityUtils.Project2DSSProject(project);*/ return projectMapper.selectProjectByID(id); } @Transactional(rollbackFor = {DSSErrorException.class,AppJointErrorException.class}) @Override - public Long addProject(String userName, String name, String description, Long taxonomyID,String product,Integer applicationArea,String business) throws DSSErrorException, AppJointErrorException { - DWSProject dwsProject = new DWSProject(); - dwsProject.setUserName(userName); - dwsProject.setName(name); - dwsProject.setDescription(description); + public Long addProject(String userName, String name, String description, Long taxonomyID,String product,Integer applicationArea,String business, Long workspaceId) throws DSSErrorException, AppJointErrorException { + DSSProject dssProject = new DSSProject(); + dssProject.setUserName(userName); + dssProject.setName(name); + dssProject.setDescription(description); //创建scheduler的project if(existSchesulis()){ - createSchedulerProject(dwsProject); + createSchedulerProject(dssProject); } //创建appjoint的project - Map appjointProjectIDAndAppID = createAppjointProject(dwsProject); - Long userID = dwsUserMapper.getUserID(userName); + Map appjointProjectIDAndAppID = createAppjointProject(dssProject); + Long userID = dssUserMapper.getUserID(userName); //创建dss自己的project - Pair pair = addDWSProject(userID, name, description,product,applicationArea,business); + Pair pair = addDSSProject(userID, name, description,product,applicationArea,business, workspaceId); //添加关联 projectTaxonomyMapper.addProjectTaxonomyRelation(pair.getFirst(), taxonomyID, userID); if(!appjointProjectIDAndAppID.isEmpty())projectMapper.addAccessProjectRelation(appjointProjectIDAndAppID,pair.getFirst()); @@ -121,7 +121,7 @@ public Long addProject(String userName, String name, String description, Long ta - private Map createAppjointProject(DWSProject project) throws DSSErrorException, AppJointErrorException { + private Map createAppjointProject(DSSProject project) throws DSSErrorException, AppJointErrorException { Map applicationProjectIDs = new HashMap(); List> pairs = functionInvoker.projectServiceAddFunction(project, ProjectService::createProject, applicationService.listAppjoint()); for (Pair pair : pairs) { @@ -132,33 +132,34 @@ private Map createAppjointProject(DWSProject project) throws DSSError return applicationProjectIDs; } - private Pair addDWSProject(Long userID, String name, String description,String product,Integer applicationArea,String business) { - DWSProject dwsProject = new DWSProject(); - dwsProject.setUserID(userID); - dwsProject.setName(name); - dwsProject.setDescription(description); - dwsProject.setSource(DSSServerConstant.DWS_PROJECT_SOURCE); - dwsProject.setCreateTime(new Date()); - dwsProject.setCreateBy(userID); - dwsProject.setProduct(product); - dwsProject.setApplicationArea(applicationArea); - dwsProject.setBusiness(business); - projectMapper.addProject(dwsProject); - DWSProjectVersion dwsProjectVersion = new DWSProjectVersion(); - dwsProjectVersion.setComment(DSSServerConstant.DWS_PROJECT_FIRST_VERSION_COMMENT); - dwsProjectVersion.setProjectID(dwsProject.getId()); - dwsProjectVersion.setUpdateTime(new Date()); - dwsProjectVersion.setUpdatorID(userID); - dwsProjectVersion.setVersion(DSSServerConstant.DWS_PROJECT_FIRST_VERSION); - dwsProjectVersion.setLock(0); - projectMapper.addProjectVersion(dwsProjectVersion); - return new Pair(dwsProject.getId(),dwsProjectVersion.getId()); + private Pair addDSSProject(Long userID, String name, String description, String product, Integer applicationArea, String business, Long workspaceId) { + DSSProject dssProject = new DSSProject(); + dssProject.setUserID(userID); + dssProject.setName(name); + dssProject.setDescription(description); + dssProject.setSource(DSSServerConstant.DSS_PROJECT_SOURCE); + dssProject.setCreateTime(new Date()); + dssProject.setCreateBy(userID); + dssProject.setProduct(product); + dssProject.setApplicationArea(applicationArea); + dssProject.setBusiness(business); + dssProject.setWorkspaceId(workspaceId); + projectMapper.addProject(dssProject); + DSSProjectVersion dssProjectVersion = new DSSProjectVersion(); + dssProjectVersion.setComment(DSSServerConstant.DSS_PROJECT_FIRST_VERSION_COMMENT); + dssProjectVersion.setProjectID(dssProject.getId()); + dssProjectVersion.setUpdateTime(new Date()); + dssProjectVersion.setUpdatorID(userID); + dssProjectVersion.setVersion(DSSServerConstant.DSS_PROJECT_FIRST_VERSION); + dssProjectVersion.setLock(0); + projectMapper.addProjectVersion(dssProjectVersion); + return new Pair(dssProject.getId(), dssProjectVersion.getId()); } - private void createSchedulerProject(DWSProject dwsProject) throws DSSErrorException { + private void createSchedulerProject(DSSProject dssProject) throws DSSErrorException { try { if(getSchedulerAppJoint() != null) { - functionInvoker.projectServiceAddFunction(dwsProject, ProjectService::createProject, Arrays.asList(getSchedulerAppJoint())); + functionInvoker.projectServiceAddFunction(dssProject, ProjectService::createProject, Arrays.asList(getSchedulerAppJoint())); }else{ logger.error("Add scheduler project failed for scheduler appjoint is null"); } @@ -174,7 +175,7 @@ public void updateProject(long projectID, String name, String description, Strin //无法修改名字 //更新wtssProject中的description if(!StringUtils.isBlank(description)){ - DWSProject project = getProjectByID(projectID); + DSSProject project = getProjectByID(projectID); project.setUserName(userName); project.setDescription(description); if(existSchesulis()){ @@ -193,7 +194,7 @@ public void updateProject(long projectID, String name, String description, Strin @Override public void deleteProject(long projectID, String userName, Boolean ifDelScheduler) throws DSSErrorException { try { - DWSProject project = getProjectByID(projectID); + DSSProject project = getProjectByID(projectID); project.setUserName(userName); if(ifDelScheduler){ if(existSchesulis()){ @@ -212,19 +213,19 @@ public void deleteProject(long projectID, String userName, Boolean ifDelSchedule throw new DSSErrorException(90012, errorMsg); } flowTaxonomyMapper.deleteFlowTaxonomyByProjectID(projectID); - List dwsFlowList = flowMapper.listFlowByProjectID(projectID); - flowService.batchDeleteFlow(dwsFlowList.stream().map(f -> f.getId()).distinct().collect(Collectors.toList()), null); + List dssFlowList = flowMapper.listFlowByProjectID(projectID); + flowService.batchDeleteFlow(dssFlowList.stream().map(f -> f.getId()).distinct().collect(Collectors.toList()), null); projectMapper.deleteProjectVersions(projectID); projectMapper.deleteProjectBaseInfo(projectID); projectTaxonomyMapper.deleteProjectTaxonomyRelationByProjectID(projectID); } @Override - public DWSProject getLatestVersionProject(Long projectID) { - DWSProject dwsProject = getProjectByID(projectID); - DWSProjectVersion dwsProjectVersion = projectMapper.selectLatestVersionByProjectID(projectID); - dwsProject.setLatestVersion(dwsProjectVersion); - return dwsProject; + public DSSProject getLatestVersionProject(Long projectID) { + DSSProject dssProject = getProjectByID(projectID); + DSSProjectVersion dssProjectVersion = projectMapper.selectLatestVersionByProjectID(projectID); + dssProject.setLatestVersion(dssProjectVersion); + return dssProject; } /** @@ -234,9 +235,9 @@ public DWSProject getLatestVersionProject(Long projectID) { * @return */ @Override - public DWSProject getProjectByProjectVersionID(Long projectVersionID) { - DWSProject dwsProject = projectMapper.selectProjectByVersionID(projectVersionID); - return dwsProject; + public DSSProject getProjectByProjectVersionID(Long projectVersionID) { + DSSProject dssProject = projectMapper.selectProjectByVersionID(projectVersionID); + return dssProject; } @Override @@ -245,13 +246,13 @@ public Boolean isPublished(Long projectID) { } @Override - public List listAllProjectVersions(Long projectID) { - List dwsProjectVersions = projectMapper.listProjectVersionsByProjectID(projectID); - for (DWSProjectVersion dwsProjectVersion : dwsProjectVersions) { - DWSProjectPublishHistory publishHistory = projectMapper.selectProjectPublishHistoryByProjectVersionID(dwsProjectVersion.getId()); - dwsProjectVersion.setPublishHistory(publishHistory); + public List listAllProjectVersions(Long projectID) { + List dssProjectVersions = projectMapper.listProjectVersionsByProjectID(projectID); + for (DSSProjectVersion dssProjectVersion : dssProjectVersions) { + DSSProjectPublishHistory publishHistory = projectMapper.selectProjectPublishHistoryByProjectVersionID(dssProjectVersion.getId()); + dssProjectVersion.setPublishHistory(publishHistory); } - return dwsProjectVersions; + return dssProjectVersions; } @@ -266,39 +267,39 @@ public void publish(Long projectVersionID, String userName, String comment) thro ProjectTuning projectTuning = schedulerAppJoint.getProjectTuning(); ProjectPublishHook[] projectPublishHooks = schedulerAppJoint.getProjectPublishHooks(); // TODO: 2019/9/24 try catch 下载json要挪到parser去 - //1.封装dwsProject - DWSProject dwsProject = projectMapper.selectProjectByVersionID(projectVersionID); - dwsProject.setUserName(dwsUserMapper.getuserName(dwsProject.getUserID())); - logger.info(userName + "-开始发布工程:" + dwsProject.getName() + "版本ID为:" + projectVersionID); - ArrayList dwsFlows = new ArrayList<>(); - List dwsFlowVersionList = flowMapper.listLatestRootFlowVersionByProjectVersionID(projectVersionID); - for (DWSFlowVersion dwsFlowVersion : dwsFlowVersionList) { - DWSFlow dwsFlow = flowMapper.selectFlowByID(dwsFlowVersion.getFlowID()); - String json = (String) bmlService.query(userName, dwsFlowVersion.getJsonPath(), dwsFlowVersion.getVersion()).get("string"); - if (!dwsFlow.getHasSaved()) { - logger.info("工作流{}从未保存过,忽略", dwsFlow.getName()); + //1.封装DSSProject + DSSProject dssProject = projectMapper.selectProjectByVersionID(projectVersionID); + dssProject.setUserName(dssUserMapper.getuserName(dssProject.getUserID())); + logger.info(userName + "-开始发布工程:" + dssProject.getName() + "版本ID为:" + projectVersionID); + ArrayList dssFlows = new ArrayList<>(); + List dssFlowVersionList = flowMapper.listLatestRootFlowVersionByProjectVersionID(projectVersionID); + for (DSSFlowVersion dssFlowVersion : dssFlowVersionList) { + DSSFlow dssFlow = flowMapper.selectFlowByID(dssFlowVersion.getFlowID()); + String json = (String) bmlService.query(userName, dssFlowVersion.getJsonPath(), dssFlowVersion.getVersion()).get("string"); + if (!dssFlow.getHasSaved()) { + logger.info("工作流{}从未保存过,忽略", dssFlow.getName()); } else if (StringUtils.isNotBlank(json)) { - dwsFlowVersion.setJson(json); - dwsFlow.setLatestVersion(dwsFlowVersion); - createPublishProject(userName, dwsFlowVersion.getFlowID(), dwsFlow, projectVersionID); - dwsFlows.add(dwsFlow); + dssFlowVersion.setJson(json); + dssFlow.setLatestVersion(dssFlowVersion); + createPublishProject(userName, dssFlowVersion.getFlowID(), dssFlow, projectVersionID); + dssFlows.add(dssFlow); } else { - String warnMsg = String.format(DSSServerConstant.PUBLISH_FLOW_REPORT_FORMATE, dwsFlow.getName(), dwsFlowVersion.getVersion()); + String warnMsg = String.format(DSSServerConstant.PUBLISH_FLOW_REPORT_FORMATE, dssFlow.getName(), dssFlowVersion.getVersion()); logger.info(warnMsg); throw new DSSErrorException(90013, warnMsg); } } - if (dwsFlows.isEmpty()) throw new DSSErrorException(90007, "该工程没有可以发布的工作流,请检查工作流是否都为空"); - dwsProject.setFlows(dwsFlows); - //2.封装dwsProject完成,开始发布 - SchedulerProject schedulerProject = projectParser.parseProject(dwsProject); + if (dssFlows.isEmpty()) throw new DSSErrorException(90007, "该工程没有可以发布的工作流,请检查工作流是否都为空"); + dssProject.setFlows(dssFlows); + //2.封装DSSProject完成,开始发布 + SchedulerProject schedulerProject = projectParser.parseProject(dssProject); projectTuning.tuningSchedulerProject(schedulerProject); Stream.of(projectPublishHooks).forEach(DSSExceptionUtils.handling(hook -> hook.prePublish(schedulerProject))); (schedulerAppJoint.getProjectService()).publishProject(schedulerProject, schedulerAppJoint.getSecurityService().login(userName)); Stream.of(projectPublishHooks).forEach(DSSExceptionUtils.handling(hook -> hook.postPublish(schedulerProject))); //3.发布完成后复制工程 - DWSProjectVersion dwsProjectVersion = projectMapper.selectProjectVersionByID(projectVersionID); - copyProjectVersionMax(projectVersionID, dwsProjectVersion, dwsProjectVersion, userName, null); + DSSProjectVersion dssProjectVersion = projectMapper.selectProjectVersionByID(projectVersionID); + copyProjectVersionMax(projectVersionID, dssProjectVersion, dssProjectVersion, userName, null); }else { logger.error("SchedulerAppJoint is null"); throw new DSSErrorException(90014, "SchedulerAppJoint is null"); @@ -307,15 +308,15 @@ public void publish(Long projectVersionID, String userName, String comment) thro @Override public Long createPublishHistory(String comment, Long creatorID, Long projectVersionID) { - DWSProjectPublishHistory dwsProjectPublishHistory = new DWSProjectPublishHistory(); - dwsProjectPublishHistory.setComment(comment); - dwsProjectPublishHistory.setCreateID(creatorID); - dwsProjectPublishHistory.setCreateTime(new Date()); - dwsProjectPublishHistory.setUpdateTime(new Date()); - dwsProjectPublishHistory.setProjectVersionID(projectVersionID); - dwsProjectPublishHistory.setState(0); - projectMapper.insertPublishHistory(dwsProjectPublishHistory); - return dwsProjectPublishHistory.getId(); + DSSProjectPublishHistory dssProjectPublishHistory = new DSSProjectPublishHistory(); + dssProjectPublishHistory.setComment(comment); + dssProjectPublishHistory.setCreateID(creatorID); + dssProjectPublishHistory.setCreateTime(new Date()); + dssProjectPublishHistory.setUpdateTime(new Date()); + dssProjectPublishHistory.setProjectVersionID(projectVersionID); + dssProjectPublishHistory.setState(0); + projectMapper.insertPublishHistory(dssProjectPublishHistory); + return dssProjectPublishHistory.getId(); } @Override @@ -324,18 +325,18 @@ public void updatePublishHistory(Long projectVersionID, Integer status, Date upd } @Override - public DWSProjectPublishHistory getPublishHistoryByID(Long projectVersionID) { + public DSSProjectPublishHistory getPublishHistoryByID(Long projectVersionID) { return projectMapper.selectProjectPublishHistoryByProjectVersionID(projectVersionID); } @Override - public DWSProject getExecutionDWSProject(RequestDWSProject requestDWSProject) throws DSSErrorException { - DWSFlow dwsFlow = flowService.getOneVersionFlow(requestDWSProject.flowId(), requestDWSProject.version(),requestDWSProject.projectVersionId()); - DWSProject dwsProject = projectMapper.selectProjectByVersionID(requestDWSProject.projectVersionId()); - dwsProject.setUserName(dwsUserMapper.getuserName(dwsProject.getUserID())); - DWSFlow returnFlow = recursiveGenerateParentFlow(dwsFlow,requestDWSProject); - dwsProject.setFlows(Arrays.asList(returnFlow)); - return dwsProject; + public DSSProject getExecutionDSSProject(RequestDSSProject requestDSSProject) throws DSSErrorException { + DSSFlow dssFlow = flowService.getOneVersionFlow(requestDSSProject.flowId(), requestDSSProject.version(), requestDSSProject.projectVersionId()); + DSSProject dssProject = projectMapper.selectProjectByVersionID(requestDSSProject.projectVersionId()); + dssProject.setUserName(dssUserMapper.getuserName(dssProject.getUserID())); + DSSFlow returnFlow = recursiveGenerateParentFlow(dssFlow, requestDSSProject); + dssProject.setFlows(Arrays.asList(returnFlow)); + return dssProject; } @Override @@ -352,43 +353,43 @@ public Long getAppjointProjectIDByApplicationName(Long projectID, String applica return appjointProjectID == null? projectID:appjointProjectID; } - private DWSFlow recursiveGenerateParentFlow(DWSFlow dwsFlow,RequestDWSProject requestDWSProject) throws DSSErrorException { - DWSFlow returnFlow = null; - Long parentFlowID = flowService.getParentFlowID(dwsFlow.getId()); + private DSSFlow recursiveGenerateParentFlow(DSSFlow dssFlow, RequestDSSProject requestDSSProject) throws DSSErrorException { + DSSFlow returnFlow = null; + Long parentFlowID = flowService.getParentFlowID(dssFlow.getId()); if(parentFlowID != null){ //对于当前执行的工作流的父工作流,直接找其最新的版本 - DWSFlow parentFlow = flowService.getLatestVersionFlow(parentFlowID,requestDWSProject.projectVersionId()); - parentFlow.setChildren(Arrays.asList(dwsFlow)); - returnFlow = recursiveGenerateParentFlow(parentFlow,requestDWSProject); + DSSFlow parentFlow = flowService.getLatestVersionFlow(parentFlowID, requestDSSProject.projectVersionId()); + parentFlow.setChildren(Arrays.asList(dssFlow)); + returnFlow = recursiveGenerateParentFlow(parentFlow, requestDSSProject); }else { - returnFlow = dwsFlow; + returnFlow = dssFlow; } return returnFlow; } - private void createPublishProject(String userName, Long parentFlowID, DWSFlow dwsFlowParent, Long projectVersionID) throws DSSErrorException { + private void createPublishProject(String userName, Long parentFlowID, DSSFlow dssFlowParent, Long projectVersionID) throws DSSErrorException { List subFlowIDS = flowMapper.selectSubFlowIDByParentFlowID(parentFlowID); - ArrayList dwsFlows = new ArrayList<>(); + ArrayList dssFlows = new ArrayList<>(); for (Long subFlowID : subFlowIDS) { - DWSFlowVersion dwsFlowVersion = flowService.getLatestVersionByFlowIDAndProjectVersionID(subFlowID, projectVersionID); - if (dwsFlowVersion != null) { //subFlowIDS通过flow关联查出来的,但是有可能最新版本的project对已有的flows做了删除 - DWSFlow dwsFlow = flowMapper.selectFlowByID(dwsFlowVersion.getFlowID()); - String json = (String) bmlService.query(userName, dwsFlowVersion.getJsonPath(), dwsFlowVersion.getVersion()).get("string"); - if (!dwsFlow.getHasSaved()) { - logger.info("工作流{}从未保存过,忽略",dwsFlow.getName()); + DSSFlowVersion dssFlowVersion = flowService.getLatestVersionByFlowIDAndProjectVersionID(subFlowID, projectVersionID); + if (dssFlowVersion != null) { //subFlowIDS通过flow关联查出来的,但是有可能最新版本的project对已有的flows做了删除 + DSSFlow dssFlow = flowMapper.selectFlowByID(dssFlowVersion.getFlowID()); + String json = (String) bmlService.query(userName, dssFlowVersion.getJsonPath(), dssFlowVersion.getVersion()).get("string"); + if (!dssFlow.getHasSaved()) { + logger.info("工作流{}从未保存过,忽略", dssFlow.getName()); }else if (StringUtils.isNotBlank(json)){ - dwsFlowVersion.setJson(json); - dwsFlow.setLatestVersion(dwsFlowVersion); - createPublishProject(userName, subFlowID, dwsFlow, projectVersionID); - dwsFlows.add(dwsFlow); + dssFlowVersion.setJson(json); + dssFlow.setLatestVersion(dssFlowVersion); + createPublishProject(userName, subFlowID, dssFlow, projectVersionID); + dssFlows.add(dssFlow); } else { - String warnMsg = String.format(DSSServerConstant.PUBLISH_FLOW_REPORT_FORMATE, dwsFlow.getName(), dwsFlowVersion.getVersion()); + String warnMsg = String.format(DSSServerConstant.PUBLISH_FLOW_REPORT_FORMATE, dssFlow.getName(), dssFlowVersion.getVersion()); logger.info(warnMsg); throw new DSSErrorException(90013, warnMsg); } } } - dwsFlowParent.setChildren(dwsFlows); + dssFlowParent.setChildren(dssFlows); } /* @@ -398,17 +399,17 @@ private void createPublishProject(String userName, Long parentFlowID, DWSFlow dw @Transactional(rollbackFor = {DSSErrorException.class, InterruptedException.class,AppJointErrorException.class}) @Override public Long copyProject(Long projectVersionID, Long projectID, String projectName, String userName) throws DSSErrorException, InterruptedException, AppJointErrorException { - DWSProject project = projectMapper.selectProjectByID(projectID); + DSSProject project = projectMapper.selectProjectByID(projectID); if (StringUtils.isNotEmpty(projectName)) {project.setName(projectName);} - DWSProjectTaxonomyRelation projectTaxonomyRelation = projectTaxonomyMapper.selectProjectTaxonomyRelationByTaxonomyIdOrProjectId(projectID); + DSSProjectTaxonomyRelation projectTaxonomyRelation = projectTaxonomyMapper.selectProjectTaxonomyRelationByTaxonomyIdOrProjectId(projectID); //添加至wtss的project数据库,获取projectID project.setUserName(userName); if(existSchesulis()){ createSchedulerProject(project); } Map appjointProjectIDAndAppID = createAppjointProject(project); - Long userID = dwsUserMapper.getUserID(userName); - //添加至dws的project数据库,这里的projectID应该不需要自增 + Long userID = dssUserMapper.getUserID(userName); + //添加至DSS的project数据库,这里的projectID应该不需要自增 //目前是相同数据库,需要自增id project.setUserID(userID); project.setCreateTime(new Date()); @@ -416,7 +417,7 @@ public Long copyProject(Long projectVersionID, Long projectID, String projectNam projectMapper.addProject(project); if(!appjointProjectIDAndAppID.isEmpty())projectMapper.addAccessProjectRelation(appjointProjectIDAndAppID,project.getId()); projectTaxonomyMapper.addProjectTaxonomyRelation(project.getId(), projectTaxonomyRelation.getTaxonomyId(), userID); - DWSProjectVersion maxVersion = projectMapper.selectLatestVersionByProjectID(projectID); + DSSProjectVersion maxVersion = projectMapper.selectLatestVersionByProjectID(projectID); copyProjectVersionMax(maxVersion.getId(), maxVersion, maxVersion, userName, project.getId()); return project.getId(); } @@ -437,19 +438,19 @@ private boolean existSchesulis(){ @Lock(type = LockEnum.ADD) @Transactional(rollbackFor = {DSSErrorException.class, InterruptedException.class}) @Override - public void copyProjectVersionMax(Long projectVersionID, DWSProjectVersion maxVersion, DWSProjectVersion copyVersion, String userName, Long WTSSprojectID) throws DSSErrorException, InterruptedException { + public void copyProjectVersionMax(Long projectVersionID, DSSProjectVersion maxVersion, DSSProjectVersion copyVersion, String userName, Long WTSSprojectID) throws DSSErrorException, InterruptedException { // copy project_version String maxVersionNum = generateNewVersion(maxVersion.getVersion()); if (null != WTSSprojectID) { - copyVersion.setVersion(DSSServerConstant.DWS_PROJECT_FIRST_VERSION); + copyVersion.setVersion(DSSServerConstant.DSS_PROJECT_FIRST_VERSION); copyVersion.setProjectID(WTSSprojectID); } else { copyVersion.setVersion(maxVersionNum); } - Long userID = dwsUserMapper.getUserID(userName); + Long userID = dssUserMapper.getUserID(userName); copyVersion.setUpdatorID(userID); copyVersion.setUpdateTime(new Date()); - List flowVersions = flowMapper.listLastFlowVersionsByProjectVersionID(copyVersion.getId()) + List flowVersions = flowMapper.listLastFlowVersionsByProjectVersionID(copyVersion.getId()) .stream().sorted((o1, o2) -> Integer.valueOf(o1.getFlowID().toString()) - Integer.valueOf(o2.getFlowID().toString())) .collect(Collectors.toList()); Long oldProjectVersionID = copyVersion.getId(); @@ -460,20 +461,20 @@ public void copyProjectVersionMax(Long projectVersionID, DWSProjectVersion maxVe // copy flow if (null != WTSSprojectID) { flowVersions.stream().forEach(f -> { - DWSFlow flow = flowMapper.selectFlowByID(f.getFlowID()); + DSSFlow flow = flowMapper.selectFlowByID(f.getFlowID()); Long parentFlowID = flowMapper.selectParentFlowIDByFlowID(flow.getId()); if (parentFlowID != null) {subAndParentFlowIDMap.put(flow.getId(), parentFlowID);} }); - for (DWSFlowVersion fv : flowVersions) { + for (DSSFlowVersion fv : flowVersions) { // 添加所有父子到map中 - DWSFlow flow = flowMapper.selectFlowByID(fv.getFlowID()); + DSSFlow flow = flowMapper.selectFlowByID(fv.getFlowID()); flow.setCreatorID(userID); flow.setName(flow.getName()); flow.setProjectID(copyVersion.getProjectID()); flow.setCreateTime(new Date()); Long taxonomyID = flowTaxonomyMapper.selectTaxonomyIDByFlowID(flow.getId()); - DWSFlowTaxonomy flowTaxonomy = flowTaxonomyMapper.selectFlowTaxonomyByID(taxonomyID); + DSSFlowTaxonomy flowTaxonomy = flowTaxonomyMapper.selectFlowTaxonomyByID(taxonomyID); //新增flow相关数据 fv.setOldFlowID(flow.getId()); flow.setId(null); @@ -493,19 +494,19 @@ public void copyProjectVersionMax(Long projectVersionID, DWSProjectVersion maxVe if (null != taxonomyID){flowTaxonomyMapper.insertFlowTaxonomyRelation(flowTaxonomy.getId(), flow.getId());} fv.setFlowID(flow.getId()); } - for (DWSFlowVersion fv : flowVersions) { + for (DSSFlowVersion fv : flowVersions) { if (subAndParentFlowIDMap.get(fv.getFlowID()) != null){flowMapper.insertFlowRelation(fv.getFlowID(), subAndParentFlowIDMap.get(fv.getFlowID()));} } } // copy flow_version if (flowVersions.size() > 0) { - ThreadPoolTool tool = new ThreadPoolTool(5, flowVersions); - tool.setCallBack(new ThreadPoolTool.CallBack() { + ThreadPoolTool tool = new ThreadPoolTool(5, flowVersions); + tool.setCallBack(new ThreadPoolTool.CallBack() { @Override - public void method(List flowVersions) { - for (DWSFlowVersion fv : flowVersions) { + public void method(List flowVersions) { + for (DSSFlowVersion fv : flowVersions) { // 工作流版本的json文件,都是需要重新上传到bml - Map bmlQueryMap = bmlService.download(dwsUserMapper.getuserName(fv.getUpdatorID()), fv.getJsonPath(), fv.getVersion()); + Map bmlQueryMap = bmlService.download(dssUserMapper.getuserName(fv.getUpdatorID()), fv.getJsonPath(), fv.getVersion()); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader((InputStream) bmlQueryMap.get("is"))); StringBuilder sb = new StringBuilder(); String s = null; diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DWSProjectTaxonomyServiceImpl.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DSSProjectTaxonomyServiceImpl.java similarity index 61% rename from dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DWSProjectTaxonomyServiceImpl.java rename to dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DSSProjectTaxonomyServiceImpl.java index 1d573c556..215115167 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DWSProjectTaxonomyServiceImpl.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DSSProjectTaxonomyServiceImpl.java @@ -18,11 +18,11 @@ package com.webank.wedatasphere.dss.server.service.impl; +import com.webank.wedatasphere.dss.common.entity.project.DSSProject; import com.webank.wedatasphere.dss.server.dao.ProjectTaxonomyMapper; -import com.webank.wedatasphere.dss.common.entity.project.DWSProject; -import com.webank.wedatasphere.dss.server.entity.DWSProjectTaxonomy; -import com.webank.wedatasphere.dss.server.service.DWSProjectService; -import com.webank.wedatasphere.dss.server.service.DWSProjectTaxonomyService; +import com.webank.wedatasphere.dss.server.entity.DSSProjectTaxonomy; +import com.webank.wedatasphere.dss.server.service.DSSProjectService; +import com.webank.wedatasphere.dss.server.service.DSSProjectTaxonomyService; import com.webank.wedatasphere.dss.common.exception.DSSErrorException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -36,22 +36,22 @@ @Service -public class DWSProjectTaxonomyServiceImpl implements DWSProjectTaxonomyService { +public class DSSProjectTaxonomyServiceImpl implements DSSProjectTaxonomyService { private Logger logger = LoggerFactory.getLogger(this.getClass()); @Autowired private ProjectTaxonomyMapper projectTaxonomyMapper; @Autowired - private DWSProjectService projectService; + private DSSProjectService projectService; @Override - public DWSProjectTaxonomy getProjectTaxonomyByID(Long id) { + public DSSProjectTaxonomy getProjectTaxonomyByID(Long id) { return projectTaxonomyMapper.selectProjectTaxonomyByID(id); } @Override - public List listProjectTaxonomyByUser(String userName) { + public List listProjectTaxonomyByUser(String userName) { return projectTaxonomyMapper.listProjectTaxonomyByUser(userName); } @@ -62,37 +62,40 @@ private List listProjectIDByTaxonomyID(Long taxonomyID, String userName) { @Override - public List listAllProjectTaxonomy(String userName) { - List dwsProjectTaxonomies = listProjectTaxonomyByUser(userName); - for (DWSProjectTaxonomy dwsProjectTaxonomy : dwsProjectTaxonomies) { - List projectIDs = listProjectIDByTaxonomyID(dwsProjectTaxonomy.getId(), userName); - ArrayList dwsProjectList = new ArrayList<>(); + public List listAllProjectTaxonomy(String userName, Long workspaceId) { + List dssProjectTaxonomies = listProjectTaxonomyByUser(userName); + for (DSSProjectTaxonomy dssProjectTaxonomy : dssProjectTaxonomies) { + List projectIDs = listProjectIDByTaxonomyID(dssProjectTaxonomy.getId(), userName); + ArrayList dssProjectList = new ArrayList<>(); for (Long projectID : projectIDs) { - DWSProject dwsProject = projectService.getLatestVersionProject(projectID); - dwsProjectList.add(dwsProject); + DSSProject dssProject = projectService.getLatestVersionProject(projectID); + // 只选择返回属于这个workspace的project,(某些用户拥有多个workspace的不同project) + if(workspaceId.equals(dssProject.getWorkspaceId())) { + dssProjectList.add(dssProject); + } } - dwsProjectTaxonomy.setDwsProjectList(dwsProjectList); + dssProjectTaxonomy.setDssProjectList(dssProjectList); } - return dwsProjectTaxonomies; + return dssProjectTaxonomies; } @Override - public List listProjectTaxonomy(Long taxonomyID, String userName) { - DWSProjectTaxonomy dwsProjectTaxonomy = getProjectTaxonomyByID(taxonomyID); - List projectIDs = listProjectIDByTaxonomyID(dwsProjectTaxonomy.getId(), userName); - ArrayList dwsProjectList = new ArrayList<>(); + public List listProjectTaxonomy(Long taxonomyID, String userName) { + DSSProjectTaxonomy dssProjectTaxonomy = getProjectTaxonomyByID(taxonomyID); + List projectIDs = listProjectIDByTaxonomyID(dssProjectTaxonomy.getId(), userName); + ArrayList dssProjectList = new ArrayList<>(); for (Long projectID : projectIDs) { - DWSProject dwsProject = projectService.getLatestVersionProject(projectID); - dwsProjectList.add(dwsProject); + DSSProject dssProject = projectService.getLatestVersionProject(projectID); + dssProjectList.add(dssProject); } - dwsProjectTaxonomy.setDwsProjectList(dwsProjectList); - return Arrays.asList(dwsProjectTaxonomy); + dssProjectTaxonomy.setDssProjectList(dssProjectList); + return Arrays.asList(dssProjectTaxonomy); } @Override - public void addProjectTaxonomy(DWSProjectTaxonomy dwsProjectTaxonomy) throws DSSErrorException { + public void addProjectTaxonomy(DSSProjectTaxonomy dssProjectTaxonomy) throws DSSErrorException { try { - projectTaxonomyMapper.insertProjectTaxonomy(dwsProjectTaxonomy); + projectTaxonomyMapper.insertProjectTaxonomy(dssProjectTaxonomy); } catch (DuplicateKeyException e) { logger.info(e.getMessage()); throw new DSSErrorException(90004, "工程分类名不能重复"); @@ -100,9 +103,9 @@ public void addProjectTaxonomy(DWSProjectTaxonomy dwsProjectTaxonomy) throws DSS } @Override - public void updateProjectTaxonomy(DWSProjectTaxonomy dwsProjectTaxonomy) throws DSSErrorException { + public void updateProjectTaxonomy(DSSProjectTaxonomy dssProjectTaxonomy) throws DSSErrorException { try { - projectTaxonomyMapper.updateProjectTaxonomy(dwsProjectTaxonomy); + projectTaxonomyMapper.updateProjectTaxonomy(dssProjectTaxonomy); } catch (DuplicateKeyException e) { logger.info(e.getMessage()); throw new DSSErrorException(90004, "工程分类名不能重复"); diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DWSUserServiceImpl.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DSSUserServiceImpl.java similarity index 71% rename from dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DWSUserServiceImpl.java rename to dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DSSUserServiceImpl.java index 8c2ec4c72..60973c98f 100644 --- a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DWSUserServiceImpl.java +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DSSUserServiceImpl.java @@ -18,18 +18,20 @@ package com.webank.wedatasphere.dss.server.service.impl; -import com.webank.wedatasphere.dss.server.dao.DWSUserMapper; -import com.webank.wedatasphere.dss.server.service.DWSUserService; +import com.webank.wedatasphere.dss.application.entity.DSSUser; +import com.webank.wedatasphere.dss.server.dao.DSSUserMapper; +import com.webank.wedatasphere.dss.server.service.DSSUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service -public class DWSUserServiceImpl implements DWSUserService { +public class DSSUserServiceImpl implements DSSUserService { @Autowired - private DWSUserMapper dwsUserMapper; + private DSSUserMapper dssUserMapper; + @Override public Long getUserID(String userName) { - return dwsUserMapper.getUserID(userName); + return dssUserMapper.getUserID(userName); } } diff --git a/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DSSWorkspaceServiceImpl.java b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DSSWorkspaceServiceImpl.java new file mode 100644 index 000000000..19a27befb --- /dev/null +++ b/dss-server/src/main/java/com/webank/wedatasphere/dss/server/service/impl/DSSWorkspaceServiceImpl.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.server.service.impl; + +import com.webank.wedatasphere.dss.server.constant.DSSServerConstant; +import com.webank.wedatasphere.dss.server.dao.WorkspaceMapper; +import com.webank.wedatasphere.dss.server.dto.response.*; +import com.webank.wedatasphere.dss.server.entity.*; +import com.webank.wedatasphere.dss.server.service.DSSWorkspaceService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by schumiyi on 2020/6/22 + */ +@Service +public class DSSWorkspaceServiceImpl implements DSSWorkspaceService { + + @Autowired + private WorkspaceMapper workspaceMapper; + + @Override + public List getWorkspaces() { + + return workspaceMapper.getWorkspaces(); + } + + @Override + public DSSWorkspace getWorkspacesById(Long id) { + return workspaceMapper.getWorkspaceById(id); + } + + + @Override + public Long addWorkspace(String userName, String name, String department, String label, String description) { + DSSWorkspace dssWorkspace = new DSSWorkspace(); + dssWorkspace.setName(name); + dssWorkspace.setDepartment(department); + dssWorkspace.setDescription(description); + dssWorkspace.setLabel(label); + dssWorkspace.setCreateBy(userName); + dssWorkspace.setSource(DSSServerConstant.DSS_WORKSPACE_SOURCE); + dssWorkspace.setLastUpdateUser(userName); + workspaceMapper.addWorkSpace(dssWorkspace); + return dssWorkspace.getId(); + } + + @Override + public boolean existWorkspaceName(String name) { + return !workspaceMapper.findByWorkspaceName(name).isEmpty(); + } + + @Override + public List getWorkSpaceDepartments() { + // TODO: service层和dao层完善 + WorkspaceDepartmentVo dp = new WorkspaceDepartmentVo(); + dp.setId(1L); + dp.setName("应用开发组"); + WorkspaceDepartmentVo di = new WorkspaceDepartmentVo(); + di.setId(2L); + di.setName("平台研发组"); + List departments = new ArrayList<>(); + departments.add(dp); + departments.add(di); + return departments; + } + + @Override + public List getHomepageDemos(boolean isChinese) { + List demoMenuVos = isChinese ? workspaceMapper.getHomepageDemoMenusCn() : workspaceMapper.getHomepageDemoMenusEn(); + for (HomepageDemoMenuVo demoMenuVo : demoMenuVos) { + Long menuId = demoMenuVo.getId(); + List demoInstanceVos = isChinese ? workspaceMapper.getHomepageInstancesByMenuIdCn(menuId) : workspaceMapper.getHomepageInstancesByMenuIdEn(menuId); + demoMenuVo.setDemoInstances(demoInstanceVos); + } + return demoMenuVos; + } + + @Override + public List getHomepageVideos(boolean isChinese) { + return isChinese ? workspaceMapper.getHomepageVideosCn() : workspaceMapper.getHomepageVideosEn(); + } + + @Override + public List getWorkspaceManagements(Long workspaceId, String username, boolean isChinese) { + if (!isAdminUser(workspaceId, username)) { + return new ArrayList<>(); + } + List managementMenuVos = isChinese ? workspaceMapper.getManagementMenuCn() : workspaceMapper.getManagementMenuEn(); + return getMenuAppInstances(managementMenuVos, isChinese); + } + + private List getMenuAppInstances(List menuVos, boolean isChinese) { + for (OnestopMenuVo menuVo : menuVos) { + Long menuId = menuVo.getId(); + List menuAppInstanceVos = isChinese ? workspaceMapper.getMenuAppInstancesCn(menuId) : workspaceMapper.getMenuAppInstancesEn(menuId); + menuVo.setAppInstances(menuAppInstanceVos); + } + return menuVos; + } + + @Override + public List getWorkspaceApplications(Long workspaceId, String username, boolean isChinese) { + List applicationMenuVos = isChinese ? workspaceMapper.getApplicationMenuCn() : workspaceMapper.getApplicationMenuEn(); + return getMenuAppInstances(applicationMenuVos, isChinese); + } + + @Override + public List getWorkspaceFavorites(Long workspaceId, String username, boolean isChinese) { + return isChinese ? workspaceMapper.getWorkspaceFavoritesCn(username, workspaceId) : workspaceMapper.getWorkspaceFavoritesEn(username, workspaceId); + } + + @Override + public Long addFavorite(String username, Long workspaceId, Long menuApplicationId) { + DSSFavorite dssFavorite = new DSSFavorite(); + dssFavorite.setUsername(username); + dssFavorite.setWorkspaceId(workspaceId); + dssFavorite.setMenuApplicationId(menuApplicationId); + // todo: order will from the front end + dssFavorite.setOrder(1); + dssFavorite.setCreateBy(username); + dssFavorite.setLastUpdateUser(username); + workspaceMapper.addFavorite(dssFavorite); + return dssFavorite.getId(); + } + + @Override + public Long deleteFavorite(String username, Long favouritesId) { + workspaceMapper.deleteFavorite(favouritesId); + return favouritesId; + } + + private boolean isAdminUser(Long workspaceId, String username) { + DSSWorkspace workspace = workspaceMapper.getWorkspaceById(workspaceId); + return username != null && workspace != null && username.equals(workspace.getCreateBy()); + } +} diff --git a/dss-server/src/main/scala/com/webank/wedatasphere/dss/server/crumb/CrumbFactory.scala b/dss-server/src/main/scala/com/webank/wedatasphere/dss/server/crumb/CrumbFactory.scala index 9c631c4c2..35df203a7 100644 --- a/dss-server/src/main/scala/com/webank/wedatasphere/dss/server/crumb/CrumbFactory.scala +++ b/dss-server/src/main/scala/com/webank/wedatasphere/dss/server/crumb/CrumbFactory.scala @@ -18,8 +18,8 @@ package com.webank.wedatasphere.dss.server.crumb import com.webank.wedatasphere.dss.server.entity.CrumbType.CrumbType -import com.webank.wedatasphere.dss.server.entity.{Crumb, CrumbType, DWSFlowTaxonomy, DWSProjectTaxonomy} -import com.webank.wedatasphere.dss.server.service.impl.{DWSFlowServiceImpl, DWSFlowTaxonomyServiceImpl, DWSProjectServiceImpl, DWSProjectTaxonomyServiceImpl} +import com.webank.wedatasphere.dss.server.entity.{Crumb, CrumbType, DSSFlowTaxonomy, DSSProjectTaxonomy} +import com.webank.wedatasphere.dss.server.service.impl.{DSSFlowServiceImpl, DSSFlowTaxonomyServiceImpl, DSSProjectServiceImpl, DSSProjectTaxonomyServiceImpl} import org.springframework.beans.factory.annotation.Autowired import org.springframework.stereotype.Component @@ -29,13 +29,13 @@ import scala.collection.mutable.ArrayBuffer @Component class CrumbFactory { @Autowired - private var projectService: DWSProjectServiceImpl = _ + private var projectService: DSSProjectServiceImpl = _ @Autowired - private var projectTaxonomyService:DWSProjectTaxonomyServiceImpl = _ + private var projectTaxonomyService:DSSProjectTaxonomyServiceImpl = _ @Autowired - private var flowService: DWSFlowServiceImpl = _ + private var flowService: DSSFlowServiceImpl = _ @Autowired - private var flowTaxonomyService:DWSFlowTaxonomyServiceImpl = _ + private var flowTaxonomyService:DSSFlowTaxonomyServiceImpl = _ def createCrumbs(crumbType: CrumbType, params: Array[String]): Array[Crumb] = { crumbType match { @@ -104,7 +104,7 @@ class CrumbFactory { def createCrumbData(crumbType: CrumbType, params: java.util.Map[String, String],userName:String): Any = { crumbType match { - case CrumbType.All =>createAllData(userName) + case CrumbType.All =>createAllData(userName, params.get("workspaceId").toLong) case CrumbType.SortProject =>createSortProjectData(params.get("projectTaxonomyID").toLong,userName) case CrumbType.Project =>createProjectData(params.get("projectVersionID").toLong,params.get("isRootFlow").toBoolean) case CrumbType.SortFlow =>createSortFlowData(params.get("projectVersionID").toLong,params.get("flowTaxonomyID").toLong,params.get("isRootFlow").toBoolean) @@ -112,19 +112,19 @@ class CrumbFactory { } } - private def createAllData(userName:String):java.util.List[DWSProjectTaxonomy] ={ - projectTaxonomyService.listAllProjectTaxonomy(userName) + private def createAllData(userName:String, workspaceId: Long):java.util.List[DSSProjectTaxonomy] ={ + projectTaxonomyService.listAllProjectTaxonomy(userName, workspaceId) } - private def createSortProjectData(projectTaxonomyID:Long,userName:String):java.util.List[DWSProjectTaxonomy] ={ + private def createSortProjectData(projectTaxonomyID:Long,userName:String):java.util.List[DSSProjectTaxonomy] ={ projectTaxonomyService.listProjectTaxonomy(projectTaxonomyID,userName) } - private def createProjectData(projectVersionID:Long,isRootFlow:Boolean):java.util.List[DWSFlowTaxonomy] = { + private def createProjectData(projectVersionID:Long,isRootFlow:Boolean):java.util.List[DSSFlowTaxonomy] = { flowTaxonomyService.listAllFlowTaxonomy(projectVersionID,isRootFlow) } - private def createSortFlowData(projectVersionID:Long,flowTaxonomyID:Long,isRootFlow:Boolean):java.util.List[DWSFlowTaxonomy] = { + private def createSortFlowData(projectVersionID:Long,flowTaxonomyID:Long,isRootFlow:Boolean):java.util.List[DSSFlowTaxonomy] = { flowTaxonomyService.listFlowTaxonomy(projectVersionID,flowTaxonomyID:Long,isRootFlow:Boolean) } } diff --git a/dss-server/src/main/scala/com/webank/wedatasphere/dss/server/crumb/QuerParamsParser.scala b/dss-server/src/main/scala/com/webank/wedatasphere/dss/server/crumb/QuerParamsParser.scala index 345a9a47c..5b979f85f 100644 --- a/dss-server/src/main/scala/com/webank/wedatasphere/dss/server/crumb/QuerParamsParser.scala +++ b/dss-server/src/main/scala/com/webank/wedatasphere/dss/server/crumb/QuerParamsParser.scala @@ -27,10 +27,11 @@ object QuerParamsParser { def getCrumbType(queryParams: String): CrumbType = { queryParams.split("&").size match { - case 1 => if ("".equals(queryParams)) CrumbType.All else CrumbType.SortProject - case 3 => CrumbType.Project - case 4 => CrumbType.SortFlow - case 5 => CrumbType.Flow + case 1 => CrumbType.All + case 2 => CrumbType.SortProject + case 4 => CrumbType.Project + case 5 => CrumbType.SortFlow + case 6 => CrumbType.Flow } } diff --git a/dss-server/src/main/scala/com/webank/wedatasphere/dss/server/receiver/DSSServerReceiver.scala b/dss-server/src/main/scala/com/webank/wedatasphere/dss/server/receiver/DSSServerReceiver.scala index 05fef8a51..951128083 100644 --- a/dss-server/src/main/scala/com/webank/wedatasphere/dss/server/receiver/DSSServerReceiver.scala +++ b/dss-server/src/main/scala/com/webank/wedatasphere/dss/server/receiver/DSSServerReceiver.scala @@ -19,8 +19,8 @@ package com.webank.wedatasphere.dss.server.receiver import com.webank.wedatasphere.dss.application.dao.ApplicationMapper import com.webank.wedatasphere.dss.common.exception.DSSErrorException -import com.webank.wedatasphere.dss.common.protocol.{RequestDSSApplication, RequestDWSProject} -import com.webank.wedatasphere.dss.server.service.DWSProjectService +import com.webank.wedatasphere.dss.common.protocol.{RequestDSSApplication, RequestDSSProject} +import com.webank.wedatasphere.dss.server.service.DSSProjectService import com.webank.wedatasphere.linkis.rpc.{Receiver, Sender} import org.springframework.beans.factory.annotation.Autowired import org.springframework.stereotype.Component @@ -32,7 +32,7 @@ import scala.concurrent.duration.Duration class DSSServerReceiver extends Receiver{ @Autowired - var dwsProjectService:DWSProjectService = _ + var dwsProjectService:DSSProjectService = _ @Autowired var applicationMapper:ApplicationMapper = _ @@ -40,7 +40,7 @@ class DSSServerReceiver extends Receiver{ override def receive(message: Any, sender: Sender): Unit = {} override def receiveAndReply(message: Any, sender: Sender): Any = message match { - case f:RequestDWSProject => dwsProjectService.getExecutionDWSProject(f) + case f:RequestDSSProject => dwsProjectService.getExecutionDSSProject(f) case RequestDSSApplication(name) => applicationMapper.getApplication(name) case _ =>throw new DSSErrorException(90000,"") } diff --git a/eventchecker-appjoint/pom.xml b/eventchecker-appjoint/pom.xml index 80243766f..3ae6e8f70 100644 --- a/eventchecker-appjoint/pom.xml +++ b/eventchecker-appjoint/pom.xml @@ -22,7 +22,7 @@ dss com.webank.wedatasphere.dss - 0.8.0 + 0.9.0 4.0.0 diff --git a/examples/ch3/WordCount.jar b/examples/ch3/WordCount.jar new file mode 100644 index 000000000..cbcf5803c Binary files /dev/null and b/examples/ch3/WordCount.jar differ diff --git a/examples/ch3/dept.txt b/examples/ch3/dept.txt new file mode 100644 index 000000000..fe587aa7d --- /dev/null +++ b/examples/ch3/dept.txt @@ -0,0 +1,4 @@ +10 ACCOUNTING 1700 +20 RESEARCH 1800 +30 SALES 1900 +40 OPERATIONS 1700 \ No newline at end of file diff --git a/examples/ch3/emp.txt b/examples/ch3/emp.txt new file mode 100644 index 000000000..f8c77cd40 --- /dev/null +++ b/examples/ch3/emp.txt @@ -0,0 +1,14 @@ +7369 SMITH CLERK 7902 1980-12-17 800.00 20 +7499 ALLEN SALESMAN 7698 1981-2-20 1600.00 300.00 30 +7521 WARD SALESMAN 7698 1981-2-22 1250.00 500.00 30 +7566 JONES MANAGER 7839 1981-4-2 2975.00 20 +7654 MARTIN SALESMAN 7698 1981-9-28 1250.00 1400.00 30 +7698 BLAKE MANAGER 7839 1981-5-1 2850.00 30 +7782 CLARK MANAGER 7839 1981-6-9 2450.00 10 +7788 SCOTT ANALYST 7566 1987-4-19 3000.00 20 +7839 KING PRESIDENT 1981-11-17 5000.00 10 +7844 TURNER SALESMAN 7698 1981-9-8 1500.00 0.00 30 +7876 ADAMS CLERK 7788 1987-5-23 1100.00 20 +7900 JAMES CLERK 7698 1981-12-3 950.00 30 +7902 FORD ANALYST 7566 1981-12-3 3000.00 20 +7934 MILLER CLERK 7782 1982-1-23 1300.00 10 \ No newline at end of file diff --git a/examples/ch3/emp1.txt b/examples/ch3/emp1.txt new file mode 100644 index 000000000..92d107a17 --- /dev/null +++ b/examples/ch3/emp1.txt @@ -0,0 +1,5 @@ +7369 SMITH CLERK 7902 2020-1-17 800.00 20 +7499 ALLEN SALESMAN 7698 2020-1-20 1600.00 300.00 30 +7521 WARD SALESMAN 7698 2020-1-22 1250.00 500.00 30 +7566 JONES MANAGER 7839 2020-1-2 2975.00 20 +7654 MARTIN SALESMAN 7698 2020-1-28 1250.00 1400.00 30 \ No newline at end of file diff --git a/examples/ch3/emp2.txt b/examples/ch3/emp2.txt new file mode 100644 index 000000000..d00a23876 --- /dev/null +++ b/examples/ch3/emp2.txt @@ -0,0 +1,5 @@ +7698 BLAKE MANAGER 7839 2020-2-1 2850.00 30 +7782 CLARK MANAGER 7839 2020-2-9 2450.00 10 +7788 SCOTT ANALYST 7566 2020-2-19 3000.00 20 +7839 KING PRESIDENT 2020-2-17 5000.00 10 +7844 TURNER SALESMAN 7698 2020-2-8 1500.00 0.00 30 \ No newline at end of file diff --git a/examples/ch3/emp3.txt b/examples/ch3/emp3.txt new file mode 100644 index 000000000..8f62853f2 --- /dev/null +++ b/examples/ch3/emp3.txt @@ -0,0 +1,4 @@ +7876 ADAMS CLERK 7788 2020-3-23 1100.00 20 +7900 JAMES CLERK 7698 2020-3-3 950.00 30 +7902 FORD ANALYST 7566 2020-3-3 3000.00 20 +7934 MILLER CLERK 7782 2020-3-23 1300.00 10 \ No newline at end of file diff --git a/examples/ch3/rename.jar b/examples/ch3/rename.jar new file mode 100644 index 000000000..738483a21 Binary files /dev/null and b/examples/ch3/rename.jar differ diff --git a/images/zh_CN/chapter3/tests/hive-6.png b/images/zh_CN/chapter3/tests/hive-6.png new file mode 100644 index 000000000..f1cb9d661 Binary files /dev/null and b/images/zh_CN/chapter3/tests/hive-6.png differ diff --git a/images/zh_CN/chapter3/tests/hive1.png b/images/zh_CN/chapter3/tests/hive1.png new file mode 100644 index 000000000..19322869c Binary files /dev/null and b/images/zh_CN/chapter3/tests/hive1.png differ diff --git a/images/zh_CN/chapter3/tests/hive2.png b/images/zh_CN/chapter3/tests/hive2.png new file mode 100644 index 000000000..8232e3b46 Binary files /dev/null and b/images/zh_CN/chapter3/tests/hive2.png differ diff --git a/images/zh_CN/chapter3/tests/hive3.png b/images/zh_CN/chapter3/tests/hive3.png new file mode 100644 index 000000000..523f1e13c Binary files /dev/null and b/images/zh_CN/chapter3/tests/hive3.png differ diff --git a/images/zh_CN/chapter3/tests/hive4.png b/images/zh_CN/chapter3/tests/hive4.png new file mode 100644 index 000000000..77e26589e Binary files /dev/null and b/images/zh_CN/chapter3/tests/hive4.png differ diff --git a/images/zh_CN/chapter3/tests/hive5.png b/images/zh_CN/chapter3/tests/hive5.png new file mode 100644 index 000000000..f2ecae301 Binary files /dev/null and b/images/zh_CN/chapter3/tests/hive5.png differ diff --git a/images/zh_CN/chapter3/tests/hive7.png b/images/zh_CN/chapter3/tests/hive7.png new file mode 100644 index 000000000..efe714107 Binary files /dev/null and b/images/zh_CN/chapter3/tests/hive7.png differ diff --git a/images/zh_CN/chapter3/tests/home.png b/images/zh_CN/chapter3/tests/home.png new file mode 100644 index 000000000..1564c5150 Binary files /dev/null and b/images/zh_CN/chapter3/tests/home.png differ diff --git a/images/zh_CN/chapter3/tests/udf-3.png b/images/zh_CN/chapter3/tests/udf-3.png new file mode 100644 index 000000000..64bad9b7c Binary files /dev/null and b/images/zh_CN/chapter3/tests/udf-3.png differ diff --git a/images/zh_CN/chapter3/tests/udf1.png b/images/zh_CN/chapter3/tests/udf1.png new file mode 100644 index 000000000..0866f3845 Binary files /dev/null and b/images/zh_CN/chapter3/tests/udf1.png differ diff --git a/images/zh_CN/chapter3/tests/udf2.png b/images/zh_CN/chapter3/tests/udf2.png new file mode 100644 index 000000000..8bb046f7b Binary files /dev/null and b/images/zh_CN/chapter3/tests/udf2.png differ diff --git a/plugins/azkaban/linkis-jobtype/pom.xml b/plugins/azkaban/linkis-jobtype/pom.xml index 54497a7f3..c1c697d8c 100644 --- a/plugins/azkaban/linkis-jobtype/pom.xml +++ b/plugins/azkaban/linkis-jobtype/pom.xml @@ -23,7 +23,7 @@ dss com.webank.wedatasphere.dss - 0.8.0 + 0.9.0 com.webank.wedatasphere.dss linkis-jobtype diff --git a/plugins/linkis/linkis-appjoint-entrance/bin/stop-linkis-appjoint-entrance.sh b/plugins/linkis/linkis-appjoint-entrance/bin/stop-linkis-appjoint-entrance.sh index 7d4703250..a1528811c 100644 --- a/plugins/linkis/linkis-appjoint-entrance/bin/stop-linkis-appjoint-entrance.sh +++ b/plugins/linkis/linkis-appjoint-entrance/bin/stop-linkis-appjoint-entrance.sh @@ -4,9 +4,9 @@ cd `dirname $0` cd .. HOE=`pwd` -export DWS_ENTRANCE_PID=$HOE/bin/linkis.pid +export DSS_ENTRANCE_PID=$HOE/bin/linkis.pid -function wait_for_DWS_ENGINE_MANAGER_to_die() { +function wait_for_DSS_ENGINE_MANAGER_to_die() { local pid local count pid=$1 @@ -33,15 +33,15 @@ function wait_for_DWS_ENGINE_MANAGER_to_die() { fi } -if [[ ! -f "${DWS_ENTRANCE_PID}" ]]; then +if [[ ! -f "${DSS_ENTRANCE_PID}" ]]; then echo "AppJoint Entrance is not running" else - pid=$(cat ${DWS_ENTRANCE_PID}) + pid=$(cat ${DSS_ENTRANCE_PID}) if [[ -z "${pid}" ]]; then echo "AppJoint Entrance is not running" else - wait_for_DWS_ENGINE_MANAGER_to_die $pid 40 - $(rm -f ${DWS_ENTRANCE_PID}) + wait_for_DSS_ENGINE_MANAGER_to_die $pid 40 + $(rm -f ${DSS_ENTRANCE_PID}) echo "AppJoint Entrance is stopped." fi fi diff --git a/plugins/linkis/linkis-appjoint-entrance/pom.xml b/plugins/linkis/linkis-appjoint-entrance/pom.xml index 6e0d82a24..12a064427 100644 --- a/plugins/linkis/linkis-appjoint-entrance/pom.xml +++ b/plugins/linkis/linkis-appjoint-entrance/pom.xml @@ -22,7 +22,7 @@ dss com.webank.wedatasphere.dss - 0.8.0 + 0.9.0 4.0.0 diff --git a/plugins/linkis/linkis-appjoint-entrance/src/main/assembly/distribution.xml b/plugins/linkis/linkis-appjoint-entrance/src/main/assembly/distribution.xml index 83c6ee1a0..b3ac1a0b5 100644 --- a/plugins/linkis/linkis-appjoint-entrance/src/main/assembly/distribution.xml +++ b/plugins/linkis/linkis-appjoint-entrance/src/main/assembly/distribution.xml @@ -59,16 +59,16 @@ aopalliance:aopalliance:jar asm:asm:jar cglib:cglib:jar - com.amazonaws:aws-java-sdk-autoscaling:jar - com.amazonaws:aws-java-sdk-core:jar - com.amazonaws:aws-java-sdk-ec2:jar - com.amazonaws:aws-java-sdk-route53:jar - com.amazonaws:aws-java-sdk-sts:jar - com.amazonaws:jmespath-java:jar + + + + + + com.fasterxml.jackson.core:jackson-annotations:jar com.fasterxml.jackson.core:jackson-core:jar com.fasterxml.jackson.core:jackson-databind:jar - com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:jar + com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar @@ -293,7 +293,7 @@ org.springframework:spring-webmvc:jar org.tukaani:xz:jar org.yaml:snakeyaml:jar - software.amazon.ion:ion-java:jar + xerces:xercesImpl:jar xmlenc:xmlenc:jar xmlpull:xmlpull:jar diff --git a/pom.xml b/pom.xml index 4040e500d..e80674603 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ pom com.webank.wedatasphere.dss dss - 0.8.0 + 0.9.0 dss-common @@ -47,7 +47,7 @@ - 0.8.0 + 0.9.0 0.9.4 2.11.8 1.8 diff --git a/qualitis-appjoint/appjoint/pom.xml b/qualitis-appjoint/appjoint/pom.xml index 579263865..280e567a8 100644 --- a/qualitis-appjoint/appjoint/pom.xml +++ b/qualitis-appjoint/appjoint/pom.xml @@ -5,7 +5,7 @@ dss com.webank.wedatasphere.dss - 0.8.0 + 0.9.0 4.0.0 diff --git a/qualitis-appjoint/appjoint/src/main/java/com.webank/wedatasphere/project/QualitisProjectServiceImpl.java b/qualitis-appjoint/appjoint/src/main/java/com.webank/wedatasphere/project/QualitisProjectServiceImpl.java index c65273eb1..0c3cde2b9 100644 --- a/qualitis-appjoint/appjoint/src/main/java/com.webank/wedatasphere/project/QualitisProjectServiceImpl.java +++ b/qualitis-appjoint/appjoint/src/main/java/com.webank/wedatasphere/project/QualitisProjectServiceImpl.java @@ -7,7 +7,7 @@ import com.webank.wedatasphere.dss.appjoint.service.AppJointUrlImpl; import com.webank.wedatasphere.dss.appjoint.service.ProjectService; import com.webank.wedatasphere.dss.appjoint.service.session.Session; -import com.webank.wedatasphere.dss.common.entity.project.DWSProject; +import com.webank.wedatasphere.dss.common.entity.project.DSSProject; import com.webank.wedatasphere.dss.common.entity.project.Project; import org.apache.commons.lang.RandomStringUtils; import org.slf4j.Logger; @@ -60,10 +60,10 @@ public Project createProject(Project project, Session session) throws AppJointEr try { QualitisAddProjectRequest qualitisAddProjectRequest = new QualitisAddProjectRequest(); - DWSProject dwsProject = (DWSProject) project; + DSSProject dssProject = (DSSProject) project; qualitisAddProjectRequest.setProjectName(project.getName()); qualitisAddProjectRequest.setDescription(project.getDescription()); - qualitisAddProjectRequest.setUsername(dwsProject.getUserName()); + qualitisAddProjectRequest.setUsername(dssProject.getUserName()); RestTemplate restTemplate = new RestTemplate(); HttpEntity entity = generateEntity(qualitisAddProjectRequest); @@ -73,7 +73,7 @@ public Project createProject(Project project, Session session) throws AppJointEr String responseStatus = (String) response.get("code"); if (FAILURE_CODE.equals(responseStatus)) { // Send request to auto create qualitis user - autoAddUser(restTemplate, dwsProject.getUserName()); + autoAddUser(restTemplate, dssProject.getUserName()); // restart to create project response = createProjectReal(restTemplate, entity); @@ -142,9 +142,9 @@ public void deleteProject(Project project, Session session) throws AppJointError try { QualitisDeleteProjectRequest qualitisDeleteProjectRequest = new QualitisDeleteProjectRequest(); - DWSProject dwsProject = (DWSProject) project; + DSSProject dssProject = (DSSProject) project; qualitisDeleteProjectRequest.setProjectId(project.getId()); - qualitisDeleteProjectRequest.setUsername(dwsProject.getUserName()); + qualitisDeleteProjectRequest.setUsername(dssProject.getUserName()); RestTemplate restTemplate = new RestTemplate(); HttpEntity entity = generateEntity(qualitisDeleteProjectRequest); @@ -183,11 +183,11 @@ public void updateProject(Project project, Session session) throws AppJointError try { QualitisUpdateProjectRequest qualitisUpdateProjectRequest = new QualitisUpdateProjectRequest(); - DWSProject dwsProject = (DWSProject) project; + DSSProject dssProject = (DSSProject) project; qualitisUpdateProjectRequest.setProjectId(project.getId()); qualitisUpdateProjectRequest.setProjectName(project.getName()); qualitisUpdateProjectRequest.setDescription(project.getDescription()); - qualitisUpdateProjectRequest.setUsername(dwsProject.getUserName()); + qualitisUpdateProjectRequest.setUsername(dssProject.getUserName()); RestTemplate restTemplate = new RestTemplate(); HttpEntity entity = generateEntity(qualitisUpdateProjectRequest); diff --git a/sendemail-appjoint/sendemail-core/pom.xml b/sendemail-appjoint/sendemail-core/pom.xml index ebff3d1ea..31440bd86 100644 --- a/sendemail-appjoint/sendemail-core/pom.xml +++ b/sendemail-appjoint/sendemail-core/pom.xml @@ -22,7 +22,7 @@ dss com.webank.wedatasphere.dss - 0.8.0 + 0.9.0 4.0.0 diff --git a/visualis-appjoint/appjoint/pom.xml b/visualis-appjoint/appjoint/pom.xml index afe7b4e61..11506add2 100644 --- a/visualis-appjoint/appjoint/pom.xml +++ b/visualis-appjoint/appjoint/pom.xml @@ -22,7 +22,7 @@ dss com.webank.wedatasphere.dss - 0.8.0 + 0.9.0 4.0.0 diff --git a/web/package.json b/web/package.json index 6d748244c..5ac9b99f5 100644 --- a/web/package.json +++ b/web/package.json @@ -1,6 +1,6 @@ { "name": "dataspherestudio", - "version": "0.8.0", + "version": "0.9.0", "private": true, "scripts": { "serve": "vue-cli-service serve", diff --git a/web/src/assets/iconfont/font-dws-icon.svg b/web/src/assets/iconfont/font-dws-icon.svg old mode 100644 new mode 100755 index 776dd6f8c..2b1c8c606 --- a/web/src/assets/iconfont/font-dws-icon.svg +++ b/web/src/assets/iconfont/font-dws-icon.svg @@ -1,85 +1,103 @@ -Generated by IcoMoon + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/web/src/assets/iconfont/font-dws-icon.ttf b/web/src/assets/iconfont/font-dws-icon.ttf old mode 100644 new mode 100755 index ad3754489..ddfdc404d Binary files a/web/src/assets/iconfont/font-dws-icon.ttf and b/web/src/assets/iconfont/font-dws-icon.ttf differ diff --git a/web/src/assets/iconfont/font-dws-icon.woff b/web/src/assets/iconfont/font-dws-icon.woff old mode 100644 new mode 100755 index 978571427..efd6d59b7 Binary files a/web/src/assets/iconfont/font-dws-icon.woff and b/web/src/assets/iconfont/font-dws-icon.woff differ diff --git a/web/src/assets/styles/iconfonts.scss b/web/src/assets/styles/iconfonts.scss index 4fb16747f..551929385 100644 --- a/web/src/assets/styles/iconfonts.scss +++ b/web/src/assets/styles/iconfonts.scss @@ -14,21 +14,17 @@ * limitations under the License. * */ - @import 'variables.scss'; - @font-face { font-family: 'font-dws-icon'; - src: url('../iconfont/font-dws-icon.eot?fkqrnv'); - src: url('../iconfont/font-dws-icon.eot?fkqrnv#iefix') format('embedded-opentype'), - url('../iconfont/font-dws-icon.ttf?fkqrnv') format('truetype'), - url('../iconfont/font-dws-icon.woff?fkqrnv') format('woff'), - url('../iconfont/font-dws-icon.svg?fkqrnv#font-dws-icon') format('svg'); + src: url('../iconfont/font-dws-icon.eot?fkqrnv'); + src: url('../iconfont/font-dws-icon.eot?fkqrnv#iefix') format('embedded-opentype'), url('../iconfont/font-dws-icon.ttf?fkqrnv') format('truetype'), url('../iconfont/font-dws-icon.woff?fkqrnv') format('woff'), url('../iconfont/font-dws-icon.svg?fkqrnv#font-dws-icon') format('svg'); font-weight: normal; font-style: normal; } -[class^="fi-"], [class*=" fi-"] { +[class*=" fi-"], +[class^="fi-"] { /* use !important to prevent issues with browser extensions that change fonts */ font-family: 'font-dws-icon' !important; font-style: normal; @@ -45,293 +41,377 @@ .fi-export:before { content: "\e904"; } + .fi-download:before { content: "\e905"; } + .fi-quit:before { content: "\e906"; } + .fi-search:before { content: "\e907"; } + .fi-undo:before { content: "\e908"; } + .fi-redo:before { content: "\e909"; } + .fi-format:before { content: "\e90a"; } + .fi-play:before { content: "\e90b"; } + .fi-stop:before { content: "\e90c"; } + .fi-save:before { content: "\e90d"; } + .fi-disconnect:before { content: "\e90e"; } + .fi-warn:before { content: "\e90f"; } + .fi-expand-right:before { content: "\e910"; } + .fi-cross:before { content: "\e911"; } + .fi-tick:before { content: "\e912"; } + .fi-dir-fold:before { content: "\e913"; } + .fi-dir-unfold:before { content: "\e914"; } + .fi-more-things:before { content: "\e915"; } + .fi-radio-on2:before { content: "\e918"; } + .fi-ide:before { content: "\e91d"; } + .fi-hivedb.open:before { content: "\e91e"; } + .fi-hivedb:before { content: "\e91f"; } + .fi-disk-o:before { content: "\e920"; } + .fi-disk:before { content: "\e921"; } + .fi-project-o:before { content: "\e922"; } + .fi-project:before { content: "\e923"; } + .fi-caret-down:before { content: "\e924"; } + .fi-caret-right:before { content: "\e925"; } + .fi-folder:before { content: "\e926"; padding: 0 2px; font-size: 14px; } + .fi-folder-o:before { content: "\e927"; padding: 0 2px; font-size: 14px; } + .fi-file:before { content: "\e928"; font-size: 16px; color: gray; } + .fi-file-o:before { content: "\e929"; font-size: 16px; padding: 0 2px; } + .fi-logo:before { - content: "\e930" + content: "\e930"; } + .fi-table:before { content: "\e931"; } + .fi-table.open:before { content: "\e931"; color: gray; } + .fi-field:before { content: "\e932"; font-size: 14px; color: gray; } + .fi-field.open:before { content: "\e932"; font-size: 14px; color: gray; } + .fi-open-in:before { - content: "\e92d" + content: "\e92d"; } + .fi-dock-show:before { - content: "\e92e" + content: "\e92e"; } + .fi-dock-hide:before { - content: "\e92f" + content: "\e92f"; } + .fi-hive:before { content: "\e93a"; color: #f4cf2a; font-size: 16px; } + .fi-spark:before { content: "\e93b"; color: $warning-color; font-size: 16px; } + .fi-scala:before { content: "\e93c"; color: $error-color; font-size: 16px; } + .fi-jdbc:before { content: "\e93d"; font-size: 16px; } + .fi-python:before { content: "\e93e"; color: #3573a6; font-size: 16px; font-weight: bold; } + .fi-spark-python:before { color: #3573a6; content: "\e93f"; font-size: 18px; } + .fi-storage:before { content: "\e940"; color: #4db091; font-size: 12px; } + .fi-sas:before { content: "\e941"; color: #58c6a2; } + .fi-r:before { content: "\e942"; color: #2d8cf0; font-size: 14px; } + .fi-txt:before { content: "\e943"; color: gray; font-size: 16px; } + .fi-log:before { content: "\e944"; color: gray; font-size: 16px; } + .fi-xls:before { content: "\e945"; color: #36af47; font-size: 16px; } + .fi-xlsx:before { content: "\e946"; color: #36af47; font-size: 16px; } + .fi-csv:before { content: "\e947"; color: #36af47; font-size: 16px; } + .fi-jar:before { content: "\e948"; color: #e45f3d; font-size: 16px; } + .fi-fx-method:before { content: "\e94a"; } + .fi-fx-method-o:before { content: "\e94a"; } + .fi-fx-udf:before { content: "\e94b"; } + .fi-fx-udf-o:before { - content: "\e94b" + content: "\e94b"; } + .fi-data-develop:before { content: "\e600"; color: #4cbf4b; } + .fi-resource:before { content: "\e601"; color: #3293e3; } + .fi-data-exchange:before { content: "\e602"; } + .fi-algorithms:before { content: "\e603"; color: #ff3d3d; } + .fi-workflow:before { - content: "\e604" + content: "\e604"; } + .fi-bi:before { content: "\e605"; color: #9654f5; font-size: 14px; } + .fi-schedule:before { content: "\e903"; } + .fi-workflow1:before { content: "\e901"; } + .fi-exchange:before { content: "\e902"; } + .fi-application:before { content: "\e916"; } + .fi-newproject:before { content: "\e91a"; } + .fi-addproject:before { content: "\e919"; } + .fi-visualis:before { content: "\e91b"; } + .fi-qualitis:before { content: "\e91c"; } + .fi-scriptis:before { content: "\e92a"; } + .fi-system:before { content: "\e92b"; } +.fi-plus:before { + content: "\ea0a"; +} + +.fi-cross1:before { + content: "\ea0f"; +} + // refresh icon 单独设置padding -.ivu-icon-ios-refresh{ +.ivu-icon-ios-refresh { padding: 4px 3px; } - @keyframes we-icon-loading-spin { - from { - transform: rotate(0deg); - } - 50% { - transform: rotate(180deg); - } - to { - transform: rotate(360deg); - } + from { + transform: rotate(0deg); } + + 50% { + transform: rotate(180deg); + } + + to { + transform: rotate(360deg); + } +} + .we-icon-loading { - color: #3d3d3d; - animation: we-icon-loading-spin 1s linear infinite; + color: #3d3d3d; + animation: we-icon-loading-spin 1s linear infinite; } diff --git a/web/src/assets/styles/login.scss b/web/src/assets/styles/login.scss index d0ed8583e..43402abe3 100644 --- a/web/src/assets/styles/login.scss +++ b/web/src/assets/styles/login.scss @@ -44,7 +44,6 @@ } .login-main { width: 380px; - height: 300px; background-color: $body-background; margin-right: 9.5%; padding: 20px; @@ -76,9 +75,15 @@ } } .remember-user-name { - margin: 5px 0 0 10px; + margin: 0px 0 10px 10px; } .ivu-form-item { margin-bottom: 20px; } + .captcha-wp { + display: flex; + img{ + height: 44px; + } + } } diff --git a/web/src/assets/styles/workspace.scss b/web/src/assets/styles/workspace.scss new file mode 100644 index 000000000..da510ba56 --- /dev/null +++ b/web/src/assets/styles/workspace.scss @@ -0,0 +1,291 @@ +/*! + * 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. + * + */ +@import './variables.scss'; + +.page-bgc { + background: rgb(245, 245, 245); + height: 100%; + margin: 0; + display: flex; + flex-direction: column; + //竖轴方向 + + .page-bgc-header { + padding: 10px 25px 0; + } + + .header-title { + font-size: 14px; + font-weight: bold; + padding-left: 5px; + border-left: 3px solid $primary-color; + } + + .header-info { + padding: 10px 0 10px 20px; + + p { + line-height: 24px; + } + } + +} + +.app-icon { + font-size: 14px; + height: 30px; + line-height: 30px; + color: #39f; +} + +.nodata-tips { + font-size: 12px; + margin: auto; + height: 70px; + line-height: 70px; + text-align: center; +} + +.workspace-main { + padding: 10px 25px; + display: -webkit-box; + display: flex; + -webkit-box-pack: start; + justify-content: flex-start; + -webkit-box-align: start; + align-items: flex-start; + + .item-header { + font-size: 14px; + font-weight: bold; + padding-left: 23px; + border-left: 2px solid $primary-color; + + } + + .left { + flex: 1; + min-height: 137px; + // box-shadow: 0 1px 6px rgba(0,0,0,.2); + border-color: rgba(0,0,0,0); + padding: 0; + } + + .right { + // flex: 1; + margin-left: 25px; + min-height: 137px; + width: 500px; + // box-shadow: 0 1px 6px rgba(0,0,0,.2); + border-color: rgba(0,0,0,0); + padding: 0; + } + + .setting-bt-wrap { + position: absolute; + right: 20px; + top: 10px; + font-size: 24px; + + &.ivu-btn-text { + outline: none; + border: none; + box-shadow: 0 0 0 2px transparent; + } + } + + .app-list { + display: flex; + flex-wrap: wrap; + align-items: center; + + .app-item-add { + display: flex; + margin: 20px 10px 10px 25px; + padding: 10px; + cursor: pointer; + font-size: 24px; + transition: color .2s linear,background-color .2s linear,border .2s linear,box-shadow .2s linear; + + &:hover { + transition: color .2s linear,background-color .2s linear,border .2s linear,box-shadow .2s linear; + color: #39f; + + box-shadow: 0 2px 12px 0 rgba(0,0,0,.2); + border-radius: 4px; + } + } + + .shadow { + box-shadow: 0 2px 12px 0 rgba(0,0,0,.2); + border-radius: 4px; + } + + .app-item-wrap { + display: flex; + position: relative; + margin: 20px 10px 10px 25px; + padding: 10px 30px; + cursor: pointer; + border: 1px solid rgb(245, 245, 245); + border-radius: 3px; + + .close-wrap { + position: absolute; + right: -5px; + top: -5px; + color: #39f; + } + + &:hover { + box-shadow: 0 2px 12px 0 rgba(0,0,0,.2); + border-radius: 4px; + } + + .label { + margin-left: 10px; + // width: 110px; + // font-weight: 700; + font-size: 12px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + line-height: 30px; + height: 30px; + } + } + } +} + +.app-list-main { + padding: 0 25px 10px; + // bottom: 0; + flex: auto; + + .app-list-tabs { + padding: 20px 20px 20px 22px; + + border-radius: 6px; + height: 100%; + position: relative; + -webkit-transition: all .2s ease-in-out; + transition: all .2s ease-in-out; + background-color: #fff; + + &:hover { + box-shadow: 0 2px 7px rgba(0,0,0,.15); + border-color: transparent; + position: relative; + } + + .pane-wrap { + display: flex; + flex-wrap: wrap; + + .pane-item { + float: left; + margin: 10px 100px 0 0; + width: 450px; + } + + .app-entrance { + display: flex; + + .app-title-wrap { + flex: 1; + font-size: 12px; + + .app-title { + display: flex; + align-items: center; + margin-top: -10px; + margin-right: 50px; + flex-wrap: wrap; + + .sub-margin { + margin-right: 10px; + } + + .sub-title { + font-weight: 700; + } + + .app-tag { + color: #07C1E0; + border: 1px solid transparent; + background: #07C1E0; + } + + } + + } + + .app-status-wrap-active { + position: absolute; + right: 0; + top: 6px; + width: 70px; + font-size: 12px; + + color: #0c6; + + span { + color: #515a6e; + } + } + + .app-status-wrap-disable { + + position: absolute; + right: 0; + top: 6px; + width: 70px; + font-size: 12px; + color: #ccc; + + span { + color: #515a6e; + } + } + + } + + .button-wrap { + display: flex; + margin-top: 20px; + // justify-content: center; + + .entrace-btn { + margin-right: 10px; + } + } + + } + } + +} + +.input-wrap { + position: absolute; + right: 20px; + top: 20px; + width: 200px; +} + +.radio-box .ivu-radio .ivu-radio-inner { + border: 1px solid #2d8cf0; +} diff --git a/web/src/commonData/i18n/common/en.json b/web/src/commonData/i18n/common/en.json index d89c38063..0bb80defb 100644 --- a/web/src/commonData/i18n/common/en.json +++ b/web/src/commonData/i18n/common/en.json @@ -81,9 +81,10 @@ "publishSuccess": "Successfully published", "publishFailed": "Publish failed", "infoTitle": "Welcome", - "infoHeader": "Welcome to DataSphere Studio !", + "infoHeader": "Welcome to Workflow Development !", "infoBodyFirstRow": "DataSphere Studio is a one-stop portal focusing on development and management of data application, as a part of WeDataSphere -- the big data platform of WeBank.", "infoBodySecondRow": "Based on Linkis computation middleware, it's able to easily integrate various data application systems, making the development of data application easier and simpler.", + "workspace": "Workspace", "appTitle": "Application Navigation", "applicationStudio": "Business Application Development", "applicationMore": "More Information", @@ -103,7 +104,35 @@ "deleteWtss": "Delete the scheduler project at the same time?", "noData": "No data please add" }, + "workspace": { + "infoHeader": "Welcome to DataSphere Studio !", + "createWorkspace": "Create Workspace", + "searchWorkspace": "Search Workspace", + "workspaceList": "Workspace List", + "editWorkspace": "Edit", + "newWorkspace": "New Workspace", + "editor": "Edit Workspace", + "workName": "Name", + "department": "Department", + "selectDepartment": "Please Select Department", + "label": "Label", + "addLabel": "Add Label", + "description": "Description", + "pleaseInputWorkspaceDesc": "Please Input Workspace Description", + "createdSuccess": "Successfully created!", + "createdFailed": "Created failed!", + "display": "Display", + "tableDisplay": "Table", + "cardDisplay": "Card", + "createTime": "CreateTime" + }, + "GLY": { + "ALTY": "Demos", + "KSRM": "Quick Start", + "HYP": "Change" + }, "workflow": { + "infoHeader": "Welcome to Workflow!", "workflow": "Workflow", "createWorkflow": "Create workflow", "gotoVisualis": "Enter Visualis", @@ -490,7 +519,7 @@ "cancel": "Cancel", "timeout": "Timeout on publishing project {name}!" }, - "tableDetails" : { + "tableDetails": { "BZBSX": "Table basic attributes", "BZDXX": "Table column information", "BTJXX": "Table statistical information", @@ -771,7 +800,8 @@ "password": "Please enter password!", "loginSuccess": "Login Success", "haveLogin": "You have already logged in, please do not login repeatedly", - "vaildFaild": "Authentication failed!" + "vaildFaild": "Authentication failed!", + "captcha": "Please enter captcha" }, "userMenu": { "title": "Warning", @@ -779,6 +809,10 @@ "clearCacheSuccess": "Successfully cleared local cache!", "comingSoon": "Not yet open source, please stay tuned!" }, + "header": { + "home": "Home", + "console": "Console" + }, "headerNavBar": { "Workflow": "Workflow Development", "Exchangis": "Data Exchange Component", @@ -1018,6 +1052,22 @@ }, "error": { "fileExists": "Duplicated file!" + }, + "home": { + "welcome": "Welcome to the {text} workspace!", + "setting": "Seting", + "exit": "Exit", + "enter": "Enter {text}", + "dlgTitle": "New Fast entry", + "selectType": "Please select category", + "selectApp": "Please select Application", + "save": "Save", + "cancel": "Cancel", + "running": "running", + "stop": "disable", + "searchPlaceholder": "Search application", + "tips": "No data or no addition", + "repeat": "You cannot add the same application repeatedly" } }, "database": { @@ -1614,4 +1664,4 @@ } } } -} +} \ No newline at end of file diff --git a/web/src/commonData/i18n/common/zh.json b/web/src/commonData/i18n/common/zh.json index 93c250f1a..3bd655377 100644 --- a/web/src/commonData/i18n/common/zh.json +++ b/web/src/commonData/i18n/common/zh.json @@ -17,7 +17,8 @@ "nameLength": "名称长度不能大于", "validNameDesc": "必须以字母开头,且只支持字母、数字、下划线", "project": "工程", - "feedback": "反馈" + "feedback": "反馈", + "validNameExist": "名称不能重复" }, "project": { "projectName": "工程名", @@ -81,11 +82,11 @@ "publishSuccess": "发布成功", "publishFailed": "发布失败", "infoTitle": "欢迎信息", - "infoHeader": "欢迎来到 DataSphere Studio !", + "infoHeader": "欢迎来到工作流开发首页!", "infoBodyFirstRow": "DataSphere Studio是微众银行大数据平台——WeDataSphere,自研的一站式数据应用开发管理门户。", "infoBodySecondRow": "基于Linkis计算中间件构建,可轻松整合上层各数据应用系统,让数据应用开发变得简洁又易用。", "appTitle": "应用导航", - "applicationStudio": "业务应用开发", + "workspace": "工作空间", "applicationMore": "了解更多", "applicationTipsFirst": "工程 > 工作流,是应用开发的基本组织结构。", "applictaionTipsSecond": "在工作流拖拽编辑页面,DataSphere Studio已集成的所有数据应用系统,都将以工作流节点的形式出现,让您能够以业务的视角将其编排串连起来,快速实现全部业务。", @@ -103,7 +104,35 @@ "deleteWtss": "是否同时删除scheduler工程?", "noData": "暂无数据请添加" }, + "workspace": { + "infoHeader": "欢迎来到 DataSphere Studio !", + "createWorkspace": "创建工作空间", + "searchWorkspace": "搜索工作空间", + "workspaceList": "工作空间列表", + "editWorkspace": "编辑", + "newWorkspace": "新建工作空间", + "editor": "编辑工作空间", + "workName": "工作空间名", + "department": "归属部门", + "selectDepartment": "请选择部门", + "label": "标签", + "addLabel": "添加标签", + "description": "描述", + "pleaseInputWorkspaceDesc": "请输入工作空间描述", + "createdSuccess": "工作空间创建成功!", + "createdFailed": "工作空间创建失败!", + "display": "展示方式", + "tableDisplay": "列表展示", + "cardDisplay": "图标展示", + "createTime": "创建时间" + }, + "GLY": { + "ALTY": "案例体验", + "KSRM": "快速入门", + "HYP": "换一批" + }, "workflow": { + "infoHeader": "欢迎来到工作流!", "workflow": "工作流", "createWorkflow": "创建工作流", "gotoVisualis": "进入Visualis", @@ -293,7 +322,7 @@ "WJYCZ": "文件已存在,请选择其它文件或选择其它文件夹!", "WJMCBHF": "文件名称不合法,仅支持以字母、数字、中文、下划线、中短线且带后缀的命名!", "SCBCG100": "上传文件不超过100M!", - "SCCG": "文件 {name} 上传成功!", + "SCCG": "文件 {name} 上传成功!", "WJCCXE": "文件大小超出限额!", "WJBSC": "资源文件 {name} 已被成功删除!" } @@ -490,7 +519,7 @@ "cancel": "关闭", "timeout": "工程{name}发布超时!" }, - "tableDetails" : { + "tableDetails": { "BZBSX": "表基本属性", "BZDXX": "表字段信息", "BTJXX": "表统计信息", @@ -534,7 +563,6 @@ "YES": "对", "GSHJX": "进行格式化成", "ZJXYGE": "组件需要的格式" - }, "logView": { "taskId": "任务ID:", @@ -772,7 +800,8 @@ "password": "请输入密码!", "loginSuccess": "登录成功", "haveLogin": "您已经登录,请不要重复登录", - "vaildFaild": "验证未通过!" + "vaildFaild": "验证未通过!", + "captcha": "请输入验证码" }, "userMenu": { "title": "警告", @@ -780,6 +809,10 @@ "clearCacheSuccess": "清除本地数据缓存成功!", "comingSoon": "尚未开源,敬请期待!" }, + "header": { + "home": "首页", + "console": "控制台" + }, "headerNavBar": { "Workflow": "工作流开发", "Exchangis": "数据交换组件", @@ -1019,6 +1052,22 @@ }, "error": { "fileExists": "该文件已经存在!" + }, + "home": { + "welcome": "欢迎来到 {text} 的工作空间!", + "setting": "设置", + "exit": "退出设置", + "enter": "进入{text}", + "dlgTitle": "新增快速入口", + "selectType": "请选择分类", + "selectApp": "请选择系统", + "save": "保存", + "cancel": "取消", + "running": "运行中", + "stop": "不可用", + "searchPlaceholder": "搜索应用系统", + "tips": "没有数据或者未添加", + "repeat": "不能重复添加相同的应用" } }, "database": { @@ -1615,4 +1664,4 @@ } } } -} +} \ No newline at end of file diff --git a/web/src/js/component/navMenu/index.vue b/web/src/js/component/navMenu/index.vue index b965857bd..4b16b6d63 100644 --- a/web/src/js/component/navMenu/index.vue +++ b/web/src/js/component/navMenu/index.vue @@ -5,15 +5,15 @@ - {{item.mainTitle}} + {{item.title}} + v-if="item.appInstances"> @@ -22,121 +22,68 @@ v-if="current"> - {{item.classify}} + :key="current.id"> + {{current.title}} + :key="item.title" + @click.stop="handleClick(item)"> - {{child.title}} + {{item.title}} + diff --git a/web/src/js/component/vue-process/style/index.scss b/web/src/js/component/vue-process/style/index.scss index bd2cbbc50..bf7ea68d1 100644 --- a/web/src/js/component/vue-process/style/index.scss +++ b/web/src/js/component/vue-process/style/index.scss @@ -400,7 +400,7 @@ $mask-color: rgba(55, 55, 55, .6); .designer-control-header { background: #5c5c5c; - background-image: linear-gradient(top, #5c5c5c, #3e3e3e); + background-image: linear-gradient(to top, #5c5c5c, #3e3e3e); height: 8px; border-left: 1px solid #5c5c5c; border-right: 1px solid #5c5c5c; diff --git a/web/src/js/component/workflowContentItem/index.scss b/web/src/js/component/workflowContentItem/index.scss index e4c1fb83f..00e473c4f 100644 --- a/web/src/js/component/workflowContentItem/index.scss +++ b/web/src/js/component/workflowContentItem/index.scss @@ -31,6 +31,14 @@ margin: 15px; box-shadow: 0 2px 12px 0 rgba(0,0,0,.2); background: #fff; + .project-add { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + height: 100%; + cursor: pointer; + } .project-main { position: relative; height: 130px; diff --git a/web/src/js/component/workflowContentItem/index.vue b/web/src/js/component/workflowContentItem/index.vue index 09bb49838..c1c795a78 100644 --- a/web/src/js/component/workflowContentItem/index.vue +++ b/web/src/js/component/workflowContentItem/index.vue @@ -5,8 +5,19 @@ + + + + {{$t(`message.${source}`)}} + + - {{$t('message.workflowItem.nodata')}} + v-else>{{$t('message.workflowItem.nodata')}} --> { diff --git a/web/src/js/module/footer/index.scss b/web/src/js/module/footer/index.scss index 5df19daf3..ee8cf90c6 100644 --- a/web/src/js/module/footer/index.scss +++ b/web/src/js/module/footer/index.scss @@ -50,3 +50,12 @@ color: $text-color; } } +.footer-mask { + position: fixed; + top: -100vh; + left: -100vw; + width: 200vw; + height: 200vh; + background-color: #00000000; +} + \ No newline at end of file diff --git a/web/src/js/module/footer/index.vue b/web/src/js/module/footer/index.vue index 16d9fd644..e47a22d73 100644 --- a/web/src/js/module/footer/index.vue +++ b/web/src/js/module/footer/index.vue @@ -9,6 +9,7 @@ ref="resourceSimple" @update-job="updateJob"> +
{{item.mainTitle}}
{{item.title}}