Skip to content

Commit

Permalink
Merge pull request #2 from WeBankFinTech/dev-0.9.0
Browse files Browse the repository at this point in the history
Dev 0.9.0
  • Loading branch information
Adamyuanyuan authored Jun 30, 2020
2 parents 5d30210 + 987c611 commit e4b7bd4
Show file tree
Hide file tree
Showing 68 changed files with 3,943 additions and 300 deletions.
152 changes: 152 additions & 0 deletions db/dss_ddl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -294,3 +294,155 @@ 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,
`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;

Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ 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 DWS_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";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.webank.wedatasphere.dss.server.dao;

import com.webank.wedatasphere.dss.server.dto.response.*;
import com.webank.wedatasphere.dss.server.entity.*;

import java.util.List;

/**
* Created by schumiyi on 2020/6/22
*/
public interface WorkspaceMapper {

List<DWSWorkspace> getWorkspaces();

List<DWSWorkspace> findByWorkspaceName(String name);

void addWorkSpace(DWSWorkspace dwsWorkspace);

List<HomepageDemoMenuVo> getHomepageDemoMenusEn();
List<HomepageDemoMenuVo> getHomepageDemoMenusCn();

List<HomepageDemoInstanceVo> getHomepageInstancesByMenuIdCn(Long id);
List<HomepageDemoInstanceVo> getHomepageInstancesByMenuIdEn(Long id);

List<HomepageVideoVo> getHomepageVideosEn();
List<HomepageVideoVo> getHomepageVideosCn();

DWSWorkspace getWorkspaceById(Long workspaceId);

List<OnestopMenuVo> getManagementMenuCn();
List<OnestopMenuVo> getManagementMenuEn();

List<OnestopMenuVo> getApplicationMenuCn();
List<OnestopMenuVo> getApplicationMenuEn();

List<OnestopMenuAppInstanceVo> getMenuAppInstancesCn(Long id);
List<OnestopMenuAppInstanceVo> getMenuAppInstanceEn(Long id);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
~ 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.
~
-->

<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >

<mapper namespace="com.webank.wedatasphere.dss.server.dao.WorkspaceMapper">

<sql id="workspace_main">
id,`name`,`label`,`description`,`department`,`product`,`source`,`create_by`,`create_time`,`last_update_user`,`last_update_time`
</sql>

<sql id="menu_appInstances_cn">
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`
</sql>
<sql id="menu_appInstances_en">
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`
</sql>


<select id="getWorkspaces" resultType="com.webank.wedatasphere.dss.server.entity.DWSWorkspace">
SELECT *
FROM dss_workspace
ORDER BY dss_workspace.`create_time` DESC
</select>

<select id="getWorkspaceById" resultType="com.webank.wedatasphere.dss.server.entity.DWSWorkspace">
SELECT *
FROM dss_workspace
WHERE id = #{workspaceId}
</select>

<select id="findByWorkspaceName" resultType="com.webank.wedatasphere.dss.server.entity.DWSWorkspace">
SELECT *
FROM dss_workspace
<where>
dss_workspace.`name` = #{name}
</where>
</select>

<insert id="addWorkSpace" useGeneratedKeys="true" keyProperty="id" parameterType="com.webank.wedatasphere.dss.server.entity.DWSWorkspace">
INSERT INTO dss_workspace (<include refid = "workspace_main" />)
VALUES
(#{id},#{name},#{label},#{description},#{department},#{product},#{source},#{createBy},#{createTime},#{lastUpdateUser},#{lastUpdateTime})
</insert>

<select id="getHomepageDemoMenusCn" resultType="com.webank.wedatasphere.dss.server.dto.response.HomepageDemoMenuVo">
SELECT `id`,`name`,`title_cn` AS title,`description`,`icon`,`order`
FROM dss_homepage_demo_menu
<where>
`is_active` = 1
</where>
</select>
<select id="getHomepageDemoMenusEn" resultType="com.webank.wedatasphere.dss.server.dto.response.HomepageDemoMenuVo">
SELECT `id`,`name`,`title_en` AS `title`,`description`,`icon`,`order`
FROM dss_homepage_demo_menu
<where>
`is_active` = 1
</where>
</select>

<select id="getHomepageInstancesByMenuIdCn" resultType="com.webank.wedatasphere.dss.server.dto.response.HomepageDemoInstanceVo">
SELECT `id`,`menu_id`,`name`,`url`,`title_cn` AS `title`,`description`,`icon`,`order`
FROM dss_homepage_demo_instance
<where>
`is_active` = 1 AND `menu_id` = #{id}
</where>
</select>
<select id="getHomepageInstancesByMenuIdEn" resultType="com.webank.wedatasphere.dss.server.dto.response.HomepageDemoInstanceVo">
SELECT `id`,`menu_id`,`name`,`url`,`title_en` AS `title`,`description`,`icon`,`order`
FROM dss_homepage_demo_instance
<where>
`is_active` = 1 AND `menu_id` = #{id}
</where>
</select>

<select id="getHomepageVideosCn" resultType="com.webank.wedatasphere.dss.server.dto.response.HomepageVideoVo">
SELECT `id`,`name`,`title_cn` AS `title`,`url`,`description`,`order`
FROM dss_homepage_video
<where>
`is_active` = 1
</where>
</select>
<select id="getHomepageVideosEn" resultType="com.webank.wedatasphere.dss.server.dto.response.HomepageVideoVo">
SELECT `id`,`name`,`title_en` AS `title`,`url`,`description`,`order`
FROM dss_homepage_video
<where>
`is_active` = 1
</where>
</select>

<select id="getManagementMenuCn" resultType="com.webank.wedatasphere.dss.server.dto.response.OnestopMenuVo">
SELECT `id`,`name`,`title_cn` AS `title`,`order`
FROM dss_onestop_menu
<where>
`is_active` = 0
</where>
</select>
<select id="getManagementMenuEn" resultType="com.webank.wedatasphere.dss.server.dto.response.OnestopMenuVo">
SELECT `id`,`name`,`title_en` AS `title`,`order`
FROM dss_onestop_menu
<where>
`is_active` = 0
</where>
</select>

<select id="getApplicationMenuCn" resultType="com.webank.wedatasphere.dss.server.dto.response.OnestopMenuVo">
SELECT `id`,`name`,`title_cn` AS `title`,`order`
FROM dss_onestop_menu
<where>
`is_active` = 1
</where>
</select>
<select id="getApplicationMenuEn" resultType="com.webank.wedatasphere.dss.server.dto.response.OnestopMenuVo">
SELECT `id`,`name`,`title_en` AS `title`,`order`
FROM dss_onestop_menu
<where>
`is_active` = 1
</where>
</select>

<select id="getMenuAppInstancesCn" resultType="com.webank.wedatasphere.dss.server.dto.response.OnestopMenuAppInstanceVo">
SELECT <include refid = "menu_appInstances_cn"/>
FROM dss_onestop_menu_application m
LEFT JOIN dss_application app
ON m.`application_id` = app.`id`
<where>
m.`onestop_menu_id` = #{id}
</where>
</select>
<select id="getMenuAppInstancesEn" resultType="com.webank.wedatasphere.dss.server.dto.response.OnestopMenuAppInstanceVo">
SELECT <include refid = "menu_appInstances_en"/>
FROM dss_onestop_menu_application m
LEFT JOIN dss_application app
ON m.`application_id` = app.`id`
<where>
m.`onestop_menu_id` = #{id}
</where>
</select>
</mapper>
Loading

0 comments on commit e4b7bd4

Please sign in to comment.