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 @@ - + @@ -72,9 +199,8 @@ - - - + + @@ -84,84 +210,57 @@ - - + + - + - + - - - - - - - + + + + + + + + + - + 1710157283817 - - - - - - \ 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> findDatabaseTableFieldPrice(DruidReq druidReq); + List> findDatabaseTableFieldPrice(DataSourceReq dataSourceReq); } diff --git a/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/impl/DataSouceServiceImpl.java b/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/impl/DataSouceServiceImpl.java index c974f21..ba838a3 100644 --- a/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/impl/DataSouceServiceImpl.java +++ b/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/impl/DataSouceServiceImpl.java @@ -36,7 +36,7 @@ public class DataSouceServiceImpl extends MPJBaseServiceImpl page = new Page<>(dataSourceReq.getPageNum(), dataSourceReq.getPageSize()); + Page page = new Page(dataSourceReq.getPageNum(), dataSourceReq.getPageSize()); IPage dataSourceReqIPage = dataSourceMapper.selectJoinPage(page, DataSources.class, dataSourceMPJLambdaWrapper); List records = dataSourceReqIPage.getRecords(); return Result.success(records); diff --git a/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/impl/FileServiceImpl.java b/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/impl/FileServiceImpl.java index aecd5c6..6f8b3dc 100644 --- a/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/impl/FileServiceImpl.java +++ b/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/impl/FileServiceImpl.java @@ -57,7 +57,7 @@ public class FileServiceImpl extends MPJBaseServiceImpl implem if (fileReq.getFilePath() != null && !fileReq.getFilePath().isEmpty()) { taskMPJLambdaWrapper.like(File::getFilePath, fileReq.getFilePath()); } - Page page = new Page<>(fileReq.getPageNum(), fileReq.getPageSize()); + Page page = new Page(fileReq.getPageNum(), fileReq.getPageSize()); IPage dataSourceReqIPage = fileMapper.selectJoinPage(page, File.class, taskMPJLambdaWrapper); List records = dataSourceReqIPage.getRecords(); return fileMapper.selectJoinList(File.class, taskMPJLambdaWrapper); diff --git a/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/impl/InterFaceServiceImpl.java b/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/impl/InterFaceServiceImpl.java new file mode 100644 index 0000000..0873c8d --- /dev/null +++ b/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/impl/InterFaceServiceImpl.java @@ -0,0 +1,42 @@ +package com.etl.database.server.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +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.mapper.InterFaceMapper; +import com.etl.database.server.service.InterFaceService; +import com.github.yulichang.base.MPJBaseServiceImpl; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +@Slf4j +public class InterFaceServiceImpl extends MPJBaseServiceImpl implements InterFaceService { + @Autowired + private InterFaceMapper interFaceMapper; + + @Override + public InterResp findInterFaceList(InterFaceReq interFaceReq) { + + Page interFacePage = new Page().setCurrent(interFaceReq.getPageNum()).setSize(interFaceReq.getPageSize()); + + LambdaQueryWrapper interFaceLambdaQueryWrapper = new LambdaQueryWrapper(); + if (interFaceReq.getAccessItemName() != null){ + interFaceLambdaQueryWrapper.like(InterFace::getInterfaceName, interFaceReq.getInterfaceName()); + } + + Page interFacePage1 = interFaceMapper.selectPage(interFacePage, interFaceLambdaQueryWrapper); + InterResp interResp = new InterResp(); + interResp.setPageSize(interFacePage1.getSize()); + interResp.setPageNum(interFacePage1.getCurrent()); + interResp.setTotal(interFacePage1.getTotal()); + interResp.setIntervals(interFacePage1.getRecords()); + return interResp; + } +} diff --git a/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/impl/MysqlServiceImpl.java b/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/impl/MysqlServiceImpl.java index 7025aaf..dfa9b4a 100644 --- a/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/impl/MysqlServiceImpl.java +++ b/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/impl/MysqlServiceImpl.java @@ -4,12 +4,18 @@ package com.etl.database.server.service.impl; import com.etl.common.util.StringUtils; import com.etl.database.common.entity.DataSources; 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.mapper.MysqlMapper; import com.etl.database.server.service.MysqlService; import com.github.yulichang.base.MPJBaseServiceImpl; import lombok.extern.slf4j.Slf4j; +import net.sourceforge.pinyin4j.PinyinHelper; +import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; +import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; +import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; +import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.datasource.DriverManagerDataSource; @@ -18,6 +24,7 @@ import org.springframework.stereotype.Service; import javax.sql.DataSource; import java.sql.*; import java.util.*; +import java.util.stream.Collectors; /** @@ -64,7 +71,7 @@ public class MysqlServiceImpl extends MPJBaseServiceImpl findDatabaseTable(DruidReq druidReq) { - List tableNames = new ArrayList<>(); + List tableNames = new ArrayList(); try (Connection connection = getConnection(druidReq)) { try (Statement statement = connection.createStatement()) { // 查询所有数据库名 @@ -85,7 +92,7 @@ public class MysqlServiceImpl extends MPJBaseServiceImpl tableNames = new ArrayList<>(); + List tableNames = new ArrayList(); try (Connection connection = getConnection(druidReq)) { try (Statement statement = connection.createStatement()) { // 查询指定数据库的所有表名 @@ -105,7 +112,7 @@ public class MysqlServiceImpl extends MPJBaseServiceImpl findDatabaseTableField(DruidReq druidReq) { checkDruidReq(druidReq); - List columnInfos = new ArrayList<>(); + List columnInfos = new ArrayList(); Connection connection = null; PreparedStatement preparedStatement = null; ResultSet resultSet = null; @@ -176,16 +183,25 @@ public class MysqlServiceImpl extends MPJBaseServiceImpl> findDatabaseTableFieldPrice(DruidReq druidReq) { - List> results = new ArrayList<>(); + public List> findDatabaseTableFieldPrice(DataSourceReq dataSourceReq) { + checkDataSourceReq(dataSourceReq); + List> results = new ArrayList(); Connection connection = null; PreparedStatement preparedStatement = null; ResultSet resultSet = null; + DruidReq druidReq = new DruidReq(); + druidReq.setDriverClassName(dataSourceReq.getDriverClassName()); + druidReq.setUrl(dataSourceReq.getUrl()); + druidReq.setUsername(dataSourceReq.getUsername()); + druidReq.setPassword(dataSourceReq.getPassword()); + druidReq.setDatabaseName(dataSourceReq.getDatabaseName()); + druidReq.setTableName(dataSourceReq.getTableName()); + try { connection = getConnection(druidReq); // 这里我们仅作为示例直接构建SQL查询语句,实际中可能需要更复杂的逻辑来构建SQL - String sql = "SELECT * FROM " + druidReq.getDatabaseName() + "." + druidReq.getTableName(); + String sql = "SELECT * FROM " + dataSourceReq.getDatabaseName() + "." + dataSourceReq.getTableName(); preparedStatement = connection.prepareStatement(sql); resultSet = preparedStatement.executeQuery(); @@ -193,7 +209,7 @@ public class MysqlServiceImpl extends MPJBaseServiceImpl rowData = new HashMap<>(); + Map rowData = new HashMap(); for (int i = 1; i <= columnCount; i++) { String columnName = metaData.getColumnName(i); Object columnValue = resultSet.getObject(i); @@ -209,20 +225,28 @@ public class MysqlServiceImpl extends MPJBaseServiceImpl> results) { + private void insertDataExcludingId(DruidReq druidReq, List> results) { Connection connection = null; PreparedStatement preparedStatement = null; @@ -231,7 +255,7 @@ public class MysqlServiceImpl extends MPJBaseServiceImpl rowData : results) { // 获取列名并构建 SQL 语句 - List columnNames = new ArrayList<>(rowData.keySet()); + List columnNames = new ArrayList(rowData.keySet()); columnNames.remove("id"); // 移除 id 列 StringBuilder sql = new StringBuilder("INSERT INTO "); sql.append(druidReq.getDatabaseName()).append(".").append(druidReq.getTableName()).append(" ("); @@ -267,13 +291,97 @@ public class MysqlServiceImpl extends MPJBaseServiceImpl> checkRoule(List> results, Integer ruleTypeId) { + if (ruleTypeId != null) { + // 根据不同的ruleTypeId进行不同的处理 + switch (ruleTypeId) { + case 1: + // 对results数据进行清洗,将所有包含中文的字段内容转为英文 + results = results.stream() + .map(map -> { + map.forEach((key, value) -> { + if (value instanceof String) { + String strValue = (String) value; + if (strValue.matches(".*[\u4e00-\u9fa5]+.*")) { // 判断是否包含中文 + HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat(); + format.setCaseType(HanyuPinyinCaseType.LOWERCASE); // 小写 + format.setToneType(HanyuPinyinToneType.WITHOUT_TONE); // 不带音调 + format.setVCharType(HanyuPinyinVCharType.WITH_V); // 使用带 "v" 的拼写方式 + + StringBuilder englishValue = new StringBuilder(); + for (char c : strValue.toCharArray()) { + try { + String[] pinyinArray = PinyinHelper.toHanyuPinyinStringArray(c, format); + if (pinyinArray != null) { + englishValue.append(String.join("", pinyinArray)); + } else { + englishValue.append(c); // 非中文字符直接追加 + } + } catch (Exception e) { + // 处理转换异常 + System.err.println("拼音转换异常:" + e.getMessage()); + } + } + map.put(key, englishValue.toString()); + } + } + }); + return map; + }) + .collect(Collectors.toList()); + break; + case 2: + // 对results数据进行脱敏,对字段是username的进行脱敏 + results = results.stream() + .map(map -> { + if (map.containsKey("username")) { + String name = (String) map.get("username"); + if (name.length() > 1) { + // 根据姓名长度添加星号 + String desensitizedName = name.substring(0, 1); // 保留第一个字 + for (int i = 1; i < name.length(); i++) { + desensitizedName += "*"; + } + map.put("username", desensitizedName); + } + } + if (map.containsKey("mobile")) { + String userphone = (String) map.get("mobile"); + if (userphone.length() > 7) { + map.put("mobile", userphone.substring(0, 3) + "****" + userphone.substring(7)); // 保留前三位和后一位,中间用星号代替 + } + } + return map; + }) + .collect(Collectors.toList()); + break; + default: + throw new RuntimeException("不支持的规则类型ID: " + ruleTypeId); + } + return results; + } + return results; + } + + private void checkDataSourceReq(DataSourceReq dataSourceReq) { + if (StringUtils.isEmpty(dataSourceReq.getDatabaseName())){ + throw new RuntimeException("请选择数据库"); + } + if (StringUtils.isNull(dataSourceReq.getTableName())){ + throw new RuntimeException("请选择表"); + } } diff --git a/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/impl/RedisServiceImpl.java b/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/impl/RedisServiceImpl.java index 744e637..c15998b 100644 --- a/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/impl/RedisServiceImpl.java +++ b/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/impl/RedisServiceImpl.java @@ -23,7 +23,7 @@ public class RedisServiceImpl extends MPJBaseServiceImpl testDatabaseRedis(DatabaseRedisReq databaseRedis) { // 创建一个空的HashMap来存储Redis中的所有键值对 - Map allData = new HashMap<>(); + Map allData = new HashMap(); // 从Redis配置中获取Jedis连接池 JedisPool jedisPool = RedisConfig.getJedisPool(databaseRedis); diff --git a/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/impl/RuleServiceImpl.java b/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/impl/RuleServiceImpl.java index 832eea1..1d5f817 100644 --- a/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/impl/RuleServiceImpl.java +++ b/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/impl/RuleServiceImpl.java @@ -27,7 +27,7 @@ public class RuleServiceImpl extends MPJBaseServiceImpl implem @Override public List findRule(RuleReq ruleReq) { - MPJLambdaWrapper ruleMPJLambdaWrapper = new MPJLambdaWrapper<>(); + MPJLambdaWrapper ruleMPJLambdaWrapper = new MPJLambdaWrapper(); ruleMPJLambdaWrapper.select(Rule::getId, Rule::getRuleTypeId, Rule::getRuleName) .select(RuleType::getRuleTypeName) .select(CodeType::getCodeTypeName) @@ -40,7 +40,7 @@ public class RuleServiceImpl extends MPJBaseServiceImpl implem if (ruleReq.getCodeTypeId() != null) { ruleMPJLambdaWrapper.eq(Code::getCodeTypeId, ruleReq.getCodeTypeId()); } - Page page = new Page<>(ruleReq.getPageNum(), ruleReq.getPageSize()); + Page page = new Page(ruleReq.getPageNum(), ruleReq.getPageSize()); IPage ruleIPage = ruleMapper.selectJoinPage(page, Rule.class, ruleMPJLambdaWrapper); List records = ruleIPage.getRecords(); return records; diff --git a/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/impl/TaskServiceImpl.java b/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/impl/TaskServiceImpl.java index e018f28..8718d57 100644 --- a/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/impl/TaskServiceImpl.java +++ b/etl-database/etl-database-server/src/main/java/com/etl/database/server/service/impl/TaskServiceImpl.java @@ -130,7 +130,7 @@ public class TaskServiceImpl extends MPJBaseServiceImpl implem javax.sql.DataSource newDataSource = createDataSource(dataSource2); JdbcTemplate newJdbcTemplate = new JdbcTemplate(newDataSource); - ArrayList> maps = new ArrayList<>(); + ArrayList> maps = new ArrayList(); String groovyScript = getGroovyScriptContent(); // 创建Binding对象 @@ -153,7 +153,7 @@ public class TaskServiceImpl extends MPJBaseServiceImpl implem // 执行Groovy脚本,脚本应该返回处理后的values List newValues = (List) shell.evaluate(groovyScript); - HashMap map = new HashMap<>(); + HashMap map = new HashMap(); map.put(columnName, newValues); maps.add(map); } diff --git a/etl-database/etl-database-server/target/classes/bootstrap.yml b/etl-database/etl-database-server/target/classes/bootstrap.yml index d95858c..d5c4a47 100644 --- a/etl-database/etl-database-server/target/classes/bootstrap.yml +++ b/etl-database/etl-database-server/target/classes/bootstrap.yml @@ -39,4 +39,4 @@ mybatis-plus: typeAliasesPackage: com.etl.database.common.entity file: path: "D:\\" - name: "美美子新创建的文件" + name: "美美子新创建的文件7.15" diff --git a/etl-database/etl-database-server/target/classes/com/etl/database/server/config/MybatisPlusConfig.class b/etl-database/etl-database-server/target/classes/com/etl/database/server/config/MybatisPlusConfig.class new file mode 100644 index 0000000..bceb3a9 Binary files /dev/null and b/etl-database/etl-database-server/target/classes/com/etl/database/server/config/MybatisPlusConfig.class differ diff --git a/etl-database/etl-database-server/target/classes/com/etl/database/server/controller/CodeTypeController.class b/etl-database/etl-database-server/target/classes/com/etl/database/server/controller/CodeTypeController.class index b368e71..adac1f1 100644 Binary files a/etl-database/etl-database-server/target/classes/com/etl/database/server/controller/CodeTypeController.class and b/etl-database/etl-database-server/target/classes/com/etl/database/server/controller/CodeTypeController.class differ diff --git a/etl-database/etl-database-server/target/classes/com/etl/database/server/controller/InterfaceController.class b/etl-database/etl-database-server/target/classes/com/etl/database/server/controller/InterfaceController.class new file mode 100644 index 0000000..c1b905b Binary files /dev/null and b/etl-database/etl-database-server/target/classes/com/etl/database/server/controller/InterfaceController.class differ diff --git a/etl-database/etl-database-server/target/classes/com/etl/database/server/controller/MysqlController.class b/etl-database/etl-database-server/target/classes/com/etl/database/server/controller/MysqlController.class index 5079e72..56fd67b 100644 Binary files a/etl-database/etl-database-server/target/classes/com/etl/database/server/controller/MysqlController.class and b/etl-database/etl-database-server/target/classes/com/etl/database/server/controller/MysqlController.class differ diff --git a/etl-database/etl-database-server/target/classes/com/etl/database/server/mapper/InterFaceMapper.class b/etl-database/etl-database-server/target/classes/com/etl/database/server/mapper/InterFaceMapper.class new file mode 100644 index 0000000..bdc2427 Binary files /dev/null and b/etl-database/etl-database-server/target/classes/com/etl/database/server/mapper/InterFaceMapper.class differ diff --git a/etl-database/etl-database-server/target/classes/com/etl/database/server/service/InterFaceService.class b/etl-database/etl-database-server/target/classes/com/etl/database/server/service/InterFaceService.class new file mode 100644 index 0000000..fe33f4d Binary files /dev/null and b/etl-database/etl-database-server/target/classes/com/etl/database/server/service/InterFaceService.class differ diff --git a/etl-database/etl-database-server/target/classes/com/etl/database/server/service/MysqlService.class b/etl-database/etl-database-server/target/classes/com/etl/database/server/service/MysqlService.class index 8288a0e..804be1a 100644 Binary files a/etl-database/etl-database-server/target/classes/com/etl/database/server/service/MysqlService.class and b/etl-database/etl-database-server/target/classes/com/etl/database/server/service/MysqlService.class differ diff --git a/etl-database/etl-database-server/target/classes/com/etl/database/server/service/impl/InterFaceServiceImpl.class b/etl-database/etl-database-server/target/classes/com/etl/database/server/service/impl/InterFaceServiceImpl.class new file mode 100644 index 0000000..7b475fd Binary files /dev/null and b/etl-database/etl-database-server/target/classes/com/etl/database/server/service/impl/InterFaceServiceImpl.class differ diff --git a/etl-database/etl-database-server/target/classes/com/etl/database/server/service/impl/MysqlServiceImpl.class b/etl-database/etl-database-server/target/classes/com/etl/database/server/service/impl/MysqlServiceImpl.class index a411b25..87c6f50 100644 Binary files a/etl-database/etl-database-server/target/classes/com/etl/database/server/service/impl/MysqlServiceImpl.class and b/etl-database/etl-database-server/target/classes/com/etl/database/server/service/impl/MysqlServiceImpl.class differ diff --git a/etl-easycode/pom.xml b/etl-easycode/pom.xml index 6516067..4fd85e8 100644 --- a/etl-easycode/pom.xml +++ b/etl-easycode/pom.xml @@ -62,23 +62,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.EtlEasycodeApplication - true diff --git a/etl-easycode/src/main/java/com/service/impl/TUserServiceImpl.java b/etl-easycode/src/main/java/com/service/impl/TUserServiceImpl.java index f43d096..dc1aa7f 100644 --- a/etl-easycode/src/main/java/com/service/impl/TUserServiceImpl.java +++ b/etl-easycode/src/main/java/com/service/impl/TUserServiceImpl.java @@ -44,7 +44,7 @@ public class TUserServiceImpl implements TUserService { @Override public Page queryByPage(TUser tUser, PageRequest pageRequest) { long total = this.tUserDao.count(tUser); - return new PageImpl<>(this.tUserDao.queryAllByLimit(tUser, pageRequest), pageRequest, total); + return new PageImpl(this.tUserDao.queryAllByLimit(tUser, pageRequest), pageRequest, total); } /** diff --git a/etl-gateway/pom.xml b/etl-gateway/pom.xml index 2ef021b..360a7b2 100644 --- a/etl-gateway/pom.xml +++ b/etl-gateway/pom.xml @@ -112,5 +112,24 @@ spring-cloud-starter-alibaba-nacos-discovery - + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + com.etl.gateway.EtlGatewayApplication + + + + repackage + + repackage + + + + + + diff --git a/etl-gateway/src/main/java/com/etl/gateway/config/IgnoreWhiteConfig.java b/etl-gateway/src/main/java/com/etl/gateway/config/IgnoreWhiteConfig.java index f01f313..c44847c 100644 --- a/etl-gateway/src/main/java/com/etl/gateway/config/IgnoreWhiteConfig.java +++ b/etl-gateway/src/main/java/com/etl/gateway/config/IgnoreWhiteConfig.java @@ -23,7 +23,7 @@ public class IgnoreWhiteConfig { /** * 放行白名单配置,网关不校验此处的白名单 */ - private List whites = new ArrayList<>(); + private List whites = new ArrayList(); public void setWhites(List whites) { log.info("加载网关路径白名单:{}", JSONObject.toJSONString(whites)); diff --git a/etl-gateway/src/main/java/com/etl/gateway/filters/JwtAuthCheckFilter.java b/etl-gateway/src/main/java/com/etl/gateway/filters/JwtAuthCheckFilter.java index 452ed06..f112651 100644 --- a/etl-gateway/src/main/java/com/etl/gateway/filters/JwtAuthCheckFilter.java +++ b/etl-gateway/src/main/java/com/etl/gateway/filters/JwtAuthCheckFilter.java @@ -126,7 +126,7 @@ public class JwtAuthCheckFilter { log.warn("token异常处理,请求路径:{}", exchange.getRequest().getPath()); serverHttpResponse.setStatusCode(HttpStatus.UNAUTHORIZED); serverHttpResponse.getHeaders().add("Content-Type", "application/json;charset=UTF-8"); - CommonResult responseResult = new CommonResult<>(responseCodeEnum.getCode(),responseCodeEnum.getMessage()); + CommonResult responseResult = new CommonResult(responseCodeEnum.getCode(),responseCodeEnum.getMessage()); DataBuffer dataBuffer = serverHttpResponse.bufferFactory() .wrap(JSON.toJSONStringWithDateFormat(responseResult, JSON.DEFFAULT_DATE_FORMAT) .getBytes(StandardCharsets.UTF_8)); diff --git a/etl-gateway/target/etl-gateway-1.0-SNAPSHOT.jar b/etl-gateway/target/etl-gateway-1.0-SNAPSHOT.jar deleted file mode 100644 index ecad299..0000000 Binary files a/etl-gateway/target/etl-gateway-1.0-SNAPSHOT.jar and /dev/null differ diff --git a/etl-gateway/target/maven-archiver/pom.properties b/etl-gateway/target/maven-archiver/pom.properties deleted file mode 100644 index faef141..0000000 --- a/etl-gateway/target/maven-archiver/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by Maven -#Wed Jul 03 15:15:42 CST 2024 -version=1.0-SNAPSHOT -groupId=com.bwie -artifactId=etl-gateway diff --git a/etl-gateway/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/etl-gateway/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst index e0b90ed..e69de29 100644 --- a/etl-gateway/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst +++ b/etl-gateway/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -1,9 +0,0 @@ -com\etl\gateway\service\PermissionService.class -com\etl\gateway\config\WhiteListProperties.class -com\etl\gateway\filters\LogFilter.class -com\etl\gateway\utils\GatewayUtils.class -com\etl\gateway\filters\JwtAuthCheckFilter.class -com\etl\gateway\EtlGatewayApplication.class -com\etl\gateway\config\IgnoreWhiteConfig.class -com\etl\gateway\config\FeignConfig.class -com\etl\gateway\filters\AuthFilter.class diff --git a/etl-gateway/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/etl-gateway/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst index bb405eb..90353bf 100644 --- a/etl-gateway/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +++ b/etl-gateway/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -1,9 +1,9 @@ -D:\workspace\ETL\etl-gateway\src\main\java\com\etl\gateway\config\WhiteListProperties.java -D:\workspace\ETL\etl-gateway\src\main\java\com\etl\gateway\config\IgnoreWhiteConfig.java -D:\workspace\ETL\etl-gateway\src\main\java\com\etl\gateway\utils\GatewayUtils.java -D:\workspace\ETL\etl-gateway\src\main\java\com\etl\gateway\filters\AuthFilter.java -D:\workspace\ETL\etl-gateway\src\main\java\com\etl\gateway\EtlGatewayApplication.java -D:\workspace\ETL\etl-gateway\src\main\java\com\etl\gateway\filters\JwtAuthCheckFilter.java -D:\workspace\ETL\etl-gateway\src\main\java\com\etl\gateway\config\FeignConfig.java -D:\workspace\ETL\etl-gateway\src\main\java\com\etl\gateway\filters\LogFilter.java -D:\workspace\ETL\etl-gateway\src\main\java\com\etl\gateway\service\PermissionService.java +D:\workspace\etl-cloud\etl-gateway\src\main\java\com\etl\gateway\filters\AuthFilter.java +D:\workspace\etl-cloud\etl-gateway\src\main\java\com\etl\gateway\config\IgnoreWhiteConfig.java +D:\workspace\etl-cloud\etl-gateway\src\main\java\com\etl\gateway\filters\LogFilter.java +D:\workspace\etl-cloud\etl-gateway\src\main\java\com\etl\gateway\filters\JwtAuthCheckFilter.java +D:\workspace\etl-cloud\etl-gateway\src\main\java\com\etl\gateway\config\FeignConfig.java +D:\workspace\etl-cloud\etl-gateway\src\main\java\com\etl\gateway\service\PermissionService.java +D:\workspace\etl-cloud\etl-gateway\src\main\java\com\etl\gateway\EtlGatewayApplication.java +D:\workspace\etl-cloud\etl-gateway\src\main\java\com\etl\gateway\utils\GatewayUtils.java +D:\workspace\etl-cloud\etl-gateway\src\main\java\com\etl\gateway\config\WhiteListProperties.java diff --git a/etl-groovy/pom.xml b/etl-groovy/pom.xml index ae9594e..3b4958b 100644 --- a/etl-groovy/pom.xml +++ b/etl-groovy/pom.xml @@ -64,5 +64,24 @@ test - + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + com.etl.groovy.SpringBootGroovyApplication + + + + repackage + + repackage + + + + + + diff --git a/etl-jwt-manage/pom.xml b/etl-jwt-manage/pom.xml index 393087f..4e24faa 100644 --- a/etl-jwt-manage/pom.xml +++ b/etl-jwt-manage/pom.xml @@ -101,36 +101,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.jwt.EtlJwtManageApplication - true - - - - repackage - - repackage - - - - - - - diff --git a/etl-jwt-manage/src/main/java/com/etl/jwt/util/JwtTokenUtil.java b/etl-jwt-manage/src/main/java/com/etl/jwt/util/JwtTokenUtil.java index fe0385f..efd8cd2 100644 --- a/etl-jwt-manage/src/main/java/com/etl/jwt/util/JwtTokenUtil.java +++ b/etl-jwt-manage/src/main/java/com/etl/jwt/util/JwtTokenUtil.java @@ -61,7 +61,7 @@ public class JwtTokenUtil { //生成刷新令牌 String refreshToken = generateRefreshToken(userId, username, null); //存储两个令牌及过期时间,返回结果 - HashMap tokenMap = new HashMap<>(2); + HashMap tokenMap = new HashMap(2); tokenMap.put(ACCESS_TOKEN, accessToken); tokenMap.put(REFRESH_TOKEN, refreshToken); tokenMap.put(EXPIRE_IN, jwtProperties.getExpiration()); @@ -88,7 +88,7 @@ public class JwtTokenUtil { private Map buildClaims(String userId, String username, Map payloads) { int payloadSizes = payloads == null? 0 : payloads.size(); - Map claims = new HashMap<>(payloadSizes + 2); + Map claims = new HashMap(payloadSizes + 2); claims.put("sub", userId); claims.put("username", username); claims.put("created", new Date()); diff --git a/etl-jwt-manage/target/classes/META-INF/spring-configuration-metadata.json b/etl-jwt-manage/target/classes/META-INF/spring-configuration-metadata.json index 801feb4..52c9406 100644 --- a/etl-jwt-manage/target/classes/META-INF/spring-configuration-metadata.json +++ b/etl-jwt-manage/target/classes/META-INF/spring-configuration-metadata.json @@ -10,8 +10,7 @@ { "name": "auth.jwt.enabled", "type": "java.lang.Boolean", - "sourceType": "com.etl.jwt.config.AuthJwtProperties", - "defaultValue": true + "sourceType": "com.etl.jwt.config.AuthJwtProperties" }, { "name": "auth.jwt.expiration", @@ -27,8 +26,7 @@ "name": "auth.jwt.pwd-param-name", "type": "java.lang.String", "description": "用户登录-密码参数名称", - "sourceType": "com.etl.jwt.config.AuthJwtProperties", - "defaultValue": "password" + "sourceType": "com.etl.jwt.config.AuthJwtProperties" }, { "name": "auth.jwt.secret", @@ -43,15 +41,13 @@ { "name": "auth.jwt.use-default-controller", "type": "java.lang.Boolean", - "sourceType": "com.etl.jwt.config.AuthJwtProperties", - "defaultValue": false + "sourceType": "com.etl.jwt.config.AuthJwtProperties" }, { "name": "auth.jwt.user-param-name", "type": "java.lang.String", "description": "用户登录-用户名参数名称", - "sourceType": "com.etl.jwt.config.AuthJwtProperties", - "defaultValue": "userId" + "sourceType": "com.etl.jwt.config.AuthJwtProperties" } ], "hints": [] diff --git a/etl-jwt-manage/target/etl-jwt-manage-1.0-SNAPSHOT.jar b/etl-jwt-manage/target/etl-jwt-manage-1.0-SNAPSHOT.jar index 0bd7540..f93c9d9 100644 Binary files a/etl-jwt-manage/target/etl-jwt-manage-1.0-SNAPSHOT.jar and b/etl-jwt-manage/target/etl-jwt-manage-1.0-SNAPSHOT.jar differ diff --git a/etl-jwt-manage/target/maven-archiver/pom.properties b/etl-jwt-manage/target/maven-archiver/pom.properties index 3b6f1e7..6bd351a 100644 --- a/etl-jwt-manage/target/maven-archiver/pom.properties +++ b/etl-jwt-manage/target/maven-archiver/pom.properties @@ -1,5 +1,5 @@ #Generated by Maven -#Wed Jul 03 15:15:41 CST 2024 +#Fri Jul 12 19:28:40 CST 2024 version=1.0-SNAPSHOT groupId=com.bwie artifactId=etl-jwt-manage diff --git a/etl-jwt-manage/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/etl-jwt-manage/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst index 8dcd269..af8aac0 100644 --- a/etl-jwt-manage/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +++ b/etl-jwt-manage/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -1,2 +1,2 @@ -D:\workspace\ETL\etl-jwt-manage\src\main\java\com\etl\jwt\config\AuthJwtProperties.java -D:\workspace\ETL\etl-jwt-manage\src\main\java\com\etl\jwt\util\JwtTokenUtil.java +D:\workspace\etl-cloud\etl-jwt-manage\src\main\java\com\etl\jwt\util\JwtTokenUtil.java +D:\workspace\etl-cloud\etl-jwt-manage\src\main\java\com\etl\jwt\config\AuthJwtProperties.java diff --git a/etl-jwt-manage/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst b/etl-jwt-manage/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst deleted file mode 100644 index e69de29..0000000 diff --git a/etl-roles/pom.xml b/etl-roles/pom.xml index 01010c3..9e48109 100644 --- a/etl-roles/pom.xml +++ b/etl-roles/pom.xml @@ -2,11 +2,12 @@ 4.0.0 - com.roles + + com.bwie + etl-cloud + 1.0-SNAPSHOT + etl-roles - 0.0.1-SNAPSHOT - etl-roles - etl-roles 1.8 UTF-8 @@ -80,23 +81,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.roles.EtlRolesApplication - true diff --git a/etl-roles/src/main/java/com/etl/roles/controlller/PermissionController.java b/etl-roles/src/main/java/com/etl/roles/controlller/PermissionController.java index 736f502..1f7e3b6 100644 --- a/etl-roles/src/main/java/com/etl/roles/controlller/PermissionController.java +++ b/etl-roles/src/main/java/com/etl/roles/controlller/PermissionController.java @@ -1,8 +1,9 @@ package com.etl.roles.controlller; + import com.auth.common.entity.PathPermission; import com.auth.common.entity.RolesPermission; -import com.auth.common.enums.PermissionConstants; +import com.auth.server.enums.PermissionConstants; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.etl.roles.service.PathService; import com.etl.roles.service.PermissionService; @@ -42,7 +43,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-roles/src/main/java/com/etl/roles/service/impl/PermissionServiceImpl.java b/etl-roles/src/main/java/com/etl/roles/service/impl/PermissionServiceImpl.java index 65902f6..0102fc5 100644 --- a/etl-roles/src/main/java/com/etl/roles/service/impl/PermissionServiceImpl.java +++ b/etl-roles/src/main/java/com/etl/roles/service/impl/PermissionServiceImpl.java @@ -41,7 +41,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/pom.xml b/pom.xml index 8197e74..159e77a 100644 --- a/pom.xml +++ b/pom.xml @@ -14,6 +14,7 @@ etl-auth etl-jwt-manage etl-database + product_seckill @@ -99,37 +100,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.health.cloud.HealthCloudApplication - true - - - - repackage - - repackage - - - - - - - - diff --git a/product_seckill/pom.xml b/product_seckill/pom.xml new file mode 100644 index 0000000..4e553cf --- /dev/null +++ b/product_seckill/pom.xml @@ -0,0 +1,24 @@ + + + 4.0.0 + + com.bwie + etl-cloud + 1.0-SNAPSHOT + + pom + + product_seckill_server + product_seckill_common + + product_seckill + + 1.8 + UTF-8 + UTF-8 + 2.6.13 + 2021.0.5.0 + 2021.0.5 + + diff --git a/product_seckill/product_seckill.iml b/product_seckill/product_seckill.iml new file mode 100644 index 0000000..9e3449c --- /dev/null +++ b/product_seckill/product_seckill.iml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/product_seckill/product_seckill_common/pom.xml b/product_seckill/product_seckill_common/pom.xml new file mode 100644 index 0000000..047c3c6 --- /dev/null +++ b/product_seckill/product_seckill_common/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + product_seckill_common + + com.bwie + product_seckill + 1.0-SNAPSHOT + + + 1.8 + UTF-8 + UTF-8 + 2.6.13 + + + + com.baomidou + mybatis-plus-boot-starter + + + com.github.yulichang + mybatis-plus-join-boot-starter + 1.4.13 + + + org.springframework.boot + spring-boot-starter-jdbc + + + com.mysql + mysql-connector-j + runtime + + + org.projectlombok + lombok + true + + + + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + diff --git a/product_seckill/product_seckill_common/product_seckill_common.iml b/product_seckill/product_seckill_common/product_seckill_common.iml new file mode 100644 index 0000000..9e3449c --- /dev/null +++ b/product_seckill/product_seckill_common/product_seckill_common.iml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/product_seckill/product_seckill_common/src/main/java/com/seckill/common/entity/Product.java b/product_seckill/product_seckill_common/src/main/java/com/seckill/common/entity/Product.java new file mode 100644 index 0000000..689625b --- /dev/null +++ b/product_seckill/product_seckill_common/src/main/java/com/seckill/common/entity/Product.java @@ -0,0 +1,49 @@ +package com.seckill.common.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.math.BigDecimal; + +@Data +@TableName("mall_product_info") +public class Product { + + private String id; + + private String name; + + private String productDesc; + + private String type; + + private String typeIds; + + private String img; + + private String carouselImages; + + private String commentCount; + + private String collectCount; + + private String brand; + + private String status; + + private String unit; + + private String keywords; + + private String ruleId; + + private String revision; + + private String data; + + private BigDecimal price; + + private Integer inventory; + + private Integer seckillId; +} diff --git a/product_seckill/product_seckill_common/src/main/java/com/seckill/common/entity/Seckill.java b/product_seckill/product_seckill_common/src/main/java/com/seckill/common/entity/Seckill.java new file mode 100644 index 0000000..b8768d4 --- /dev/null +++ b/product_seckill/product_seckill_common/src/main/java/com/seckill/common/entity/Seckill.java @@ -0,0 +1,24 @@ +package com.seckill.common.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.util.Date; + +@Data +@TableName("mall_product_seckill") +public class Seckill { + private Integer id; + + private Integer productId; + + private Date beginTime; + + private Date endTime; + + private String title; + + private Integer isBegin; + + private Integer isOnline; +} diff --git a/product_seckill/product_seckill_common/src/main/java/com/seckill/common/entity/meta/BaseMeta.java b/product_seckill/product_seckill_common/src/main/java/com/seckill/common/entity/meta/BaseMeta.java new file mode 100644 index 0000000..a82c820 --- /dev/null +++ b/product_seckill/product_seckill_common/src/main/java/com/seckill/common/entity/meta/BaseMeta.java @@ -0,0 +1,13 @@ +package com.seckill.common.entity.meta; + +import lombok.Data; + +import java.util.Date; + +@Data +public class BaseMeta { + private Integer createBy; + private Date createTime; + private Integer updateBy; + private Date updateTime; +} diff --git a/product_seckill/product_seckill_common/src/main/java/com/seckill/common/entity/req/SeckillReq.java b/product_seckill/product_seckill_common/src/main/java/com/seckill/common/entity/req/SeckillReq.java new file mode 100644 index 0000000..fcb4e67 --- /dev/null +++ b/product_seckill/product_seckill_common/src/main/java/com/seckill/common/entity/req/SeckillReq.java @@ -0,0 +1,26 @@ +package com.seckill.common.entity.req; + +import lombok.Data; + +@Data +public class SeckillReq { + /** + * 活动名称 + */ + private String title; + + /** + * 状态 1-已开抢 2-抢购中 3-即将开始 + */ + private Integer status; + + /** + * 页码 + */ + private Integer pageNum = 1; + + /** + * 每页数量 + */ + private Integer pageSize = 3; +} diff --git a/product_seckill/product_seckill_common/target/classes/com/seckill/common/entity/Product.class b/product_seckill/product_seckill_common/target/classes/com/seckill/common/entity/Product.class new file mode 100644 index 0000000..ef6a37d Binary files /dev/null and b/product_seckill/product_seckill_common/target/classes/com/seckill/common/entity/Product.class differ diff --git a/product_seckill/product_seckill_common/target/classes/com/seckill/common/entity/Seckill.class b/product_seckill/product_seckill_common/target/classes/com/seckill/common/entity/Seckill.class new file mode 100644 index 0000000..ee914b2 Binary files /dev/null and b/product_seckill/product_seckill_common/target/classes/com/seckill/common/entity/Seckill.class differ diff --git a/product_seckill/product_seckill_common/target/classes/com/seckill/common/entity/meta/BaseMeta.class b/product_seckill/product_seckill_common/target/classes/com/seckill/common/entity/meta/BaseMeta.class new file mode 100644 index 0000000..1874340 Binary files /dev/null and b/product_seckill/product_seckill_common/target/classes/com/seckill/common/entity/meta/BaseMeta.class differ diff --git a/product_seckill/product_seckill_common/target/classes/com/seckill/common/entity/req/SeckillReq.class b/product_seckill/product_seckill_common/target/classes/com/seckill/common/entity/req/SeckillReq.class new file mode 100644 index 0000000..5ce88e1 Binary files /dev/null and b/product_seckill/product_seckill_common/target/classes/com/seckill/common/entity/req/SeckillReq.class differ diff --git a/product_seckill/product_seckill_server/pom.xml b/product_seckill/product_seckill_server/pom.xml new file mode 100644 index 0000000..bfa0a85 --- /dev/null +++ b/product_seckill/product_seckill_server/pom.xml @@ -0,0 +1,118 @@ + + + 4.0.0 + + com.bwie + product_seckill + 1.0-SNAPSHOT + + product_seckill_server + + 1.8 + UTF-8 + UTF-8 + 2.6.13 + 2021.0.5.0 + 2021.0.5 + + + + io.minio + minio + 7.0.2 + + + com.bwie + product_seckill_common + 1.0-SNAPSHOT + + + com.github.yulichang + mybatis-plus-join-boot-starter + 1.4.13 + + + com.baomidou + mybatis-plus-boot-starter + + + com.mysql + mysql-connector-j + + + org.springframework.cloud + spring-cloud-starter-bootstrap + 3.1.3 + + + org.springframework.boot + spring-boot-starter-web + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + org.springframework.cloud + spring-cloud-starter + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + com.alibaba.cloud + spring-cloud-alibaba-dependencies + ${spring-cloud-alibaba.version} + pom + import + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + com.product.seckill.server.ProductSeckillServerApplication + + + + repackage + + repackage + + + + + + + + diff --git a/product_seckill/product_seckill_server/product_seckill_server.iml b/product_seckill/product_seckill_server/product_seckill_server.iml new file mode 100644 index 0000000..9e3449c --- /dev/null +++ b/product_seckill/product_seckill_server/product_seckill_server.iml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/product_seckill/product_seckill_server/src/main/java/com/product/seckill/server/ProductSeckillServerApplication.java b/product_seckill/product_seckill_server/src/main/java/com/product/seckill/server/ProductSeckillServerApplication.java new file mode 100644 index 0000000..c25ff99 --- /dev/null +++ b/product_seckill/product_seckill_server/src/main/java/com/product/seckill/server/ProductSeckillServerApplication.java @@ -0,0 +1,15 @@ +package com.product.seckill.server; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +@MapperScan("com.product.seckill.server.mapper") +public class ProductSeckillServerApplication { + + public static void main(String[] args) { + SpringApplication.run(ProductSeckillServerApplication.class, args); + } + +} diff --git a/product_seckill/product_seckill_server/src/main/java/com/product/seckill/server/config/MinioConfig.java b/product_seckill/product_seckill_server/src/main/java/com/product/seckill/server/config/MinioConfig.java new file mode 100644 index 0000000..51cb708 --- /dev/null +++ b/product_seckill/product_seckill_server/src/main/java/com/product/seckill/server/config/MinioConfig.java @@ -0,0 +1,260 @@ +package com.product.seckill.server.config; + +import io.minio.MinioClient; +import io.minio.ObjectStat; +import io.minio.PutObjectOptions; +import io.minio.Result; +import io.minio.messages.Bucket; +import io.minio.messages.Item; +import org.apache.tomcat.util.http.fileupload.IOUtils; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; +import org.springframework.util.Assert; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.util.UriUtils; + +import javax.servlet.http.HttpServletResponse; +import java.io.InputStream; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; + + +@Component +public class MinioConfig implements InitializingBean { + + @Value(value = "${minio.bucket}") + private String bucket; + + @Value(value = "${minio.host}") + private String host; + + @Value(value = "${minio.url}") + private String url; + + @Value(value = "${minio.access-key}") + private String accessKey; + + @Value(value = "${minio.secret-key}") + private String secretKey; + + private MinioClient minioClient; + + @Override + public void afterPropertiesSet() throws Exception { + Assert.hasText(url, "Minio url 为空"); + Assert.hasText(accessKey, "Minio accessKey为空"); + Assert.hasText(secretKey, "Minio secretKey为空"); + this.minioClient = new MinioClient(this.host, this.accessKey, this.secretKey); + } + + + + /** + * 上传 + */ + public String putObject(MultipartFile multipartFile) throws Exception { + // bucket 不存在,创建 + if (!minioClient.bucketExists(this.bucket)) { + minioClient.makeBucket(this.bucket); + } + try (InputStream inputStream = multipartFile.getInputStream()) { + // 上传文件的名称 + String fileName = multipartFile.getOriginalFilename(); + // PutObjectOptions,上传配置(文件大小,内存中文件分片大小) + PutObjectOptions putObjectOptions = new PutObjectOptions(multipartFile.getSize(), PutObjectOptions.MIN_MULTIPART_SIZE); + // 文件的ContentType + putObjectOptions.setContentType(multipartFile.getContentType()); + minioClient.putObject(this.bucket, fileName, inputStream, putObjectOptions); + // 返回访问路径 + return this.url + UriUtils.encode(fileName, StandardCharsets.UTF_8); + } + } + + /** + * 文件下载 + */ + public void download(String fileName, HttpServletResponse response){ + // 从链接中得到文件名 + InputStream inputStream; + try { + MinioClient minioClient = new MinioClient(host, accessKey, secretKey); + ObjectStat stat = minioClient.statObject(bucket, fileName); + inputStream = minioClient.getObject(bucket, fileName); + response.setContentType(stat.contentType()); + response.setCharacterEncoding("UTF-8"); + response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8")); + IOUtils.copy(inputStream, response.getOutputStream()); + inputStream.close(); + } catch (Exception e){ + e.printStackTrace(); + System.out.println("有异常:" + e); + } + } + + /** + * 列出所有存储桶名称 + * + * @return + * @throws Exception + */ + public List listBucketNames() + throws Exception { + List bucketList = listBuckets(); + List bucketListName = new ArrayList(); + for (Bucket bucket : bucketList) { + bucketListName.add(bucket.name()); + } + return bucketListName; + } + + /** + * 查看所有桶 + * + * @return + * @throws Exception + */ + public List listBuckets() + throws Exception { + return minioClient.listBuckets(); + } + + /** + * 检查存储桶是否存在 + * + * @param bucketName + * @return + * @throws Exception + */ + public boolean bucketExists(String bucketName) throws Exception { + boolean flag = minioClient.bucketExists(bucketName); + if (flag) { + return true; + } + return false; + } + + /** + * 创建存储桶 + * + * @param bucketName + * @return + * @throws Exception + */ + public boolean makeBucket(String bucketName) + throws Exception { + boolean flag = bucketExists(bucketName); + if (!flag) { + minioClient.makeBucket(bucketName); + return true; + } else { + return false; + } + } + + /** + * 删除桶 + * + * @param bucketName + * @return + * @throws Exception + */ + public boolean removeBucket(String bucketName) + throws Exception { + boolean flag = bucketExists(bucketName); + if (flag) { + Iterable> myObjects = listObjects(bucketName); + for (Result result : myObjects) { + Item item = result.get(); + // 有对象文件,则删除失败 + if (item.size() > 0) { + return false; + } + } + // 删除存储桶,注意,只有存储桶为空时才能删除成功。 + minioClient.removeBucket(bucketName); + flag = bucketExists(bucketName); + if (!flag) { + return true; + } + + } + return false; + } + + /** + * 列出存储桶中的所有对象 + * + * @param bucketName 存储桶名称 + * @return + * @throws Exception + */ + public Iterable> listObjects(String bucketName) throws Exception { + boolean flag = bucketExists(bucketName); + if (flag) { + return minioClient.listObjects(bucketName); + } + return null; + } + + /** + * 列出存储桶中的所有对象名称 + * + * @param bucketName 存储桶名称 + * @return + * @throws Exception + */ + public List listObjectNames(String bucketName) throws Exception { + List listObjectNames = new ArrayList(); + boolean flag = bucketExists(bucketName); + if (flag) { + Iterable> myObjects = listObjects(bucketName); + for (Result result : myObjects) { + Item item = result.get(); + listObjectNames.add(item.objectName()); + } + } + return listObjectNames; + } + + /** + * 删除一个对象 + * + * @param bucketName 存储桶名称 + * @param objectName 存储桶里的对象名称 + * @throws Exception + */ + public boolean removeObject(String bucketName, String objectName) throws Exception { + boolean flag = bucketExists(bucketName); + if (flag) { + List objectList = listObjectNames(bucketName); + for (String s : objectList) { + if(s.equals(objectName)){ + minioClient.removeObject(bucketName, objectName); + return true; + } + } + } + return false; + } + + /** + * 文件访问路径 + * + * @param bucketName 存储桶名称 + * @param objectName 存储桶里的对象名称 + * @return + * @throws Exception + */ + public String getObjectUrl(String bucketName, String objectName) throws Exception { + boolean flag = bucketExists(bucketName); + String url = ""; + if (flag) { + url = minioClient.getObjectUrl(bucketName, objectName); + } + return url; + } + +} diff --git a/product_seckill/product_seckill_server/src/main/java/com/product/seckill/server/controller/MinioController.java b/product_seckill/product_seckill_server/src/main/java/com/product/seckill/server/controller/MinioController.java new file mode 100644 index 0000000..2c7a940 --- /dev/null +++ b/product_seckill/product_seckill_server/src/main/java/com/product/seckill/server/controller/MinioController.java @@ -0,0 +1,73 @@ +package com.product.seckill.server.controller; + + + +import com.product.seckill.server.config.MinioConfig; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * minio 上传图片控制层 + */ +@RestController +@CrossOrigin +@RequestMapping("/test") +public class MinioController { + + @Autowired + MinioConfig minioConfig; + + // 上传 + @PostMapping("/upload") + public Object upload(@RequestParam("file") MultipartFile multipartFile) throws Exception { + return this.minioConfig.putObject(multipartFile); + } + + // 下载文件 + @GetMapping("/download") + public void download(@RequestParam("fileName")String fileName, HttpServletResponse response) { + this.minioConfig.download(fileName,response); + } + + // 列出所有存储桶名称 + @PostMapping("/list") + public List list() throws Exception { + return this.minioConfig.listBucketNames(); + } + + // 创建存储桶 + @PostMapping("/createBucket") + public boolean createBucket(String bucketName) throws Exception { + return this.minioConfig.makeBucket(bucketName); + } + + // 删除存储桶 + @PostMapping("/deleteBucket") + public boolean deleteBucket(String bucketName) throws Exception { + return this.minioConfig.removeBucket(bucketName); + } + + // 列出存储桶中的所有对象名称 + @PostMapping("/listObjectNames") + public List listObjectNames(String bucketName) throws Exception { + return this.minioConfig.listObjectNames(bucketName); + } + + // 删除一个对象 + @PostMapping("/removeObject") + public boolean removeObject(String bucketName, String objectName) throws Exception { + return this.minioConfig.removeObject(bucketName, objectName); + } + + // 文件访问路径 + @PostMapping("/getObjectUrl") + public String getObjectUrl(String bucketName, String objectName) throws Exception { + return this.minioConfig.getObjectUrl(bucketName, objectName); + } +} + + diff --git a/product_seckill/product_seckill_server/src/main/java/com/product/seckill/server/controller/SeckillController.java b/product_seckill/product_seckill_server/src/main/java/com/product/seckill/server/controller/SeckillController.java new file mode 100644 index 0000000..2041141 --- /dev/null +++ b/product_seckill/product_seckill_server/src/main/java/com/product/seckill/server/controller/SeckillController.java @@ -0,0 +1,38 @@ +package com.product.seckill.server.controller; + +import com.alibaba.nacos.api.model.v2.Result; +import com.product.seckill.server.service.SeckillService; +import com.seckill.common.entity.Product; +import com.seckill.common.entity.req.SeckillReq; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 秒杀控制层 + */ +@RestController +@RequestMapping("/seckill") +public class SeckillController { + @Autowired + private SeckillService seckillService; + + @PostMapping("/findSeckillList") + public Result findSeckillList(@RequestBody SeckillReq seckillReq){ + List productList = seckillService.findSeckillList(seckillReq); + return Result.success(productList); + } + + @PostMapping("/insertSeckill") + public Result insertSeckill(@RequestBody Product product){ + seckillService.insertSeckill(product); + return Result.success(); + } + + @PutMapping("/updateSeckill/{id}") + public Result updateSeckill(@PathVariable Integer id){ + seckillService.updateSeckill(id); + return Result.success(); + } +} diff --git a/product_seckill/product_seckill_server/src/main/java/com/product/seckill/server/mapper/ProductMapper.java b/product_seckill/product_seckill_server/src/main/java/com/product/seckill/server/mapper/ProductMapper.java new file mode 100644 index 0000000..c37a7b2 --- /dev/null +++ b/product_seckill/product_seckill_server/src/main/java/com/product/seckill/server/mapper/ProductMapper.java @@ -0,0 +1,9 @@ +package com.product.seckill.server.mapper; + +import com.github.yulichang.base.MPJBaseMapper; +import com.seckill.common.entity.Product; +import org.springframework.stereotype.Repository; + +@Repository +public interface ProductMapper extends MPJBaseMapper { +} diff --git a/product_seckill/product_seckill_server/src/main/java/com/product/seckill/server/mapper/SeckillMapper.java b/product_seckill/product_seckill_server/src/main/java/com/product/seckill/server/mapper/SeckillMapper.java new file mode 100644 index 0000000..53eb7a4 --- /dev/null +++ b/product_seckill/product_seckill_server/src/main/java/com/product/seckill/server/mapper/SeckillMapper.java @@ -0,0 +1,10 @@ +package com.product.seckill.server.mapper; + +import com.github.yulichang.base.MPJBaseMapper; +import com.seckill.common.entity.Product; +import com.seckill.common.entity.Seckill; +import org.springframework.stereotype.Repository; + +@Repository +public interface SeckillMapper extends MPJBaseMapper { +} diff --git a/product_seckill/product_seckill_server/src/main/java/com/product/seckill/server/service/SeckillService.java b/product_seckill/product_seckill_server/src/main/java/com/product/seckill/server/service/SeckillService.java new file mode 100644 index 0000000..0bcefcc --- /dev/null +++ b/product_seckill/product_seckill_server/src/main/java/com/product/seckill/server/service/SeckillService.java @@ -0,0 +1,15 @@ +package com.product.seckill.server.service; + +import com.github.yulichang.base.MPJBaseService; +import com.seckill.common.entity.Product; +import com.seckill.common.entity.req.SeckillReq; + +import java.util.List; + +public interface SeckillService extends MPJBaseService { + List findSeckillList(SeckillReq seckillReq); + + void insertSeckill(Product product); + + void updateSeckill(Integer id); +} diff --git a/product_seckill/product_seckill_server/src/main/java/com/product/seckill/server/service/impl/SeckillServiceImpl.java b/product_seckill/product_seckill_server/src/main/java/com/product/seckill/server/service/impl/SeckillServiceImpl.java new file mode 100644 index 0000000..55aba6b --- /dev/null +++ b/product_seckill/product_seckill_server/src/main/java/com/product/seckill/server/service/impl/SeckillServiceImpl.java @@ -0,0 +1,52 @@ +package com.product.seckill.server.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.github.yulichang.base.MPJBaseServiceImpl; +import com.github.yulichang.query.MPJLambdaQueryWrapper; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.product.seckill.server.mapper.ProductMapper; +import com.product.seckill.server.service.SeckillService; +import com.seckill.common.entity.Product; +import com.seckill.common.entity.Seckill; +import com.seckill.common.entity.req.SeckillReq; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +@Service +public class SeckillServiceImpl extends MPJBaseServiceImpl implements SeckillService { + @Autowired + private ProductMapper productMapper; + + @Override + public List findSeckillList(SeckillReq seckillReq) { + MPJLambdaWrapper wrapper = new MPJLambdaWrapper<>(); + wrapper.selectAll(Product.class) + .leftJoin(Seckill.class, Seckill::getId, Product::getSeckillId); + if (seckillReq.getStatus() != null) { + wrapper.eq(Product::getStatus, seckillReq.getStatus()); + } + if (seckillReq.getTitle() != null) { + wrapper.like(Product::getName, seckillReq.getTitle()); + } + return productMapper.selectJoinList(Product.class, wrapper); + } + + @Override + public void insertSeckill(Product product) { + checkProduct(product); + productMapper.insert(product); + } + + private void checkProduct(Product product) { + if (product.getName()==null){ + throw new RuntimeException("商品名称不能为空"); + } + if (product.getPrice()==null){ + throw new RuntimeException("商品价格不能为空"); + } + } +} diff --git a/product_seckill/product_seckill_server/src/main/resources/bootstrap.yml b/product_seckill/product_seckill_server/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..1513af2 --- /dev/null +++ b/product_seckill/product_seckill_server/src/main/resources/bootstrap.yml @@ -0,0 +1,45 @@ +server: + port: 9199 +spring: + application: + name: product-seckill + redis: + host: 115.159.33.152 + port: 6379 + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://115.159.33.152:3306/mall-product + username: root + password: lzm@123 + mvc: + pathmatch: + matching-strategy: ant_path_matcher + profiles: + active: dev + cloud: + nacos: + #注册服务 + discovery: + server-addr: 115.159.33.152:8848 + namespace: f9f293d4-55ce-45c1-aa15-124ca461c060 + # 配置 + config: + server-addr: 115.159.33.152:8848 + namespace: f9f293d4-55ce-45c1-aa15-124ca461c060 + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} +logging: + level: + com.bwie: DEBUG +mybatis-plus: + mapper-locations: classpath:/mapper/*mapper.xml + typeAliasesPackage: com.etl.database.common.entity +minio: + host: http://115.159.33.152:9000 + url: ${minio.host}/${minio.bucket}/ + access-key: minioadmin + secret-key: minioadmin + bucket: liz diff --git a/product_seckill/product_seckill_server/src/main/resources/static/index.html b/product_seckill/product_seckill_server/src/main/resources/static/index.html new file mode 100644 index 0000000..f67da0a --- /dev/null +++ b/product_seckill/product_seckill_server/src/main/resources/static/index.html @@ -0,0 +1,6 @@ + + +

hello word!!!

+

this is a html page

+ + diff --git a/product_seckill/product_seckill_server/src/test/java/com/product/seckill/server/ProductSeckillServerApplicationTests.java b/product_seckill/product_seckill_server/src/test/java/com/product/seckill/server/ProductSeckillServerApplicationTests.java new file mode 100644 index 0000000..530e12a --- /dev/null +++ b/product_seckill/product_seckill_server/src/test/java/com/product/seckill/server/ProductSeckillServerApplicationTests.java @@ -0,0 +1,13 @@ +package com.product.seckill.server; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class ProductSeckillServerApplicationTests { + + @Test + void contextLoads() { + } + +} diff --git a/product_seckill/product_seckill_server/target/classes/bootstrap.yml b/product_seckill/product_seckill_server/target/classes/bootstrap.yml new file mode 100644 index 0000000..1513af2 --- /dev/null +++ b/product_seckill/product_seckill_server/target/classes/bootstrap.yml @@ -0,0 +1,45 @@ +server: + port: 9199 +spring: + application: + name: product-seckill + redis: + host: 115.159.33.152 + port: 6379 + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://115.159.33.152:3306/mall-product + username: root + password: lzm@123 + mvc: + pathmatch: + matching-strategy: ant_path_matcher + profiles: + active: dev + cloud: + nacos: + #注册服务 + discovery: + server-addr: 115.159.33.152:8848 + namespace: f9f293d4-55ce-45c1-aa15-124ca461c060 + # 配置 + config: + server-addr: 115.159.33.152:8848 + namespace: f9f293d4-55ce-45c1-aa15-124ca461c060 + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} +logging: + level: + com.bwie: DEBUG +mybatis-plus: + mapper-locations: classpath:/mapper/*mapper.xml + typeAliasesPackage: com.etl.database.common.entity +minio: + host: http://115.159.33.152:9000 + url: ${minio.host}/${minio.bucket}/ + access-key: minioadmin + secret-key: minioadmin + bucket: liz diff --git a/product_seckill/product_seckill_server/target/classes/com/product/seckill/server/ProductSeckillServerApplication.class b/product_seckill/product_seckill_server/target/classes/com/product/seckill/server/ProductSeckillServerApplication.class new file mode 100644 index 0000000..c5c0a5a Binary files /dev/null and b/product_seckill/product_seckill_server/target/classes/com/product/seckill/server/ProductSeckillServerApplication.class differ diff --git a/product_seckill/product_seckill_server/target/classes/com/product/seckill/server/config/MinioConfig.class b/product_seckill/product_seckill_server/target/classes/com/product/seckill/server/config/MinioConfig.class new file mode 100644 index 0000000..a667ae4 Binary files /dev/null and b/product_seckill/product_seckill_server/target/classes/com/product/seckill/server/config/MinioConfig.class differ diff --git a/product_seckill/product_seckill_server/target/classes/com/product/seckill/server/controller/MinioController.class b/product_seckill/product_seckill_server/target/classes/com/product/seckill/server/controller/MinioController.class new file mode 100644 index 0000000..6cbeb03 Binary files /dev/null and b/product_seckill/product_seckill_server/target/classes/com/product/seckill/server/controller/MinioController.class differ diff --git a/product_seckill/product_seckill_server/target/classes/com/product/seckill/server/controller/SeckillController.class b/product_seckill/product_seckill_server/target/classes/com/product/seckill/server/controller/SeckillController.class new file mode 100644 index 0000000..e90c0d9 Binary files /dev/null and b/product_seckill/product_seckill_server/target/classes/com/product/seckill/server/controller/SeckillController.class differ diff --git a/product_seckill/product_seckill_server/target/classes/com/product/seckill/server/mapper/ProductMapper.class b/product_seckill/product_seckill_server/target/classes/com/product/seckill/server/mapper/ProductMapper.class new file mode 100644 index 0000000..a3c6c86 Binary files /dev/null and b/product_seckill/product_seckill_server/target/classes/com/product/seckill/server/mapper/ProductMapper.class differ diff --git a/product_seckill/product_seckill_server/target/classes/com/product/seckill/server/mapper/SeckillMapper.class b/product_seckill/product_seckill_server/target/classes/com/product/seckill/server/mapper/SeckillMapper.class new file mode 100644 index 0000000..830694a Binary files /dev/null and b/product_seckill/product_seckill_server/target/classes/com/product/seckill/server/mapper/SeckillMapper.class differ diff --git a/product_seckill/product_seckill_server/target/classes/com/product/seckill/server/service/SeckillService.class b/product_seckill/product_seckill_server/target/classes/com/product/seckill/server/service/SeckillService.class new file mode 100644 index 0000000..f054057 Binary files /dev/null and b/product_seckill/product_seckill_server/target/classes/com/product/seckill/server/service/SeckillService.class differ diff --git a/product_seckill/product_seckill_server/target/classes/com/product/seckill/server/service/impl/SeckillServiceImpl.class b/product_seckill/product_seckill_server/target/classes/com/product/seckill/server/service/impl/SeckillServiceImpl.class new file mode 100644 index 0000000..45ee10e Binary files /dev/null and b/product_seckill/product_seckill_server/target/classes/com/product/seckill/server/service/impl/SeckillServiceImpl.class differ diff --git a/product_seckill/product_seckill_server/target/classes/static/index.html b/product_seckill/product_seckill_server/target/classes/static/index.html new file mode 100644 index 0000000..f67da0a --- /dev/null +++ b/product_seckill/product_seckill_server/target/classes/static/index.html @@ -0,0 +1,6 @@ + + +

hello word!!!

+

this is a html page

+ +