diff --git a/.idea/.name b/.idea/.name
new file mode 100644
index 0000000..af1f028
--- /dev/null
+++ b/.idea/.name
@@ -0,0 +1 @@
+pom.xml
\ No newline at end of file
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
index 0bdb031..f8bc583 100644
--- a/.idea/compiler.xml
+++ b/.idea/compiler.xml
@@ -2,17 +2,18 @@
-
-
+
+
+
+
-
-
+
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
index 603407b..1f37213 100644
--- a/.idea/encodings.xml
+++ b/.idea/encodings.xml
@@ -19,6 +19,12 @@
+
+
+
+
+
+
diff --git a/.idea/misc.xml b/.idea/misc.xml
index d68b839..e1d1921 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,19 +1,15 @@
+
-
-
-
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
deleted file mode 100644
index e5536fd..0000000
--- a/.idea/modules.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index ca117dc..f83960b 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,23 +4,149 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
@@ -28,34 +154,35 @@
+
-
+
-
+
@@ -72,9 +199,8 @@
-
-
-
+
+
@@ -84,84 +210,57 @@
-
-
+
+
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
1710157283817
1710157283817
-
-
-
-
-
+
+
+
-
-
- 1720096284062
-
-
-
- 1720096284062
-
-
-
-
-
-
\ No newline at end of file
diff --git a/etl-easycode/etl-easycode.iml b/etl-auth/etl-auth-common/etl-auth-common.iml
similarity index 100%
rename from etl-easycode/etl-easycode.iml
rename to etl-auth/etl-auth-common/etl-auth-common.iml
diff --git a/etl-auth/etl-auth-common/pom.xml b/etl-auth/etl-auth-common/pom.xml
index f1a8fab..770d1a0 100644
--- a/etl-auth/etl-auth-common/pom.xml
+++ b/etl-auth/etl-auth-common/pom.xml
@@ -52,4 +52,19 @@
compile
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.7.0
+
+ 1.8
+ 1.8
+
+
+
+
+
diff --git a/etl-auth/etl-auth-common/src/main/java/com/auth/common/entity/PathPermission.java b/etl-auth/etl-auth-common/src/main/java/com/auth/common/entity/PathPermission.java
new file mode 100644
index 0000000..43726c2
--- /dev/null
+++ b/etl-auth/etl-auth-common/src/main/java/com/auth/common/entity/PathPermission.java
@@ -0,0 +1,33 @@
+package com.auth.common.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@TableName("t_data_source")
+public class PathPermission {
+ @TableId(value = "id",type = IdType.AUTO)
+ private Integer id;
+
+ @ApiModelProperty(value = "权限代号")
+ private String permissionCode;
+
+ @ApiModelProperty(value = "路由层次")
+ private String hierarchy;
+
+ @ApiModelProperty(value = "路由")
+ private String path;
+
+ @ApiModelProperty(value = "功能描述")
+ private String description;
+
+ @ApiModelProperty(value = "状态 0-废弃 1-正在使用")
+ private boolean status;
+}
diff --git a/etl-auth/etl-auth-common/src/main/java/com/auth/common/entity/RolesPermission.java b/etl-auth/etl-auth-common/src/main/java/com/auth/common/entity/RolesPermission.java
new file mode 100644
index 0000000..7860c7d
--- /dev/null
+++ b/etl-auth/etl-auth-common/src/main/java/com/auth/common/entity/RolesPermission.java
@@ -0,0 +1,24 @@
+package com.auth.common.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@TableName("t_role_source")
+@AllArgsConstructor
+@NoArgsConstructor
+public class RolesPermission {
+ @TableId(value = "id",type = IdType.AUTO)
+ private Integer id;
+
+ @ApiModelProperty(value = "权限代号")
+ private String permissionCode;
+
+ @ApiModelProperty(value = "角色")
+ private String role;
+}
diff --git a/etl-auth/etl-auth-common/src/main/java/com/auth/common/entity/UserAccount.java b/etl-auth/etl-auth-common/src/main/java/com/auth/common/entity/UserAccount.java
new file mode 100644
index 0000000..db1f24e
--- /dev/null
+++ b/etl-auth/etl-auth-common/src/main/java/com/auth/common/entity/UserAccount.java
@@ -0,0 +1,26 @@
+package com.auth.common.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@TableName("t_user")
+public class UserAccount {
+ @TableId(value = "id",type = IdType.AUTO)
+ private Integer id;
+
+ @ApiModelProperty("角色")
+ private String roles;
+
+ @ApiModelProperty("名称")
+ private String username;
+
+ @ApiModelProperty("密码/")
+ private String password;
+
+// @ApiModelProperty("uuid")
+// private String UUID;
+}
diff --git a/etl-auth/etl-auth-common/src/main/java/com/auth/common/enums/PermissionConstants.java b/etl-auth/etl-auth-common/src/main/java/com/auth/common/enums/PermissionConstants.java
new file mode 100644
index 0000000..452b326
--- /dev/null
+++ b/etl-auth/etl-auth-common/src/main/java/com/auth/common/enums/PermissionConstants.java
@@ -0,0 +1,13 @@
+package com.auth.server.enums;
+
+public class PermissionConstants {
+ public static final String ROLES = "roles";
+ public static final String CODE_LIST = "codeList";
+ public static final String ROLE = "role";
+ public static final String PERMISSION_CODE = "permission_code";
+ public static final String USER_CACHE_KEY = "user:username:";
+ public static final String USER_KEY = "user:key:";
+ public static final String USER_NAME = "username";
+
+ public static final String USER_ID = "userId";
+}
diff --git a/etl-groovy/etl-groovy.iml b/etl-auth/etl-auth-server/etl-auth-server.iml
similarity index 100%
rename from etl-groovy/etl-groovy.iml
rename to etl-auth/etl-auth-server/etl-auth-server.iml
diff --git a/etl-auth/etl-auth-server/pom.xml b/etl-auth/etl-auth-server/pom.xml
index ac19771..3890299 100644
--- a/etl-auth/etl-auth-server/pom.xml
+++ b/etl-auth/etl-auth-server/pom.xml
@@ -112,23 +112,13 @@
-
- org.apache.maven.plugins
- maven-compiler-plugin
- 3.8.1
-
- 1.8
- 1.8
- UTF-8
-
-
+
org.springframework.boot
spring-boot-maven-plugin
${spring-boot.version}
com.auth.server.EtlAuthServerApplication
- true
diff --git a/etl-auth/etl-auth-server/src/main/java/com/auth/server/config/ShiroConfig.java b/etl-auth/etl-auth-server/src/main/java/com/auth/server/config/ShiroConfig.java
index 0f29627..1e8ee58 100644
--- a/etl-auth/etl-auth-server/src/main/java/com/auth/server/config/ShiroConfig.java
+++ b/etl-auth/etl-auth-server/src/main/java/com/auth/server/config/ShiroConfig.java
@@ -23,7 +23,7 @@ public class ShiroConfig {
ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean();
shiroFilterFactoryBean.setSecurityManager(defaultWebSecurityManager);
//拦截页面
- Map filterMap = new LinkedHashMap<>();
+ Map filterMap = new LinkedHashMap();
//登录/登出,所有人的权限
filterMap.put("/user/login", "anon");
filterMap.put("/user/logout", "anon");
diff --git a/etl-auth/etl-auth-server/src/main/java/com/auth/server/controller/PermissionController.java b/etl-auth/etl-auth-server/src/main/java/com/auth/server/controller/PermissionController.java
index 1221762..e8a1029 100644
--- a/etl-auth/etl-auth-server/src/main/java/com/auth/server/controller/PermissionController.java
+++ b/etl-auth/etl-auth-server/src/main/java/com/auth/server/controller/PermissionController.java
@@ -42,7 +42,7 @@ public class PermissionController {
RolesPermission permission = permissionService.getOne(new QueryWrapper().eq(PermissionConstants.ROLE,roles));
String codes = StringUtils.strip(permission.getPermissionCode(), "[]");
List list = Arrays.asList(codes.split(","));
- List pathList = new ArrayList<>();
+ List pathList = new ArrayList();
for(String code:list){
String api = pathService.getOne(new QueryWrapper().eq(PermissionConstants.PERMISSION_CODE,code.trim())).getPath();
pathList.add(api);
diff --git a/etl-auth/etl-auth-server/src/main/java/com/auth/server/service/impl/PermissionServiceImpl.java b/etl-auth/etl-auth-server/src/main/java/com/auth/server/service/impl/PermissionServiceImpl.java
index f48a094..ebf2493 100644
--- a/etl-auth/etl-auth-server/src/main/java/com/auth/server/service/impl/PermissionServiceImpl.java
+++ b/etl-auth/etl-auth-server/src/main/java/com/auth/server/service/impl/PermissionServiceImpl.java
@@ -42,7 +42,7 @@ public class PermissionServiceImpl extends ServiceImpl codeList) {
//去掉头尾括号,并转为列表
- List list = new java.util.ArrayList<>(Collections.singletonList(
+ List list = new java.util.ArrayList(Collections.singletonList(
StringUtils.strip(role.getPermissionCode(), "[]")));
//将新数据添加至列表
list.addAll(codeList);
diff --git a/etl-auth/etl-auth-server/src/main/java/com/auth/server/service/impl/UserManageServiceImpl.java b/etl-auth/etl-auth-server/src/main/java/com/auth/server/service/impl/UserManageServiceImpl.java
index 16d41d6..b2d2199 100644
--- a/etl-auth/etl-auth-server/src/main/java/com/auth/server/service/impl/UserManageServiceImpl.java
+++ b/etl-auth/etl-auth-server/src/main/java/com/auth/server/service/impl/UserManageServiceImpl.java
@@ -74,13 +74,13 @@ public class UserManageServiceImpl extends ServiceImpl(416, "用户不存在", username);
+ return new Result(416, "用户不存在", username);
} catch (IncorrectCredentialsException e) {
log.info("登录密码错误:{}", e);
- return new Result<>(412, "密码错误,请重新登录", password);
+ return new Result(412, "密码错误,请重新登录", password);
} catch (AuthenticationException e) {
log.warn("用户登录异常:" + e.getMessage());
- return new Result<>(416, "账户异常", username);
+ return new Result(416, "账户异常", username);
}
String userInfo = stringRedisTemplate.opsForValue().get(PermissionConstants.USER_NAME + username);
UserAccount account = null;
@@ -112,16 +112,16 @@ public class UserManageServiceImpl extends ServiceImpl(400, "用户名或密码不能为空");
+ return new Result(400, "用户名或密码不能为空");
}
if (username.length() < 3 || username.length() > 20) {
- return new Result<>(400, "用户名长度必须在6-20个字符之间");
+ return new Result(400, "用户名长度必须在6-20个字符之间");
}
if (password.length() < 3 || password.length() > 20) {
- return new Result<>(400, "密码长度必须在6-20个字符之间");
+ return new Result(400, "密码长度必须在6-20个字符之间");
}
return null;
}
@@ -131,14 +131,14 @@ public class UserManageServiceImpl extends ServiceImpl(ResponseCodeEnum.TOKEN_MISSION.getCode(),
+ return new CommonResult(ResponseCodeEnum.TOKEN_MISSION.getCode(),
ResponseCodeEnum.TOKEN_MISSION.getMessage());
}
// 对Token解签名,并验证Token是否过期
boolean isJwtNotValid = jwtTokenUtil.isTokenExpired(token);
if (isJwtNotValid) {
- return new CommonResult<>(ResponseCodeEnum.TOKEN_INVALID.getCode(),
+ return new CommonResult(ResponseCodeEnum.TOKEN_INVALID.getCode(),
ResponseCodeEnum.TOKEN_INVALID.getMessage());
}
@@ -146,7 +146,7 @@ public class UserManageServiceImpl extends ServiceImpl(ResponseCodeEnum.TOKEN_INVALID.getCode(),
+ return new CommonResult(ResponseCodeEnum.TOKEN_INVALID.getCode(),
ResponseCodeEnum.TOKEN_INVALID.getMessage());
}
@@ -155,14 +155,14 @@ public class UserManageServiceImpl extends ServiceImpl(ResponseCodeEnum.REFRESH_TOKEN_INVALID.getCode(),
+ return new CommonResult(ResponseCodeEnum.REFRESH_TOKEN_INVALID.getCode(),
ResponseCodeEnum.REFRESH_TOKEN_INVALID.getMessage());
}
//String us = jwtTokenUtil.getUserIdFromToken(token);
Map tokenMap = jwtTokenUtil.refreshTokenAndGenerateToken(userId, username);
- return new CommonResult<>(200, ResponseCodeEnum.SUCCESS.getMessage(), tokenMap);
+ return new CommonResult(200, ResponseCodeEnum.SUCCESS.getMessage(), tokenMap);
}
}
diff --git a/etl-auth/etl-auth-server/src/main/java/com/auth/server/util/UserRealm.java b/etl-auth/etl-auth-server/src/main/java/com/auth/server/util/UserRealm.java
index 84cf367..880c63f 100644
--- a/etl-auth/etl-auth-server/src/main/java/com/auth/server/util/UserRealm.java
+++ b/etl-auth/etl-auth-server/src/main/java/com/auth/server/util/UserRealm.java
@@ -44,7 +44,7 @@ public class UserRealm extends AuthorizingRealm {
String username = token.getUsername();
//调用mybatis_plus中的方法,查询数据库中用户名对应的数据
- QueryWrapper wrapper = new QueryWrapper<>();
+ QueryWrapper wrapper = new QueryWrapper();
wrapper.eq("username",username);
UserAccount user=userManageService.getOne(wrapper);
diff --git a/etl-auth/etl-auth-server/target/etl-auth-server-1.0-SNAPSHOT.jar b/etl-auth/etl-auth-server/target/etl-auth-server-1.0-SNAPSHOT.jar
deleted file mode 100644
index 0ae55d1..0000000
Binary files a/etl-auth/etl-auth-server/target/etl-auth-server-1.0-SNAPSHOT.jar and /dev/null differ
diff --git a/etl-auth/etl-auth-server/target/maven-archiver/pom.properties b/etl-auth/etl-auth-server/target/maven-archiver/pom.properties
deleted file mode 100644
index f68dc30..0000000
--- a/etl-auth/etl-auth-server/target/maven-archiver/pom.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-#Generated by Maven
-#Wed Jul 03 15:26:21 CST 2024
-version=1.0-SNAPSHOT
-groupId=com.bwie
-artifactId=etl-auth-server
diff --git a/etl-auth/etl-auth-server/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/etl-auth/etl-auth-server/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
deleted file mode 100644
index 5642f4e..0000000
--- a/etl-auth/etl-auth-server/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
+++ /dev/null
@@ -1,20 +0,0 @@
-com\auth\server\config\MD5s.class
-com\auth\server\service\PathService.class
-com\auth\server\service\PermissionService.class
-com\auth\server\mapper\UserMangeMapper.class
-com\auth\server\mapper\PathMapper.class
-com\auth\server\service\impl\PathServiceImpl.class
-com\auth\server\EtlAuthServerApplication.class
-com\auth\server\entity\RolesPermission.class
-com\auth\server\service\impl\UserManageServiceImpl.class
-com\auth\server\config\ShiroConfig.class
-com\auth\server\enums\PermissionConstants.class
-com\auth\server\service\UserManageService.class
-com\auth\server\mapper\PermissionMapper.class
-com\auth\server\entity\PathPermission.class
-com\auth\server\util\UserRealm.class
-com\auth\server\controller\LoginControler.class
-com\auth\server\controller\PermissionController.class
-com\auth\server\util\SecurityUtils.class
-com\auth\server\service\impl\PermissionServiceImpl.class
-com\auth\server\entity\UserAccount.class
diff --git a/etl-auth/etl-auth-server/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/etl-auth/etl-auth-server/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
deleted file mode 100644
index 53c53d1..0000000
--- a/etl-auth/etl-auth-server/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
+++ /dev/null
@@ -1,21 +0,0 @@
-D:\workspace\ETL\etl-auth\etl-auth-server\src\main\java\com\auth\server\entity\RolesPermission.java
-D:\workspace\ETL\etl-auth\etl-auth-server\src\main\java\com\auth\server\service\UserManageService.java
-D:\workspace\ETL\etl-auth\etl-auth-server\src\main\java\com\auth\server\enums\PermissionConstants.java
-D:\workspace\ETL\etl-auth\etl-auth-server\src\main\java\com\auth\server\service\impl\UserManageServiceImpl.java
-D:\workspace\ETL\etl-auth\etl-auth-server\src\main\java\com\auth\server\entity\UserAccount.java
-D:\workspace\ETL\etl-auth\etl-auth-server\src\main\java\com\auth\server\EtlAuthServerApplication.java
-D:\workspace\ETL\etl-auth\etl-auth-server\src\main\java\com\auth\server\controller\LoginControler.java
-D:\workspace\ETL\etl-auth\etl-auth-server\src\main\java\com\auth\server\interceptor\UserInterceptor.java
-D:\workspace\ETL\etl-auth\etl-auth-server\src\main\java\com\auth\server\service\impl\PathServiceImpl.java
-D:\workspace\ETL\etl-auth\etl-auth-server\src\main\java\com\auth\server\controller\PermissionController.java
-D:\workspace\ETL\etl-auth\etl-auth-server\src\main\java\com\auth\server\service\PermissionService.java
-D:\workspace\ETL\etl-auth\etl-auth-server\src\main\java\com\auth\server\service\impl\PermissionServiceImpl.java
-D:\workspace\ETL\etl-auth\etl-auth-server\src\main\java\com\auth\server\service\PathService.java
-D:\workspace\ETL\etl-auth\etl-auth-server\src\main\java\com\auth\server\config\MD5s.java
-D:\workspace\ETL\etl-auth\etl-auth-server\src\main\java\com\auth\server\mapper\PermissionMapper.java
-D:\workspace\ETL\etl-auth\etl-auth-server\src\main\java\com\auth\server\util\UserRealm.java
-D:\workspace\ETL\etl-auth\etl-auth-server\src\main\java\com\auth\server\util\SecurityUtils.java
-D:\workspace\ETL\etl-auth\etl-auth-server\src\main\java\com\auth\server\entity\PathPermission.java
-D:\workspace\ETL\etl-auth\etl-auth-server\src\main\java\com\auth\server\mapper\PathMapper.java
-D:\workspace\ETL\etl-auth\etl-auth-server\src\main\java\com\auth\server\mapper\UserMangeMapper.java
-D:\workspace\ETL\etl-auth\etl-auth-server\src\main\java\com\auth\server\config\ShiroConfig.java
diff --git a/etl-auth/etl-auth-server/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst b/etl-auth/etl-auth-server/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst
deleted file mode 100644
index 660e055..0000000
--- a/etl-auth/etl-auth-server/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst
+++ /dev/null
@@ -1 +0,0 @@
-com\auth\server\EtlAuthServerApplicationTests.class
diff --git a/etl-auth/etl-auth-server/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/etl-auth/etl-auth-server/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst
deleted file mode 100644
index 2efc1f5..0000000
--- a/etl-auth/etl-auth-server/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst
+++ /dev/null
@@ -1 +0,0 @@
-D:\workspace\ETL\etl-auth\etl-auth-server\src\test\java\com\auth\server\EtlAuthServerApplicationTests.java
diff --git a/etl-auth/etl-auth-server/target/test-classes/com/auth/server/EtlAuthServerApplicationTests.class b/etl-auth/etl-auth-server/target/test-classes/com/auth/server/EtlAuthServerApplicationTests.class
deleted file mode 100644
index 3f07e7a..0000000
Binary files a/etl-auth/etl-auth-server/target/test-classes/com/auth/server/EtlAuthServerApplicationTests.class and /dev/null differ
diff --git a/etl-roles/etl-roles.iml b/etl-auth/etl-auth.iml
similarity index 100%
rename from etl-roles/etl-roles.iml
rename to etl-auth/etl-auth.iml
diff --git a/etl-common/pom.xml b/etl-common/pom.xml
index 412ed7b..212d227 100644
--- a/etl-common/pom.xml
+++ b/etl-common/pom.xml
@@ -100,26 +100,15 @@
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
- 3.8.1
-
- 1.8
- 1.8
- UTF-8
-
-
+
org.springframework.boot
spring-boot-maven-plugin
${spring-boot.version}
- com.health.cloud.common.HealthCloudCommonApplication
- true
+ com.auth.server.EtlAuthServerApplication
@@ -132,6 +121,4 @@
-
-
diff --git a/etl-common/src/main/java/com/etl/common/handler/ExceptionHandlers.java b/etl-common/src/main/java/com/etl/common/handler/ExceptionHandlers.java
index 794ee96..74e27b2 100644
--- a/etl-common/src/main/java/com/etl/common/handler/ExceptionHandlers.java
+++ b/etl-common/src/main/java/com/etl/common/handler/ExceptionHandlers.java
@@ -62,7 +62,7 @@ public class ExceptionHandlers {
.collect(Collectors.joining(";"));
result = Result.error(HttpStatus.BAD_REQUEST.value(), errorMessages);
}
- return new ResponseEntity<>(result, HttpStatus.BAD_REQUEST);
+ return new ResponseEntity(result, HttpStatus.BAD_REQUEST);
}
/**
diff --git a/etl-common/src/main/java/com/etl/common/result/Result.java b/etl-common/src/main/java/com/etl/common/result/Result.java
index ee12c23..7fad3cd 100644
--- a/etl-common/src/main/java/com/etl/common/result/Result.java
+++ b/etl-common/src/main/java/com/etl/common/result/Result.java
@@ -70,7 +70,7 @@ public class Result implements Serializable {
}
private static Result restResult(T data, int code, String msg) {
- Result apiResult = new Result<>();
+ Result apiResult = new Result();
apiResult.setCode(code);
apiResult.setData(data);
apiResult.setMsg(msg);
diff --git a/etl-common/src/main/java/com/etl/common/util/RestTemplateUtil.java b/etl-common/src/main/java/com/etl/common/util/RestTemplateUtil.java
index 2aae86b..5fc6880 100644
--- a/etl-common/src/main/java/com/etl/common/util/RestTemplateUtil.java
+++ b/etl-common/src/main/java/com/etl/common/util/RestTemplateUtil.java
@@ -16,21 +16,22 @@ public class RestTemplateUtil {
@Autowired
private RestTemplate restTemplate;
public JSONObject get(String url, Map queryParams) throws IOException {
- return get(url, queryParams, new HashMap<>(1));
+ return get(url, queryParams, new HashMap(1));
}
public JSONObject get(String url, Map queryParams, Map headerParams) throws IOException {
String tempUrl = setParamsByAppendUrl(queryParams, url);
HttpHeaders headers = new HttpHeaders();
headerParams.forEach(headers::add);
- HttpEntity> httpEntity = new HttpEntity<>(null, headers);
+ HttpEntity> httpEntity = new HttpEntity(null, headers);
ResponseEntity response = restTemplate.exchange(tempUrl, HttpMethod.GET, httpEntity, String.class);
return JSONObject.parseObject(response.getBody());
}
+
public JSONObject get2(String url, Map queryParams, Map headerParams) throws IOException {
String tempUrl = setParamsByPath(queryParams, url);
HttpHeaders headers = new HttpHeaders();
headerParams.forEach(headers::add);
- HttpEntity> httpEntity = new HttpEntity<>(null, headers);
+ HttpEntity> httpEntity = new HttpEntity(null, headers);
ResponseEntity response = restTemplate.exchange(tempUrl, HttpMethod.GET, httpEntity, String.class, queryParams);
return JSONObject.parseObject(response.getBody());
}
@@ -39,7 +40,7 @@ public class RestTemplateUtil {
headerParams.forEach(headers::add);
headers.setContentType(MediaType.APPLICATION_JSON);
headers.add("Accept", MediaType.APPLICATION_JSON.toString());
- HttpEntity httpEntity = new HttpEntity<>(json, headers);
+ HttpEntity httpEntity = new HttpEntity(json, headers);
ResponseEntity response = restTemplate.exchange(url, HttpMethod.POST, httpEntity, String.class);
return JSONObject.parseObject(response.getBody());
}
diff --git a/etl-common/target/classes/com/etl/common/util/RestTemplateUtil.class b/etl-common/target/classes/com/etl/common/util/RestTemplateUtil.class
index 00ed40b..00e7e27 100644
Binary files a/etl-common/target/classes/com/etl/common/util/RestTemplateUtil.class and b/etl-common/target/classes/com/etl/common/util/RestTemplateUtil.class differ
diff --git a/etl-common/target/etl-common-1.0-SNAPSHOT.jar b/etl-common/target/etl-common-1.0-SNAPSHOT.jar
index 7ceaaa8..48a205c 100644
Binary files a/etl-common/target/etl-common-1.0-SNAPSHOT.jar and b/etl-common/target/etl-common-1.0-SNAPSHOT.jar differ
diff --git a/etl-common/target/etl-common-1.0-SNAPSHOT.jar.original b/etl-common/target/etl-common-1.0-SNAPSHOT.jar.original
new file mode 100644
index 0000000..1fb9284
Binary files /dev/null and b/etl-common/target/etl-common-1.0-SNAPSHOT.jar.original differ
diff --git a/etl-common/target/maven-archiver/pom.properties b/etl-common/target/maven-archiver/pom.properties
index 0427b5a..344e8e8 100644
--- a/etl-common/target/maven-archiver/pom.properties
+++ b/etl-common/target/maven-archiver/pom.properties
@@ -1,5 +1,5 @@
#Generated by Maven
-#Wed Jul 03 15:15:40 CST 2024
+#Fri Jul 12 19:28:38 CST 2024
version=1.0-SNAPSHOT
groupId=com.bwie
artifactId=etl-common
diff --git a/etl-common/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/etl-common/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
index 25f0682..e69de29 100644
--- a/etl-common/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
+++ b/etl-common/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
@@ -1,20 +0,0 @@
-com\etl\common\constants\Constants.class
-com\etl\common\result\PageResult.class
-com\etl\common\constants\JwtConstants.class
-com\etl\common\Entity.class
-com\etl\common\handler\ExceptionHandlers.class
-com\etl\common\exception\LimitException.class
-com\etl\common\util\JwtUtils.class
-com\etl\common\result\CommonResult.class
-com\etl\common\util\RequestUtil.class
-com\etl\common\exception\ServiceException.class
-com\etl\common\result\ResultBody.class
-com\etl\common\exception\AllException.class
-com\etl\common\enums\ResponseCodeEnum.class
-com\etl\common\util\RestTemplateUtil.class
-com\etl\common\result\Result.class
-com\etl\common\BaseEntity.class
-com\etl\common\exception\GlobalException.class
-com\etl\common\util\RestTemplateConfig.class
-com\etl\common\constants\TokenConstants.class
-com\etl\common\util\StringUtils.class
diff --git a/etl-common/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/etl-common/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
index cd2ff3a..e8ff4ad 100644
--- a/etl-common/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
+++ b/etl-common/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
@@ -1,20 +1,20 @@
-D:\workspace\ETL\etl-common\src\main\java\com\etl\common\enums\ResponseCodeEnum.java
-D:\workspace\ETL\etl-common\src\main\java\com\etl\common\result\ResultBody.java
-D:\workspace\ETL\etl-common\src\main\java\com\etl\common\util\RestTemplateConfig.java
-D:\workspace\ETL\etl-common\src\main\java\com\etl\common\exception\GlobalException.java
-D:\workspace\ETL\etl-common\src\main\java\com\etl\common\handler\ExceptionHandlers.java
-D:\workspace\ETL\etl-common\src\main\java\com\etl\common\BaseEntity.java
-D:\workspace\ETL\etl-common\src\main\java\com\etl\common\result\CommonResult.java
-D:\workspace\ETL\etl-common\src\main\java\com\etl\common\result\Result.java
-D:\workspace\ETL\etl-common\src\main\java\com\etl\common\constants\TokenConstants.java
-D:\workspace\ETL\etl-common\src\main\java\com\etl\common\util\JwtUtils.java
-D:\workspace\ETL\etl-common\src\main\java\com\etl\common\exception\LimitException.java
-D:\workspace\ETL\etl-common\src\main\java\com\etl\common\util\RequestUtil.java
-D:\workspace\ETL\etl-common\src\main\java\com\etl\common\exception\AllException.java
-D:\workspace\ETL\etl-common\src\main\java\com\etl\common\util\StringUtils.java
-D:\workspace\ETL\etl-common\src\main\java\com\etl\common\constants\Constants.java
-D:\workspace\ETL\etl-common\src\main\java\com\etl\common\Entity.java
-D:\workspace\ETL\etl-common\src\main\java\com\etl\common\result\PageResult.java
-D:\workspace\ETL\etl-common\src\main\java\com\etl\common\constants\JwtConstants.java
-D:\workspace\ETL\etl-common\src\main\java\com\etl\common\exception\ServiceException.java
-D:\workspace\ETL\etl-common\src\main\java\com\etl\common\util\RestTemplateUtil.java
+D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\exception\AllException.java
+D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\result\Result.java
+D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\result\CommonResult.java
+D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\util\RestTemplateConfig.java
+D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\constants\Constants.java
+D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\exception\LimitException.java
+D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\result\PageResult.java
+D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\constants\TokenConstants.java
+D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\util\RequestUtil.java
+D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\util\StringUtils.java
+D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\enums\ResponseCodeEnum.java
+D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\util\RestTemplateUtil.java
+D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\constants\JwtConstants.java
+D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\util\JwtUtils.java
+D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\BaseEntity.java
+D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\exception\GlobalException.java
+D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\handler\ExceptionHandlers.java
+D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\Entity.java
+D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\exception\ServiceException.java
+D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\result\ResultBody.java
diff --git a/etl-database/etl-database-common/pom.xml b/etl-database/etl-database-common/pom.xml
index a4d63d7..ff5672c 100644
--- a/etl-database/etl-database-common/pom.xml
+++ b/etl-database/etl-database-common/pom.xml
@@ -16,6 +16,11 @@
2021.0.5.0
+
+ com.belerweb
+ pinyin4j
+ 2.5.1
+
com.baomidou
mybatis-plus-boot-starter
@@ -79,37 +84,4 @@
-
-
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
- 3.8.1
-
- 1.8
- 1.8
- UTF-8
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
- ${spring-boot.version}
-
- com.etl.database.common.EtlDatabaseCommonApplication
- true
-
-
-
- repackage
-
- repackage
-
-
-
-
-
-
-
diff --git a/etl-database/etl-database-common/src/main/java/com/etl/database/common/entity/AccessItem.java b/etl-database/etl-database-common/src/main/java/com/etl/database/common/entity/AccessItem.java
new file mode 100644
index 0000000..34d51b8
--- /dev/null
+++ b/etl-database/etl-database-common/src/main/java/com/etl/database/common/entity/AccessItem.java
@@ -0,0 +1,23 @@
+package com.etl.database.common.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.etl.database.common.entity.database.BaseMate;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 项目实体类
+ */
+@Data
+@ApiModel(value = "项目实体类")
+@TableName("t_access_item")
+public class AccessItem extends BaseMate {
+ @ApiModelProperty(value = "主键")
+ private Integer id;
+
+ @ApiModelProperty(value = "接入项目名称")
+ private String accessItemName;
+}
diff --git a/etl-database/etl-database-common/src/main/java/com/etl/database/common/entity/AnalyticWay.java b/etl-database/etl-database-common/src/main/java/com/etl/database/common/entity/AnalyticWay.java
new file mode 100644
index 0000000..d940655
--- /dev/null
+++ b/etl-database/etl-database-common/src/main/java/com/etl/database/common/entity/AnalyticWay.java
@@ -0,0 +1,20 @@
+package com.etl.database.common.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * 分析方式 实体类
+ */
+@Data
+@ApiModel(value = "分析方式")
+@TableName("t_analytic_way")
+public class AnalyticWay {
+ @ApiModelProperty(value = "主键")
+ private Integer id;
+
+ @ApiModelProperty(value = "分析方式名称")
+ private String analyticWayName;
+}
diff --git a/etl-database/etl-database-common/src/main/java/com/etl/database/common/entity/DataSources.java b/etl-database/etl-database-common/src/main/java/com/etl/database/common/entity/DataSources.java
index a68aae7..a33b723 100644
--- a/etl-database/etl-database-common/src/main/java/com/etl/database/common/entity/DataSources.java
+++ b/etl-database/etl-database-common/src/main/java/com/etl/database/common/entity/DataSources.java
@@ -60,4 +60,7 @@ public class DataSources extends BaseMate {
@ApiModelProperty(value = "密码")
private String password;
+ @ApiModelProperty(value = "数据库输入输出状态")
+ private Integer data;
+
}
diff --git a/etl-database/etl-database-common/src/main/java/com/etl/database/common/entity/InterFace.java b/etl-database/etl-database-common/src/main/java/com/etl/database/common/entity/InterFace.java
new file mode 100644
index 0000000..827b9ea
--- /dev/null
+++ b/etl-database/etl-database-common/src/main/java/com/etl/database/common/entity/InterFace.java
@@ -0,0 +1,71 @@
+package com.etl.database.common.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * 接口实体类
+ */
+@Data
+@TableName("t_interface")
+@Api(tags = "数据集成--创建接口")
+public class InterFace {
+
+ @ApiModelProperty(value = "接口id")
+ private Integer id;
+
+ @ApiModelProperty(value = "接口名称")
+ private String interfaceName;
+
+ @ApiModelProperty(value = "包名")
+ private String packageName;
+
+ @ApiModelProperty(value = "请求方式id")
+ private Integer requestTypeId;
+
+ @ApiModelProperty(value = "分析方式id")
+ private Integer analyticWayId;
+
+ @ApiModelProperty(value = "接入方式id")
+ private Integer accessItemId;
+
+ @ApiModelProperty(value = "接口描述")
+ private String interfaceDescribe;
+
+ @ApiModelProperty(value = "接口来源")
+ private String interfaceSource;
+
+ @ApiModelProperty(value = "调用次数")
+ private Integer invokeCount;
+
+ @ApiModelProperty(value = "成功次数")
+ private Integer successCount;
+
+ @ApiModelProperty(value = "失败次数")
+ private Integer failureCount;
+
+ @ApiModelProperty(value = "创建人")
+ private String createBy;
+
+ @ApiModelProperty(value = "创建时间")
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+ private Date createTime;
+
+ @ApiModelProperty(value = "修改人")
+ private String updateBy;
+
+ @ApiModelProperty(value = "修改时间")
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+ private Date updateTime;
+
+ @ApiModelProperty(value = "是否删除")
+ private Integer isDelete;
+}
diff --git a/etl-database/etl-database-common/src/main/java/com/etl/database/common/entity/RequestType.java b/etl-database/etl-database-common/src/main/java/com/etl/database/common/entity/RequestType.java
new file mode 100644
index 0000000..1b4ca06
--- /dev/null
+++ b/etl-database/etl-database-common/src/main/java/com/etl/database/common/entity/RequestType.java
@@ -0,0 +1,20 @@
+package com.etl.database.common.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * 请求类型 实体类
+ */
+@Data
+@TableName("t_request_type")
+@ApiModel(value = "请求类型 实体类")
+public class RequestType {
+ @ApiModelProperty(value = "主键")
+ private Integer id;
+
+ @ApiModelProperty(value = "请求类型名称")
+ private String requestTypeName;
+}
diff --git a/etl-database/etl-database-common/src/main/java/com/etl/database/common/entity/req/DataSourceReq.java b/etl-database/etl-database-common/src/main/java/com/etl/database/common/entity/req/DataSourceReq.java
index a8f6734..28fd7a0 100644
--- a/etl-database/etl-database-common/src/main/java/com/etl/database/common/entity/req/DataSourceReq.java
+++ b/etl-database/etl-database-common/src/main/java/com/etl/database/common/entity/req/DataSourceReq.java
@@ -18,4 +18,28 @@ public class DataSourceReq {
@ApiModelProperty("数据源类型")
private Integer dataSourceType;
+
+ @ApiModelProperty("驱动类")
+ private String driverClassName;
+
+ @ApiModelProperty("连接地址")
+ private String url;
+
+ @ApiModelProperty("用户名")
+ private String username;
+
+ @ApiModelProperty("密码")
+ private String password;
+
+ @ApiModelProperty("状态 1-输入 2-输出")
+ private Integer data;
+
+ @ApiModelProperty("数据库名")
+ private String databaseName;
+
+ @ApiModelProperty("表名")
+ private String tableName;
+
+ @ApiModelProperty("规则类型id")
+ private Integer ruleTypeId;
}
diff --git a/etl-database/etl-database-common/src/main/java/com/etl/database/common/entity/req/InterFaceReq.java b/etl-database/etl-database-common/src/main/java/com/etl/database/common/entity/req/InterFaceReq.java
new file mode 100644
index 0000000..7d4642f
--- /dev/null
+++ b/etl-database/etl-database-common/src/main/java/com/etl/database/common/entity/req/InterFaceReq.java
@@ -0,0 +1,28 @@
+package com.etl.database.common.entity.req;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * 接口请求体
+ */
+@Data
+@ApiModel(value = "接口请求实体类")
+public class InterFaceReq {
+
+ @ApiModelProperty(value = "接口名称")
+ private String interfaceName;
+
+ @ApiModelProperty(value = "接入项目主键")
+ private Integer id;
+
+ @ApiModelProperty(value = "接入项目名称")
+ private String accessItemName;
+
+ @ApiModelProperty(value = "当前页数")
+ private Integer pageNum = 1;
+
+ @ApiModelProperty(value = "每页条数")
+ private Integer pageSize = 3;
+}
diff --git a/etl-database/etl-database-common/src/main/java/com/etl/database/common/entity/resp/InterResp.java b/etl-database/etl-database-common/src/main/java/com/etl/database/common/entity/resp/InterResp.java
new file mode 100644
index 0000000..9946fae
--- /dev/null
+++ b/etl-database/etl-database-common/src/main/java/com/etl/database/common/entity/resp/InterResp.java
@@ -0,0 +1,17 @@
+package com.etl.database.common.entity.resp;
+
+import com.etl.database.common.entity.InterFace;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class InterResp {
+ private Long pageNum;
+
+ private Long pageSize;
+
+ private Long total;
+
+ private List intervals;
+}
diff --git a/etl-database/etl-database-common/target/classes/com/etl/database/common/entity/AccessItem.class b/etl-database/etl-database-common/target/classes/com/etl/database/common/entity/AccessItem.class
new file mode 100644
index 0000000..185a4f8
Binary files /dev/null and b/etl-database/etl-database-common/target/classes/com/etl/database/common/entity/AccessItem.class differ
diff --git a/etl-database/etl-database-common/target/classes/com/etl/database/common/entity/AnalyticWay.class b/etl-database/etl-database-common/target/classes/com/etl/database/common/entity/AnalyticWay.class
new file mode 100644
index 0000000..9a2ee90
Binary files /dev/null and b/etl-database/etl-database-common/target/classes/com/etl/database/common/entity/AnalyticWay.class differ
diff --git a/etl-database/etl-database-common/target/classes/com/etl/database/common/entity/DataSources.class b/etl-database/etl-database-common/target/classes/com/etl/database/common/entity/DataSources.class
index 61e0b93..9c0c11f 100644
Binary files a/etl-database/etl-database-common/target/classes/com/etl/database/common/entity/DataSources.class and b/etl-database/etl-database-common/target/classes/com/etl/database/common/entity/DataSources.class differ
diff --git a/etl-database/etl-database-common/target/classes/com/etl/database/common/entity/InterFace.class b/etl-database/etl-database-common/target/classes/com/etl/database/common/entity/InterFace.class
new file mode 100644
index 0000000..3822c9e
Binary files /dev/null and b/etl-database/etl-database-common/target/classes/com/etl/database/common/entity/InterFace.class differ
diff --git a/etl-database/etl-database-common/target/classes/com/etl/database/common/entity/RequestType.class b/etl-database/etl-database-common/target/classes/com/etl/database/common/entity/RequestType.class
new file mode 100644
index 0000000..0ea4f6b
Binary files /dev/null and b/etl-database/etl-database-common/target/classes/com/etl/database/common/entity/RequestType.class differ
diff --git a/etl-database/etl-database-common/target/classes/com/etl/database/common/entity/req/DataSourceReq.class b/etl-database/etl-database-common/target/classes/com/etl/database/common/entity/req/DataSourceReq.class
index 8717a95..e4cc8b2 100644
Binary files a/etl-database/etl-database-common/target/classes/com/etl/database/common/entity/req/DataSourceReq.class and b/etl-database/etl-database-common/target/classes/com/etl/database/common/entity/req/DataSourceReq.class differ
diff --git a/etl-database/etl-database-common/target/classes/com/etl/database/common/entity/req/InterFaceReq.class b/etl-database/etl-database-common/target/classes/com/etl/database/common/entity/req/InterFaceReq.class
new file mode 100644
index 0000000..50c3f3a
Binary files /dev/null and b/etl-database/etl-database-common/target/classes/com/etl/database/common/entity/req/InterFaceReq.class differ
diff --git a/etl-database/etl-database-common/target/classes/com/etl/database/common/entity/resp/InterResp.class b/etl-database/etl-database-common/target/classes/com/etl/database/common/entity/resp/InterResp.class
new file mode 100644
index 0000000..9638730
Binary files /dev/null and b/etl-database/etl-database-common/target/classes/com/etl/database/common/entity/resp/InterResp.class differ
diff --git a/etl-database/etl-database-server/pom.xml b/etl-database/etl-database-server/pom.xml
index eaae8d8..6199d9b 100644
--- a/etl-database/etl-database-server/pom.xml
+++ b/etl-database/etl-database-server/pom.xml
@@ -119,23 +119,12 @@
-
- org.apache.maven.plugins
- maven-compiler-plugin
- 3.8.1
-
- 1.8
- 1.8
- UTF-8
-
-
org.springframework.boot
spring-boot-maven-plugin
${spring-boot.version}
com.etl.database.server.EtlDatabaseServerApplication
- true
diff --git a/etl-database/etl-database-server/src/main/java/com/etl/database/server/config/MybatisPlusConfig.java b/etl-database/etl-database-server/src/main/java/com/etl/database/server/config/MybatisPlusConfig.java
new file mode 100644
index 0000000..1d4194d
--- /dev/null
+++ b/etl-database/etl-database-server/src/main/java/com/etl/database/server/config/MybatisPlusConfig.java
@@ -0,0 +1,36 @@
+package com.etl.database.server.config;
+import com.baomidou.mybatisplus.annotation.DbType;
+import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+public class MybatisPlusConfig {
+ /**
+ *
+ * 1 怎么来配置mybatis-plus中的插件?
+ * 这里所需要的类型是MybatisPlusInterceptor,这是mybatis-plus的一个拦截器,用于配置mybatis-plus中的插件。
+ * 2 为什么要使用拦截器MybatisPlusInterceptor呢?
+ * 这里边的原理和mybatis分页插件的功能是一样的,工作流程如下 :
+ * (1)第一步:执行查询功能。
+ * (2)第二步:拦截器对查询功能进行拦截。
+ * (3)第三步:拦截器对查询功能的基础上做了额外的处理,达到分页的效果(功能)。
+ * 3 对比配置mybatis中的插件?
+ * 用的也是拦截器的方式。
+ *
+ * @return MybatisPlusInterceptor
+ */
+ @Bean
+ public MybatisPlusInterceptor mybatisPlusInterceptor() {
+ MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
+ //添加:分页插件
+ //参数:new PaginationInnerInterceptor(DbType.MYSQL),是专门为mysql定制实现的内部的分页插件
+ interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
+ //添加:乐观锁插件
+ interceptor.addInnerInterceptor(new OptimisticLockerInnerInterceptor());
+ return interceptor;
+ }
+}
diff --git a/etl-database/etl-database-server/src/main/java/com/etl/database/server/controller/CodeTypeController.java b/etl-database/etl-database-server/src/main/java/com/etl/database/server/controller/CodeTypeController.java
index a265322..161fa6c 100644
--- a/etl-database/etl-database-server/src/main/java/com/etl/database/server/controller/CodeTypeController.java
+++ b/etl-database/etl-database-server/src/main/java/com/etl/database/server/controller/CodeTypeController.java
@@ -1,6 +1,7 @@
package com.etl.database.server.controller;
import com.etl.common.result.Result;
+import com.etl.database.common.annoation.Limit;
import com.etl.database.common.entity.CodeType;
import com.etl.database.server.service.CodeTypeService;
import io.swagger.annotations.Api;
@@ -18,6 +19,7 @@ public class CodeTypeController {
private CodeTypeService codeTypeervice;
@RequestMapping(value = "/findCodeType")
+ @Limit(key = "findCodeType",permitsPerSecond = 1, timeout = 500,msg = "系统繁忙,请在稍后重试")
public Result findCodeType() {
List list = codeTypeervice.findCodeType();
return Result.success(list);
diff --git a/etl-database/etl-database-server/src/main/java/com/etl/database/server/controller/InterfaceController.java b/etl-database/etl-database-server/src/main/java/com/etl/database/server/controller/InterfaceController.java
new file mode 100644
index 0000000..d07fd3f
--- /dev/null
+++ b/etl-database/etl-database-server/src/main/java/com/etl/database/server/controller/InterfaceController.java
@@ -0,0 +1,32 @@
+package com.etl.database.server.controller;
+
+import com.etl.common.result.Result;
+import com.etl.database.common.entity.InterFace;
+import com.etl.database.common.entity.req.InterFaceReq;
+import com.etl.database.common.entity.resp.InterResp;
+import com.etl.database.server.service.InterFaceService;
+import io.swagger.annotations.Api;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 数据集成--接口 controller
+ */
+@RestController
+@RequestMapping("/interface")
+@Api(tags = "数据集成--创建接口")
+public class InterfaceController {
+ @Autowired
+ private InterFaceService interFaceService;
+
+ @PostMapping("/findInterFaceList")
+ public Result findInterFaceList(@RequestBody InterFaceReq interFaceReq) {
+ InterResp interFaceList = interFaceService.findInterFaceList(interFaceReq);
+ return Result.success(interFaceList);
+ }
+}
diff --git a/etl-database/etl-database-server/src/main/java/com/etl/database/server/controller/MysqlController.java b/etl-database/etl-database-server/src/main/java/com/etl/database/server/controller/MysqlController.java
index aeb5591..bd84fa9 100644
--- a/etl-database/etl-database-server/src/main/java/com/etl/database/server/controller/MysqlController.java
+++ b/etl-database/etl-database-server/src/main/java/com/etl/database/server/controller/MysqlController.java
@@ -2,6 +2,7 @@ package com.etl.database.server.controller;
import com.etl.common.result.Result;
import com.etl.database.common.entity.constants.DataSourceConstants;
+import com.etl.database.common.entity.req.DataSourceReq;
import com.etl.database.common.entity.req.DruidReq;
import com.etl.database.common.entity.resp.ColumnInfo;
import com.etl.database.server.service.MysqlService;
@@ -55,13 +56,13 @@ public class MysqlController {
@PostMapping("/findDatabaseTableFieldPrice")
@ApiOperation("数据表输入")
- public Result>> findDatabaseTableFieldPrice(@Valid @RequestBody DruidReq druidReq) {
- return Result.success(dataSouceService.findDatabaseTableFieldPrice(druidReq));
+ public Result>> findDatabaseTableFieldPrice(@Valid @RequestBody DataSourceReq dataSourceReq) {
+ return Result.success(dataSouceService.findDatabaseTableFieldPrice(dataSourceReq));
}
@PostMapping("outDatabaseTableFieldPrice")
@ApiOperation("数据表输出")
- public Result outDatabaseTableFieldPrice(@Valid @RequestBody DruidReq druidReq) {
- return Result.success(dataSouceService.findDatabaseTableFieldPrice(druidReq));
+ public Result outDatabaseTableFieldPrice(@Valid @RequestBody DataSourceReq dataSourceReq) {
+ return Result.success(dataSouceService.findDatabaseTableFieldPrice(dataSourceReq));
}
}
diff --git a/etl-database/etl-database-server/src/main/java/com/etl/database/server/exception/GlobalExceptionHandler.java b/etl-database/etl-database-server/src/main/java/com/etl/database/server/exception/GlobalExceptionHandler.java
index a7fa18d..f395730 100644
--- a/etl-database/etl-database-server/src/main/java/com/etl/database/server/exception/GlobalExceptionHandler.java
+++ b/etl-database/etl-database-server/src/main/java/com/etl/database/server/exception/GlobalExceptionHandler.java
@@ -28,7 +28,7 @@ public class GlobalExceptionHandler {
// 使用Result封装错误信息
Result result = Result.error(errorMessage);
- return new ResponseEntity<>(result, HttpStatus.BAD_REQUEST);
+ return new ResponseEntity(result, HttpStatus.BAD_REQUEST);
}
@ExceptionHandler(Exception.class)
@@ -37,6 +37,6 @@ public class GlobalExceptionHandler {
// 使用Result封装错误信息
Result result = Result.error(ex.getMessage());
- return new ResponseEntity<>(result, HttpStatus.INTERNAL_SERVER_ERROR);
+ return new ResponseEntity(result, HttpStatus.INTERNAL_SERVER_ERROR);
}
}
diff --git a/etl-database/etl-database-server/src/main/java/com/etl/database/server/mapper/InterFaceMapper.java b/etl-database/etl-database-server/src/main/java/com/etl/database/server/mapper/InterFaceMapper.java
new file mode 100644
index 0000000..d9b8a01
--- /dev/null
+++ b/etl-database/etl-database-server/src/main/java/com/etl/database/server/mapper/InterFaceMapper.java
@@ -0,0 +1,9 @@
+package com.etl.database.server.mapper;
+
+import com.etl.database.common.entity.InterFace;
+import com.github.yulichang.base.MPJBaseMapper;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface InterFaceMapper extends MPJBaseMapper {
+}
diff --git a/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/InterFaceService.java b/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/InterFaceService.java
new file mode 100644
index 0000000..f5380b8
--- /dev/null
+++ b/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/InterFaceService.java
@@ -0,0 +1,14 @@
+package com.etl.database.server.service;
+
+import com.etl.database.common.entity.InterFace;
+import com.etl.database.common.entity.req.InterFaceReq;
+import com.etl.database.common.entity.resp.InterResp;
+import com.github.yulichang.base.MPJBaseService;
+
+import java.util.List;
+
+public interface InterFaceService extends MPJBaseService {
+
+
+ InterResp findInterFaceList(InterFaceReq interFaceReq);
+}
diff --git a/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/MysqlService.java b/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/MysqlService.java
index 2c4731e..6ea8240 100644
--- a/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/MysqlService.java
+++ b/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/MysqlService.java
@@ -1,6 +1,7 @@
package com.etl.database.server.service;
import com.etl.database.common.entity.DataSources;
+import com.etl.database.common.entity.req.DataSourceReq;
import com.etl.database.common.entity.req.DruidReq;
import com.etl.database.common.entity.resp.ColumnInfo;
import com.github.yulichang.base.MPJBaseService;
@@ -17,5 +18,5 @@ public interface MysqlService extends MPJBaseService {
List findDatabaseTableField(DruidReq druidReq);
- List