You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@linkis.apache.org by ca...@apache.org on 2022/08/27 03:49:52 UTC
[incubator-linkis] branch dev-1.3.1 updated: feat(basedata-manager): add DatasourceAccessService manager restful api (#3081)
This is an automated email from the ASF dual-hosted git repository.
casion pushed a commit to branch dev-1.3.1
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git
The following commit(s) were added to refs/heads/dev-1.3.1 by this push:
new 308f50f94 feat(basedata-manager): add DatasourceAccessService manager restful api (#3081)
308f50f94 is described below
commit 308f50f947229428ce677b629ca1e5c7edab3bc4
Author: jack tao <79...@qq.com>
AuthorDate: Sat Aug 27 11:49:47 2022 +0800
feat(basedata-manager): add DatasourceAccessService manager restful api (#3081)
---
.../{ => linkis-basedata-manager}/pom.xml | 102 +++++------
.../src/main/assembly/distribution.xml | 192 +++++++++++++++++++++
.../server/LinkisBasedataManagerApplication.java | 32 ++++
.../server/dao/DatasourceAccessMapper.java | 39 +++++
.../server/dao/mapper/DatasourceAccessMapper.xml | 49 ++++++
.../server/domain/DatasourceAccessEntity.java | 171 ++++++++++++++++++
.../server/restful/DatasourceAccessRestfulApi.java | 64 +++++++
.../server/service/DatasourceAccessService.java | 31 ++++
.../service/impl/DatasourceAccessServiceImpl.java | 47 +++++
.../linkis-publicservice/pom.xml | 8 +-
10 files changed, 683 insertions(+), 52 deletions(-)
diff --git a/linkis-public-enhancements/linkis-publicservice/pom.xml b/linkis-public-enhancements/linkis-publicservice/linkis-basedata-manager/pom.xml
similarity index 53%
copy from linkis-public-enhancements/linkis-publicservice/pom.xml
copy to linkis-public-enhancements/linkis-publicservice/linkis-basedata-manager/pom.xml
index 93d1a9efb..e49dc001b 100644
--- a/linkis-public-enhancements/linkis-publicservice/pom.xml
+++ b/linkis-public-enhancements/linkis-publicservice/linkis-basedata-manager/pom.xml
@@ -6,9 +6,9 @@
~ The ASF licenses this file to You 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.
@@ -16,76 +16,50 @@
~ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.linkis</groupId>
<artifactId>linkis</artifactId>
<version>1.2.0</version>
</parent>
-
- <artifactId>linkis-publicservice</artifactId>
- <packaging>pom</packaging>
- <modules>
- <module>linkis-udf/linkis-udf-client</module>
- <module>linkis-udf/linkis-udf-common</module>
- <module>linkis-udf/linkis-udf-service</module>
- <module>linkis-jobhistory</module>
- <module>linkis-configuration</module>
- <module>linkis-variable</module>
- <module>linkis-instance-label/linkis-instance-label-client</module>
- <module>linkis-instance-label/linkis-instance-label-server</module>
- <module>linkis-script-dev/linkis-storage-script-dev-client</module>
- <module>linkis-script-dev/linkis-storage-script-dev-server</module>
-
- <module>linkis-error-code</module>
- <module>linkis-ps-common-lock</module>
-
- </modules>
+ <artifactId>linkis-basedata-manager</artifactId>
+ <packaging>jar</packaging>
+ <name>linkis-basedata-manager</name>
<dependencies>
<dependency>
<groupId>org.apache.linkis</groupId>
- <artifactId>linkis-configuration</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.linkis</groupId>
- <artifactId>linkis-instance-label-server</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.linkis</groupId>
- <artifactId>linkis-jobhistory</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.linkis</groupId>
- <artifactId>linkis-udf-service</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.linkis</groupId>
- <artifactId>linkis-variable</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.linkis</groupId>
- <artifactId>linkis-storage-script-dev-server</artifactId>
+ <artifactId>linkis-module</artifactId>
<version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.ow2.asm</groupId>
+ <artifactId>asm</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
+
<dependency>
<groupId>org.apache.linkis</groupId>
- <artifactId>linkis-error-code-server</artifactId>
+ <artifactId>linkis-mybatis</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
+
<build>
<finalName>${project.artifactId}-${project.version}</finalName>
<resources>
<resource>
- <directory>${basedir}/src/main/resources</directory>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**/*.xml</include>
+ </includes>
</resource>
</resources>
<plugins>
@@ -93,7 +67,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
</plugin>
-
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
@@ -102,6 +75,35 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>3.2.0</version>
+ <inherited>false</inherited>
+ <configuration>
+ <skipAssembly>false</skipAssembly>
+ <finalName>out</finalName>
+ <appendAssemblyId>false</appendAssemblyId>
+ <attach>false</attach>
+ <descriptors>
+ <descriptor>src/main/assembly/distribution.xml</descriptor>
+ </descriptors>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <phase>package</phase>
+ <configuration>
+ <descriptors>
+ <descriptor>src/main/assembly/distribution.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
diff --git a/linkis-public-enhancements/linkis-publicservice/linkis-basedata-manager/src/main/assembly/distribution.xml b/linkis-public-enhancements/linkis-publicservice/linkis-basedata-manager/src/main/assembly/distribution.xml
new file mode 100644
index 000000000..5e0d66a66
--- /dev/null
+++ b/linkis-public-enhancements/linkis-publicservice/linkis-basedata-manager/src/main/assembly/distribution.xml
@@ -0,0 +1,192 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You 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.
+ -->
+
+<assembly
+ xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/2.3"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/2.3 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+ <id>linkis-basedata-manager</id>
+ <formats>
+ <format>dir</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <baseDirectory>linkis-basedata-manager</baseDirectory>
+
+ <dependencySets>
+ <dependencySet>
+ <!-- Enable access to all projects in the current multimodule build! <useAllReactorProjects>true</useAllReactorProjects> -->
+ <!-- Now, select which projects to include in this module-set. -->
+ <outputDirectory>lib</outputDirectory>
+ <useProjectArtifact>true</useProjectArtifact>
+ <useTransitiveDependencies>true</useTransitiveDependencies>
+ <unpack>false</unpack>
+ <useStrictFiltering>false</useStrictFiltering>
+ <useTransitiveFiltering>true</useTransitiveFiltering>
+ <excludes> <!-- 不包括 -->
+ <exclude>antlr:antlr:jar</exclude>
+ <exclude>aopalliance:aopalliance:jar</exclude>
+ <exclude>com.fasterxml.jackson.core:jackson-annotations:jar</exclude>
+ <exclude>com.fasterxml.jackson.core:jackson-core:jar</exclude>
+ <exclude>com.fasterxml.jackson.core:jackson-databind:jar</exclude>
+ <exclude>com.fasterxml.jackson.module:jackson-module-paranamer:jar</exclude>
+ <exclude>com.fasterxml.jackson.module:jackson-module-scala_2.11:jar</exclude>
+ <exclude>com.google.code.gson:gson:jar</exclude>
+ <exclude>com.google.guava:guava:jar</exclude>
+ <exclude>com.google.protobuf:protobuf-java:jar</exclude>
+ <exclude>com.netflix.archaius:archaius-core:jar</exclude>
+ <exclude>com.netflix.hystrix:hystrix-core:jar</exclude>
+ <exclude>com.netflix.netflix-commons:netflix-commons-util:jar</exclude>
+ <exclude>com.netflix.netflix-commons:netflix-statistics:jar</exclude>
+ <exclude>com.netflix.ribbon:ribbon:jar</exclude>
+ <exclude>com.netflix.ribbon:ribbon-core:jar</exclude>
+ <exclude>com.netflix.ribbon:ribbon-httpclient:jar</exclude>
+ <exclude>com.netflix.ribbon:ribbon-loadbalancer:jar</exclude>
+ <exclude>com.netflix.ribbon:ribbon-transport:jar</exclude>
+ <exclude>com.netflix.servo:servo-core:jar</exclude>
+ <exclude>com.ning:async-http-client:jar</exclude>
+ <exclude>com.sun.jersey.contribs:jersey-apache-client4:jar</exclude>
+ <exclude>com.sun.jersey:jersey-client:jar</exclude>
+ <exclude>com.sun.jersey:jersey-core:jar</exclude>
+ <exclude>com.sun.jersey:jersey-server:jar</exclude>
+ <exclude>com.sun.xml.bind:jaxb-impl:jar</exclude>
+ <exclude>org.apache.linkis:linkis-common:jar</exclude>
+ <exclude>commons-beanutils:commons-beanutils:jar</exclude>
+ <exclude>commons-beanutils:commons-beanutils-core:jar</exclude>
+ <exclude>commons-cli:commons-cli:jar</exclude>
+ <exclude>commons-collections:commons-collections:jar</exclude>
+ <exclude>commons-configuration:commons-configuration:jar</exclude>
+ <exclude>commons-daemon:commons-daemon:jar</exclude>
+ <exclude>commons-dbcp:commons-dbcp:jar</exclude>
+ <exclude>commons-digester:commons-digester:jar</exclude>
+ <exclude>commons-io:commons-io:jar</exclude>
+ <exclude>commons-lang:commons-lang:jar</exclude>
+ <exclude>commons-net:commons-net:jar</exclude>
+ <exclude>commons-pool:commons-pool:jar</exclude>
+ <exclude>io.netty:netty:jar</exclude>
+ <exclude>io.netty:netty-all:jar</exclude>
+ <exclude>io.netty:netty-buffer:jar</exclude>
+ <exclude>io.netty:netty-codec:jar</exclude>
+ <exclude>io.netty:netty-codec-http:jar</exclude>
+ <exclude>io.netty:netty-common:jar</exclude>
+ <exclude>io.netty:netty-handler:jar</exclude>
+ <exclude>io.netty:netty-transport:jar</exclude>
+ <exclude>io.netty:netty-transport-native-epoll:jar</exclude>
+ <exclude>io.reactivex:rxjava:jar</exclude>
+ <exclude>io.reactivex:rxnetty:jar</exclude>
+ <exclude>io.reactivex:rxnetty-contexts:jar</exclude>
+ <exclude>io.reactivex:rxnetty-servo:jar</exclude>
+ <exclude>javax.activation:activation:jar</exclude>
+ <exclude>javax.annotation:javax.annotation-api:jar</exclude>
+ <exclude>javax.inject:javax.inject:jar</exclude>
+ <exclude>javax.servlet:javax.servlet-api:jar</exclude>
+ <exclude>javax.servlet.jsp:jsp-api:jar</exclude>
+ <exclude>javax.xml.bind:jaxb-api:jar</exclude>
+ <exclude>javax.xml.stream:stax-api:jar</exclude>
+ <exclude>net.databinder.dispatch:dispatch-core_2.11:jar</exclude>
+ <exclude>net.databinder.dispatch:dispatch-json4s-jackson_2.11:jar</exclude>
+ <exclude>org.antlr:antlr-runtime:jar</exclude>
+ <exclude>org.antlr:stringtemplate:jar</exclude>
+ <exclude>org.apache.commons:commons-compress:jar</exclude>
+ <exclude>org.apache.commons:commons-math3:jar</exclude>
+ <exclude>org.apache.curator:curator-framework:jar</exclude>
+ <exclude>org.apache.curator:curator-recipes:jar</exclude>
+ <exclude>org.apache.directory.api:api-asn1-api:jar</exclude>
+ <exclude>org.apache.directory.api:api-util:jar</exclude>
+ <exclude>org.apache.directory.server:apacheds-i18n:jar</exclude>
+ <exclude>org.apache.directory.server:apacheds-kerberos-codec:jar</exclude>
+ <exclude>org.apache.hadoop:hadoop-annotations:jar</exclude>
+ <exclude>org.apache.hadoop:hadoop-auth:jar</exclude>
+ <exclude>org.apache.hadoop:hadoop-common:jar</exclude>
+ <exclude>org.apache.hadoop:hadoop-hdfs:jar</exclude>
+ <exclude>org.apache.htrace:htrace-core:jar</exclude>
+ <exclude>org.apache.logging.log4j:log4j-api:jar</exclude>
+ <exclude>org.apache.zookeeper:zookeeper:jar</exclude>
+ <exclude>org.aspectj:aspectjweaver:jar</exclude>
+ <exclude>org.bouncycastle:bcpkix-jdk15on:jar</exclude>
+ <exclude>org.bouncycastle:bcprov-jdk15on:jar</exclude>
+ <exclude>org.codehaus.jettison:jettison:jar</exclude>
+ <exclude>org.eclipse.jetty:jetty-continuation:jar</exclude>
+ <exclude>org.eclipse.jetty:jetty-http:jar</exclude>
+ <exclude>org.eclipse.jetty:jetty-io:jar</exclude>
+ <exclude>org.eclipse.jetty:jetty-jndi:jar</exclude>
+ <exclude>org.eclipse.jetty:jetty-plus:jar</exclude>
+ <exclude>org.eclipse.jetty:jetty-security:jar</exclude>
+ <exclude>org.eclipse.jetty:jetty-server:jar</exclude>
+ <exclude>org.eclipse.jetty:jetty-servlet:jar</exclude>
+ <exclude>org.eclipse.jetty:jetty-util:jar</exclude>
+ <exclude>org.eclipse.jetty:jetty-webapp:jar</exclude>
+ <exclude>org.eclipse.jetty:jetty-xml:jar</exclude>
+ <exclude>org.fusesource.leveldbjni:leveldbjni-all:jar</exclude>
+ <exclude>org.hdrhistogram:HdrHistogram:jar</exclude>
+ <exclude>org.json4s:json4s-ast_2.11:jar</exclude>
+ <exclude>org.json4s:json4s-core_2.11:jar</exclude>
+ <exclude>org.json4s:json4s-jackson_2.11:jar</exclude>
+ <exclude>org.jsoup:jsoup:jar</exclude>
+ <exclude>org.mortbay.jetty:jetty:jar</exclude>
+ <exclude>org.mortbay.jetty:jetty-util:jar</exclude>
+ <exclude>org.scala-lang.modules:scala-parser-combinators_2.11:jar</exclude>
+ <exclude>org.scala-lang.modules:scala-xml_2.11:jar</exclude>
+ <exclude>org.scala-lang:scala-compiler:jar</exclude>
+ <exclude>org.scala-lang:scala-library:jar</exclude>
+ <exclude>org.scala-lang:scala-reflect:jar</exclude>
+ <exclude>org.scala-lang:scalap:jar</exclude>
+ <exclude>org.slf4j:jul-to-slf4j:jar</exclude>
+ <exclude>org.slf4j:slf4j-api:jar</exclude>
+ <exclude>org.springframework.boot:spring-boot:jar</exclude>
+ <exclude>org.springframework.boot:spring-boot-autoconfigure:jar</exclude>
+ <exclude>org.springframework.boot:spring-boot-starter:jar</exclude>
+ <exclude>org.springframework.boot:spring-boot-starter-aop:jar</exclude>
+ <exclude>org.springframework.cloud:spring-cloud-commons:jar</exclude>
+ <exclude>org.springframework.cloud:spring-cloud-context:jar</exclude>
+ <exclude>org.springframework.cloud:spring-cloud-netflix-archaius:jar</exclude>
+ <exclude>org.springframework.cloud:spring-cloud-netflix-ribbon:jar</exclude>
+ <exclude>org.springframework.cloud:spring-cloud-starter:jar</exclude>
+ <exclude>org.springframework.cloud:spring-cloud-starter-netflix-archaius:jar</exclude>
+ <exclude>org.springframework.cloud:spring-cloud-starter-netflix-ribbon:jar</exclude>
+ <exclude>org.springframework.security:spring-security-crypto:jar</exclude>
+ <exclude>org.springframework.security:spring-security-rsa:jar</exclude>
+ <exclude>org.springframework:spring-aop:jar</exclude>
+ <exclude>org.springframework:spring-beans:jar</exclude>
+ <exclude>org.springframework:spring-context:jar</exclude>
+ <exclude>org.springframework:spring-core:jar</exclude>
+ <exclude>org.springframework:spring-expression:jar</exclude>
+ <!--<exclude>org.springframework:spring-jcl:jar</exclude>-->
+ <exclude>org.springframework:spring-web:jar</exclude>
+ <exclude>org.tukaani:xz:jar</exclude>
+ <exclude>org.yaml:snakeyaml:jar</exclude>
+ <exclude>xerces:xercesImpl:jar</exclude>
+ <exclude>xml-apis:xml-apis:jar</exclude>
+ <exclude>xmlenc:xmlenc:jar</exclude>
+ </excludes>
+ </dependencySet>
+ </dependencySets>
+ <!-- 文件集合 -->
+ <fileSets>
+ <fileSet>
+ <directory>${basedir}/src/main/resources</directory>
+ <includes>
+ <include>*</include>
+ </includes>
+ <fileMode>0777</fileMode>
+ <outputDirectory>conf</outputDirectory>
+ <lineEnding>unix</lineEnding>
+ </fileSet>
+ </fileSets>
+
+</assembly>
+
diff --git a/linkis-public-enhancements/linkis-publicservice/linkis-basedata-manager/src/main/java/org/apache/linkis/basedatamanager/server/LinkisBasedataManagerApplication.java b/linkis-public-enhancements/linkis-publicservice/linkis-basedata-manager/src/main/java/org/apache/linkis/basedatamanager/server/LinkisBasedataManagerApplication.java
new file mode 100644
index 000000000..1a8a47c7b
--- /dev/null
+++ b/linkis-public-enhancements/linkis-publicservice/linkis-basedata-manager/src/main/java/org/apache/linkis/basedatamanager/server/LinkisBasedataManagerApplication.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.linkis.basedatamanager.server;
+
+import org.apache.linkis.LinkisBaseServerApp;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+public class LinkisBasedataManagerApplication {
+
+ private static final Log logger = LogFactory.getLog(LinkisBasedataManagerApplication.class);
+
+ public static void main(String[] args) throws ReflectiveOperationException {
+ logger.info("Start to running LinkisDataSourceManagerApplication");
+ LinkisBaseServerApp.main(args);
+ }
+}
diff --git a/linkis-public-enhancements/linkis-publicservice/linkis-basedata-manager/src/main/java/org/apache/linkis/basedatamanager/server/dao/DatasourceAccessMapper.java b/linkis-public-enhancements/linkis-publicservice/linkis-basedata-manager/src/main/java/org/apache/linkis/basedatamanager/server/dao/DatasourceAccessMapper.java
new file mode 100644
index 000000000..6340df1cc
--- /dev/null
+++ b/linkis-public-enhancements/linkis-publicservice/linkis-basedata-manager/src/main/java/org/apache/linkis/basedatamanager/server/dao/DatasourceAccessMapper.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.linkis.basedatamanager.server.dao;
+
+import org.apache.linkis.basedatamanager.server.domain.DatasourceAccessEntity;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @author jack
+ * @description 针对表【linkis_ps_datasource_access】的数据库操作Mapper
+ * @createDate 2022-08-13 15:17:35 @Entity
+ * org.apache.linkis.basedatamanager.server.domain.LinkisPsDatasourceAccess
+ */
+public interface DatasourceAccessMapper extends BaseMapper<DatasourceAccessEntity> {
+ /**
+ * 获取列表(分页)
+ *
+ * @param searchName
+ * @return
+ */
+ List<DatasourceAccessEntity> getListByPage(String searchName);
+}
diff --git a/linkis-public-enhancements/linkis-publicservice/linkis-basedata-manager/src/main/java/org/apache/linkis/basedatamanager/server/dao/mapper/DatasourceAccessMapper.xml b/linkis-public-enhancements/linkis-publicservice/linkis-basedata-manager/src/main/java/org/apache/linkis/basedatamanager/server/dao/mapper/DatasourceAccessMapper.xml
new file mode 100644
index 000000000..0faa890b5
--- /dev/null
+++ b/linkis-public-enhancements/linkis-publicservice/linkis-basedata-manager/src/main/java/org/apache/linkis/basedatamanager/server/dao/mapper/DatasourceAccessMapper.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You 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="org.apache.linkis.basedatamanager.server.dao.DatasourceAccessMapper">
+
+ <resultMap id="BaseResultMap" type="org.apache.linkis.basedatamanager.server.domain.DatasourceAccessEntity">
+ <id property="id" column="id" jdbcType="BIGINT"/>
+ <result property="tableId" column="table_id" jdbcType="BIGINT"/>
+ <result property="visitor" column="visitor" jdbcType="VARCHAR"/>
+ <result property="fields" column="fields" jdbcType="VARCHAR"/>
+ <result property="applicationId" column="application_id" jdbcType="INTEGER"/>
+ <result property="accessTime" column="access_time" jdbcType="TIMESTAMP"/>
+ </resultMap>
+
+ <sql id="Base_Column_List">
+ id,table_id,visitor,
+ fields,application_id,access_time
+ </sql>
+
+ <select id="getListByPage" resultMap="BaseResultMap">
+ select
+ <include refid="Base_Column_List"></include>
+ from linkis_ps_datasource_access
+ <if test="searchName != null and searchName!=''">
+ where visitor like concat('%',#{searchName},'%')
+ or fields like concat('%',#{searchName},'%')
+ </if>
+ </select>
+</mapper>
diff --git a/linkis-public-enhancements/linkis-publicservice/linkis-basedata-manager/src/main/java/org/apache/linkis/basedatamanager/server/domain/DatasourceAccessEntity.java b/linkis-public-enhancements/linkis-publicservice/linkis-basedata-manager/src/main/java/org/apache/linkis/basedatamanager/server/domain/DatasourceAccessEntity.java
new file mode 100644
index 000000000..9196e1edc
--- /dev/null
+++ b/linkis-public-enhancements/linkis-publicservice/linkis-basedata-manager/src/main/java/org/apache/linkis/basedatamanager/server/domain/DatasourceAccessEntity.java
@@ -0,0 +1,171 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.linkis.basedatamanager.server.domain;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+/** @TableName linkis_ps_datasource_access */
+@TableName(value = "linkis_ps_datasource_access")
+public class DatasourceAccessEntity implements Serializable {
+ /** */
+ @TableId(type = IdType.AUTO)
+ private Long id;
+
+ /** */
+ private Long tableId;
+
+ /** */
+ private String visitor;
+
+ /** */
+ private String fields;
+
+ /** */
+ private Integer applicationId;
+
+ /** */
+ private Date accessTime;
+
+ @TableField(exist = false)
+ private static final long serialVersionUID = 1L;
+
+ /** */
+ public Long getId() {
+ return id;
+ }
+
+ /** */
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ /** */
+ public Long getTableId() {
+ return tableId;
+ }
+
+ /** */
+ public void setTableId(Long tableId) {
+ this.tableId = tableId;
+ }
+
+ /** */
+ public String getVisitor() {
+ return visitor;
+ }
+
+ /** */
+ public void setVisitor(String visitor) {
+ this.visitor = visitor;
+ }
+
+ /** */
+ public String getFields() {
+ return fields;
+ }
+
+ /** */
+ public void setFields(String fields) {
+ this.fields = fields;
+ }
+
+ /** */
+ public Integer getApplicationId() {
+ return applicationId;
+ }
+
+ /** */
+ public void setApplicationId(Integer applicationId) {
+ this.applicationId = applicationId;
+ }
+
+ /** */
+ public Date getAccessTime() {
+ return accessTime;
+ }
+
+ /** */
+ public void setAccessTime(Date accessTime) {
+ this.accessTime = accessTime;
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (this == that) {
+ return true;
+ }
+ if (that == null) {
+ return false;
+ }
+ if (getClass() != that.getClass()) {
+ return false;
+ }
+ DatasourceAccessEntity other = (DatasourceAccessEntity) that;
+ return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
+ && (this.getTableId() == null
+ ? other.getTableId() == null
+ : this.getTableId().equals(other.getTableId()))
+ && (this.getVisitor() == null
+ ? other.getVisitor() == null
+ : this.getVisitor().equals(other.getVisitor()))
+ && (this.getFields() == null
+ ? other.getFields() == null
+ : this.getFields().equals(other.getFields()))
+ && (this.getApplicationId() == null
+ ? other.getApplicationId() == null
+ : this.getApplicationId().equals(other.getApplicationId()))
+ && (this.getAccessTime() == null
+ ? other.getAccessTime() == null
+ : this.getAccessTime().equals(other.getAccessTime()));
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
+ result = prime * result + ((getTableId() == null) ? 0 : getTableId().hashCode());
+ result = prime * result + ((getVisitor() == null) ? 0 : getVisitor().hashCode());
+ result = prime * result + ((getFields() == null) ? 0 : getFields().hashCode());
+ result = prime * result + ((getApplicationId() == null) ? 0 : getApplicationId().hashCode());
+ result = prime * result + ((getAccessTime() == null) ? 0 : getAccessTime().hashCode());
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(getClass().getSimpleName());
+ sb.append(" [");
+ sb.append("Hash = ").append(hashCode());
+ sb.append(", id=").append(id);
+ sb.append(", tableId=").append(tableId);
+ sb.append(", visitor=").append(visitor);
+ sb.append(", fields=").append(fields);
+ sb.append(", applicationId=").append(applicationId);
+ sb.append(", accessTime=").append(accessTime);
+ sb.append(", serialVersionUID=").append(serialVersionUID);
+ sb.append("]");
+ return sb.toString();
+ }
+}
diff --git a/linkis-public-enhancements/linkis-publicservice/linkis-basedata-manager/src/main/java/org/apache/linkis/basedatamanager/server/restful/DatasourceAccessRestfulApi.java b/linkis-public-enhancements/linkis-publicservice/linkis-basedata-manager/src/main/java/org/apache/linkis/basedatamanager/server/restful/DatasourceAccessRestfulApi.java
new file mode 100644
index 000000000..2ead2348e
--- /dev/null
+++ b/linkis-public-enhancements/linkis-publicservice/linkis-basedata-manager/src/main/java/org/apache/linkis/basedatamanager/server/restful/DatasourceAccessRestfulApi.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.linkis.basedatamanager.server.restful;
+
+import com.github.pagehelper.PageInfo;
+import org.apache.linkis.basedatamanager.server.domain.DatasourceAccessEntity;
+import org.apache.linkis.basedatamanager.server.service.DatasourceAccessService;
+import org.apache.linkis.server.Message;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@RequestMapping(path = "/basedata_manager/datasource_access")
+public class DatasourceAccessRestfulApi {
+
+ @Autowired
+ DatasourceAccessService datasourceAccessService;
+
+ @RequestMapping(path = "", method = RequestMethod.GET)
+ public Message list(String searchName,Integer currentPage,Integer pageSize) {
+ PageInfo pageList = datasourceAccessService.getListByPage(searchName,currentPage,pageSize);
+ return Message.ok("").data("list", pageList);
+ }
+
+ @RequestMapping(path = "/{id}", method = RequestMethod.GET)
+ public Message get(@PathVariable("id") Long id) {
+ DatasourceAccessEntity datasourceAccess = datasourceAccessService.getById(id);
+ return Message.ok("").data("item", datasourceAccess);
+ }
+
+ @RequestMapping(path = "", method = RequestMethod.POST)
+ public Message add(@RequestBody DatasourceAccessEntity errorCode) {
+ boolean result = datasourceAccessService.save(errorCode);
+ return Message.ok("").data("result", result);
+ }
+
+ @RequestMapping(path = "/{id}", method = RequestMethod.DELETE)
+ public Message remove(@PathVariable("id") Long id) {
+ boolean result = datasourceAccessService.removeById(id);
+ return Message.ok("").data("result", result);
+ }
+
+ @RequestMapping(path = "", method = RequestMethod.PUT)
+ public Message update(@RequestBody DatasourceAccessEntity errorCode) {
+ boolean result = datasourceAccessService.updateById(errorCode);
+ return Message.ok("").data("result", result);
+ }
+
+
+}
diff --git a/linkis-public-enhancements/linkis-publicservice/linkis-basedata-manager/src/main/java/org/apache/linkis/basedatamanager/server/service/DatasourceAccessService.java b/linkis-public-enhancements/linkis-publicservice/linkis-basedata-manager/src/main/java/org/apache/linkis/basedatamanager/server/service/DatasourceAccessService.java
new file mode 100644
index 000000000..6456586f8
--- /dev/null
+++ b/linkis-public-enhancements/linkis-publicservice/linkis-basedata-manager/src/main/java/org/apache/linkis/basedatamanager/server/service/DatasourceAccessService.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.linkis.basedatamanager.server.service;
+
+import org.apache.linkis.basedatamanager.server.domain.DatasourceAccessEntity;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.github.pagehelper.PageInfo;
+
+/**
+ * @author jack
+ * @description 针对表【linkis_ps_datasource_access】的数据库操作Service
+ * @createDate 2022-08-13 15:17:35
+ */
+public interface DatasourceAccessService extends IService<DatasourceAccessEntity> {
+ public PageInfo getListByPage(String searchName, Integer currentPage, Integer pageSize);
+}
diff --git a/linkis-public-enhancements/linkis-publicservice/linkis-basedata-manager/src/main/java/org/apache/linkis/basedatamanager/server/service/impl/DatasourceAccessServiceImpl.java b/linkis-public-enhancements/linkis-publicservice/linkis-basedata-manager/src/main/java/org/apache/linkis/basedatamanager/server/service/impl/DatasourceAccessServiceImpl.java
new file mode 100644
index 000000000..22691a31a
--- /dev/null
+++ b/linkis-public-enhancements/linkis-publicservice/linkis-basedata-manager/src/main/java/org/apache/linkis/basedatamanager/server/service/impl/DatasourceAccessServiceImpl.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.linkis.basedatamanager.server.service.impl;
+
+import org.apache.linkis.basedatamanager.server.dao.DatasourceAccessMapper;
+import org.apache.linkis.basedatamanager.server.domain.DatasourceAccessEntity;
+import org.apache.linkis.basedatamanager.server.service.DatasourceAccessService;
+
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+
+/**
+ * @author jack
+ * @description 针对表【linkis_ps_datasource_access】的数据库操作Service实现
+ * @createDate 2022-08-13 15:17:35
+ */
+@Service
+public class DatasourceAccessServiceImpl
+ extends ServiceImpl<DatasourceAccessMapper, DatasourceAccessEntity>
+ implements DatasourceAccessService {
+ @Override
+ public PageInfo getListByPage(String searchName, Integer currentPage, Integer pageSize) {
+ PageHelper.startPage(currentPage, pageSize);
+ List<DatasourceAccessEntity> listByPage = this.getBaseMapper().getListByPage(searchName);
+ PageInfo pageInfo = new PageInfo(listByPage);
+ return pageInfo;
+ }
+}
diff --git a/linkis-public-enhancements/linkis-publicservice/pom.xml b/linkis-public-enhancements/linkis-publicservice/pom.xml
index 93d1a9efb..731dae470 100644
--- a/linkis-public-enhancements/linkis-publicservice/pom.xml
+++ b/linkis-public-enhancements/linkis-publicservice/pom.xml
@@ -36,7 +36,7 @@
<module>linkis-instance-label/linkis-instance-label-server</module>
<module>linkis-script-dev/linkis-storage-script-dev-client</module>
<module>linkis-script-dev/linkis-storage-script-dev-server</module>
-
+ <module>linkis-basedata-manager</module>
<module>linkis-error-code</module>
<module>linkis-ps-common-lock</module>
@@ -79,7 +79,11 @@
<artifactId>linkis-error-code-server</artifactId>
<version>${project.version}</version>
</dependency>
-
+ <dependency>
+ <groupId>org.apache.linkis</groupId>
+ <artifactId>linkis-basedata-manager</artifactId>
+ <version>${project.version}</version>
+ </dependency>
</dependencies>
<build>
<finalName>${project.artifactId}-${project.version}</finalName>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org