Skip to content

Commit 1032103

Browse files
authored
Merge pull request #379 from yangzhiyue/dev-1.0.0
add dss-framework module
2 parents 7fbbbde + 01cfcbe commit 1032103

File tree

254 files changed

+22485
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

254 files changed

+22485
-0
lines changed
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright 2019 WeBank
4+
~ Licensed under the Apache License, Version 2.0 (the "License");
5+
~ you may not use this file except in compliance with the License.
6+
~ You may obtain a copy of the License at
7+
~
8+
~ http://www.apache.org/licenses/LICENSE-2.0
9+
~
10+
~ Unless required by applicable law or agreed to in writing, software
11+
~ distributed under the License is distributed on an "AS IS" BASIS,
12+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
~ See the License for the specific language governing permissions and
14+
~ limitations under the License.
15+
~
16+
-->
17+
18+
<project xmlns="http://maven.apache.org/POM/4.0.0"
19+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
21+
<parent>
22+
<artifactId>dss</artifactId>
23+
<groupId>com.webank.wedatasphere.dss</groupId>
24+
<version>1.0.0</version>
25+
<!--<relativePath>../../pom.xml</relativePath>-->
26+
</parent>
27+
<modelVersion>4.0.0</modelVersion>
28+
29+
<artifactId>dss-appconn-framework</artifactId>
30+
31+
<dependencies>
32+
<dependency>
33+
<groupId>junit</groupId>
34+
<artifactId>junit</artifactId>
35+
<version>4.12</version>
36+
<scope>test</scope>
37+
</dependency>
38+
39+
40+
<dependency>
41+
<groupId>com.webank.wedatasphere.linkis</groupId>
42+
<artifactId>linkis-mybatis</artifactId>
43+
<version>${linkis.version}</version>
44+
<scope>provided</scope>
45+
</dependency>
46+
47+
<dependency>
48+
<groupId>com.webank.wedatasphere.dss</groupId>
49+
<artifactId>dss-appconn-manager-core</artifactId>
50+
<version>${dss.version}</version>
51+
</dependency>
52+
<dependency>
53+
<groupId>com.webank.wedatasphere.dss</groupId>
54+
<artifactId>dss-common</artifactId>
55+
<version>${dss.version}</version>
56+
<scope>provided</scope>
57+
</dependency>
58+
<dependency>
59+
<groupId>com.webank.wedatasphere.linkis</groupId>
60+
<artifactId>linkis-rpc</artifactId>
61+
<version>${linkis.version}</version>
62+
<scope>provided</scope>
63+
<exclusions>
64+
<exclusion>
65+
<artifactId>linkis-common</artifactId>
66+
<groupId>com.webank.wedatasphere.linkis</groupId>
67+
</exclusion>
68+
</exclusions>
69+
</dependency>
70+
<dependency>
71+
<groupId>com.webank.wedatasphere.linkis</groupId>
72+
<artifactId>linkis-bml-client</artifactId>
73+
<version>${linkis.version}</version>
74+
<exclusions>
75+
<exclusion>
76+
<artifactId>commons-beanutils</artifactId>
77+
<groupId>commons-beanutils</groupId>
78+
</exclusion>
79+
<exclusion>
80+
<artifactId>linkis-common</artifactId>
81+
<groupId>com.webank.wedatasphere.linkis</groupId>
82+
</exclusion>
83+
<exclusion>
84+
<artifactId>json4s-jackson_2.11</artifactId>
85+
<groupId>org.json4s</groupId>
86+
</exclusion>
87+
</exclusions>
88+
</dependency>
89+
<dependency>
90+
<groupId>jakarta.annotation</groupId>
91+
<artifactId>jakarta.annotation-api</artifactId>
92+
<version>1.3.5</version>
93+
<scope>provided</scope>
94+
</dependency>
95+
96+
</dependencies>
97+
98+
99+
100+
<build>
101+
<plugins>
102+
<plugin>
103+
<groupId>org.apache.maven.plugins</groupId>
104+
<artifactId>maven-deploy-plugin</artifactId>
105+
</plugin>
106+
107+
<plugin>
108+
<groupId>net.alchim31.maven</groupId>
109+
<artifactId>scala-maven-plugin</artifactId>
110+
</plugin>
111+
<plugin>
112+
<groupId>org.apache.maven.plugins</groupId>
113+
<artifactId>maven-jar-plugin</artifactId>
114+
</plugin>
115+
</plugins>
116+
<resources>
117+
<resource>
118+
<directory>src/main/java</directory>
119+
<includes>
120+
<include>**/*.xml</include>
121+
</includes>
122+
</resource>
123+
</resources>
124+
</build>
125+
126+
127+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright 2019 WeBank
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*
15+
*/
16+
17+
package com.webank.wedatasphere.dss.framework.appconn;
18+
19+
import com.webank.wedatasphere.dss.appconn.manager.impl.AbstractAppConnManager;
20+
import com.webank.wedatasphere.dss.appconn.manager.service.AppConnInfoService;
21+
import com.webank.wedatasphere.dss.appconn.manager.service.AppConnResourceService;
22+
import com.webank.wedatasphere.linkis.DataWorkCloudApplication;
23+
24+
25+
public class SpringAppConnManager extends AbstractAppConnManager {
26+
27+
@Override
28+
protected AppConnInfoService createAppConnInfoService() {
29+
return DataWorkCloudApplication.getApplicationContext().getBean(AppConnInfoService.class);
30+
}
31+
32+
@Override
33+
protected AppConnResourceService createAppConnResourceService() {
34+
return DataWorkCloudApplication.getApplicationContext().getBean(AppConnResourceService.class);
35+
}
36+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* Copyright 2019 WeBank
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*
15+
*/
16+
17+
package com.webank.wedatasphere.dss.framework.appconn.dao;
18+
19+
20+
import com.webank.wedatasphere.dss.framework.appconn.entity.AppConnBean;
21+
import org.apache.ibatis.annotations.Mapper;
22+
import org.apache.ibatis.annotations.Param;
23+
24+
import java.util.List;
25+
26+
27+
@Mapper
28+
public interface AppConnMapper {
29+
30+
/**
31+
* get all appconnbeans
32+
* */
33+
List<AppConnBean> getAllAppConnBeans();
34+
35+
/**
36+
* get all appconns' name
37+
* */
38+
List<String> getAllAppConnsName();
39+
40+
/**
41+
* get appconnbeans by name
42+
* */
43+
AppConnBean getAppConnBeanByName(@Param("appConnName") String appConnName);
44+
45+
/**
46+
* get appconn by id
47+
* */
48+
AppConnBean getAppConnBeanById(@Param("appConnId") Long appConnId);
49+
50+
void updateResourceByName(AppConnBean appConnBean);
51+
52+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright 2019 WeBank
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*
15+
*/
16+
17+
package com.webank.wedatasphere.dss.framework.appconn.dao;
18+
19+
20+
import com.webank.wedatasphere.dss.framework.appconn.entity.AppInstanceBean;
21+
import org.apache.ibatis.annotations.Mapper;
22+
import org.apache.ibatis.annotations.Param;
23+
24+
import java.util.List;
25+
26+
27+
@Mapper
28+
public interface AppInstanceMapper {
29+
30+
/**
31+
* get instance by appconnid
32+
* */
33+
List<AppInstanceBean> getAppInstancesByAppConnId(@Param("appConnId") Long appConnId);
34+
35+
/**
36+
* get instance by appconnid and label
37+
* */
38+
List<AppInstanceBean> getAppInstance(@Param("appConnId") Long appConnId,
39+
@Param("label") String label);
40+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<!--
3+
~ Copyright 2019 WeBank
4+
~ Licensed under the Apache License, Version 2.0 (the "License");
5+
~ you may not use this file except in compliance with the License.
6+
~ You may obtain a copy of the License at
7+
~
8+
~ http://www.apache.org/licenses/LICENSE-2.0
9+
~
10+
~ Unless required by applicable law or agreed to in writing, software
11+
~ distributed under the License is distributed on an "AS IS" BASIS,
12+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
~ See the License for the specific language governing permissions and
14+
~ limitations under the License.
15+
~
16+
-->
17+
18+
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
19+
20+
21+
<mapper namespace="com.webank.wedatasphere.dss.framework.appconn.dao.AppConnMapper">
22+
23+
<cache flushInterval="120000"/>
24+
25+
<resultMap id="AppConnBeanMap" type="com.webank.wedatasphere.dss.framework.appconn.entity.AppConnBean">
26+
<result property="id" column="id"/>
27+
<result property="appConnName" column="appconn_name"/>
28+
<result property="isUserNeedInit" column="is_user_need_init"/>
29+
<result property="level" column="level"/>
30+
<result property="ifIframe" column="if_iframe"/>
31+
<result property="isExternal" column="is_external"/>
32+
<result property="reference" column="reference"/>
33+
<result property="className" column="class_name"/>
34+
<result property="appConnClassPath" column="appconn_class_path"/>
35+
<result property="resource" column="resource"/>
36+
</resultMap>
37+
38+
<sql id="fields">
39+
`appconn_name`, `is_user_need_init`, `level`, `if_iframe`, `is_external`,
40+
`reference`, `class_name`, `appconn_class_path`,`resource`
41+
</sql>
42+
43+
<sql id="fields_query">
44+
`id`, `appconn_name`, `is_user_need_init`, `level`, `if_iframe`, `is_external`,
45+
`reference`, `class_name`, `appconn_class_path`, `resource`
46+
</sql>
47+
48+
<select id="getAllAppConnBeans" resultMap="AppConnBeanMap">
49+
<![CDATA[SELECT]]>
50+
<include refid="fields_query"/>
51+
FROM `dss_appconn`
52+
</select>
53+
54+
<select id="getAllAppConnsName" resultType="String">
55+
SELECT `appconn_name`
56+
FROM `dss_appconn`
57+
</select>
58+
59+
<select id="getAppConnBeanByName" resultMap="AppConnBeanMap">
60+
<![CDATA[SELECT]]>
61+
<include refid="fields_query"/>
62+
FROM `dss_appconn`
63+
WHERE `appconn_name` = #{appConnName}
64+
</select>
65+
66+
<select id="getAppConnBeanById" resultMap="AppConnBeanMap">
67+
<![CDATA[SELECT]]>
68+
<include refid="fields_query"/>
69+
FROM `dss_appconn`
70+
WHERE `id` = #{appConnId}
71+
</select>
72+
73+
<update id="updateResourceByName" parameterType="com.webank.wedatasphere.dss.framework.appconn.entity.AppConnBean">
74+
update `dss_appconn`
75+
<trim prefix="set" suffixOverrides=",">
76+
<if test="resource != null">resource=#{resource},</if>
77+
<if test="appConnClassPath != null">appconn_class_path=#{appConnClassPath},</if>
78+
</trim>
79+
where appconn_name=#{appConnName}
80+
</update>
81+
</mapper>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<!--
3+
~ Copyright 2019 WeBank
4+
~ Licensed under the Apache License, Version 2.0 (the "License");
5+
~ you may not use this file except in compliance with the License.
6+
~ You may obtain a copy of the License at
7+
~
8+
~ http://www.apache.org/licenses/LICENSE-2.0
9+
~
10+
~ Unless required by applicable law or agreed to in writing, software
11+
~ distributed under the License is distributed on an "AS IS" BASIS,
12+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
~ See the License for the specific language governing permissions and
14+
~ limitations under the License.
15+
~
16+
-->
17+
18+
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
19+
20+
21+
<mapper namespace="com.webank.wedatasphere.dss.framework.appconn.dao.AppInstanceMapper">
22+
<resultMap id="AppInstanceMap" type="com.webank.wedatasphere.dss.framework.appconn.entity.AppInstanceBean">
23+
<result property="id" column="id"/>
24+
<result property="appConnId" column="appconn_id"/>
25+
<result property="label" column="label"/>
26+
<result property="url" column="url"/>
27+
<result property="enhanceJson" column="enhance_json"/>
28+
<result property="homepageUrl" column="homepage_url"/>
29+
<result property="redirectUrl" column="redirect_url"/>
30+
</resultMap>
31+
32+
<sql id="fields_query">
33+
`id`, `appconn_id`, `label`, `url`, `enhance_json`, `homepage_url`, `redirect_url`
34+
</sql>
35+
36+
<select id="getAppInstancesByAppConnId" resultMap="AppInstanceMap">
37+
<![CDATA[SELECT]]>
38+
<include refid="fields_query"/>
39+
FROM `dss_appconn_instance`
40+
WHERE `appconn_id` = #{appConnId}
41+
</select>
42+
43+
<select id="getAppInstance" resultMap="AppInstanceMap">
44+
<![CDATA[SELECT]]>
45+
<include refid="fields_query"/>
46+
FROM `dss_appconn_instance`
47+
WHERE `appconn_id` = #{appConnId} AND `label` = #{label}
48+
</select>
49+
</mapper>

0 commit comments

Comments
 (0)