Skip to content

Commit f9bfc8e

Browse files
authored
Merge pull request #9 from WeBankFinTech/dev-0.9.0
Dev 0.9.0
2 parents 5d695a4 + dfa434d commit f9bfc8e

40 files changed

+2863
-540
lines changed

db/dss_ddl.sql

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,3 +294,155 @@ CREATE TABLE `event_status` (
294294
`msg_id` int(11) NOT NULL COMMENT '消息的最大消费id',
295295
PRIMARY KEY (`receiver`,`topic`,`msg_name`)
296296
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='消息消费状态表';
297+
298+
299+
-- ----------------------------
300+
-- Table structure for dss_workspace
301+
-- ----------------------------
302+
DROP TABLE IF EXISTS `dss_workspace`;
303+
CREATE TABLE `dss_workspace` (
304+
`id` bigint(20) NOT NULL AUTO_INCREMENT,
305+
`name` varchar(255) DEFAULT NULL,
306+
`label` varchar(255) DEFAULT NULL,
307+
`description` varchar(255) DEFAULT NULL,
308+
`department` varchar(255) DEFAULT NULL,
309+
`product` varchar(255) DEFAULT NULL,
310+
`source` varchar(255) DEFAULT NULL,
311+
`create_by` varchar(255) DEFAULT NULL,
312+
`create_time` datetime DEFAULT NULL,
313+
`last_update_time` datetime DEFAULT NULL,
314+
`last_update_user` varchar(30) DEFAULT NULL,
315+
PRIMARY KEY (`id`),
316+
UNIQUE KEY `name` (`name`)
317+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
318+
319+
-- ----------------------------
320+
-- Table structure for dss_onestop_menu
321+
-- ----------------------------
322+
DROP TABLE IF EXISTS `dss_onestop_menu`;
323+
CREATE TABLE `dss_onestop_menu` (
324+
`id` int(20) NOT NULL AUTO_INCREMENT,
325+
`name` varchar(64) DEFAULT NULL,
326+
`title_en` varchar(64) DEFAULT NULL,
327+
`title_cn` varchar(64) DEFAULT NULL,
328+
`description` varchar(255) DEFAULT NULL,
329+
`is_active` tinyint(1) DEFAULT 1,
330+
`icon` varchar(255) DEFAULT NULL,
331+
`order` int(2) DEFAULT NULL,
332+
`create_by` varchar(255) DEFAULT NULL,
333+
`create_time` datetime DEFAULT NULL,
334+
`last_update_time` datetime DEFAULT NULL,
335+
`last_update_user` varchar(30) DEFAULT NULL,
336+
PRIMARY KEY (`id`)
337+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
338+
339+
-- ----------------------------
340+
-- Table structure for dss_onestop_menu_application
341+
-- ----------------------------
342+
DROP TABLE IF EXISTS `dss_onestop_menu_application`;
343+
CREATE TABLE `dss_onestop_menu_application` (
344+
`id` int(20) NOT NULL AUTO_INCREMENT,
345+
`application_id` int(20) DEFAULT NULL,
346+
`onestop_menu_id` int(20) NOT NULL,
347+
`title_en` varchar(64) DEFAULT NULL,
348+
`title_cn` varchar(64) DEFAULT NULL,
349+
`desc_en` varchar(255) DEFAULT NULL,
350+
`desc_cn` varchar(255) DEFAULT NULL,
351+
`labels_en` varchar(255) DEFAULT NULL,
352+
`labels_cn` varchar(255) DEFAULT NULL,
353+
`is_active` tinyint(1) DEFAULT NULL,
354+
`access_button_en` varchar(64) DEFAULT NULL,
355+
`access_button_cn` varchar(64) DEFAULT NULL,
356+
`manual_button_en` varchar(64) DEFAULT NULL,
357+
`manual_button_cn` varchar(64) DEFAULT NULL,
358+
`manual_button_url` varchar(255) DEFAULT NULL,
359+
`icon` varchar(255) DEFAULT NULL,
360+
`order` int(2) DEFAULT NULL,
361+
`create_by` varchar(255) DEFAULT NULL,
362+
`create_time` datetime DEFAULT NULL,
363+
`last_update_time` datetime DEFAULT NULL,
364+
`last_update_user` varchar(30) DEFAULT NULL,
365+
PRIMARY KEY (`id`)
366+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
367+
368+
-- ----------------------------
369+
-- Table structure for dss_onestop_user_favorites
370+
-- ----------------------------
371+
DROP TABLE IF EXISTS `dss_onestop_user_favorites`;
372+
CREATE TABLE `dss_onestop_user_favorites` (
373+
`id` int(20) NOT NULL AUTO_INCREMENT,
374+
`username` varchar(64) DEFAULT NULL,
375+
`menu_application_id` int(20) DEFAULT NULL,
376+
`order` int(2) DEFAULT NULL,
377+
`create_by` varchar(255) DEFAULT NULL,
378+
`create_time` datetime DEFAULT NULL,
379+
`last_update_time` datetime DEFAULT NULL,
380+
`last_update_user` varchar(30) DEFAULT NULL,
381+
PRIMARY KEY (`id`)
382+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
383+
384+
-- ----------------------------
385+
-- Table structure for dss_homepage_demo_menu
386+
-- ----------------------------
387+
DROP TABLE IF EXISTS `dss_homepage_demo_menu`;
388+
CREATE TABLE `dss_homepage_demo_menu` (
389+
`id` int(20) NOT NULL AUTO_INCREMENT,
390+
`name` varchar(64) DEFAULT NULL,
391+
`title_en` varchar(64) DEFAULT NULL,
392+
`title_cn` varchar(64) DEFAULT NULL,
393+
`description` varchar(255) DEFAULT NULL,
394+
`is_active` tinyint(1) DEFAULT 1,
395+
`icon` varchar(255) DEFAULT NULL,
396+
`order` int(2) DEFAULT NULL,
397+
`create_by` varchar(255) DEFAULT NULL,
398+
`create_time` datetime DEFAULT NULL,
399+
`last_update_time` datetime DEFAULT NULL,
400+
`last_update_user` varchar(30) DEFAULT NULL,
401+
PRIMARY KEY (`id`)
402+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
403+
404+
-- ----------------------------
405+
-- Table structure for dss_homepage_demo_instance
406+
-- ----------------------------
407+
DROP TABLE IF EXISTS `dss_homepage_demo_instance`;
408+
CREATE TABLE `dss_homepage_demo_instance` (
409+
`id` int(20) NOT NULL AUTO_INCREMENT,
410+
`menu_id` int(20) DEFAULT NULL,
411+
`name` varchar(64) DEFAULT NULL,
412+
`url` varchar(128) DEFAULT NULL,
413+
`title_en` varchar(64) DEFAULT NULL,
414+
`title_cn` varchar(64) DEFAULT NULL,
415+
`description` varchar(255) DEFAULT NULL,
416+
`is_active` tinyint(1) DEFAULT 1,
417+
`icon` varchar(255) DEFAULT NULL,
418+
`order` int(2) DEFAULT NULL,
419+
`click_num` int(11) DEFAULT 0,
420+
`create_by` varchar(255) DEFAULT NULL,
421+
`create_time` datetime DEFAULT NULL,
422+
`last_update_time` datetime DEFAULT NULL,
423+
`last_update_user` varchar(30) DEFAULT NULL,
424+
PRIMARY KEY (`id`)
425+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
426+
427+
-- ----------------------------
428+
-- Table structure for dss_homepage_video
429+
-- ----------------------------
430+
DROP TABLE IF EXISTS `dss_homepage_video`;
431+
CREATE TABLE `dss_homepage_video` (
432+
`id` int(20) NOT NULL AUTO_INCREMENT,
433+
`name` varchar(64) DEFAULT NULL,
434+
`url` varchar(128) DEFAULT NULL,
435+
`title_en` varchar(64) DEFAULT NULL,
436+
`title_cn` varchar(64) DEFAULT NULL,
437+
`description` varchar(255) DEFAULT NULL,
438+
`is_active` tinyint(1) DEFAULT 1,
439+
`icon` varchar(255) DEFAULT NULL,
440+
`order` int(2) DEFAULT NULL,
441+
`play_num` int(11) DEFAULT 0,
442+
`create_by` varchar(255) DEFAULT NULL,
443+
`create_time` datetime DEFAULT NULL,
444+
`last_update_time` datetime DEFAULT NULL,
445+
`last_update_user` varchar(30) DEFAULT NULL,
446+
PRIMARY KEY (`id`)
447+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
448+

dss-server/src/main/java/com/webank/wedatasphere/dss/server/constant/DSSServerConstant.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ public class DSSServerConstant {
2222
public static final String DWS_PROJECT_FIRST_VERSION = "v000001";
2323
public static final String DWS_PROJECT_FIRST_VERSION_COMMENT = "first version";
2424
public static final String DWS_PROJECT_SOURCE = "create by user";
25+
public static final String DWS_WORKSPACE_SOURCE = "create by user";
2526
public static final String PROJECT_VERSION_ID = "projectVersionID";
2627
public static final String PUBLISH_FLOW_REPORT_FORMATE = "工作流名:%s,版本号:%s,工作流内容为空,请自行修改或者删除";
27-
public static final String EMVEDDEDFLOWID ="\"embeddedFlowId\":" ;
28+
public static final String EMVEDDEDFLOWID = "\"embeddedFlowId\":";
2829
public static final String VERSION_FORMAT = "%06d";
2930
public static final String VERSION_PREFIX = "v";
3031
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package com.webank.wedatasphere.dss.server.dao;
2+
3+
import com.webank.wedatasphere.dss.server.dto.response.*;
4+
import com.webank.wedatasphere.dss.server.entity.*;
5+
6+
import java.util.List;
7+
8+
/**
9+
* Created by schumiyi on 2020/6/22
10+
*/
11+
public interface WorkspaceMapper {
12+
13+
List<DWSWorkspace> getWorkspaces();
14+
15+
List<DWSWorkspace> findByWorkspaceName(String name);
16+
17+
void addWorkSpace(DWSWorkspace dwsWorkspace);
18+
19+
List<HomepageDemoMenuVo> getHomepageDemoMenusEn();
20+
List<HomepageDemoMenuVo> getHomepageDemoMenusCn();
21+
22+
List<HomepageDemoInstanceVo> getHomepageInstancesByMenuIdCn(Long id);
23+
List<HomepageDemoInstanceVo> getHomepageInstancesByMenuIdEn(Long id);
24+
25+
List<HomepageVideoVo> getHomepageVideosEn();
26+
List<HomepageVideoVo> getHomepageVideosCn();
27+
28+
DWSWorkspace getWorkspaceById(Long workspaceId);
29+
30+
List<OnestopMenuVo> getManagementMenuCn();
31+
List<OnestopMenuVo> getManagementMenuEn();
32+
33+
List<OnestopMenuVo> getApplicationMenuCn();
34+
List<OnestopMenuVo> getApplicationMenuEn();
35+
36+
List<OnestopMenuAppInstanceVo> getMenuAppInstancesCn(Long id);
37+
List<OnestopMenuAppInstanceVo> getMenuAppInstanceEn(Long id);
38+
39+
}
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<!--
3+
~ Copyright 2019 WeBank
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
~
17+
-->
18+
19+
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
20+
21+
<mapper namespace="com.webank.wedatasphere.dss.server.dao.WorkspaceMapper">
22+
23+
<sql id="workspace_main">
24+
id,`name`,`label`,`description`,`department`,`product`,`source`,`create_by`,`create_time`,`last_update_user`,`last_update_time`
25+
</sql>
26+
27+
<sql id="menu_appInstances_cn">
28+
m.`id`,m.`title_cn` AS `title`, m.`desc_cn` AS `description`,m.`labels_cn` AS `labels`,
29+
m.`access_button_cn` AS `access_button`,m.`manual_button_cn` AS `manualButton`,m.`is_active`,
30+
m.`manual_button_url`,m.`icon`,m.`order`,app.`homepage_url` AS `access_button_url`,app.project_url, app.`name`
31+
</sql>
32+
<sql id="menu_appInstances_en">
33+
m.`id`,m.`title_en` AS `title`, m.`desc_en` AS `description`,m.`labels_en` AS `labels`,
34+
m.`access_button_en` AS `access_button`,m.`manual_button_en` AS `manualButton`,m.`is_active`
35+
m.`manual_button_url`,m.`icon`,m.`order`,app.`homepage_url` AS `access_button_url`,app.project_url, app.`name`
36+
</sql>
37+
38+
39+
<select id="getWorkspaces" resultType="com.webank.wedatasphere.dss.server.entity.DWSWorkspace">
40+
SELECT *
41+
FROM dss_workspace
42+
ORDER BY dss_workspace.`create_time` DESC
43+
</select>
44+
45+
<select id="getWorkspaceById" resultType="com.webank.wedatasphere.dss.server.entity.DWSWorkspace">
46+
SELECT *
47+
FROM dss_workspace
48+
WHERE id = #{workspaceId}
49+
</select>
50+
51+
<select id="findByWorkspaceName" resultType="com.webank.wedatasphere.dss.server.entity.DWSWorkspace">
52+
SELECT *
53+
FROM dss_workspace
54+
<where>
55+
dss_workspace.`name` = #{name}
56+
</where>
57+
</select>
58+
59+
<insert id="addWorkSpace" useGeneratedKeys="true" keyProperty="id" parameterType="com.webank.wedatasphere.dss.server.entity.DWSWorkspace">
60+
INSERT INTO dss_workspace (<include refid = "workspace_main" />)
61+
VALUES
62+
(#{id},#{name},#{label},#{description},#{department},#{product},#{source},#{createBy},#{createTime},#{lastUpdateUser},#{lastUpdateTime})
63+
</insert>
64+
65+
<select id="getHomepageDemoMenusCn" resultType="com.webank.wedatasphere.dss.server.dto.response.HomepageDemoMenuVo">
66+
SELECT `id`,`name`,`title_cn` AS title,`description`,`icon`,`order`
67+
FROM dss_homepage_demo_menu
68+
<where>
69+
`is_active` = 1
70+
</where>
71+
</select>
72+
<select id="getHomepageDemoMenusEn" resultType="com.webank.wedatasphere.dss.server.dto.response.HomepageDemoMenuVo">
73+
SELECT `id`,`name`,`title_en` AS `title`,`description`,`icon`,`order`
74+
FROM dss_homepage_demo_menu
75+
<where>
76+
`is_active` = 1
77+
</where>
78+
</select>
79+
80+
<select id="getHomepageInstancesByMenuIdCn" resultType="com.webank.wedatasphere.dss.server.dto.response.HomepageDemoInstanceVo">
81+
SELECT `id`,`menu_id`,`name`,`url`,`title_cn` AS `title`,`description`,`icon`,`order`
82+
FROM dss_homepage_demo_instance
83+
<where>
84+
`is_active` = 1 AND `menu_id` = #{id}
85+
</where>
86+
</select>
87+
<select id="getHomepageInstancesByMenuIdEn" resultType="com.webank.wedatasphere.dss.server.dto.response.HomepageDemoInstanceVo">
88+
SELECT `id`,`menu_id`,`name`,`url`,`title_en` AS `title`,`description`,`icon`,`order`
89+
FROM dss_homepage_demo_instance
90+
<where>
91+
`is_active` = 1 AND `menu_id` = #{id}
92+
</where>
93+
</select>
94+
95+
<select id="getHomepageVideosCn" resultType="com.webank.wedatasphere.dss.server.dto.response.HomepageVideoVo">
96+
SELECT `id`,`name`,`title_cn` AS `title`,`url`,`description`,`order`
97+
FROM dss_homepage_video
98+
<where>
99+
`is_active` = 1
100+
</where>
101+
</select>
102+
<select id="getHomepageVideosEn" resultType="com.webank.wedatasphere.dss.server.dto.response.HomepageVideoVo">
103+
SELECT `id`,`name`,`title_en` AS `title`,`url`,`description`,`order`
104+
FROM dss_homepage_video
105+
<where>
106+
`is_active` = 1
107+
</where>
108+
</select>
109+
110+
<select id="getManagementMenuCn" resultType="com.webank.wedatasphere.dss.server.dto.response.OnestopMenuVo">
111+
SELECT `id`,`name`,`title_cn` AS `title`,`order`
112+
FROM dss_onestop_menu
113+
<where>
114+
`is_active` = 0
115+
</where>
116+
</select>
117+
<select id="getManagementMenuEn" resultType="com.webank.wedatasphere.dss.server.dto.response.OnestopMenuVo">
118+
SELECT `id`,`name`,`title_en` AS `title`,`order`
119+
FROM dss_onestop_menu
120+
<where>
121+
`is_active` = 0
122+
</where>
123+
</select>
124+
125+
<select id="getApplicationMenuCn" resultType="com.webank.wedatasphere.dss.server.dto.response.OnestopMenuVo">
126+
SELECT `id`,`name`,`title_cn` AS `title`,`order`
127+
FROM dss_onestop_menu
128+
<where>
129+
`is_active` = 1
130+
</where>
131+
</select>
132+
<select id="getApplicationMenuEn" resultType="com.webank.wedatasphere.dss.server.dto.response.OnestopMenuVo">
133+
SELECT `id`,`name`,`title_en` AS `title`,`order`
134+
FROM dss_onestop_menu
135+
<where>
136+
`is_active` = 1
137+
</where>
138+
</select>
139+
140+
<select id="getMenuAppInstancesCn" resultType="com.webank.wedatasphere.dss.server.dto.response.OnestopMenuAppInstanceVo">
141+
SELECT <include refid = "menu_appInstances_cn"/>
142+
FROM dss_onestop_menu_application m
143+
LEFT JOIN dss_application app
144+
ON m.`application_id` = app.`id`
145+
<where>
146+
m.`onestop_menu_id` = #{id}
147+
</where>
148+
</select>
149+
<select id="getMenuAppInstancesEn" resultType="com.webank.wedatasphere.dss.server.dto.response.OnestopMenuAppInstanceVo">
150+
SELECT <include refid = "menu_appInstances_en"/>
151+
FROM dss_onestop_menu_application m
152+
LEFT JOIN dss_application app
153+
ON m.`application_id` = app.`id`
154+
<where>
155+
m.`onestop_menu_id` = #{id}
156+
</where>
157+
</select>
158+
</mapper>

0 commit comments

Comments
 (0)