diff --git a/README.md b/README.md index fd25013..3916621 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@

- Downloads - Build Status + Downloads + Build Status Build Status - Coverage Status - Downloads + Coverage Status + Downloads Downloads diff --git a/blade-auth/Dockerfile b/blade-auth/Dockerfile index d95904e..1e4e1ac 100644 --- a/blade-auth/Dockerfile +++ b/blade-auth/Dockerfile @@ -1,6 +1,6 @@ -FROM anapsix/alpine-java:8_server-jre_unlimited +FROM bladex/alpine-java:openjdk17_cn_slim -MAINTAINER smallchill@163.com +MAINTAINER bladejava@qq.com RUN mkdir -p /blade/auth @@ -10,6 +10,6 @@ EXPOSE 8010 ADD ./target/blade-auth.jar ./app.jar -ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"] +ENTRYPOINT ["java", "--add-opens java.base/java.lang.reflect=ALL-UNNAMED", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"] CMD ["--spring.profiles.active=test"] diff --git a/blade-auth/pom.xml b/blade-auth/pom.xml index 17877d5..4f73a83 100644 --- a/blade-auth/pom.xml +++ b/blade-auth/pom.xml @@ -8,7 +8,7 @@ SpringBlade org.springblade - 3.7.1 + 4.0.0 blade-auth @@ -61,9 +61,8 @@ - mysql - mysql-connector-java - ${mysql.connector.version} + com.mysql + mysql-connector-j runtime @@ -93,22 +92,6 @@ org.apache.maven.plugins maven-antrun-plugin - - - package - - run - - - - - - - - - diff --git a/blade-auth/src/main/java/org/springblade/auth/controller/AuthController.java b/blade-auth/src/main/java/org/springblade/auth/controller/AuthController.java index 529264b..ef45124 100644 --- a/blade-auth/src/main/java/org/springblade/auth/controller/AuthController.java +++ b/blade-auth/src/main/java/org/springblade/auth/controller/AuthController.java @@ -16,9 +16,9 @@ package org.springblade.auth.controller; import com.wf.captcha.SpecCaptcha; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; import lombok.AllArgsConstructor; import org.springblade.auth.granter.ITokenGranter; import org.springblade.auth.granter.TokenGranterBuilder; @@ -47,18 +47,18 @@ import java.util.concurrent.TimeUnit; */ @RestController @AllArgsConstructor -@Api(value = "用户授权认证", tags = "授权接口") +@Tag(name = "用户授权认证", description = "授权接口") public class AuthController { private RedisUtil redisUtil; @PostMapping("token") - @ApiOperation(value = "获取认证token", notes = "传入租户ID:tenantId,账号:account,密码:password") - public R token(@ApiParam(value = "授权类型", required = true) @RequestParam(defaultValue = "password", required = false) String grantType, - @ApiParam(value = "刷新令牌") @RequestParam(required = false) String refreshToken, - @ApiParam(value = "租户ID", required = true) @RequestParam(defaultValue = "000000", required = false) String tenantId, - @ApiParam(value = "账号") @RequestParam(required = false) String account, - @ApiParam(value = "密码") @RequestParam(required = false) String password) { + @Operation(summary = "获取认证token", description = "传入租户ID:tenantId,账号:account,密码:password") + public R token(@Parameter(name = "授权类型", required = true) @RequestParam(defaultValue = "password", required = false) String grantType, + @Parameter(name = "刷新令牌") @RequestParam(required = false) String refreshToken, + @Parameter(name = "租户ID", required = true) @RequestParam(defaultValue = "000000", required = false) String tenantId, + @Parameter(name = "账号") @RequestParam(required = false) String account, + @Parameter(name = "密码") @RequestParam(required = false) String password) { String userType = Func.toStr(WebUtil.getRequest().getHeader(TokenUtil.USER_TYPE_HEADER_KEY), TokenUtil.DEFAULT_USER_TYPE); @@ -81,7 +81,7 @@ public class AuthController { } @GetMapping("/captcha") - @ApiOperation(value = "获取验证码") + @Operation(summary = "获取验证码") public R captcha() { SpecCaptcha specCaptcha = new SpecCaptcha(130, 48, 5); String verCode = specCaptcha.text().toLowerCase(); diff --git a/blade-auth/src/main/java/org/springblade/auth/controller/SocialController.java b/blade-auth/src/main/java/org/springblade/auth/controller/SocialController.java index e231dd6..f64b922 100644 --- a/blade-auth/src/main/java/org/springblade/auth/controller/SocialController.java +++ b/blade-auth/src/main/java/org/springblade/auth/controller/SocialController.java @@ -15,8 +15,8 @@ */ package org.springblade.auth.controller; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import me.zhyd.oauth.model.AuthCallback; @@ -30,7 +30,7 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; /** @@ -42,7 +42,7 @@ import java.io.IOException; @RestController @AllArgsConstructor @ConditionalOnProperty(value = "social.enabled", havingValue = "true") -@Api(value = "第三方登陆", tags = "第三方登陆端点") +@Tag(name = "第三方登陆", description = "第三方登陆端点") public class SocialController { private final SocialProperties socialProperties; @@ -50,7 +50,7 @@ public class SocialController { /** * 授权完毕跳转 */ - @ApiOperation(value = "授权完毕跳转") + @Operation(summary = "授权完毕跳转") @RequestMapping("/oauth/render/{source}") public void renderAuth(@PathVariable("source") String source, HttpServletResponse response) throws IOException { AuthRequest authRequest = SocialUtil.getAuthRequest(source, socialProperties); @@ -61,7 +61,7 @@ public class SocialController { /** * 获取认证信息 */ - @ApiOperation(value = "获取认证信息") + @Operation(summary = "获取认证信息") @RequestMapping("/oauth/callback/{source}") public Object login(@PathVariable("source") String source, AuthCallback callback) { AuthRequest authRequest = SocialUtil.getAuthRequest(source, socialProperties); @@ -71,7 +71,7 @@ public class SocialController { /** * 撤销授权 */ - @ApiOperation(value = "撤销授权") + @Operation(summary = "撤销授权") @RequestMapping("/oauth/revoke/{source}/{token}") public Object revokeAuth(@PathVariable("source") String source, @PathVariable("token") String token) { AuthRequest authRequest = SocialUtil.getAuthRequest(source, socialProperties); @@ -81,7 +81,7 @@ public class SocialController { /** * 续期accessToken */ - @ApiOperation(value = "续期令牌") + @Operation(summary = "续期令牌") @RequestMapping("/oauth/refresh/{source}") public Object refreshAuth(@PathVariable("source") String source, String token) { AuthRequest authRequest = SocialUtil.getAuthRequest(source, socialProperties); diff --git a/blade-auth/src/main/java/org/springblade/auth/granter/CaptchaTokenGranter.java b/blade-auth/src/main/java/org/springblade/auth/granter/CaptchaTokenGranter.java index a3d9e7c..2bf81bd 100644 --- a/blade-auth/src/main/java/org/springblade/auth/granter/CaptchaTokenGranter.java +++ b/blade-auth/src/main/java/org/springblade/auth/granter/CaptchaTokenGranter.java @@ -26,7 +26,7 @@ import org.springblade.system.user.entity.UserInfo; import org.springblade.system.user.feign.IUserClient; import org.springframework.stereotype.Component; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; /** * 验证码TokenGranter diff --git a/blade-auth/src/main/java/org/springblade/auth/granter/SocialTokenGranter.java b/blade-auth/src/main/java/org/springblade/auth/granter/SocialTokenGranter.java index 905312d..689ae63 100644 --- a/blade-auth/src/main/java/org/springblade/auth/granter/SocialTokenGranter.java +++ b/blade-auth/src/main/java/org/springblade/auth/granter/SocialTokenGranter.java @@ -33,7 +33,7 @@ import org.springblade.system.user.entity.UserOauth; import org.springblade.system.user.feign.IUserClient; import org.springframework.stereotype.Component; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import java.util.Objects; /** @@ -79,7 +79,7 @@ public class SocialTokenGranter implements ITokenGranter { } // 组装数据 - UserOauth userOauth = Objects.requireNonNull(BeanUtil.copy(authUser, UserOauth.class)); + UserOauth userOauth = Objects.requireNonNull(BeanUtil.copyProperties(authUser, UserOauth.class)); userOauth.setSource(authUser.getSource()); userOauth.setTenantId(tenantId); userOauth.setUuid(authUser.getUuid()); diff --git a/blade-common/pom.xml b/blade-common/pom.xml index ba89b03..4fa1dce 100644 --- a/blade-common/pom.xml +++ b/blade-common/pom.xml @@ -5,7 +5,7 @@ SpringBlade org.springblade - 3.7.1 + 4.0.0 4.0.0 diff --git a/blade-common/src/main/java/org/springblade/common/constant/LauncherConstant.java b/blade-common/src/main/java/org/springblade/common/constant/LauncherConstant.java index abc2107..4be5147 100644 --- a/blade-common/src/main/java/org/springblade/common/constant/LauncherConstant.java +++ b/blade-common/src/main/java/org/springblade/common/constant/LauncherConstant.java @@ -9,6 +9,16 @@ import org.springblade.core.launch.constant.AppConstant; */ public interface LauncherConstant { + /** + * nacos 用户名 + */ + String NACOS_USERNAME = "nacos"; + + /** + * nacos 密码 + */ + String NACOS_PASSWORD = "nacos"; + /** * nacos namespace id */ diff --git a/blade-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java b/blade-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java index f2424ea..bbe99f8 100644 --- a/blade-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java +++ b/blade-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java @@ -32,6 +32,8 @@ public class LauncherServiceImpl implements LauncherService { @Override public void launcher(SpringApplicationBuilder builder, String appName, String profile) { Properties props = System.getProperties(); + PropsUtil.setProperty(props, "spring.cloud.nacos.username", LauncherConstant.NACOS_USERNAME); + PropsUtil.setProperty(props, "spring.cloud.nacos.password", LauncherConstant.NACOS_PASSWORD); PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.server-addr", LauncherConstant.nacosAddr(profile)); PropsUtil.setProperty(props, "spring.cloud.nacos.config.server-addr", LauncherConstant.nacosAddr(profile)); PropsUtil.setProperty(props, "spring.cloud.sentinel.transport.dashboard", LauncherConstant.sentinelAddr(profile)); diff --git a/blade-gateway/Dockerfile b/blade-gateway/Dockerfile index e0ae9f9..e410977 100644 --- a/blade-gateway/Dockerfile +++ b/blade-gateway/Dockerfile @@ -1,6 +1,6 @@ -FROM anapsix/alpine-java:8_server-jre_unlimited +FROM bladex/alpine-java:openjdk17_cn_slim -MAINTAINER smallchill@163.com +MAINTAINER bladejava@qq.com RUN mkdir -p /blade/gateway @@ -10,6 +10,6 @@ EXPOSE 80 ADD ./target/blade-gateway.jar ./app.jar -ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"] +ENTRYPOINT ["java", "--add-opens java.base/java.lang.reflect=ALL-UNNAMED", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"] CMD ["--spring.profiles.active=test"] diff --git a/blade-gateway/pom.xml b/blade-gateway/pom.xml index 8893e2c..1247830 100644 --- a/blade-gateway/pom.xml +++ b/blade-gateway/pom.xml @@ -5,7 +5,7 @@ SpringBlade org.springblade - 3.7.1 + 4.0.0 4.0.0 @@ -69,6 +69,11 @@ com.alibaba.cloud spring-cloud-starter-alibaba-sentinel + + + com.github.xiaoymin + knife4j-gateway-spring-boot-starter + io.jsonwebtoken @@ -107,22 +112,6 @@ org.apache.maven.plugins maven-antrun-plugin - - - package - - run - - - - - - - - - diff --git a/blade-gateway/src/main/java/org/springblade/gateway/handler/ErrorExceptionHandler.java b/blade-gateway/src/main/java/org/springblade/gateway/handler/ErrorExceptionHandler.java index 9a84773..3794fd1 100644 --- a/blade-gateway/src/main/java/org/springblade/gateway/handler/ErrorExceptionHandler.java +++ b/blade-gateway/src/main/java/org/springblade/gateway/handler/ErrorExceptionHandler.java @@ -24,15 +24,15 @@ import org.springframework.boot.web.reactive.error.ErrorWebExceptionHandler; import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.Order; import org.springframework.core.io.buffer.DataBufferFactory; -import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.server.reactive.ServerHttpRequest; import org.springframework.http.server.reactive.ServerHttpResponse; -import org.springframework.lang.NonNull; import org.springframework.web.server.ResponseStatusException; import org.springframework.web.server.ServerWebExchange; import reactor.core.publisher.Mono; +import java.util.Map; + /** * 异常处理 * @@ -45,43 +45,42 @@ public class ErrorExceptionHandler implements ErrorWebExceptionHandler { private final ObjectMapper objectMapper; - @NonNull @Override - public Mono handle(ServerWebExchange exchange, @NonNull Throwable ex) { + public Mono handle(ServerWebExchange exchange, Throwable ex) { ServerHttpRequest request = exchange.getRequest(); ServerHttpResponse response = exchange.getResponse(); + if (response.isCommitted()) { return Mono.error(ex); } + response.getHeaders().setContentType(MediaType.APPLICATION_JSON); if (ex instanceof ResponseStatusException) { - response.setStatusCode(((ResponseStatusException) ex).getStatus()); + response.setStatusCode(((ResponseStatusException) ex).getStatusCode()); } + return response.writeWith(Mono.fromSupplier(() -> { DataBufferFactory bufferFactory = response.bufferFactory(); try { - HttpStatus status = HttpStatus.BAD_GATEWAY; - if (ex instanceof ResponseStatusException) { - status = ((ResponseStatusException) ex).getStatus(); + int status = 500; + if (response.getStatusCode() != null) { + status = response.getStatusCode().value(); } - return bufferFactory.wrap(objectMapper.writeValueAsBytes(ResponseProvider.response(status.value(), buildMessage(request, ex)))); + Map result = ResponseProvider.response(status, this.buildMessage(request, ex)); + return bufferFactory.wrap(objectMapper.writeValueAsBytes(result)); } catch (JsonProcessingException e) { - e.printStackTrace(); return bufferFactory.wrap(new byte[0]); } })); } + /** * 构建异常信息 */ private String buildMessage(ServerHttpRequest request, Throwable ex) { - String uri = request.getURI().toString(); - if (uri.endsWith("doc.html")) { - return "[Swagger聚合网关] 已迁移至 [blade-swagger] 服务,请开启 [blade-swagger] 服务并访问 [http://127.0.0.1:18000/doc.html]"; - } StringBuilder message = new StringBuilder("Failed to handle request ["); - message.append(request.getMethodValue()); + message.append(request.getMethod().name()); message.append(" "); message.append(request.getURI()); message.append("]"); @@ -92,4 +91,5 @@ public class ErrorExceptionHandler implements ErrorWebExceptionHandler { return message.toString(); } + } diff --git a/blade-gateway/src/main/java/org/springblade/gateway/provider/AuthProvider.java b/blade-gateway/src/main/java/org/springblade/gateway/provider/AuthProvider.java index 1dc1220..c0087b2 100644 --- a/blade-gateway/src/main/java/org/springblade/gateway/provider/AuthProvider.java +++ b/blade-gateway/src/main/java/org/springblade/gateway/provider/AuthProvider.java @@ -35,7 +35,7 @@ public class AuthProvider { DEFAULT_SKIP_URL.add("/token/**"); DEFAULT_SKIP_URL.add("/captcha/**"); DEFAULT_SKIP_URL.add("/actuator/health/**"); - DEFAULT_SKIP_URL.add("/v2/api-docs/**"); + DEFAULT_SKIP_URL.add("/v3/api-docs/**"); DEFAULT_SKIP_URL.add("/auth/**"); DEFAULT_SKIP_URL.add("/oauth/**"); DEFAULT_SKIP_URL.add("/log/**"); diff --git a/blade-gateway/src/main/java/org/springblade/gateway/utils/JwtCrypto.java b/blade-gateway/src/main/java/org/springblade/gateway/utils/JwtCrypto.java index e8fca22..99ec888 100644 --- a/blade-gateway/src/main/java/org/springblade/gateway/utils/JwtCrypto.java +++ b/blade-gateway/src/main/java/org/springblade/gateway/utils/JwtCrypto.java @@ -18,7 +18,6 @@ package org.springblade.gateway.utils; import lombok.SneakyThrows; import org.springframework.util.Assert; -import org.springframework.util.Base64Utils; import org.springframework.util.StringUtils; import reactor.util.annotation.Nullable; @@ -28,6 +27,7 @@ import javax.crypto.spec.SecretKeySpec; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.util.Arrays; +import java.util.Base64; import java.util.Objects; /** @@ -49,7 +49,7 @@ public class JwtCrypto { * @return {String} */ public static String encryptToString(String content, String aesTextKey) { - return Base64Utils.encodeToString(encrypt(content, aesTextKey)); + return Base64.getEncoder().encodeToString(encrypt(content, aesTextKey)); } /** @@ -60,7 +60,7 @@ public class JwtCrypto { * @return {String} */ public static String encryptToString(byte[] content, String aesTextKey) { - return Base64Utils.encodeToString(encrypt(content, aesTextKey)); + return Base64.getEncoder().encodeToString(encrypt(content, aesTextKey)); } /** @@ -109,7 +109,7 @@ public class JwtCrypto { if (!StringUtils.hasText(content) || !StringUtils.hasText(aesTextKey)) { return null; } - byte[] hexBytes = decrypt(Base64Utils.decode(content.getBytes(DEFAULT_CHARSET)), aesTextKey); + byte[] hexBytes = decrypt(Base64.getDecoder().decode(content.getBytes(DEFAULT_CHARSET)), aesTextKey); return new String(hexBytes, DEFAULT_CHARSET); } diff --git a/blade-gateway/src/main/resources/application.yml b/blade-gateway/src/main/resources/application.yml new file mode 100644 index 0000000..d0c3371 --- /dev/null +++ b/blade-gateway/src/main/resources/application.yml @@ -0,0 +1,16 @@ +knife4j: + gateway: + enabled: true + tags-sorter: order + operations-sorter: order + # 指定服务发现的模式聚合微服务文档,并且是默认`default`分组 + strategy: discover + discover: + enabled: true + # 指定版本号(Swagger2|OpenAPI3) + version : openapi3 + # 需要排除的微服务(eg:网关服务) + excluded-services: + - blade-admin + - blade-gateway + - blade-log diff --git a/blade-ops/blade-admin/Dockerfile b/blade-ops/blade-admin/Dockerfile index 67119b9..257eb09 100644 --- a/blade-ops/blade-admin/Dockerfile +++ b/blade-ops/blade-admin/Dockerfile @@ -1,6 +1,6 @@ -FROM anapsix/alpine-java:8_server-jre_unlimited +FROM bladex/alpine-java:openjdk17_cn_slim -MAINTAINER smallchill@163.com +MAINTAINER bladejava@qq.com RUN mkdir -p /blade/admin @@ -10,6 +10,6 @@ EXPOSE 7002 ADD ./target/blade-admin.jar ./app.jar -ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"] +ENTRYPOINT ["java", "--add-opens java.base/java.lang.reflect=ALL-UNNAMED", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"] CMD ["--spring.profiles.active=test"] diff --git a/blade-ops/blade-admin/pom.xml b/blade-ops/blade-admin/pom.xml index cc8073e..a3bdc50 100644 --- a/blade-ops/blade-admin/pom.xml +++ b/blade-ops/blade-admin/pom.xml @@ -5,7 +5,7 @@ blade-ops org.springblade - 3.7.1 + 4.0.0 4.0.0 @@ -75,22 +75,6 @@ org.apache.maven.plugins maven-antrun-plugin - - - package - - run - - - - - - - - - diff --git a/blade-ops/blade-develop/Dockerfile b/blade-ops/blade-develop/Dockerfile index b93d21c..927e877 100644 --- a/blade-ops/blade-develop/Dockerfile +++ b/blade-ops/blade-develop/Dockerfile @@ -1,6 +1,6 @@ -FROM anapsix/alpine-java:8_server-jre_unlimited +FROM bladex/alpine-java:openjdk17_cn_slim -MAINTAINER smallchill@163.com +MAINTAINER bladejava@qq.com RUN mkdir -p /blade/develop @@ -10,6 +10,6 @@ EXPOSE 7007 ADD ./target/blade-develop.jar ./app.jar -ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"] +ENTRYPOINT ["java", "--add-opens java.base/java.lang.reflect=ALL-UNNAMED", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"] CMD ["--spring.profiles.active=test"] diff --git a/blade-ops/blade-develop/pom.xml b/blade-ops/blade-develop/pom.xml index d14af22..74f8538 100644 --- a/blade-ops/blade-develop/pom.xml +++ b/blade-ops/blade-develop/pom.xml @@ -6,7 +6,7 @@ org.springblade blade-ops - 3.7.1 + 4.0.0 4.0.0 @@ -65,22 +65,6 @@ org.apache.maven.plugins maven-antrun-plugin - - - package - - run - - - - - - - - - diff --git a/blade-ops/blade-develop/src/main/java/org/springblade/develop/controller/CodeController.java b/blade-ops/blade-develop/src/main/java/org/springblade/develop/controller/CodeController.java index 2e6908e..37fdf0e 100644 --- a/blade-ops/blade-develop/src/main/java/org/springblade/develop/controller/CodeController.java +++ b/blade-ops/blade-develop/src/main/java/org/springblade/develop/controller/CodeController.java @@ -17,7 +17,14 @@ package org.springblade.develop.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.Hidden; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.mp.support.Condition; @@ -32,9 +39,7 @@ import org.springblade.develop.service.ICodeService; import org.springblade.develop.service.IDatasourceService; import org.springblade.develop.support.BladeCodeGenerator; import org.springframework.web.bind.annotation.*; -import springfox.documentation.annotations.ApiIgnore; -import javax.validation.Valid; import java.util.Collection; import java.util.Map; @@ -43,11 +48,11 @@ import java.util.Map; * * @author Chill */ -@ApiIgnore +@Hidden @RestController @AllArgsConstructor @RequestMapping("/code") -@Api(value = "代码生成", tags = "代码生成") +@Tag(name = "代码生成", description = "代码生成") @PreAuth(RoleConstant.HAS_ROLE_ADMIN) public class CodeController extends BladeController { @@ -59,7 +64,7 @@ public class CodeController extends BladeController { */ @GetMapping("/detail") @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入code") + @Operation(summary = "详情", description = "传入code") public R detail(Code code) { Code detail = codeService.getOne(Condition.getQueryWrapper(code)); return R.data(detail); @@ -69,14 +74,14 @@ public class CodeController extends BladeController { * 分页 */ @GetMapping("/list") - @ApiImplicitParams({ - @ApiImplicitParam(name = "codeName", value = "模块名", paramType = "query", dataType = "string"), - @ApiImplicitParam(name = "tableName", value = "表名", paramType = "query", dataType = "string"), - @ApiImplicitParam(name = "modelName", value = "实体名", paramType = "query", dataType = "string") + @Parameters({ + @Parameter(name = "codeName", description = "模块名", in = ParameterIn.QUERY, schema = @Schema(type = "string")), + @Parameter(name = "tableName", description = "表名", in = ParameterIn.QUERY, schema = @Schema(type = "string")), + @Parameter(name = "modelName", description = "实体名", in = ParameterIn.QUERY, schema = @Schema(type = "string")) }) @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页", notes = "传入code") - public R> list(@ApiIgnore @RequestParam Map code, Query query) { + @Operation(summary = "分页", description = "传入code") + public R> list(@Parameter(hidden = true) @RequestParam Map code, Query query) { IPage pages = codeService.page(Condition.getPage(query), Condition.getQueryWrapper(code, Code.class)); return R.data(pages); } @@ -86,7 +91,7 @@ public class CodeController extends BladeController { */ @PostMapping("/submit") @ApiOperationSupport(order = 3) - @ApiOperation(value = "新增或修改", notes = "传入code") + @Operation(summary = "新增或修改", description = "传入code") public R submit(@Valid @RequestBody Code code) { return R.status(codeService.submit(code)); } @@ -97,8 +102,8 @@ public class CodeController extends BladeController { */ @PostMapping("/remove") @ApiOperationSupport(order = 4) - @ApiOperation(value = "删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + @Operation(summary = "删除", description = "传入ids") + public R remove(@Parameter(name = "主键集合", required = true) @RequestParam String ids) { return R.status(codeService.removeByIds(Func.toLongList(ids))); } @@ -107,8 +112,8 @@ public class CodeController extends BladeController { */ @PostMapping("/copy") @ApiOperationSupport(order = 5) - @ApiOperation(value = "复制", notes = "传入id") - public R copy(@ApiParam(value = "主键", required = true) @RequestParam Long id) { + @Operation(summary = "复制", description = "传入id") + public R copy(@Parameter(name = "主键", required = true) @RequestParam Long id) { Code code = codeService.getById(id); code.setId(null); code.setCodeName(code.getCodeName() + "-copy"); @@ -120,8 +125,8 @@ public class CodeController extends BladeController { */ @PostMapping("/gen-code") @ApiOperationSupport(order = 6) - @ApiOperation(value = "代码生成", notes = "传入ids") - public R genCode(@ApiParam(value = "主键集合", required = true) @RequestParam String ids, @RequestParam(defaultValue = "sword") String system) { + @Operation(summary = "代码生成", description = "传入ids") + public R genCode(@Parameter(name = "主键集合", required = true) @RequestParam String ids, @RequestParam(defaultValue = "sword") String system) { Collection codes = codeService.listByIds(Func.toLongList(ids)); codes.forEach(code -> { BladeCodeGenerator generator = new BladeCodeGenerator(); diff --git a/blade-ops/blade-develop/src/main/java/org/springblade/develop/controller/DatasourceController.java b/blade-ops/blade-develop/src/main/java/org/springblade/develop/controller/DatasourceController.java index 4ca5a88..6ba4fe7 100644 --- a/blade-ops/blade-develop/src/main/java/org/springblade/develop/controller/DatasourceController.java +++ b/blade-ops/blade-develop/src/main/java/org/springblade/develop/controller/DatasourceController.java @@ -17,9 +17,9 @@ package org.springblade.develop.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.mp.support.Condition; @@ -30,7 +30,7 @@ import org.springblade.develop.entity.Datasource; import org.springblade.develop.service.IDatasourceService; import org.springframework.web.bind.annotation.*; -import javax.validation.Valid; +import jakarta.validation.Valid; import java.util.List; /** @@ -41,7 +41,7 @@ import java.util.List; @RestController @AllArgsConstructor @RequestMapping("/datasource") -@Api(value = "数据源配置表", tags = "数据源配置表接口") +@Tag(name = "数据源配置表", description = "数据源配置表接口") public class DatasourceController extends BladeController { private IDatasourceService datasourceService; @@ -51,7 +51,7 @@ public class DatasourceController extends BladeController { */ @GetMapping("/detail") @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入datasource") + @Operation(summary = "详情", description = "传入datasource") public R detail(Datasource datasource) { Datasource detail = datasourceService.getOne(Condition.getQueryWrapper(datasource)); return R.data(detail); @@ -62,7 +62,7 @@ public class DatasourceController extends BladeController { */ @GetMapping("/list") @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页", notes = "传入datasource") + @Operation(summary = "分页", description = "传入datasource") public R> list(Datasource datasource, Query query) { IPage pages = datasourceService.page(Condition.getPage(query), Condition.getQueryWrapper(datasource)); return R.data(pages); @@ -73,7 +73,7 @@ public class DatasourceController extends BladeController { */ @PostMapping("/save") @ApiOperationSupport(order = 4) - @ApiOperation(value = "新增", notes = "传入datasource") + @Operation(summary = "新增", description = "传入datasource") public R save(@Valid @RequestBody Datasource datasource) { return R.status(datasourceService.save(datasource)); } @@ -83,7 +83,7 @@ public class DatasourceController extends BladeController { */ @PostMapping("/update") @ApiOperationSupport(order = 5) - @ApiOperation(value = "修改", notes = "传入datasource") + @Operation(summary = "修改", description = "传入datasource") public R update(@Valid @RequestBody Datasource datasource) { return R.status(datasourceService.updateById(datasource)); } @@ -93,7 +93,7 @@ public class DatasourceController extends BladeController { */ @PostMapping("/submit") @ApiOperationSupport(order = 6) - @ApiOperation(value = "新增或修改", notes = "传入datasource") + @Operation(summary = "新增或修改", description = "传入datasource") public R submit(@Valid @RequestBody Datasource datasource) { datasource.setUrl(datasource.getUrl().replace("&", "&")); return R.status(datasourceService.saveOrUpdate(datasource)); @@ -105,8 +105,8 @@ public class DatasourceController extends BladeController { */ @PostMapping("/remove") @ApiOperationSupport(order = 7) - @ApiOperation(value = "逻辑删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + @Operation(summary = "逻辑删除", description = "传入ids") + public R remove(@Parameter(name = "主键集合", required = true) @RequestParam String ids) { return R.status(datasourceService.deleteLogic(Func.toLongList(ids))); } @@ -115,7 +115,7 @@ public class DatasourceController extends BladeController { */ @GetMapping("/select") @ApiOperationSupport(order = 8) - @ApiOperation(value = "下拉数据源", notes = "查询列表") + @Operation(summary = "下拉数据源", description = "查询列表") public R> select() { List list = datasourceService.list(); return R.data(list); diff --git a/blade-ops/blade-develop/src/main/java/org/springblade/develop/entity/Code.java b/blade-ops/blade-develop/src/main/java/org/springblade/develop/entity/Code.java index 390aee2..8958fba 100644 --- a/blade-ops/blade-develop/src/main/java/org/springblade/develop/entity/Code.java +++ b/blade-ops/blade-develop/src/main/java/org/springblade/develop/entity/Code.java @@ -21,10 +21,10 @@ import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; +import java.io.Serial; import java.io.Serializable; /** @@ -34,15 +34,16 @@ import java.io.Serializable; */ @Data @TableName("blade_code") -@ApiModel(value = "Code对象", description = "Code对象") +@Schema(description = "Code对象") public class Code implements Serializable { + @Serial private static final long serialVersionUID = 1L; /** * 主键 */ - @ApiModelProperty(value = "主键") + @Schema(description = "主键") @TableId(value = "id", type = IdType.ASSIGN_ID) @JsonSerialize(using = ToStringSerializer.class) private Long id; @@ -50,75 +51,75 @@ public class Code implements Serializable { /** * 数据源主键 */ - @ApiModelProperty(value = "数据源主键") + @Schema(description = "数据源主键") @JsonSerialize(using = ToStringSerializer.class) private Long datasourceId; /** * 模块名称 */ - @ApiModelProperty(value = "服务名称") + @Schema(description = "服务名称") private String serviceName; /** * 模块名称 */ - @ApiModelProperty(value = "模块名称") + @Schema(description = "模块名称") private String codeName; /** * 表名 */ - @ApiModelProperty(value = "表名") + @Schema(description = "表名") private String tableName; /** * 实体名 */ - @ApiModelProperty(value = "表前缀") + @Schema(description = "表前缀") private String tablePrefix; /** * 主键名 */ - @ApiModelProperty(value = "主键名") + @Schema(description = "主键名") private String pkName; /** * 基础业务模式 */ - @ApiModelProperty(value = "基础业务模式") + @Schema(description = "基础业务模式") private Integer baseMode; /** * 包装器模式 */ - @ApiModelProperty(value = "包装器模式") + @Schema(description = "包装器模式") private Integer wrapMode; /** * 后端包名 */ - @ApiModelProperty(value = "后端包名") + @Schema(description = "后端包名") private String packageName; /** * 后端路径 */ - @ApiModelProperty(value = "后端路径") + @Schema(description = "后端路径") private String apiPath; /** * 前端路径 */ - @ApiModelProperty(value = "前端路径") + @Schema(description = "前端路径") private String webPath; /** * 是否已删除 */ @TableLogic - @ApiModelProperty(value = "是否已删除") + @Schema(description = "是否已删除") private Integer isDeleted; diff --git a/blade-ops/blade-develop/src/main/java/org/springblade/develop/entity/Datasource.java b/blade-ops/blade-develop/src/main/java/org/springblade/develop/entity/Datasource.java index c48085c..ea82a47 100644 --- a/blade-ops/blade-develop/src/main/java/org/springblade/develop/entity/Datasource.java +++ b/blade-ops/blade-develop/src/main/java/org/springblade/develop/entity/Datasource.java @@ -20,12 +20,13 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.mp.base.BaseEntity; +import java.io.Serial; + /** * 数据源配置表实体类 * @@ -34,15 +35,16 @@ import org.springblade.core.mp.base.BaseEntity; @Data @TableName("blade_datasource") @EqualsAndHashCode(callSuper = true) -@ApiModel(value = "Datasource对象", description = "数据源配置表") +@Schema(description = "Datasource对象") public class Datasource extends BaseEntity { + @Serial private static final long serialVersionUID = 1L; /** * 主键 */ - @ApiModelProperty(value = "主键") + @Schema(description = "主键") @TableId(value = "id", type = IdType.ASSIGN_ID) @JsonSerialize(using = ToStringSerializer.class) private Long id; @@ -50,32 +52,32 @@ public class Datasource extends BaseEntity { /** * 名称 */ - @ApiModelProperty(value = "名称") + @Schema(description = "名称") private String name; /** * 驱动类 */ - @ApiModelProperty(value = "驱动类") + @Schema(description = "驱动类") private String driverClass; /** * 连接地址 */ - @ApiModelProperty(value = "连接地址") + @Schema(description = "连接地址") private String url; /** * 用户名 */ - @ApiModelProperty(value = "用户名") + @Schema(description = "用户名") private String username; /** * 密码 */ - @ApiModelProperty(value = "密码") + @Schema(description = "密码") private String password; /** * 备注 */ - @ApiModelProperty(value = "备注") + @Schema(description = "备注") private String remark; diff --git a/blade-ops/blade-develop/src/main/resources/templates/controller.java.vm b/blade-ops/blade-develop/src/main/resources/templates/controller.java.vm index a869a87..f4d18fc 100644 --- a/blade-ops/blade-develop/src/main/resources/templates/controller.java.vm +++ b/blade-ops/blade-develop/src/main/resources/templates/controller.java.vm @@ -15,12 +15,12 @@ */ package $!{package.Controller}; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import lombok.AllArgsConstructor; -import javax.validation.Valid; +import jakarta.validation.Valid; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; @@ -54,7 +54,7 @@ import $!{superControllerClassPackage}; @RestController @AllArgsConstructor @RequestMapping("#if($!{package.ModuleName})$!{package.ModuleName}#end/$!{entityKey}") -@Api(value = "$!{table.comment}", tags = "$!{table.comment}接口") +@Tag(name = "$!{table.comment}", description = "$!{table.comment}接口") #if($!{superControllerClass}) public class $!{table.controllerName} extends $!{superControllerClass} { #else @@ -69,7 +69,7 @@ public class $!{table.controllerName} { */ @GetMapping("/detail") @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入$!{table.entityPath}") + @Operation(summary = "详情", description = "传入$!{table.entityPath}") public R<$!{entity}VO> detail($!{entity} $!{table.entityPath}) { $!{entity} detail = $!{table.entityPath}Service.getOne(Condition.getQueryWrapper($!{table.entityPath})); return R.data($!{entity}Wrapper.build().entityVO(detail)); @@ -80,7 +80,7 @@ public class $!{table.controllerName} { */ @GetMapping("/list") @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页", notes = "传入$!{table.entityPath}") + @Operation(summary = "分页", description = "传入$!{table.entityPath}") public R> list($!{entity} $!{table.entityPath}, Query query) { IPage<$!{entity}> pages = $!{table.entityPath}Service.page(Condition.getPage(query), Condition.getQueryWrapper($!{table.entityPath})); return R.data($!{entity}Wrapper.build().pageVO(pages)); @@ -92,7 +92,7 @@ public class $!{table.controllerName} { */ @GetMapping("/detail") @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入$!{table.entityPath}") + @Operation(summary = "详情", description = "传入$!{table.entityPath}") public R<$!{entity}> detail($!{entity} $!{table.entityPath}) { $!{entity} detail = $!{table.entityPath}Service.getOne(Condition.getQueryWrapper($!{table.entityPath})); return R.data(detail); @@ -103,7 +103,7 @@ public class $!{table.controllerName} { */ @GetMapping("/list") @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页", notes = "传入$!{table.entityPath}") + @Operation(summary = "分页", description = "传入$!{table.entityPath}") public R> list($!{entity} $!{table.entityPath}, Query query) { IPage<$!{entity}> pages = $!{table.entityPath}Service.page(Condition.getPage(query), Condition.getQueryWrapper($!{table.entityPath})); return R.data(pages); @@ -115,7 +115,7 @@ public class $!{table.controllerName} { */ @GetMapping("/page") @ApiOperationSupport(order = 3) - @ApiOperation(value = "分页", notes = "传入$!{table.entityPath}") + @Operation(summary = "分页", description = "传入$!{table.entityPath}") public R> page($!{entity}VO $!{table.entityPath}, Query query) { IPage<$!{entity}VO> pages = $!{table.entityPath}Service.select$!{entity}Page(Condition.getPage(query), $!{table.entityPath}); return R.data(pages); @@ -126,7 +126,7 @@ public class $!{table.controllerName} { */ @PostMapping("/save") @ApiOperationSupport(order = 4) - @ApiOperation(value = "新增", notes = "传入$!{table.entityPath}") + @Operation(summary = "新增", description = "传入$!{table.entityPath}") public R save(@Valid @RequestBody $!{entity} $!{table.entityPath}) { return R.status($!{table.entityPath}Service.save($!{table.entityPath})); } @@ -136,7 +136,7 @@ public class $!{table.controllerName} { */ @PostMapping("/update") @ApiOperationSupport(order = 5) - @ApiOperation(value = "修改", notes = "传入$!{table.entityPath}") + @Operation(summary = "修改", description = "传入$!{table.entityPath}") public R update(@Valid @RequestBody $!{entity} $!{table.entityPath}) { return R.status($!{table.entityPath}Service.updateById($!{table.entityPath})); } @@ -146,7 +146,7 @@ public class $!{table.controllerName} { */ @PostMapping("/submit") @ApiOperationSupport(order = 6) - @ApiOperation(value = "新增或修改", notes = "传入$!{table.entityPath}") + @Operation(summary = "新增或修改", description = "传入$!{table.entityPath}") public R submit(@Valid @RequestBody $!{entity} $!{table.entityPath}) { return R.status($!{table.entityPath}Service.saveOrUpdate($!{table.entityPath})); } @@ -158,8 +158,8 @@ public class $!{table.controllerName} { */ @PostMapping("/remove") @ApiOperationSupport(order = 7) - @ApiOperation(value = "逻辑删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + @Operation(summary = "逻辑删除", description = "传入ids") + public R remove(@Parameter(name = "主键集合", required = true) @RequestParam String ids) { return R.status($!{table.entityPath}Service.deleteLogic(Func.toLongList(ids))); } @@ -170,8 +170,8 @@ public class $!{table.controllerName} { */ @PostMapping("/remove") @ApiOperationSupport(order = 8) - @ApiOperation(value = "删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + @Operation(summary = "删除", description = "传入ids") + public R remove(@Parameter(name = "主键集合", required = true) @RequestParam String ids) { return R.status($!{table.entityPath}Service.removeByIds(Func.toLongList(ids))); } diff --git a/blade-ops/blade-develop/src/main/resources/templates/wrapper.java.vm b/blade-ops/blade-develop/src/main/resources/templates/wrapper.java.vm index 64a8b01..3729f01 100644 --- a/blade-ops/blade-develop/src/main/resources/templates/wrapper.java.vm +++ b/blade-ops/blade-develop/src/main/resources/templates/wrapper.java.vm @@ -37,7 +37,7 @@ public class $!{entity}Wrapper extends BaseEntityWrapper<$!{entity}, $!{entity}V @Override public $!{entity}VO entityVO($!{entity} $!{table.entityPath}) { - $!{entity}VO $!{table.entityPath}VO = BeanUtil.copy($!{table.entityPath}, $!{entity}VO.class); + $!{entity}VO $!{table.entityPath}VO = BeanUtil.copyProperties($!{table.entityPath}, $!{entity}VO.class); return $!{table.entityPath}VO; } diff --git a/blade-ops/blade-develop/src/test/resources/templates/controller.java.vm b/blade-ops/blade-develop/src/test/resources/templates/controller.java.vm index a869a87..f4d18fc 100644 --- a/blade-ops/blade-develop/src/test/resources/templates/controller.java.vm +++ b/blade-ops/blade-develop/src/test/resources/templates/controller.java.vm @@ -15,12 +15,12 @@ */ package $!{package.Controller}; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import lombok.AllArgsConstructor; -import javax.validation.Valid; +import jakarta.validation.Valid; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; @@ -54,7 +54,7 @@ import $!{superControllerClassPackage}; @RestController @AllArgsConstructor @RequestMapping("#if($!{package.ModuleName})$!{package.ModuleName}#end/$!{entityKey}") -@Api(value = "$!{table.comment}", tags = "$!{table.comment}接口") +@Tag(name = "$!{table.comment}", description = "$!{table.comment}接口") #if($!{superControllerClass}) public class $!{table.controllerName} extends $!{superControllerClass} { #else @@ -69,7 +69,7 @@ public class $!{table.controllerName} { */ @GetMapping("/detail") @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入$!{table.entityPath}") + @Operation(summary = "详情", description = "传入$!{table.entityPath}") public R<$!{entity}VO> detail($!{entity} $!{table.entityPath}) { $!{entity} detail = $!{table.entityPath}Service.getOne(Condition.getQueryWrapper($!{table.entityPath})); return R.data($!{entity}Wrapper.build().entityVO(detail)); @@ -80,7 +80,7 @@ public class $!{table.controllerName} { */ @GetMapping("/list") @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页", notes = "传入$!{table.entityPath}") + @Operation(summary = "分页", description = "传入$!{table.entityPath}") public R> list($!{entity} $!{table.entityPath}, Query query) { IPage<$!{entity}> pages = $!{table.entityPath}Service.page(Condition.getPage(query), Condition.getQueryWrapper($!{table.entityPath})); return R.data($!{entity}Wrapper.build().pageVO(pages)); @@ -92,7 +92,7 @@ public class $!{table.controllerName} { */ @GetMapping("/detail") @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入$!{table.entityPath}") + @Operation(summary = "详情", description = "传入$!{table.entityPath}") public R<$!{entity}> detail($!{entity} $!{table.entityPath}) { $!{entity} detail = $!{table.entityPath}Service.getOne(Condition.getQueryWrapper($!{table.entityPath})); return R.data(detail); @@ -103,7 +103,7 @@ public class $!{table.controllerName} { */ @GetMapping("/list") @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页", notes = "传入$!{table.entityPath}") + @Operation(summary = "分页", description = "传入$!{table.entityPath}") public R> list($!{entity} $!{table.entityPath}, Query query) { IPage<$!{entity}> pages = $!{table.entityPath}Service.page(Condition.getPage(query), Condition.getQueryWrapper($!{table.entityPath})); return R.data(pages); @@ -115,7 +115,7 @@ public class $!{table.controllerName} { */ @GetMapping("/page") @ApiOperationSupport(order = 3) - @ApiOperation(value = "分页", notes = "传入$!{table.entityPath}") + @Operation(summary = "分页", description = "传入$!{table.entityPath}") public R> page($!{entity}VO $!{table.entityPath}, Query query) { IPage<$!{entity}VO> pages = $!{table.entityPath}Service.select$!{entity}Page(Condition.getPage(query), $!{table.entityPath}); return R.data(pages); @@ -126,7 +126,7 @@ public class $!{table.controllerName} { */ @PostMapping("/save") @ApiOperationSupport(order = 4) - @ApiOperation(value = "新增", notes = "传入$!{table.entityPath}") + @Operation(summary = "新增", description = "传入$!{table.entityPath}") public R save(@Valid @RequestBody $!{entity} $!{table.entityPath}) { return R.status($!{table.entityPath}Service.save($!{table.entityPath})); } @@ -136,7 +136,7 @@ public class $!{table.controllerName} { */ @PostMapping("/update") @ApiOperationSupport(order = 5) - @ApiOperation(value = "修改", notes = "传入$!{table.entityPath}") + @Operation(summary = "修改", description = "传入$!{table.entityPath}") public R update(@Valid @RequestBody $!{entity} $!{table.entityPath}) { return R.status($!{table.entityPath}Service.updateById($!{table.entityPath})); } @@ -146,7 +146,7 @@ public class $!{table.controllerName} { */ @PostMapping("/submit") @ApiOperationSupport(order = 6) - @ApiOperation(value = "新增或修改", notes = "传入$!{table.entityPath}") + @Operation(summary = "新增或修改", description = "传入$!{table.entityPath}") public R submit(@Valid @RequestBody $!{entity} $!{table.entityPath}) { return R.status($!{table.entityPath}Service.saveOrUpdate($!{table.entityPath})); } @@ -158,8 +158,8 @@ public class $!{table.controllerName} { */ @PostMapping("/remove") @ApiOperationSupport(order = 7) - @ApiOperation(value = "逻辑删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + @Operation(summary = "逻辑删除", description = "传入ids") + public R remove(@Parameter(name = "主键集合", required = true) @RequestParam String ids) { return R.status($!{table.entityPath}Service.deleteLogic(Func.toLongList(ids))); } @@ -170,8 +170,8 @@ public class $!{table.controllerName} { */ @PostMapping("/remove") @ApiOperationSupport(order = 8) - @ApiOperation(value = "删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + @Operation(summary = "删除", description = "传入ids") + public R remove(@Parameter(name = "主键集合", required = true) @RequestParam String ids) { return R.status($!{table.entityPath}Service.removeByIds(Func.toLongList(ids))); } diff --git a/blade-ops/blade-develop/src/test/resources/templates/wrapper.java.vm b/blade-ops/blade-develop/src/test/resources/templates/wrapper.java.vm index 64a8b01..3729f01 100644 --- a/blade-ops/blade-develop/src/test/resources/templates/wrapper.java.vm +++ b/blade-ops/blade-develop/src/test/resources/templates/wrapper.java.vm @@ -37,7 +37,7 @@ public class $!{entity}Wrapper extends BaseEntityWrapper<$!{entity}, $!{entity}V @Override public $!{entity}VO entityVO($!{entity} $!{table.entityPath}) { - $!{entity}VO $!{table.entityPath}VO = BeanUtil.copy($!{table.entityPath}, $!{entity}VO.class); + $!{entity}VO $!{table.entityPath}VO = BeanUtil.copyProperties($!{table.entityPath}, $!{entity}VO.class); return $!{table.entityPath}VO; } diff --git a/blade-ops/blade-report/Dockerfile b/blade-ops/blade-report/Dockerfile index a85a791..1723cb9 100644 --- a/blade-ops/blade-report/Dockerfile +++ b/blade-ops/blade-report/Dockerfile @@ -1,6 +1,6 @@ -FROM anapsix/alpine-java:8_server-jre_unlimited +FROM bladex/alpine-java:openjdk17_cn_slim -MAINTAINER smallchill@163.com +MAINTAINER bladejava@qq.com RUN mkdir -p /blade/report @@ -10,6 +10,6 @@ EXPOSE 8108 ADD ./target/blade-report.jar ./app.jar -ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"] +ENTRYPOINT ["java", "--add-opens java.base/java.lang.reflect=ALL-UNNAMED", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"] CMD ["--spring.profiles.active=test"] diff --git a/blade-ops/blade-report/pom.xml b/blade-ops/blade-report/pom.xml index dfe19ae..2020991 100644 --- a/blade-ops/blade-report/pom.xml +++ b/blade-ops/blade-report/pom.xml @@ -5,7 +5,7 @@ org.springblade blade-ops - 3.7.1 + 4.0.0 4.0.0 @@ -59,22 +59,6 @@ org.apache.maven.plugins maven-antrun-plugin - - - package - - run - - - - - - - - - diff --git a/blade-ops/blade-resource/Dockerfile b/blade-ops/blade-resource/Dockerfile index 72ee543..576c8cf 100644 --- a/blade-ops/blade-resource/Dockerfile +++ b/blade-ops/blade-resource/Dockerfile @@ -1,6 +1,6 @@ -FROM anapsix/alpine-java:8_server-jre_unlimited +FROM bladex/alpine-java:openjdk17_cn_slim -MAINTAINER smallchill@163.com +MAINTAINER bladejava@qq.com RUN mkdir -p /blade/resource @@ -10,6 +10,6 @@ EXPOSE 8010 ADD ./target/blade-resource.jar ./app.jar -ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"] +ENTRYPOINT ["java", "--add-opens java.base/java.lang.reflect=ALL-UNNAMED", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"] CMD ["--spring.profiles.active=test"] diff --git a/blade-ops/blade-resource/pom.xml b/blade-ops/blade-resource/pom.xml index c386954..f81caf7 100644 --- a/blade-ops/blade-resource/pom.xml +++ b/blade-ops/blade-resource/pom.xml @@ -5,7 +5,7 @@ blade-ops org.springblade - 3.7.1 + 4.0.0 4.0.0 @@ -68,22 +68,6 @@ org.apache.maven.plugins maven-antrun-plugin - - - package - - run - - - - - - - - - diff --git a/blade-ops/blade-resource/src/main/java/org/springblade/resource/endpoint/OssEndpoint.java b/blade-ops/blade-resource/src/main/java/org/springblade/resource/endpoint/OssEndpoint.java index 7cddd8f..50be4b0 100644 --- a/blade-ops/blade-resource/src/main/java/org/springblade/resource/endpoint/OssEndpoint.java +++ b/blade-ops/blade-resource/src/main/java/org/springblade/resource/endpoint/OssEndpoint.java @@ -15,7 +15,7 @@ */ package org.springblade.resource.endpoint; -import io.swagger.annotations.Api; +import io.swagger.v3.oas.annotations.tags.Tag; import lombok.AllArgsConstructor; import lombok.SneakyThrows; import org.springblade.core.oss.QiniuTemplate; @@ -34,7 +34,7 @@ import org.springframework.web.multipart.MultipartFile; @RestController @AllArgsConstructor @RequestMapping("/oss/endpoint") -@Api(value = "对象存储端点", tags = "对象存储端点") +@Tag(name = "对象存储端点", description = "对象存储端点") public class OssEndpoint { private QiniuTemplate qiniuTemplate; diff --git a/blade-ops/blade-seata-order/pom.xml b/blade-ops/blade-seata-order/pom.xml index 15d58ce..9642750 100644 --- a/blade-ops/blade-seata-order/pom.xml +++ b/blade-ops/blade-seata-order/pom.xml @@ -5,7 +5,7 @@ blade-ops org.springblade - 3.7.1 + 4.0.0 4.0.0 @@ -45,22 +45,6 @@ org.apache.maven.plugins maven-antrun-plugin - - - package - - run - - - - - - - - - diff --git a/blade-ops/blade-seata-order/src/main/java/org/springblade/seata/order/entity/Order.java b/blade-ops/blade-seata-order/src/main/java/org/springblade/seata/order/entity/Order.java index 8ccac26..48ac397 100644 --- a/blade-ops/blade-seata-order/src/main/java/org/springblade/seata/order/entity/Order.java +++ b/blade-ops/blade-seata-order/src/main/java/org/springblade/seata/order/entity/Order.java @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.experimental.Accessors; +import java.io.Serial; import java.io.Serializable; import java.math.BigDecimal; @@ -19,6 +20,7 @@ import java.math.BigDecimal; @TableName("tb_order") public class Order implements Serializable { + @Serial private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.AUTO) diff --git a/blade-ops/blade-seata-storage/pom.xml b/blade-ops/blade-seata-storage/pom.xml index 23fd993..4ed5602 100644 --- a/blade-ops/blade-seata-storage/pom.xml +++ b/blade-ops/blade-seata-storage/pom.xml @@ -5,7 +5,7 @@ blade-ops org.springblade - 3.7.1 + 4.0.0 4.0.0 @@ -45,22 +45,6 @@ org.apache.maven.plugins maven-antrun-plugin - - - package - - run - - - - - - - - - diff --git a/blade-ops/blade-seata-storage/src/main/java/org/springblade/seata/storage/entity/Storage.java b/blade-ops/blade-seata-storage/src/main/java/org/springblade/seata/storage/entity/Storage.java index 73e4935..b1e80ac 100644 --- a/blade-ops/blade-seata-storage/src/main/java/org/springblade/seata/storage/entity/Storage.java +++ b/blade-ops/blade-seata-storage/src/main/java/org/springblade/seata/storage/entity/Storage.java @@ -4,6 +4,7 @@ package org.springblade.seata.storage.entity; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; +import java.io.Serial; import java.io.Serializable; /** @@ -15,6 +16,7 @@ import java.io.Serializable; @TableName("tb_storage") public class Storage implements Serializable { + @Serial private static final long serialVersionUID = 1L; private Long id; diff --git a/blade-ops/blade-swagger/Dockerfile b/blade-ops/blade-swagger/Dockerfile deleted file mode 100644 index 9692c6d..0000000 --- a/blade-ops/blade-swagger/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM anapsix/alpine-java:8_server-jre_unlimited - -MAINTAINER smallchill@163.com - -RUN mkdir -p /blade/swagger - -WORKDIR /blade/swagger - -EXPOSE 18000 - -ADD ./target/blade-swagger.jar ./app.jar - -ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"] - -CMD ["--spring.profiles.active=test"] diff --git a/blade-ops/blade-swagger/pom.xml b/blade-ops/blade-swagger/pom.xml deleted file mode 100644 index 6ade847..0000000 --- a/blade-ops/blade-swagger/pom.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - blade-ops - org.springblade - 3.7.1 - - 4.0.0 - - blade-swagger - ${project.artifactId} - ${blade.project.version} - jar - - - - org.springblade - blade-core-launch - ${blade.tool.version} - - - com.github.xiaoymin - knife4j-aggregation-spring-boot-starter - - - - - - - - - com.spotify - docker-maven-plugin - ${docker.plugin.version} - - ${docker.registry.url}/blade/${project.artifactId}:${project.version} - ${project.basedir} - ${docker.registry.host} - - - / - ${project.build.directory} - ${project.build.finalName}.jar - - - ${docker.registry.url} - ${docker.registry.url} - true - - - - org.apache.maven.plugins - maven-antrun-plugin - - - package - - run - - - - - - - - - - - - - - - diff --git a/blade-ops/blade-swagger/src/main/java/org/springblade/swagger/SwaggerApplication.java b/blade-ops/blade-swagger/src/main/java/org/springblade/swagger/SwaggerApplication.java deleted file mode 100644 index 4dd1c7d..0000000 --- a/blade-ops/blade-swagger/src/main/java/org/springblade/swagger/SwaggerApplication.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). - *

- * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - *

- * http://www.apache.org/licenses/LICENSE-2.0 - *

- * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springblade.swagger; - -import org.springblade.core.launch.BladeApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * swagger聚合启动器 - * - * @author Chill - */ -@SpringBootApplication -public class SwaggerApplication { - - public static void main(String[] args) { - BladeApplication.run("blade-swagger", SwaggerApplication.class, args); - } - -} diff --git a/blade-ops/blade-swagger/src/main/resources/application.yml b/blade-ops/blade-swagger/src/main/resources/application.yml deleted file mode 100644 index 78296a6..0000000 --- a/blade-ops/blade-swagger/src/main/resources/application.yml +++ /dev/null @@ -1,16 +0,0 @@ -server: - port: 18000 -knife4j: - enableAggregation: true - cloud: - enable: true - routes: - - name: 授权模块 - uri: 127.0.0.1 - location: /blade-auth/v2/api-docs - - name: 工作台模块 - uri: 127.0.0.1 - location: /blade-desk/v2/api-docs - - name: 系统模块 - uri: 127.0.0.1 - location: /blade-system/v2/api-docs diff --git a/blade-ops/blade-swagger/src/main/resources/banner.txt b/blade-ops/blade-swagger/src/main/resources/banner.txt deleted file mode 100644 index cbd0280..0000000 --- a/blade-ops/blade-swagger/src/main/resources/banner.txt +++ /dev/null @@ -1,10 +0,0 @@ -${AnsiColor.BRIGHT_CYAN} _____ _ ${AnsiColor.BLUE} ______ _ _ -${AnsiColor.BRIGHT_CYAN}/ ___| (_) ${AnsiColor.BLUE} | ___ \| | | | -${AnsiColor.BRIGHT_CYAN}\ `--. _ __ _ __ _ _ __ __ _ ${AnsiColor.BLUE} | |_/ /| | __ _ __| | ___ -${AnsiColor.BRIGHT_CYAN} `--. \| '_ \ | '__|| || '_ \ / _` | ${AnsiColor.BLUE} | ___ \| | / _` | / _` | / _ \ -${AnsiColor.BRIGHT_CYAN}/\__/ /| |_) || | | || | | || (_| | ${AnsiColor.BLUE} | |_/ /| || (_| || (_| || __/ -${AnsiColor.BRIGHT_CYAN}\____/ | .__/ |_| |_||_| |_| \__, | ${AnsiColor.BLUE} \____/ |_| \__,_| \__,_| \___| -${AnsiColor.BRIGHT_CYAN} | | __/ | -${AnsiColor.BRIGHT_CYAN} |_| |___/ - -${AnsiColor.BLUE}:: SpringBlade :: ${spring.application.name}:${AnsiColor.RED}${blade.env}${AnsiColor.BLUE} :: Running SpringBoot ${spring-boot.version} :: ${AnsiColor.BRIGHT_BLACK} diff --git a/blade-ops/pom.xml b/blade-ops/pom.xml index b8b3d08..c1dac49 100644 --- a/blade-ops/pom.xml +++ b/blade-ops/pom.xml @@ -5,13 +5,13 @@ SpringBlade org.springblade - 3.7.1 + 4.0.0 4.0.0 blade-ops ${project.artifactId} - 3.7.1 + 4.0.0 pom blade-admin @@ -20,7 +20,6 @@ blade-resource blade-seata-order blade-seata-storage - blade-swagger diff --git a/blade-service-api/blade-demo-api/pom.xml b/blade-service-api/blade-demo-api/pom.xml index b4073a3..611f074 100644 --- a/blade-service-api/blade-demo-api/pom.xml +++ b/blade-service-api/blade-demo-api/pom.xml @@ -5,7 +5,7 @@ blade-service-api org.springblade - 3.7.1 + 4.0.0 4.0.0 diff --git a/blade-service-api/blade-demo-api/src/main/java/com/example/demo/entity/Notice.java b/blade-service-api/blade-demo-api/src/main/java/com/example/demo/entity/Notice.java index b158dfe..ba181da 100644 --- a/blade-service-api/blade-demo-api/src/main/java/com/example/demo/entity/Notice.java +++ b/blade-service-api/blade-demo-api/src/main/java/com/example/demo/entity/Notice.java @@ -20,11 +20,12 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.mp.base.BaseEntity; +import java.io.Serial; import java.util.Date; /** @@ -37,12 +38,13 @@ import java.util.Date; @EqualsAndHashCode(callSuper = true) public class Notice extends BaseEntity { + @Serial private static final long serialVersionUID = 1L; /** * 主键id */ - @ApiModelProperty(value = "主键") + @Schema(description = "主键") @TableId(value = "id", type = IdType.ASSIGN_ID) @JsonSerialize(using = ToStringSerializer.class) private Long id; @@ -50,25 +52,25 @@ public class Notice extends BaseEntity { /** * 标题 */ - @ApiModelProperty(value = "标题") + @Schema(description = "标题") private String title; /** * 通知类型 */ - @ApiModelProperty(value = "通知类型") + @Schema(description = "通知类型") private Integer category; /** * 发布日期 */ - @ApiModelProperty(value = "发布日期") + @Schema(description = "发布日期") private Date releaseTime; /** * 内容 */ - @ApiModelProperty(value = "内容") + @Schema(description = "内容") private String content; diff --git a/blade-service-api/blade-demo-api/src/main/java/com/example/demo/vo/NoticeVO.java b/blade-service-api/blade-demo-api/src/main/java/com/example/demo/vo/NoticeVO.java index dfb0a66..f8a200e 100644 --- a/blade-service-api/blade-demo-api/src/main/java/com/example/demo/vo/NoticeVO.java +++ b/blade-service-api/blade-demo-api/src/main/java/com/example/demo/vo/NoticeVO.java @@ -1,6 +1,6 @@ package com.example.demo.vo; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import com.example.demo.entity.Notice; @@ -14,7 +14,7 @@ import com.example.demo.entity.Notice; @EqualsAndHashCode(callSuper = true) public class NoticeVO extends Notice { - @ApiModelProperty(value = "通知类型名") + @Schema(description = "通知类型名") private String categoryName; } diff --git a/blade-service-api/blade-desk-api/pom.xml b/blade-service-api/blade-desk-api/pom.xml index bae6d86..fe424f6 100644 --- a/blade-service-api/blade-desk-api/pom.xml +++ b/blade-service-api/blade-desk-api/pom.xml @@ -5,7 +5,7 @@ blade-service-api org.springblade - 3.7.1 + 4.0.0 4.0.0 diff --git a/blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/entity/Notice.java b/blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/entity/Notice.java index ee07c33..fcab0ab 100644 --- a/blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/entity/Notice.java +++ b/blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/entity/Notice.java @@ -20,11 +20,12 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.mp.base.BaseEntity; +import java.io.Serial; import java.util.Date; /** @@ -37,12 +38,13 @@ import java.util.Date; @TableName("blade_notice") public class Notice extends BaseEntity { + @Serial private static final long serialVersionUID = 1L; /** * 主键id */ - @ApiModelProperty(value = "主键") + @Schema(description = "主键") @TableId(value = "id", type = IdType.ASSIGN_ID) @JsonSerialize(using = ToStringSerializer.class) private Long id; @@ -50,25 +52,25 @@ public class Notice extends BaseEntity { /** * 标题 */ - @ApiModelProperty(value = "标题") + @Schema(description = "标题") private String title; /** * 通知类型 */ - @ApiModelProperty(value = "通知类型") + @Schema(description = "通知类型") private Integer category; /** * 发布日期 */ - @ApiModelProperty(value = "发布日期") + @Schema(description = "发布日期") private Date releaseTime; /** * 内容 */ - @ApiModelProperty(value = "内容") + @Schema(description = "内容") private String content; diff --git a/blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/vo/NoticeVO.java b/blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/vo/NoticeVO.java index 49e2374..958ca6f 100644 --- a/blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/vo/NoticeVO.java +++ b/blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/vo/NoticeVO.java @@ -1,6 +1,6 @@ package org.springblade.desk.vo; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.desk.entity.Notice; @@ -14,7 +14,7 @@ import org.springblade.desk.entity.Notice; @EqualsAndHashCode(callSuper = true) public class NoticeVO extends Notice { - @ApiModelProperty(value = "通知类型名") + @Schema(description = "通知类型名") private String categoryName; } diff --git a/blade-service-api/blade-dict-api/pom.xml b/blade-service-api/blade-dict-api/pom.xml index 43c48d5..61245fb 100644 --- a/blade-service-api/blade-dict-api/pom.xml +++ b/blade-service-api/blade-dict-api/pom.xml @@ -5,7 +5,7 @@ blade-service-api org.springblade - 3.7.1 + 4.0.0 4.0.0 diff --git a/blade-service-api/blade-dict-api/src/main/java/org/springblade/system/dto/DictDTO.java b/blade-service-api/blade-dict-api/src/main/java/org/springblade/system/dto/DictDTO.java index cc09a0d..46186f9 100644 --- a/blade-service-api/blade-dict-api/src/main/java/org/springblade/system/dto/DictDTO.java +++ b/blade-service-api/blade-dict-api/src/main/java/org/springblade/system/dto/DictDTO.java @@ -19,6 +19,8 @@ import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.system.entity.Dict; +import java.io.Serial; + /** * 数据传输对象实体类 * @@ -28,6 +30,7 @@ import org.springblade.system.entity.Dict; @Data @EqualsAndHashCode(callSuper = true) public class DictDTO extends Dict { + @Serial private static final long serialVersionUID = 1L; } diff --git a/blade-service-api/blade-dict-api/src/main/java/org/springblade/system/entity/Dict.java b/blade-service-api/blade-dict-api/src/main/java/org/springblade/system/entity/Dict.java index ea05ce2..cf114ce 100644 --- a/blade-service-api/blade-dict-api/src/main/java/org/springblade/system/entity/Dict.java +++ b/blade-service-api/blade-dict-api/src/main/java/org/springblade/system/entity/Dict.java @@ -21,10 +21,10 @@ import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; +import java.io.Serial; import java.io.Serializable; /** @@ -35,15 +35,16 @@ import java.io.Serializable; */ @Data @TableName("blade_dict") -@ApiModel(value = "Dict对象", description = "Dict对象") +@Schema(description = "Dict对象") public class Dict implements Serializable { + @Serial private static final long serialVersionUID = 1L; /** * 主键 */ - @ApiModelProperty(value = "主键") + @Schema(description = "主键") @TableId(value = "id", type = IdType.ASSIGN_ID) @JsonSerialize(using = ToStringSerializer.class) private Long id; @@ -51,45 +52,45 @@ public class Dict implements Serializable { /** * 父主键 */ - @ApiModelProperty(value = "父主键") + @Schema(description = "父主键") @JsonSerialize(using = ToStringSerializer.class) private Long parentId; /** * 字典码 */ - @ApiModelProperty(value = "字典码") + @Schema(description = "字典码") private String code; /** * 字典值 */ - @ApiModelProperty(value = "字典值") + @Schema(description = "字典值") private Integer dictKey; /** * 字典名称 */ - @ApiModelProperty(value = "字典名称") + @Schema(description = "字典名称") private String dictValue; /** * 排序 */ - @ApiModelProperty(value = "排序") + @Schema(description = "排序") private Integer sort; /** * 字典备注 */ - @ApiModelProperty(value = "字典备注") + @Schema(description = "字典备注") private String remark; /** * 是否已删除 */ @TableLogic - @ApiModelProperty(value = "是否已删除") + @Schema(description = "是否已删除") private Integer isDeleted; diff --git a/blade-service-api/blade-dict-api/src/main/java/org/springblade/system/vo/DictVO.java b/blade-service-api/blade-dict-api/src/main/java/org/springblade/system/vo/DictVO.java index 8b59f44..69f0b1b 100644 --- a/blade-service-api/blade-dict-api/src/main/java/org/springblade/system/vo/DictVO.java +++ b/blade-service-api/blade-dict-api/src/main/java/org/springblade/system/vo/DictVO.java @@ -18,12 +18,13 @@ package org.springblade.system.vo; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.tool.node.INode; import org.springblade.system.entity.Dict; +import java.io.Serial; import java.util.ArrayList; import java.util.List; @@ -35,8 +36,9 @@ import java.util.List; */ @Data @EqualsAndHashCode(callSuper = true) -@ApiModel(value = "DictVO对象", description = "DictVO对象") +@Schema(description = "DictVO对象") public class DictVO extends Dict implements INode { + @Serial private static final long serialVersionUID = 1L; /** * 主键ID diff --git a/blade-service-api/blade-scope-api/pom.xml b/blade-service-api/blade-scope-api/pom.xml index b552148..cdfba6f 100644 --- a/blade-service-api/blade-scope-api/pom.xml +++ b/blade-service-api/blade-scope-api/pom.xml @@ -5,7 +5,7 @@ blade-service-api org.springblade - 3.7.1 + 4.0.0 4.0.0 diff --git a/blade-service-api/blade-system-api/pom.xml b/blade-service-api/blade-system-api/pom.xml index ed04071..eea1c81 100644 --- a/blade-service-api/blade-system-api/pom.xml +++ b/blade-service-api/blade-system-api/pom.xml @@ -5,7 +5,7 @@ blade-service-api org.springblade - 3.7.1 + 4.0.0 4.0.0 diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/dto/DeptDTO.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/dto/DeptDTO.java index 70ca428..6236fd2 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/dto/DeptDTO.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/dto/DeptDTO.java @@ -19,6 +19,8 @@ import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.system.entity.Dept; +import java.io.Serial; + /** * 数据传输对象实体类 * @@ -27,6 +29,7 @@ import org.springblade.system.entity.Dept; @Data @EqualsAndHashCode(callSuper = true) public class DeptDTO extends Dept { + @Serial private static final long serialVersionUID = 1L; } diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/dto/MenuDTO.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/dto/MenuDTO.java index 80513ce..9e3f30d 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/dto/MenuDTO.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/dto/MenuDTO.java @@ -17,6 +17,7 @@ package org.springblade.system.dto; import lombok.Data; +import java.io.Serial; import java.io.Serializable; /** @@ -26,6 +27,7 @@ import java.io.Serializable; */ @Data public class MenuDTO implements Serializable { + @Serial private static final long serialVersionUID = 1L; private String alias; private String path; diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/dto/ParamDTO.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/dto/ParamDTO.java index c5b9631..0be65d9 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/dto/ParamDTO.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/dto/ParamDTO.java @@ -19,6 +19,8 @@ import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.system.entity.Param; +import java.io.Serial; + /** * 数据传输对象实体类 * @@ -27,6 +29,7 @@ import org.springblade.system.entity.Param; @Data @EqualsAndHashCode(callSuper = true) public class ParamDTO extends Param { + @Serial private static final long serialVersionUID = 1L; } diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/dto/RoleDTO.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/dto/RoleDTO.java index c1c8dc1..cce0548 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/dto/RoleDTO.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/dto/RoleDTO.java @@ -19,6 +19,8 @@ import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.system.entity.Role; +import java.io.Serial; + /** * 数据传输对象实体类 * @@ -27,6 +29,7 @@ import org.springblade.system.entity.Role; @Data @EqualsAndHashCode(callSuper = true) public class RoleDTO extends Role { + @Serial private static final long serialVersionUID = 1L; } diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/dto/RoleMenuDTO.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/dto/RoleMenuDTO.java index 2d7e899..1ba94ab 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/dto/RoleMenuDTO.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/dto/RoleMenuDTO.java @@ -19,6 +19,8 @@ import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.system.entity.RoleMenu; +import java.io.Serial; + /** * 数据传输对象实体类 * @@ -27,6 +29,7 @@ import org.springblade.system.entity.RoleMenu; @Data @EqualsAndHashCode(callSuper = true) public class RoleMenuDTO extends RoleMenu { + @Serial private static final long serialVersionUID = 1L; } diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/AuthClient.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/AuthClient.java index 0d2cee1..d55df9b 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/AuthClient.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/AuthClient.java @@ -20,12 +20,13 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.mp.base.BaseEntity; +import java.io.Serial; + /** * 实体类 * @@ -35,15 +36,16 @@ import org.springblade.core.mp.base.BaseEntity; @Data @TableName("blade_client") @EqualsAndHashCode(callSuper = true) -@ApiModel(value = "Client对象", description = "Client对象") +@Schema(description = "Client对象") public class AuthClient extends BaseEntity { + @Serial private static final long serialVersionUID = 1L; /** * 主键id */ - @ApiModelProperty(value = "主键") + @Schema(description = "主键") @TableId(value = "id", type = IdType.ASSIGN_ID) @JsonSerialize(using = ToStringSerializer.class) private Long id; @@ -51,57 +53,57 @@ public class AuthClient extends BaseEntity { /** * 客户端id */ - @ApiModelProperty(value = "客户端id") + @Schema(description = "客户端id") private String clientId; /** * 客户端密钥 */ - @ApiModelProperty(value = "客户端密钥") + @Schema(description = "客户端密钥") private String clientSecret; /** * 资源集合 */ - @ApiModelProperty(value = "资源集合") + @Schema(description = "资源集合") private String resourceIds; /** * 授权范围 */ - @ApiModelProperty(value = "授权范围") + @Schema(description = "授权范围") private String scope; /** * 授权类型 */ - @ApiModelProperty(value = "授权类型") + @Schema(description = "授权类型") private String authorizedGrantTypes; /** * 回调地址 */ - @ApiModelProperty(value = "回调地址") + @Schema(description = "回调地址") private String webServerRedirectUri; /** * 权限 */ - @ApiModelProperty(value = "权限") + @Schema(description = "权限") private String authorities; /** * 令牌过期秒数 */ - @ApiModelProperty(value = "令牌过期秒数") + @Schema(description = "令牌过期秒数") private Integer accessTokenValidity; /** * 刷新令牌过期秒数 */ - @ApiModelProperty(value = "刷新令牌过期秒数") + @Schema(description = "刷新令牌过期秒数") private Integer refreshTokenValidity; /** * 附加说明 */ - @ApiModelProperty(value = "附加说明") + @Schema(description = "附加说明") private String additionalInformation; /** * 自动授权 */ - @ApiModelProperty(value = "自动授权") + @Schema(description = "自动授权") private String autoapprove; diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/DataScope.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/DataScope.java index 486763d..2567753 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/DataScope.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/DataScope.java @@ -20,12 +20,13 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.mp.base.BaseEntity; +import java.io.Serial; + /** * 实体类 * @@ -34,15 +35,16 @@ import org.springblade.core.mp.base.BaseEntity; @Data @TableName("blade_scope_data") @EqualsAndHashCode(callSuper = true) -@ApiModel(value = "DataScope对象", description = "DataScope对象") +@Schema(description = "DataScope对象") public class DataScope extends BaseEntity { + @Serial private static final long serialVersionUID = 1L; /** * 主键 */ - @ApiModelProperty(value = "主键") + @Schema(description = "主键") @TableId(value = "id", type = IdType.ASSIGN_ID) @JsonSerialize(using = ToStringSerializer.class) private Long id; @@ -50,47 +52,47 @@ public class DataScope extends BaseEntity { /** * 菜单主键 */ - @ApiModelProperty(value = "菜单主键") + @Schema(description = "菜单主键") private Long menuId; /** * 资源编号 */ - @ApiModelProperty(value = "资源编号") + @Schema(description = "资源编号") private String resourceCode; /** * 数据权限名称 */ - @ApiModelProperty(value = "数据权限名称") + @Schema(description = "数据权限名称") private String scopeName; /** * 数据权限可见字段 */ - @ApiModelProperty(value = "数据权限可见字段") + @Schema(description = "数据权限可见字段") private String scopeField; /** * 数据权限类名 */ - @ApiModelProperty(value = "数据权限类名") + @Schema(description = "数据权限类名") private String scopeClass; /** * 数据权限字段 */ - @ApiModelProperty(value = "数据权限字段") + @Schema(description = "数据权限字段") private String scopeColumn; /** * 数据权限类型 */ - @ApiModelProperty(value = "数据权限类型") + @Schema(description = "数据权限类型") private Integer scopeType; /** * 数据权限值域 */ - @ApiModelProperty(value = "数据权限值域") + @Schema(description = "数据权限值域") private String scopeValue; /** * 数据权限备注 */ - @ApiModelProperty(value = "数据权限备注") + @Schema(description = "数据权限备注") private String remark; diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Dept.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Dept.java index 367daec..cf27d49 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Dept.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Dept.java @@ -21,10 +21,10 @@ import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; +import java.io.Serial; import java.io.Serializable; /** @@ -34,15 +34,16 @@ import java.io.Serializable; */ @Data @TableName("blade_dept") -@ApiModel(value = "Dept对象", description = "Dept对象") +@Schema(description = "Dept对象") public class Dept implements Serializable { + @Serial private static final long serialVersionUID = 1L; /** * 主键 */ - @ApiModelProperty(value = "主键") + @Schema(description = "主键") @TableId(value = "id", type = IdType.ASSIGN_ID) @JsonSerialize(using = ToStringSerializer.class) private Long id; @@ -50,51 +51,51 @@ public class Dept implements Serializable { /** * 租户ID */ - @ApiModelProperty(value = "租户ID") + @Schema(description = "租户ID") private String tenantId; /** * 父主键 */ - @ApiModelProperty(value = "父主键") + @Schema(description = "父主键") @JsonSerialize(using = ToStringSerializer.class) private Long parentId; /** * 祖级机构主键 */ - @ApiModelProperty(value = "祖级机构主键") + @Schema(description = "祖级机构主键") private String ancestors; /** * 部门名 */ - @ApiModelProperty(value = "部门名") + @Schema(description = "部门名") private String deptName; /** * 部门全称 */ - @ApiModelProperty(value = "部门全称") + @Schema(description = "部门全称") private String fullName; /** * 排序 */ - @ApiModelProperty(value = "排序") + @Schema(description = "排序") private Integer sort; /** * 备注 */ - @ApiModelProperty(value = "备注") + @Schema(description = "备注") private String remark; /** * 是否已删除 */ @TableLogic - @ApiModelProperty(value = "是否已删除") + @Schema(description = "是否已删除") private Integer isDeleted; diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Menu.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Menu.java index f044897..89d54a4 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Menu.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Menu.java @@ -21,12 +21,13 @@ import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springblade.core.tool.utils.Func; +import java.io.Serial; import java.io.Serializable; +import java.util.Objects; /** * 实体类 @@ -35,15 +36,16 @@ import java.io.Serializable; */ @Data @TableName("blade_menu") -@ApiModel(value = "Menu对象", description = "Menu对象") +@Schema(description = "Menu对象") public class Menu implements Serializable { + @Serial private static final long serialVersionUID = 1L; /** * 主键 */ - @ApiModelProperty(value = "主键") + @Schema(description = "主键") @TableId(value = "id", type = IdType.ASSIGN_ID) @JsonSerialize(using = ToStringSerializer.class) private Long id; @@ -51,75 +53,75 @@ public class Menu implements Serializable { /** * 菜单父主键 */ - @ApiModelProperty(value = "父主键") + @Schema(description = "父主键") @JsonSerialize(using = ToStringSerializer.class) private Long parentId; /** * 菜单编号 */ - @ApiModelProperty(value = "菜单编号") + @Schema(description = "菜单编号") private String code; /** * 菜单名称 */ - @ApiModelProperty(value = "菜单名称") + @Schema(description = "菜单名称") private String name; /** * 菜单别名 */ - @ApiModelProperty(value = "菜单别名") + @Schema(description = "菜单别名") private String alias; /** * 请求地址 */ - @ApiModelProperty(value = "请求地址") + @Schema(description = "请求地址") private String path; /** * 菜单资源 */ - @ApiModelProperty(value = "菜单资源") + @Schema(description = "菜单资源") private String source; /** * 排序 */ - @ApiModelProperty(value = "排序") + @Schema(description = "排序") private Integer sort; /** * 菜单类型 */ - @ApiModelProperty(value = "菜单类型") + @Schema(description = "菜单类型") private Integer category; /** * 操作按钮类型 */ - @ApiModelProperty(value = "操作按钮类型") + @Schema(description = "操作按钮类型") private Integer action; /** * 是否打开新页面 */ - @ApiModelProperty(value = "是否打开新页面") + @Schema(description = "是否打开新页面") private Integer isOpen; /** * 备注 */ - @ApiModelProperty(value = "备注") + @Schema(description = "备注") private String remark; /** * 是否已删除 */ @TableLogic - @ApiModelProperty(value = "是否已删除") + @Schema(description = "是否已删除") private Integer isDeleted; @@ -132,10 +134,12 @@ public class Menu implements Serializable { return false; } Menu other = (Menu) obj; - if (Func.equals(this.getId(), other.getId())) { - return true; - } - return false; + return Func.equals(this.getId(), other.getId()); + } + + @Override + public int hashCode() { + return Objects.hash(id, parentId, code); } } diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Param.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Param.java index 18cd575..57c64e1 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Param.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Param.java @@ -20,12 +20,13 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.mp.base.BaseEntity; +import java.io.Serial; + /** * 实体类 * @@ -34,15 +35,16 @@ import org.springblade.core.mp.base.BaseEntity; @Data @TableName("blade_param") @EqualsAndHashCode(callSuper = true) -@ApiModel(value = "Param对象", description = "Param对象") +@Schema(description = "Param对象") public class Param extends BaseEntity { + @Serial private static final long serialVersionUID = 1L; /** * 主键id */ - @ApiModelProperty(value = "主键") + @Schema(description = "主键") @TableId(value = "id", type = IdType.ASSIGN_ID) @JsonSerialize(using = ToStringSerializer.class) private Long id; @@ -50,25 +52,25 @@ public class Param extends BaseEntity { /** * 参数名 */ - @ApiModelProperty(value = "参数名") + @Schema(description = "参数名") private String paramName; /** * 参数键 */ - @ApiModelProperty(value = "参数键") + @Schema(description = "参数键") private String paramKey; /** * 参数值 */ - @ApiModelProperty(value = "参数值") + @Schema(description = "参数值") private String paramValue; /** * 备注 */ - @ApiModelProperty(value = "备注") + @Schema(description = "备注") private String remark; diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Post.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Post.java index 782dd94..5519b23 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Post.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Post.java @@ -20,12 +20,13 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.mp.base.TenantEntity; +import java.io.Serial; + /** * 岗位表实体类 * @@ -34,15 +35,16 @@ import org.springblade.core.mp.base.TenantEntity; @Data @TableName("blade_post") @EqualsAndHashCode(callSuper = true) -@ApiModel(value = "Post对象", description = "岗位表") +@Schema(description = "Post对象") public class Post extends TenantEntity { + @Serial private static final long serialVersionUID = 1L; /** * 主键id */ - @ApiModelProperty(value = "主键") + @Schema(description = "主键") @TableId(value = "id", type = IdType.ASSIGN_ID) @JsonSerialize(using = ToStringSerializer.class) private Long id; @@ -50,27 +52,27 @@ public class Post extends TenantEntity { /** * 类型 */ - @ApiModelProperty(value = "类型") + @Schema(description = "类型") private Integer category; /** * 岗位编号 */ - @ApiModelProperty(value = "岗位编号") + @Schema(description = "岗位编号") private String postCode; /** * 岗位名称 */ - @ApiModelProperty(value = "岗位名称") + @Schema(description = "岗位名称") private String postName; /** * 岗位排序 */ - @ApiModelProperty(value = "岗位排序") + @Schema(description = "岗位排序") private Integer sort; /** * 岗位描述 */ - @ApiModelProperty(value = "岗位描述") + @Schema(description = "岗位描述") private String remark; diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Region.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Region.java index 2447890..956b754 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Region.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Region.java @@ -18,10 +18,10 @@ package org.springblade.system.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; +import java.io.Serial; import java.io.Serializable; /** @@ -31,96 +31,97 @@ import java.io.Serializable; */ @Data @TableName("blade_region") -@ApiModel(value = "Region对象", description = "行政区划表") +@Schema(description = "Region对象") public class Region implements Serializable { + @Serial private static final long serialVersionUID = 1L; /** * 区划编号 */ @TableId(value = "code", type = IdType.INPUT) - @ApiModelProperty(value = "区划编号") + @Schema(description = "区划编号") private String code; /** * 父区划编号 */ - @ApiModelProperty(value = "父区划编号") + @Schema(description = "父区划编号") private String parentCode; /** * 祖区划编号 */ - @ApiModelProperty(value = "祖区划编号") + @Schema(description = "祖区划编号") private String ancestors; /** * 区划名称 */ - @ApiModelProperty(value = "区划名称") + @Schema(description = "区划名称") private String name; /** * 省级区划编号 */ - @ApiModelProperty(value = "省级区划编号") + @Schema(description = "省级区划编号") private String provinceCode; /** * 省级名称 */ - @ApiModelProperty(value = "省级名称") + @Schema(description = "省级名称") private String provinceName; /** * 市级区划编号 */ - @ApiModelProperty(value = "市级区划编号") + @Schema(description = "市级区划编号") private String cityCode; /** * 市级名称 */ - @ApiModelProperty(value = "市级名称") + @Schema(description = "市级名称") private String cityName; /** * 区级区划编号 */ - @ApiModelProperty(value = "区级区划编号") + @Schema(description = "区级区划编号") private String districtCode; /** * 区级名称 */ - @ApiModelProperty(value = "区级名称") + @Schema(description = "区级名称") private String districtName; /** * 镇级区划编号 */ - @ApiModelProperty(value = "镇级区划编号") + @Schema(description = "镇级区划编号") private String townCode; /** * 镇级名称 */ - @ApiModelProperty(value = "镇级名称") + @Schema(description = "镇级名称") private String townName; /** * 村级区划编号 */ - @ApiModelProperty(value = "村级区划编号") + @Schema(description = "村级区划编号") private String villageCode; /** * 村级名称 */ - @ApiModelProperty(value = "村级名称") + @Schema(description = "村级名称") private String villageName; /** * 层级 */ - @ApiModelProperty(value = "层级") + @Schema(description = "层级") private Integer level; /** * 排序 */ - @ApiModelProperty(value = "排序") + @Schema(description = "排序") private Integer sort; /** * 备注 */ - @ApiModelProperty(value = "备注") + @Schema(description = "备注") private String remark; diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Role.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Role.java index d83cd7d..8b4c54a 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Role.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Role.java @@ -21,10 +21,10 @@ import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; +import java.io.Serial; import java.io.Serializable; /** @@ -34,15 +34,16 @@ import java.io.Serializable; */ @Data @TableName("blade_role") -@ApiModel(value = "Role对象", description = "Role对象") +@Schema(description = "Role对象") public class Role implements Serializable { + @Serial private static final long serialVersionUID = 1L; /** * 主键 */ - @ApiModelProperty(value = "主键") + @Schema(description = "主键") @TableId(value = "id", type = IdType.ASSIGN_ID) @JsonSerialize(using = ToStringSerializer.class) private Long id; @@ -50,39 +51,39 @@ public class Role implements Serializable { /** * 租户ID */ - @ApiModelProperty(value = "租户ID") + @Schema(description = "租户ID") private String tenantId; /** * 父主键 */ - @ApiModelProperty(value = "父主键") + @Schema(description = "父主键") @JsonSerialize(using = ToStringSerializer.class) private Long parentId; /** * 角色名 */ - @ApiModelProperty(value = "角色名") + @Schema(description = "角色名") private String roleName; /** * 排序 */ - @ApiModelProperty(value = "排序") + @Schema(description = "排序") private Integer sort; /** * 角色别名 */ - @ApiModelProperty(value = "角色别名") + @Schema(description = "角色别名") private String roleAlias; /** * 是否已删除 */ @TableLogic - @ApiModelProperty(value = "是否已删除") + @Schema(description = "是否已删除") private Integer isDeleted; diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/RoleMenu.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/RoleMenu.java index 66d9eae..5fadb60 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/RoleMenu.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/RoleMenu.java @@ -20,10 +20,10 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; +import java.io.Serial; import java.io.Serializable; /** @@ -33,15 +33,16 @@ import java.io.Serializable; */ @Data @TableName("blade_role_menu") -@ApiModel(value = "RoleMenu对象", description = "RoleMenu对象") +@Schema(description = "RoleMenu对象") public class RoleMenu implements Serializable { + @Serial private static final long serialVersionUID = 1L; /** * 主键 */ - @ApiModelProperty(value = "主键") + @Schema(description = "主键") @TableId(value = "id", type = IdType.ASSIGN_ID) @JsonSerialize(using = ToStringSerializer.class) private Long id; @@ -49,14 +50,14 @@ public class RoleMenu implements Serializable { /** * 菜单id */ - @ApiModelProperty(value = "菜单id") + @Schema(description = "菜单id") @JsonSerialize(using = ToStringSerializer.class) private Long menuId; /** * 角色id */ - @ApiModelProperty(value = "角色id") + @Schema(description = "角色id") @JsonSerialize(using = ToStringSerializer.class) private Long roleId; diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/RoleScope.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/RoleScope.java index 756a015..8ee0121 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/RoleScope.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/RoleScope.java @@ -20,10 +20,10 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; +import java.io.Serial; import java.io.Serializable; /** @@ -33,16 +33,17 @@ import java.io.Serializable; */ @Data @TableName("blade_role_scope") -@ApiModel(value = "RoleScope对象", description = "RoleScope对象") +@Schema(description = "RoleScope对象") public class RoleScope implements Serializable { + @Serial private static final long serialVersionUID = 1L; /** * 主键 */ @JsonSerialize(using = ToStringSerializer.class) - @ApiModelProperty(value = "主键") + @Schema(description = "主键") @TableId(value = "id", type = IdType.ASSIGN_ID) private Long id; @@ -50,14 +51,14 @@ public class RoleScope implements Serializable { * 权限id */ @JsonSerialize(using = ToStringSerializer.class) - @ApiModelProperty(value = "权限id") + @Schema(description = "权限id") private Long scopeId; /** * 角色id */ @JsonSerialize(using = ToStringSerializer.class) - @ApiModelProperty(value = "角色id") + @Schema(description = "角色id") private Long roleId; diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Tenant.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Tenant.java index a9b6915..ae9ab0c 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Tenant.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Tenant.java @@ -20,12 +20,13 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.mp.base.BaseEntity; +import java.io.Serial; + /** * 实体类 * @@ -34,15 +35,16 @@ import org.springblade.core.mp.base.BaseEntity; @Data @TableName("blade_tenant") @EqualsAndHashCode(callSuper = true) -@ApiModel(value = "Tenant对象", description = "Tenant对象") +@Schema(description = "Tenant对象") public class Tenant extends BaseEntity { + @Serial private static final long serialVersionUID = 1L; /** * 主键id */ - @ApiModelProperty(value = "主键") + @Schema(description = "主键") @TableId(value = "id", type = IdType.ASSIGN_ID) @JsonSerialize(using = ToStringSerializer.class) private Long id; @@ -50,32 +52,32 @@ public class Tenant extends BaseEntity { /** * 租户ID */ - @ApiModelProperty(value = "租户ID") + @Schema(description = "租户ID") private String tenantId; /** * 租户名称 */ - @ApiModelProperty(value = "租户名称") + @Schema(description = "租户名称") private String tenantName; /** * 域名地址 */ - @ApiModelProperty(value = "域名地址") + @Schema(description = "域名地址") private String domain; /** * 联系人 */ - @ApiModelProperty(value = "联系人") + @Schema(description = "联系人") private String linkman; /** * 联系电话 */ - @ApiModelProperty(value = "联系电话") + @Schema(description = "联系电话") private String contactNumber; /** * 联系地址 */ - @ApiModelProperty(value = "联系地址") + @Schema(description = "联系地址") private String address; diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/DataScopeVO.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/DataScopeVO.java index 59c8d40..7b960e1 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/DataScopeVO.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/DataScopeVO.java @@ -15,11 +15,13 @@ */ package org.springblade.system.vo; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.system.entity.DataScope; +import java.io.Serial; + /** * 视图实体类 * @@ -27,8 +29,9 @@ import org.springblade.system.entity.DataScope; */ @Data @EqualsAndHashCode(callSuper = true) -@ApiModel(value = "DataScopeVO对象", description = "DataScopeVO对象") +@Schema(description = "DataScopeVO对象") public class DataScopeVO extends DataScope { + @Serial private static final long serialVersionUID = 1L; /** diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/DeptVO.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/DeptVO.java index fc11148..7fd66fd 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/DeptVO.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/DeptVO.java @@ -18,12 +18,13 @@ package org.springblade.system.vo; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.tool.node.INode; import org.springblade.system.entity.Dept; +import java.io.Serial; import java.util.ArrayList; import java.util.List; @@ -34,8 +35,9 @@ import java.util.List; */ @Data @EqualsAndHashCode(callSuper = true) -@ApiModel(value = "DeptVO对象", description = "DeptVO对象") +@Schema(description = "DeptVO对象") public class DeptVO extends Dept implements INode { + @Serial private static final long serialVersionUID = 1L; /** diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/GrantTreeVO.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/GrantTreeVO.java index 4d9c144..325e525 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/GrantTreeVO.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/GrantTreeVO.java @@ -17,6 +17,7 @@ package org.springblade.system.vo; import lombok.Data; +import java.io.Serial; import java.io.Serializable; import java.util.List; @@ -27,6 +28,7 @@ import java.util.List; */ @Data public class GrantTreeVO implements Serializable { + @Serial private static final long serialVersionUID = 1L; private List menu; diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/GrantVO.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/GrantVO.java index 31cbc80..a7d3ab5 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/GrantVO.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/GrantVO.java @@ -15,9 +15,10 @@ */ package org.springblade.system.vo; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; +import java.io.Serial; import java.io.Serializable; import java.util.List; @@ -28,15 +29,16 @@ import java.util.List; */ @Data public class GrantVO implements Serializable { + @Serial private static final long serialVersionUID = 1L; - @ApiModelProperty(value = "roleIds集合") + @Schema(description = "roleIds集合") private List roleIds; - @ApiModelProperty(value = "menuIds集合") + @Schema(description = "menuIds集合") private List menuIds; - @ApiModelProperty(value = "dataScopeIds集合") + @Schema(description = "dataScopeIds集合") private List dataScopeIds; } diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/MenuVO.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/MenuVO.java index 17aaa20..5eea41c 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/MenuVO.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/MenuVO.java @@ -18,12 +18,13 @@ package org.springblade.system.vo; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.tool.node.INode; import org.springblade.system.entity.Menu; +import java.io.Serial; import java.util.ArrayList; import java.util.List; @@ -34,8 +35,9 @@ import java.util.List; */ @Data @EqualsAndHashCode(callSuper = true) -@ApiModel(value = "MenuVO对象", description = "MenuVO对象") +@Schema(description = "MenuVO对象") public class MenuVO extends Menu implements INode { + @Serial private static final long serialVersionUID = 1L; /** diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/ParamVO.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/ParamVO.java index b8c063e..a54abb3 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/ParamVO.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/ParamVO.java @@ -15,11 +15,13 @@ */ package org.springblade.system.vo; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.system.entity.Param; +import java.io.Serial; + /** * 视图实体类 * @@ -27,8 +29,9 @@ import org.springblade.system.entity.Param; */ @Data @EqualsAndHashCode(callSuper = true) -@ApiModel(value = "ParamVO对象", description = "ParamVO对象") +@Schema(description = "ParamVO对象") public class ParamVO extends Param { + @Serial private static final long serialVersionUID = 1L; } diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/PostVO.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/PostVO.java index dff4c49..ac86055 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/PostVO.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/PostVO.java @@ -15,11 +15,13 @@ */ package org.springblade.system.vo; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.system.entity.Post; +import java.io.Serial; + /** * 岗位表视图实体类 * @@ -27,8 +29,9 @@ import org.springblade.system.entity.Post; */ @Data @EqualsAndHashCode(callSuper = true) -@ApiModel(value = "PostVO对象", description = "岗位表") +@Schema(description = "PostVO对象") public class PostVO extends Post { + @Serial private static final long serialVersionUID = 1L; /** diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/RegionVO.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/RegionVO.java index a09754e..2d98b8b 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/RegionVO.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/RegionVO.java @@ -18,13 +18,14 @@ package org.springblade.system.vo; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.tool.node.INode; import org.springblade.core.tool.utils.Func; import org.springblade.system.entity.Region; +import java.io.Serial; import java.util.ArrayList; import java.util.List; @@ -35,8 +36,9 @@ import java.util.List; */ @Data @EqualsAndHashCode(callSuper = true) -@ApiModel(value = "RegionVO对象", description = "行政区划表") +@Schema(description = "RegionVO对象") public class RegionVO extends Region implements INode { + @Serial private static final long serialVersionUID = 1L; /** diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/RoleMenuVO.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/RoleMenuVO.java index d8099a1..8a3fb7e 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/RoleMenuVO.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/RoleMenuVO.java @@ -15,11 +15,13 @@ */ package org.springblade.system.vo; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.system.entity.RoleMenu; +import java.io.Serial; + /** * 视图实体类 * @@ -27,8 +29,9 @@ import org.springblade.system.entity.RoleMenu; */ @Data @EqualsAndHashCode(callSuper = true) -@ApiModel(value = "RoleMenuVO对象", description = "RoleMenuVO对象") +@Schema(description = "RoleMenuVO对象") public class RoleMenuVO extends RoleMenu { + @Serial private static final long serialVersionUID = 1L; } diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/RoleVO.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/RoleVO.java index 5561c4e..89622ad 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/RoleVO.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/RoleVO.java @@ -18,12 +18,13 @@ package org.springblade.system.vo; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.tool.node.INode; import org.springblade.system.entity.Role; +import java.io.Serial; import java.util.ArrayList; import java.util.List; @@ -34,8 +35,9 @@ import java.util.List; */ @Data @EqualsAndHashCode(callSuper = true) -@ApiModel(value = "RoleVO对象", description = "RoleVO对象") +@Schema(description = "RoleVO对象") public class RoleVO extends Role implements INode { + @Serial private static final long serialVersionUID = 1L; /** diff --git a/blade-service-api/blade-user-api/pom.xml b/blade-service-api/blade-user-api/pom.xml index 3d9d076..18ebda8 100644 --- a/blade-service-api/blade-user-api/pom.xml +++ b/blade-service-api/blade-user-api/pom.xml @@ -5,7 +5,7 @@ blade-service-api org.springblade - 3.7.1 + 4.0.0 4.0.0 diff --git a/blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/entity/User.java b/blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/entity/User.java index a38d1b2..027115b 100644 --- a/blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/entity/User.java +++ b/blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/entity/User.java @@ -20,11 +20,12 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.mp.base.TenantEntity; +import java.io.Serial; import java.util.Date; /** @@ -37,12 +38,13 @@ import java.util.Date; @EqualsAndHashCode(callSuper = true) public class User extends TenantEntity { + @Serial private static final long serialVersionUID = 1L; /** * 主键id */ - @ApiModelProperty(value = "主键") + @Schema(description = "主键") @TableId(value = "id", type = IdType.ASSIGN_ID) @JsonSerialize(using = ToStringSerializer.class) private Long id; diff --git a/blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/entity/UserInfo.java b/blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/entity/UserInfo.java index bb171c6..59d470f 100644 --- a/blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/entity/UserInfo.java +++ b/blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/entity/UserInfo.java @@ -15,10 +15,10 @@ */ package org.springblade.system.user.entity; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; +import java.io.Serial; import java.io.Serializable; import java.util.List; @@ -28,33 +28,34 @@ import java.util.List; * @author Chill */ @Data -@ApiModel(description = "用户信息") +@Schema(description = "用户信息") public class UserInfo implements Serializable { + @Serial private static final long serialVersionUID = 1L; /** * 用户基础信息 */ - @ApiModelProperty(value = "用户") + @Schema(description = "用户") private User user; /** * 权限标识集合 */ - @ApiModelProperty(value = "权限集合") + @Schema(description = "权限集合") private List permissions; /** * 角色集合 */ - @ApiModelProperty(value = "角色集合") + @Schema(description = "角色集合") private List roles; /** * 第三方授权id */ - @ApiModelProperty(value = "第三方授权id") + @Schema(description = "第三方授权id") private String oauthId; } diff --git a/blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/entity/UserOauth.java b/blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/entity/UserOauth.java index e6c45fd..4dbe862 100644 --- a/blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/entity/UserOauth.java +++ b/blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/entity/UserOauth.java @@ -20,9 +20,10 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; +import java.io.Serial; import java.io.Serializable; /** @@ -34,6 +35,7 @@ import java.io.Serializable; @TableName("blade_user_oauth") public class UserOauth implements Serializable { + @Serial private static final long serialVersionUID = 1L; @@ -41,7 +43,7 @@ public class UserOauth implements Serializable { * 主键 */ @JsonSerialize(using = ToStringSerializer.class) - @ApiModelProperty(value = "主键") + @Schema(description = "主键") @TableId(value = "id", type = IdType.ASSIGN_ID) private Long id; @@ -59,7 +61,7 @@ public class UserOauth implements Serializable { * 用户ID */ @JsonSerialize(using = ToStringSerializer.class) - @ApiModelProperty(value = "用户主键") + @Schema(description = "用户主键") private Long userId; /** diff --git a/blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/vo/UserVO.java b/blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/vo/UserVO.java index 0f4f767..bdd9300 100644 --- a/blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/vo/UserVO.java +++ b/blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/vo/UserVO.java @@ -17,11 +17,13 @@ package org.springblade.system.user.vo; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.system.user.entity.User; +import java.io.Serial; + /** * 视图实体类 * @@ -29,8 +31,9 @@ import org.springblade.system.user.entity.User; */ @Data @EqualsAndHashCode(callSuper = true) -@ApiModel(value = "UserVO对象", description = "UserVO对象") +@Schema(description = "UserVO对象") public class UserVO extends User { + @Serial private static final long serialVersionUID = 1L; /** diff --git a/blade-service-api/pom.xml b/blade-service-api/pom.xml index 65a2a1d..de057cd 100644 --- a/blade-service-api/pom.xml +++ b/blade-service-api/pom.xml @@ -5,13 +5,13 @@ SpringBlade org.springblade - 3.7.1 + 4.0.0 4.0.0 blade-service-api ${project.artifactId} - 3.7.1 + 4.0.0 pom SpringBlade 微服务API集合 diff --git a/blade-service/blade-demo/pom.xml b/blade-service/blade-demo/pom.xml index 3b7b93c..db20c4b 100644 --- a/blade-service/blade-demo/pom.xml +++ b/blade-service/blade-demo/pom.xml @@ -5,7 +5,7 @@ blade-service org.springblade - 3.7.1 + 4.0.0 4.0.0 diff --git a/blade-service/blade-demo/src/main/java/com/example/demo/controller/DemoController.java b/blade-service/blade-demo/src/main/java/com/example/demo/controller/DemoController.java index e9e9a2e..6063bee 100644 --- a/blade-service/blade-demo/src/main/java/com/example/demo/controller/DemoController.java +++ b/blade-service/blade-demo/src/main/java/com/example/demo/controller/DemoController.java @@ -16,7 +16,7 @@ package com.example.demo.controller; import com.example.demo.props.DemoProperties; -import io.swagger.annotations.Api; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Value; import org.springframework.cloud.context.config.annotation.RefreshScope; import org.springframework.web.bind.annotation.GetMapping; @@ -31,7 +31,7 @@ import org.springframework.web.bind.annotation.RestController; @RefreshScope @RestController @RequestMapping("demo") -@Api(value = "配置接口", tags = "即时刷新配置") +@Tag(name = "配置接口", description = "即时刷新配置") public class DemoController { @Value("${demo.name:1}") diff --git a/blade-service/blade-demo/src/main/java/com/example/demo/controller/DynamicController.java b/blade-service/blade-demo/src/main/java/com/example/demo/controller/DynamicController.java index 6ba52cd..d2d1b1f 100644 --- a/blade-service/blade-demo/src/main/java/com/example/demo/controller/DynamicController.java +++ b/blade-service/blade-demo/src/main/java/com/example/demo/controller/DynamicController.java @@ -18,8 +18,8 @@ package com.example.demo.controller; import com.example.demo.entity.Notice; import com.example.demo.service.IDynamicService; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; import lombok.AllArgsConstructor; import org.springblade.core.tool.api.R; import org.springframework.web.bind.annotation.GetMapping; @@ -36,7 +36,7 @@ import java.util.List; @RestController @AllArgsConstructor @RequestMapping("dynamic") -@Api(value = "多数据源接口", tags = "多数据源") +@Tag(name = "多数据源接口", description = "多数据源") public class DynamicController { private IDynamicService dynamicService; @@ -46,7 +46,7 @@ public class DynamicController { */ @GetMapping("/master-list") @ApiOperationSupport(order = 1) - @ApiOperation(value = "master列表", notes = "master列表") + @Operation(summary = "master列表", description = "master列表") public R> masterList() { List list = dynamicService.masterList(); return R.data(list); @@ -57,7 +57,7 @@ public class DynamicController { */ @GetMapping("/slave-list") @ApiOperationSupport(order = 1) - @ApiOperation(value = "slave列表", notes = "slave列表") + @Operation(summary = "slave列表", description = "slave列表") public R> slaveList() { List list = dynamicService.slaveList(); return R.data(list); diff --git a/blade-service/blade-demo/src/main/java/com/example/demo/controller/NoticeController.java b/blade-service/blade-demo/src/main/java/com/example/demo/controller/NoticeController.java index 3736d7b..7cbc955 100644 --- a/blade-service/blade-demo/src/main/java/com/example/demo/controller/NoticeController.java +++ b/blade-service/blade-demo/src/main/java/com/example/demo/controller/NoticeController.java @@ -19,7 +19,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.example.demo.entity.Notice; import com.example.demo.service.INoticeService; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import lombok.AllArgsConstructor; import org.springblade.common.cache.CacheNames; import org.springblade.core.boot.ctrl.BladeController; @@ -28,7 +33,6 @@ import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; import org.springframework.web.bind.annotation.*; -import springfox.documentation.annotations.ApiIgnore; import java.util.Map; @@ -40,7 +44,7 @@ import java.util.Map; @RestController @RequestMapping("notice") @AllArgsConstructor -@Api(value = "用户博客", tags = "博客接口") +@Tag(name = "用户博客", description = "博客接口") public class NoticeController extends BladeController implements CacheNames { private INoticeService noticeService; @@ -50,7 +54,7 @@ public class NoticeController extends BladeController implements CacheNames { */ @GetMapping("/detail") @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入notice") + @Operation(summary = "详情", description = "传入notice") public R detail(Notice notice) { Notice detail = noticeService.getOne(Condition.getQueryWrapper(notice)); return R.data(detail); @@ -60,13 +64,13 @@ public class NoticeController extends BladeController implements CacheNames { * 分页 */ @GetMapping("/list") - @ApiImplicitParams({ - @ApiImplicitParam(name = "category", value = "公告类型", paramType = "query", dataType = "integer"), - @ApiImplicitParam(name = "title", value = "公告标题", paramType = "query", dataType = "string") + @Parameters({ + @Parameter(name = "category", description = "公告类型", in = ParameterIn.QUERY, schema = @Schema(type = "integer")), + @Parameter(name = "title", description = "公告标题", in = ParameterIn.QUERY, schema = @Schema(type = "string")) }) @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页", notes = "传入notice") - public R> list(@ApiIgnore @RequestParam Map notice, Query query) { + @Operation(summary = "分页", description = "传入notice") + public R> list(@Parameter(hidden = true) @RequestParam Map notice, Query query) { IPage pages = noticeService.page(Condition.getPage(query), Condition.getQueryWrapper(notice, Notice.class)); return R.data(pages); } @@ -76,7 +80,7 @@ public class NoticeController extends BladeController implements CacheNames { */ @PostMapping("/save") @ApiOperationSupport(order = 3) - @ApiOperation(value = "新增", notes = "传入notice") + @Operation(summary = "新增", description = "传入notice") public R save(@RequestBody Notice notice) { return R.status(noticeService.save(notice)); } @@ -86,7 +90,7 @@ public class NoticeController extends BladeController implements CacheNames { */ @PostMapping("/update") @ApiOperationSupport(order = 4) - @ApiOperation(value = "修改", notes = "传入notice") + @Operation(summary = "修改", description = "传入notice") public R update(@RequestBody Notice notice) { return R.status(noticeService.updateById(notice)); } @@ -96,7 +100,7 @@ public class NoticeController extends BladeController implements CacheNames { */ @PostMapping("/submit") @ApiOperationSupport(order = 5) - @ApiOperation(value = "新增或修改", notes = "传入notice") + @Operation(summary = "新增或修改", description = "传入notice") public R submit(@RequestBody Notice notice) { return R.status(noticeService.saveOrUpdate(notice)); } @@ -106,8 +110,8 @@ public class NoticeController extends BladeController implements CacheNames { */ @PostMapping("/remove") @ApiOperationSupport(order = 6) - @ApiOperation(value = "逻辑删除", notes = "传入notice") - public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { + @Operation(summary = "逻辑删除", description = "传入notice") + public R remove(@Parameter(name = "主键集合") @RequestParam String ids) { boolean temp = noticeService.deleteLogic(Func.toLongList(ids)); return R.status(temp); } diff --git a/blade-service/blade-demo/src/main/java/com/example/demo/feign/NoticeClient.java b/blade-service/blade-demo/src/main/java/com/example/demo/feign/NoticeClient.java index b87b54f..0d7e3ec 100644 --- a/blade-service/blade-demo/src/main/java/com/example/demo/feign/NoticeClient.java +++ b/blade-service/blade-demo/src/main/java/com/example/demo/feign/NoticeClient.java @@ -21,7 +21,7 @@ import lombok.AllArgsConstructor; import org.springblade.core.tool.api.R; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; -import springfox.documentation.annotations.ApiIgnore; +import io.swagger.v3.oas.annotations.Hidden; import java.util.List; @@ -30,7 +30,7 @@ import java.util.List; * * @author Chill */ -@ApiIgnore() +@Hidden @RestController @AllArgsConstructor public class NoticeClient implements INoticeClient { diff --git a/blade-service/blade-demo/src/main/resources/application-dev.yml b/blade-service/blade-demo/src/main/resources/application-dev.yml index 38426fa..600cbdc 100644 --- a/blade-service/blade-demo/src/main/resources/application-dev.yml +++ b/blade-service/blade-demo/src/main/resources/application-dev.yml @@ -12,7 +12,7 @@ server: spring: #排除DruidDataSourceAutoConfigure autoconfigure: - exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure + exclude: com.alibaba.druid.spring.boot3.autoconfigure.DruidDataSourceAutoConfigure datasource: dynamic: #设置默认的数据源或者数据源组,默认值即为master diff --git a/blade-service/blade-demo/src/main/resources/application-prod.yml b/blade-service/blade-demo/src/main/resources/application-prod.yml index da89262..053bf05 100644 --- a/blade-service/blade-demo/src/main/resources/application-prod.yml +++ b/blade-service/blade-demo/src/main/resources/application-prod.yml @@ -12,7 +12,7 @@ server: spring: #排除DruidDataSourceAutoConfigure autoconfigure: - exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure + exclude: com.alibaba.druid.spring.boot3.autoconfigure.DruidDataSourceAutoConfigure datasource: dynamic: #设置默认的数据源或者数据源组,默认值即为master diff --git a/blade-service/blade-demo/src/main/resources/application-test.yml b/blade-service/blade-demo/src/main/resources/application-test.yml index 4b4e157..42ce581 100644 --- a/blade-service/blade-demo/src/main/resources/application-test.yml +++ b/blade-service/blade-demo/src/main/resources/application-test.yml @@ -12,7 +12,7 @@ server: spring: #排除DruidDataSourceAutoConfigure autoconfigure: - exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure + exclude: com.alibaba.druid.spring.boot3.autoconfigure.DruidDataSourceAutoConfigure datasource: dynamic: #设置默认的数据源或者数据源组,默认值即为master diff --git a/blade-service/blade-desk/Dockerfile b/blade-service/blade-desk/Dockerfile index 728663e..eccaf1a 100644 --- a/blade-service/blade-desk/Dockerfile +++ b/blade-service/blade-desk/Dockerfile @@ -1,6 +1,6 @@ -FROM anapsix/alpine-java:8_server-jre_unlimited +FROM bladex/alpine-java:openjdk17_cn_slim -MAINTAINER smallchill@163.com +MAINTAINER bladejava@qq.com RUN mkdir -p /blade/desk @@ -10,6 +10,6 @@ EXPOSE 8105 ADD ./target/blade-desk.jar ./app.jar -ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"] +ENTRYPOINT ["java", "--add-opens java.base/java.lang.reflect=ALL-UNNAMED", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"] CMD ["--spring.profiles.active=test"] diff --git a/blade-service/blade-desk/pom.xml b/blade-service/blade-desk/pom.xml index ab2583d..2c5a998 100644 --- a/blade-service/blade-desk/pom.xml +++ b/blade-service/blade-desk/pom.xml @@ -6,7 +6,7 @@ org.springblade blade-service - 3.7.1 + 4.0.0 4.0.0 @@ -50,22 +50,6 @@ org.apache.maven.plugins maven-antrun-plugin - - - package - - run - - - - - - - - - diff --git a/blade-service/blade-desk/src/main/java/org/springblade/desk/controller/DashBoardController.java b/blade-service/blade-desk/src/main/java/org/springblade/desk/controller/DashBoardController.java index 1c4c6d3..988d8e9 100644 --- a/blade-service/blade-desk/src/main/java/org/springblade/desk/controller/DashBoardController.java +++ b/blade-service/blade-desk/src/main/java/org/springblade/desk/controller/DashBoardController.java @@ -1,7 +1,7 @@ package org.springblade.desk.controller; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; import lombok.AllArgsConstructor; import org.springblade.core.tool.api.R; import org.springblade.core.tool.support.Kv; @@ -22,7 +22,7 @@ import java.util.Map; @RestController @RequestMapping("dashboard") @AllArgsConstructor -@Api(value = "首页", tags = "首页") +@Tag(name = "首页", description = "首页") public class DashBoardController { /** @@ -31,7 +31,7 @@ public class DashBoardController { * @return */ @GetMapping("/activities") - @ApiOperation(value = "活跃用户", notes = "活跃用户") + @Operation(summary = "活跃用户", description = "活跃用户") public R activities() { List> list = new ArrayList<>(); @@ -62,7 +62,7 @@ public class DashBoardController { * @return */ @GetMapping("/notices") - @ApiOperation(value = "消息", notes = "消息") + @Operation(summary = "消息", description = "消息") public R notices() { List> list = new ArrayList<>(); Map map1 = new HashMap<>(16); @@ -122,7 +122,7 @@ public class DashBoardController { * @return */ @GetMapping("/my-notices") - @ApiOperation(value = "消息", notes = "消息") + @Operation(summary = "消息", description = "消息") public R myNotices() { List> list = new ArrayList<>(); Map map1 = new HashMap<>(16); diff --git a/blade-service/blade-desk/src/main/java/org/springblade/desk/controller/NoticeController.java b/blade-service/blade-desk/src/main/java/org/springblade/desk/controller/NoticeController.java index d3d33ad..8c19135 100644 --- a/blade-service/blade-desk/src/main/java/org/springblade/desk/controller/NoticeController.java +++ b/blade-service/blade-desk/src/main/java/org/springblade/desk/controller/NoticeController.java @@ -17,7 +17,12 @@ package org.springblade.desk.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import lombok.AllArgsConstructor; import org.springblade.common.cache.CacheNames; import org.springblade.core.boot.ctrl.BladeController; @@ -30,7 +35,6 @@ import org.springblade.desk.service.INoticeService; import org.springblade.desk.vo.NoticeVO; import org.springblade.desk.wrapper.NoticeWrapper; import org.springframework.web.bind.annotation.*; -import springfox.documentation.annotations.ApiIgnore; import java.util.Map; @@ -43,7 +47,7 @@ import java.util.Map; @RestController @RequestMapping("notice") @AllArgsConstructor -@Api(value = "用户博客", tags = "博客接口") +@Tag(name = "用户博客", description = "博客接口") public class NoticeController extends BladeController implements CacheNames { private INoticeService noticeService; @@ -53,7 +57,7 @@ public class NoticeController extends BladeController implements CacheNames { */ @GetMapping("/detail") @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入notice") + @Operation(summary = "详情", description = "传入notice") public R detail(Notice notice) { Notice detail = noticeService.getOne(Condition.getQueryWrapper(notice)); return R.data(NoticeWrapper.build().entityVO(detail)); @@ -63,13 +67,13 @@ public class NoticeController extends BladeController implements CacheNames { * 分页 */ @GetMapping("/list") - @ApiImplicitParams({ - @ApiImplicitParam(name = "category", value = "公告类型", paramType = "query", dataType = "integer"), - @ApiImplicitParam(name = "title", value = "公告标题", paramType = "query", dataType = "string") + @Parameters({ + @Parameter(name = "category", description = "公告类型", in = ParameterIn.QUERY, schema = @Schema(type = "integer")), + @Parameter(name = "title", description = "公告标题", in = ParameterIn.QUERY, schema = @Schema(type = "string")) }) @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页", notes = "传入notice") - public R> list(@ApiIgnore @RequestParam Map notice, Query query) { + @Operation(summary = "分页", description = "传入notice") + public R> list(@Parameter(hidden = true) @RequestParam Map notice, Query query) { IPage pages = noticeService.page(Condition.getPage(query), Condition.getQueryWrapper(notice, Notice.class)); return R.data(NoticeWrapper.build().pageVO(pages)); } @@ -79,7 +83,7 @@ public class NoticeController extends BladeController implements CacheNames { */ @PostMapping("/save") @ApiOperationSupport(order = 3) - @ApiOperation(value = "新增", notes = "传入notice") + @Operation(summary = "新增", description = "传入notice") public R save(@RequestBody Notice notice) { return R.status(noticeService.save(notice)); } @@ -89,7 +93,7 @@ public class NoticeController extends BladeController implements CacheNames { */ @PostMapping("/update") @ApiOperationSupport(order = 4) - @ApiOperation(value = "修改", notes = "传入notice") + @Operation(summary = "修改", description = "传入notice") public R update(@RequestBody Notice notice) { return R.status(noticeService.updateById(notice)); } @@ -99,7 +103,7 @@ public class NoticeController extends BladeController implements CacheNames { */ @PostMapping("/submit") @ApiOperationSupport(order = 5) - @ApiOperation(value = "新增或修改", notes = "传入notice") + @Operation(summary = "新增或修改", description = "传入notice") public R submit(@RequestBody Notice notice) { return R.status(noticeService.saveOrUpdate(notice)); } @@ -109,8 +113,8 @@ public class NoticeController extends BladeController implements CacheNames { */ @PostMapping("/remove") @ApiOperationSupport(order = 6) - @ApiOperation(value = "逻辑删除", notes = "传入notice") - public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { + @Operation(summary = "逻辑删除", description = "传入notice") + public R remove(@Parameter(name = "主键集合") @RequestParam String ids) { boolean temp = noticeService.deleteLogic(Func.toLongList(ids)); return R.status(temp); } diff --git a/blade-service/blade-desk/src/main/java/org/springblade/desk/feign/NoticeClient.java b/blade-service/blade-desk/src/main/java/org/springblade/desk/feign/NoticeClient.java index 41d7ebd..a177d13 100644 --- a/blade-service/blade-desk/src/main/java/org/springblade/desk/feign/NoticeClient.java +++ b/blade-service/blade-desk/src/main/java/org/springblade/desk/feign/NoticeClient.java @@ -21,7 +21,7 @@ import org.springblade.desk.mapper.NoticeMapper; import org.springblade.desk.entity.Notice; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; -import springfox.documentation.annotations.ApiIgnore; +import io.swagger.v3.oas.annotations.Hidden; import java.util.List; @@ -30,7 +30,7 @@ import java.util.List; * * @author Chill */ -@ApiIgnore() +@Hidden @RestController @AllArgsConstructor public class NoticeClient implements INoticeClient { diff --git a/blade-service/blade-desk/src/main/java/org/springblade/desk/wrapper/NoticeWrapper.java b/blade-service/blade-desk/src/main/java/org/springblade/desk/wrapper/NoticeWrapper.java index 70fe7f7..6b22cc3 100644 --- a/blade-service/blade-desk/src/main/java/org/springblade/desk/wrapper/NoticeWrapper.java +++ b/blade-service/blade-desk/src/main/java/org/springblade/desk/wrapper/NoticeWrapper.java @@ -42,7 +42,7 @@ public class NoticeWrapper extends BaseEntityWrapper { @Override public NoticeVO entityVO(Notice notice) { - NoticeVO noticeVO = BeanUtil.copy(notice, NoticeVO.class); + NoticeVO noticeVO = BeanUtil.copyProperties(notice, NoticeVO.class); R dict = dictClient.getValue("notice", noticeVO.getCategory()); if (dict.isSuccess()) { String categoryName = dict.getData(); diff --git a/blade-service/blade-log/Dockerfile b/blade-service/blade-log/Dockerfile index 5f5181e..24f36ee 100644 --- a/blade-service/blade-log/Dockerfile +++ b/blade-service/blade-log/Dockerfile @@ -1,6 +1,6 @@ -FROM anapsix/alpine-java:8_server-jre_unlimited +FROM bladex/alpine-java:openjdk17_cn_slim -MAINTAINER smallchill@163.com +MAINTAINER bladejava@qq.com RUN mkdir -p /blade/log @@ -10,6 +10,6 @@ EXPOSE 8103 ADD ./target/blade-log.jar ./app.jar -ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"] +ENTRYPOINT ["java", "--add-opens java.base/java.lang.reflect=ALL-UNNAMED", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"] CMD ["--spring.profiles.active=test"] diff --git a/blade-service/blade-log/pom.xml b/blade-service/blade-log/pom.xml index 755f301..1795f26 100644 --- a/blade-service/blade-log/pom.xml +++ b/blade-service/blade-log/pom.xml @@ -5,7 +5,7 @@ blade-service org.springblade - 3.7.1 + 4.0.0 4.0.0 @@ -28,22 +28,6 @@ org.apache.maven.plugins maven-antrun-plugin - - - package - - run - - - - - - - - - diff --git a/blade-service/blade-log/src/main/java/org/springblade/core/log/controller/LogApiController.java b/blade-service/blade-log/src/main/java/org/springblade/core/log/controller/LogApiController.java index 86a462d..64a129c 100644 --- a/blade-service/blade-log/src/main/java/org/springblade/core/log/controller/LogApiController.java +++ b/blade-service/blade-log/src/main/java/org/springblade/core/log/controller/LogApiController.java @@ -18,6 +18,8 @@ package org.springblade.core.log.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.v3.oas.annotations.Hidden; +import io.swagger.v3.oas.annotations.Parameter; import lombok.AllArgsConstructor; import org.springblade.core.log.model.LogApi; import org.springblade.core.log.model.LogApiVo; @@ -34,7 +36,6 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import springfox.documentation.annotations.ApiIgnore; import java.util.List; import java.util.Map; @@ -46,6 +47,7 @@ import java.util.stream.Collectors; * @author Chill * @since 2018-09-26 */ +@Hidden @RestController @AllArgsConstructor @RequestMapping("/api") @@ -66,12 +68,12 @@ public class LogApiController { */ @GetMapping("/list") @PreAuth(RoleConstant.HAS_ROLE_ADMIN) - public R> list(@ApiIgnore @RequestParam Map log, Query query) { + public R> list(@Parameter(hidden = true) @RequestParam Map log, Query query) { query.setAscs("create_time"); query.setDescs(StringPool.EMPTY); IPage pages = logService.page(Condition.getPage(query), Condition.getQueryWrapper(log, LogApi.class)); List records = pages.getRecords().stream().map(logApi -> { - LogApiVo vo = BeanUtil.copy(logApi, LogApiVo.class); + LogApiVo vo = BeanUtil.copyProperties(logApi, LogApiVo.class); vo.setStrId(Func.toStr(logApi.getId())); return vo; }).collect(Collectors.toList()); diff --git a/blade-service/blade-log/src/main/java/org/springblade/core/log/controller/LogErrorController.java b/blade-service/blade-log/src/main/java/org/springblade/core/log/controller/LogErrorController.java index f6a3f62..bc8afac 100644 --- a/blade-service/blade-log/src/main/java/org/springblade/core/log/controller/LogErrorController.java +++ b/blade-service/blade-log/src/main/java/org/springblade/core/log/controller/LogErrorController.java @@ -18,6 +18,8 @@ package org.springblade.core.log.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.v3.oas.annotations.Hidden; +import io.swagger.v3.oas.annotations.Parameter; import lombok.AllArgsConstructor; import org.springblade.core.log.model.LogError; import org.springblade.core.log.model.LogErrorVo; @@ -34,7 +36,6 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import springfox.documentation.annotations.ApiIgnore; import java.util.List; import java.util.Map; @@ -46,6 +47,7 @@ import java.util.stream.Collectors; * @author Chill * @since 2018-09-26 */ +@Hidden @RestController @AllArgsConstructor @RequestMapping("/error") @@ -66,12 +68,12 @@ public class LogErrorController { */ @GetMapping("/list") @PreAuth(RoleConstant.HAS_ROLE_ADMIN) - public R> list(@ApiIgnore @RequestParam Map logError, Query query) { + public R> list(@Parameter(hidden = true) @RequestParam Map logError, Query query) { query.setAscs("create_time"); query.setDescs(StringPool.EMPTY); IPage pages = errorLogService.page(Condition.getPage(query), Condition.getQueryWrapper(logError, LogError.class)); List records = pages.getRecords().stream().map(logApi -> { - LogErrorVo vo = BeanUtil.copy(logApi, LogErrorVo.class); + LogErrorVo vo = BeanUtil.copyProperties(logApi, LogErrorVo.class); vo.setStrId(Func.toStr(logApi.getId())); return vo; }).collect(Collectors.toList()); diff --git a/blade-service/blade-log/src/main/java/org/springblade/core/log/controller/LogUsualController.java b/blade-service/blade-log/src/main/java/org/springblade/core/log/controller/LogUsualController.java index 3f0b5da..16f75e9 100644 --- a/blade-service/blade-log/src/main/java/org/springblade/core/log/controller/LogUsualController.java +++ b/blade-service/blade-log/src/main/java/org/springblade/core/log/controller/LogUsualController.java @@ -18,6 +18,8 @@ package org.springblade.core.log.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.v3.oas.annotations.Hidden; +import io.swagger.v3.oas.annotations.Parameter; import lombok.AllArgsConstructor; import org.springblade.core.log.model.LogUsual; import org.springblade.core.log.model.LogUsualVo; @@ -34,7 +36,6 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import springfox.documentation.annotations.ApiIgnore; import java.util.List; import java.util.Map; @@ -46,6 +47,7 @@ import java.util.stream.Collectors; * @author Chill * @since 2018-10-12 */ +@Hidden @RestController @AllArgsConstructor @RequestMapping("/usual") @@ -66,12 +68,12 @@ public class LogUsualController { */ @GetMapping("/list") @PreAuth(RoleConstant.HAS_ROLE_ADMIN) - public R> list(@ApiIgnore @RequestParam Map log, Query query) { + public R> list(@Parameter(hidden = true) @RequestParam Map log, Query query) { query.setAscs("create_time"); query.setDescs(StringPool.EMPTY); IPage pages = logService.page(Condition.getPage(query), Condition.getQueryWrapper(log, LogUsual.class)); List records = pages.getRecords().stream().map(logApi -> { - LogUsualVo vo = BeanUtil.copy(logApi, LogUsualVo.class); + LogUsualVo vo = BeanUtil.copyProperties(logApi, LogUsualVo.class); vo.setStrId(Func.toStr(logApi.getId())); return vo; }).collect(Collectors.toList()); diff --git a/blade-service/blade-log/src/main/java/org/springblade/core/log/feign/LogClient.java b/blade-service/blade-log/src/main/java/org/springblade/core/log/feign/LogClient.java index 0fe99a1..7e91b30 100644 --- a/blade-service/blade-log/src/main/java/org/springblade/core/log/feign/LogClient.java +++ b/blade-service/blade-log/src/main/java/org/springblade/core/log/feign/LogClient.java @@ -15,6 +15,7 @@ */ package org.springblade.core.log.feign; +import io.swagger.v3.oas.annotations.Hidden; import lombok.AllArgsConstructor; import org.springblade.core.log.model.LogApi; import org.springblade.core.log.model.LogUsual; @@ -32,6 +33,7 @@ import org.springframework.web.bind.annotation.RestController; * * @author Chill */ +@Hidden @RestController @AllArgsConstructor public class LogClient implements ILogClient { diff --git a/blade-service/blade-system/Dockerfile b/blade-service/blade-system/Dockerfile index f657a7d..209a056 100644 --- a/blade-service/blade-system/Dockerfile +++ b/blade-service/blade-system/Dockerfile @@ -1,6 +1,6 @@ -FROM anapsix/alpine-java:8_server-jre_unlimited +FROM bladex/alpine-java:openjdk17_cn_slim -MAINTAINER smallchill@163.com +MAINTAINER bladejava@qq.com RUN mkdir -p /blade/system @@ -10,6 +10,6 @@ EXPOSE 8106 ADD ./target/blade-system.jar ./app.jar -ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"] +ENTRYPOINT ["java", "--add-opens java.base/java.lang.reflect=ALL-UNNAMED", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"] CMD ["--spring.profiles.active=test"] diff --git a/blade-service/blade-system/pom.xml b/blade-service/blade-system/pom.xml index 59dbd39..69ae874 100644 --- a/blade-service/blade-system/pom.xml +++ b/blade-service/blade-system/pom.xml @@ -5,7 +5,7 @@ blade-service org.springblade - 3.7.1 + 4.0.0 4.0.0 @@ -47,22 +47,6 @@ org.apache.maven.plugins maven-antrun-plugin - - - package - - run - - - - - - - - - diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/AuthClientController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/AuthClientController.java index 6d4e346..6476bf9 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/controller/AuthClientController.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/controller/AuthClientController.java @@ -17,9 +17,9 @@ package org.springblade.system.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.mp.support.Condition; @@ -31,9 +31,9 @@ import org.springblade.core.tool.utils.Func; import org.springblade.system.entity.AuthClient; import org.springblade.system.service.IAuthClientService; import org.springframework.web.bind.annotation.*; -import springfox.documentation.annotations.ApiIgnore; +import io.swagger.v3.oas.annotations.Hidden; -import javax.validation.Valid; +import jakarta.validation.Valid; /** * 应用管理控制器 @@ -43,8 +43,8 @@ import javax.validation.Valid; @RestController @AllArgsConstructor @RequestMapping("/client") -@ApiIgnore -@Api(value = "应用管理", tags = "接口") +@Hidden +@Tag(name = "应用管理", description = "接口") @PreAuth(RoleConstant.HAS_ROLE_ADMIN) public class AuthClientController extends BladeController { @@ -55,7 +55,7 @@ public class AuthClientController extends BladeController { */ @GetMapping("/detail") @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入client") + @Operation(summary = "详情", description = "传入client") public R detail(AuthClient authClient) { AuthClient detail = clientService.getOne(Condition.getQueryWrapper(authClient)); return R.data(detail); @@ -66,7 +66,7 @@ public class AuthClientController extends BladeController { */ @GetMapping("/list") @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页", notes = "传入client") + @Operation(summary = "分页", description = "传入client") public R> list(AuthClient authClient, Query query) { IPage pages = clientService.page(Condition.getPage(query), Condition.getQueryWrapper(authClient)); return R.data(pages); @@ -77,7 +77,7 @@ public class AuthClientController extends BladeController { */ @PostMapping("/save") @ApiOperationSupport(order = 3) - @ApiOperation(value = "新增", notes = "传入client") + @Operation(summary = "新增", description = "传入client") public R save(@Valid @RequestBody AuthClient authClient) { return R.status(clientService.save(authClient)); } @@ -87,7 +87,7 @@ public class AuthClientController extends BladeController { */ @PostMapping("/update") @ApiOperationSupport(order = 4) - @ApiOperation(value = "修改", notes = "传入client") + @Operation(summary = "修改", description = "传入client") public R update(@Valid @RequestBody AuthClient authClient) { return R.status(clientService.updateById(authClient)); } @@ -97,7 +97,7 @@ public class AuthClientController extends BladeController { */ @PostMapping("/submit") @ApiOperationSupport(order = 5) - @ApiOperation(value = "新增或修改", notes = "传入client") + @Operation(summary = "新增或修改", description = "传入client") public R submit(@Valid @RequestBody AuthClient authClient) { return R.status(clientService.saveOrUpdate(authClient)); } @@ -108,8 +108,8 @@ public class AuthClientController extends BladeController { */ @PostMapping("/remove") @ApiOperationSupport(order = 6) - @ApiOperation(value = "逻辑删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + @Operation(summary = "逻辑删除", description = "传入ids") + public R remove(@Parameter(name = "主键集合", required = true) @RequestParam String ids) { return R.status(clientService.deleteLogic(Func.toLongList(ids))); } diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/DataScopeController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/DataScopeController.java index 214055e..56ca544 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/controller/DataScopeController.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/controller/DataScopeController.java @@ -17,9 +17,9 @@ package org.springblade.system.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.mp.support.Condition; @@ -33,7 +33,7 @@ import org.springblade.system.vo.DataScopeVO; import org.springblade.system.wrapper.DataScopeWrapper; import org.springframework.web.bind.annotation.*; -import javax.validation.Valid; +import jakarta.validation.Valid; import static org.springblade.core.tool.utils.CacheUtil.SYS_CACHE; @@ -45,7 +45,7 @@ import static org.springblade.core.tool.utils.CacheUtil.SYS_CACHE; @RestController @AllArgsConstructor @RequestMapping("/data-scope") -@Api(value = "数据权限", tags = "数据权限") +@Tag(name = "数据权限", description = "数据权限") public class DataScopeController extends BladeController { private final IDataScopeService dataScopeService; @@ -55,7 +55,7 @@ public class DataScopeController extends BladeController { */ @GetMapping("/detail") @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入dataScope") + @Operation(summary = "详情", description = "传入dataScope") public R detail(DataScope dataScope) { DataScope detail = dataScopeService.getOne(Condition.getQueryWrapper(dataScope)); return R.data(detail); @@ -66,7 +66,7 @@ public class DataScopeController extends BladeController { */ @GetMapping("/list") @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页", notes = "传入dataScope") + @Operation(summary = "分页", description = "传入dataScope") public R> list(DataScope dataScope, Query query) { IPage pages = dataScopeService.page(Condition.getPage(query), Condition.getQueryWrapper(dataScope)); return R.data(DataScopeWrapper.build().pageVO(pages)); @@ -77,7 +77,7 @@ public class DataScopeController extends BladeController { */ @PostMapping("/save") @ApiOperationSupport(order = 3) - @ApiOperation(value = "新增", notes = "传入dataScope") + @Operation(summary = "新增", description = "传入dataScope") public R save(@Valid @RequestBody DataScope dataScope) { CacheUtil.clear(SYS_CACHE); return R.status(dataScopeService.save(dataScope)); @@ -88,7 +88,7 @@ public class DataScopeController extends BladeController { */ @PostMapping("/update") @ApiOperationSupport(order = 4) - @ApiOperation(value = "修改", notes = "传入dataScope") + @Operation(summary = "修改", description = "传入dataScope") public R update(@Valid @RequestBody DataScope dataScope) { CacheUtil.clear(SYS_CACHE); return R.status(dataScopeService.updateById(dataScope)); @@ -99,7 +99,7 @@ public class DataScopeController extends BladeController { */ @PostMapping("/submit") @ApiOperationSupport(order = 5) - @ApiOperation(value = "新增或修改", notes = "传入dataScope") + @Operation(summary = "新增或修改", description = "传入dataScope") public R submit(@Valid @RequestBody DataScope dataScope) { CacheUtil.clear(SYS_CACHE); return R.status(dataScopeService.saveOrUpdate(dataScope)); @@ -111,8 +111,8 @@ public class DataScopeController extends BladeController { */ @PostMapping("/remove") @ApiOperationSupport(order = 6) - @ApiOperation(value = "逻辑删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + @Operation(summary = "逻辑删除", description = "传入ids") + public R remove(@Parameter(name = "主键集合", required = true) @RequestParam String ids) { CacheUtil.clear(SYS_CACHE); return R.status(dataScopeService.deleteLogic(Func.toLongList(ids))); } diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/DeptController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/DeptController.java index 1d6c53c..e55fd6a 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/controller/DeptController.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/controller/DeptController.java @@ -17,7 +17,13 @@ package org.springblade.system.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.mp.support.Condition; @@ -30,9 +36,7 @@ import org.springblade.system.service.IDeptService; import org.springblade.system.vo.DeptVO; import org.springblade.system.wrapper.DeptWrapper; import org.springframework.web.bind.annotation.*; -import springfox.documentation.annotations.ApiIgnore; -import javax.validation.Valid; import java.util.List; import java.util.Map; @@ -44,7 +48,7 @@ import java.util.Map; @RestController @AllArgsConstructor @RequestMapping("/dept") -@Api(value = "部门", tags = "部门") +@Tag(name = "部门", description = "部门") public class DeptController extends BladeController { private IDeptService deptService; @@ -54,7 +58,7 @@ public class DeptController extends BladeController { */ @GetMapping("/detail") @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入dept") + @Operation(summary = "详情", description = "传入dept") public R detail(Dept dept) { Dept detail = deptService.getOne(Condition.getQueryWrapper(dept)); return R.data(DeptWrapper.build().entityVO(detail)); @@ -64,13 +68,13 @@ public class DeptController extends BladeController { * 列表 */ @GetMapping("/list") - @ApiImplicitParams({ - @ApiImplicitParam(name = "deptName", value = "部门名称", paramType = "query", dataType = "string"), - @ApiImplicitParam(name = "fullName", value = "部门全称", paramType = "query", dataType = "string") + @Parameters({ + @Parameter(name = "deptName", description = "部门名称", in = ParameterIn.QUERY, schema = @Schema(type = "string")), + @Parameter(name = "fullName", description = "部门全称", in = ParameterIn.QUERY, schema = @Schema(type = "string")) }) @ApiOperationSupport(order = 2) - @ApiOperation(value = "列表", notes = "传入dept") - public R> list(@ApiIgnore @RequestParam Map dept, BladeUser bladeUser) { + @Operation(summary = "列表", description = "传入dept") + public R> list(@Parameter(hidden = true) @RequestParam Map dept, BladeUser bladeUser) { QueryWrapper queryWrapper = Condition.getQueryWrapper(dept, Dept.class); List list = deptService.list((!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.lambda().eq(Dept::getTenantId, bladeUser.getTenantId()) : queryWrapper); return R.data(DeptWrapper.build().listNodeVO(list)); @@ -83,7 +87,7 @@ public class DeptController extends BladeController { */ @GetMapping("/tree") @ApiOperationSupport(order = 3) - @ApiOperation(value = "树形结构", notes = "树形结构") + @Operation(summary = "树形结构", description = "树形结构") public R> tree(String tenantId, BladeUser bladeUser) { List tree = deptService.tree(Func.toStr(tenantId, bladeUser.getTenantId())); return R.data(tree); @@ -94,7 +98,7 @@ public class DeptController extends BladeController { */ @PostMapping("/submit") @ApiOperationSupport(order = 4) - @ApiOperation(value = "新增或修改", notes = "传入dept") + @Operation(summary = "新增或修改", description = "传入dept") public R submit(@Valid @RequestBody Dept dept) { return R.status(deptService.submit(dept)); } @@ -104,8 +108,8 @@ public class DeptController extends BladeController { */ @PostMapping("/remove") @ApiOperationSupport(order = 5) - @ApiOperation(value = "删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + @Operation(summary = "删除", description = "传入ids") + public R remove(@Parameter(name = "主键集合", required = true) @RequestParam String ids) { return R.status(deptService.removeByIds(Func.toLongList(ids))); } diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/DictController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/DictController.java index c1996c1..a3ad8c9 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/controller/DictController.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/controller/DictController.java @@ -16,7 +16,13 @@ package org.springblade.system.controller; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.mp.support.Condition; @@ -28,9 +34,7 @@ import org.springblade.system.vo.DictVO; import org.springblade.system.wrapper.DictWrapper; import org.springframework.cache.annotation.CacheEvict; import org.springframework.web.bind.annotation.*; -import springfox.documentation.annotations.ApiIgnore; -import javax.validation.Valid; import java.util.List; import java.util.Map; @@ -45,7 +49,7 @@ import static org.springblade.common.cache.CacheNames.DICT_VALUE; @RestController @AllArgsConstructor @RequestMapping("/dict") -@Api(value = "字典", tags = "字典") +@Tag(name = "字典", description = "字典") public class DictController extends BladeController { private IDictService dictService; @@ -55,7 +59,7 @@ public class DictController extends BladeController { */ @GetMapping("/detail") @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入dict") + @Operation(summary = "详情", description = "传入dict") public R detail(Dict dict) { Dict detail = dictService.getOne(Condition.getQueryWrapper(dict)); return R.data(DictWrapper.build().entityVO(detail)); @@ -65,13 +69,13 @@ public class DictController extends BladeController { * 列表 */ @GetMapping("/list") - @ApiImplicitParams({ - @ApiImplicitParam(name = "code", value = "字典编号", paramType = "query", dataType = "string"), - @ApiImplicitParam(name = "dictValue", value = "字典名称", paramType = "query", dataType = "string") + @Parameters({ + @Parameter(name = "code", description = "字典编号", in = ParameterIn.QUERY, schema = @Schema(type = "string")), + @Parameter(name = "dictValue", description = "字典名称", in = ParameterIn.QUERY, schema = @Schema(type = "string")) }) @ApiOperationSupport(order = 2) - @ApiOperation(value = "列表", notes = "传入dict") - public R> list(@ApiIgnore @RequestParam Map dict) { + @Operation(summary = "列表", description = "传入dict") + public R> list(@Parameter(hidden = true) @RequestParam Map dict) { List list = dictService.list(Condition.getQueryWrapper(dict, Dict.class).lambda().orderByAsc(Dict::getSort)); return R.data(DictWrapper.build().listNodeVO(list)); } @@ -83,7 +87,7 @@ public class DictController extends BladeController { */ @GetMapping("/tree") @ApiOperationSupport(order = 3) - @ApiOperation(value = "树形结构", notes = "树形结构") + @Operation(summary = "树形结构", description = "树形结构") public R> tree() { List tree = dictService.tree(); return R.data(tree); @@ -94,7 +98,7 @@ public class DictController extends BladeController { */ @PostMapping("/submit") @ApiOperationSupport(order = 4) - @ApiOperation(value = "新增或修改", notes = "传入dict") + @Operation(summary = "新增或修改", description = "传入dict") public R submit(@Valid @RequestBody Dict dict) { return R.status(dictService.submit(dict)); } @@ -106,8 +110,8 @@ public class DictController extends BladeController { @PostMapping("/remove") @CacheEvict(cacheNames = {DICT_LIST, DICT_VALUE}, allEntries = true) @ApiOperationSupport(order = 5) - @ApiOperation(value = "删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + @Operation(summary = "删除", description = "传入ids") + public R remove(@Parameter(name = "主键集合", required = true) @RequestParam String ids) { return R.status(dictService.removeByIds(Func.toLongList(ids))); } @@ -118,7 +122,7 @@ public class DictController extends BladeController { */ @GetMapping("/dictionary") @ApiOperationSupport(order = 6) - @ApiOperation(value = "获取字典", notes = "获取字典") + @Operation(summary = "获取字典", description = "获取字典") public R> dictionary(String code) { List tree = dictService.getList(code); return R.data(tree); diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/MenuController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/MenuController.java index 30836e8..51e082c 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/controller/MenuController.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/controller/MenuController.java @@ -16,7 +16,13 @@ package org.springblade.system.controller; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.mp.support.Condition; @@ -33,9 +39,7 @@ import org.springblade.system.vo.GrantTreeVO; import org.springblade.system.vo.MenuVO; import org.springblade.system.wrapper.MenuWrapper; import org.springframework.web.bind.annotation.*; -import springfox.documentation.annotations.ApiIgnore; -import javax.validation.Valid; import java.util.List; import java.util.Map; @@ -47,7 +51,7 @@ import java.util.Map; @RestController @AllArgsConstructor @RequestMapping("/menu") -@Api(value = "菜单", tags = "菜单") +@Tag(name = "菜单", description = "菜单") public class MenuController extends BladeController { private IMenuService menuService; @@ -58,7 +62,7 @@ public class MenuController extends BladeController { @GetMapping("/detail") @PreAuth(RoleConstant.HAS_ROLE_ADMIN) @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入menu") + @Operation(summary = "详情", description = "传入menu") public R detail(Menu menu) { Menu detail = menuService.getOne(Condition.getQueryWrapper(menu)); return R.data(MenuWrapper.build().entityVO(detail)); @@ -68,14 +72,14 @@ public class MenuController extends BladeController { * 列表 */ @GetMapping("/list") - @ApiImplicitParams({ - @ApiImplicitParam(name = "code", value = "菜单编号", paramType = "query", dataType = "string"), - @ApiImplicitParam(name = "name", value = "菜单名称", paramType = "query", dataType = "string") + @Parameters({ + @Parameter(name = "code", description = "菜单编号", in = ParameterIn.QUERY, schema = @Schema(type = "string")), + @Parameter(name = "name", description = "菜单名称", in = ParameterIn.QUERY, schema = @Schema(type = "string")) }) @PreAuth(RoleConstant.HAS_ROLE_ADMIN) @ApiOperationSupport(order = 2) - @ApiOperation(value = "列表", notes = "传入menu") - public R> list(@ApiIgnore @RequestParam Map menu) { + @Operation(summary = "列表", description = "传入menu") + public R> list(@Parameter(hidden = true) @RequestParam Map menu) { List

list = menuService.list(Condition.getQueryWrapper(menu, Menu.class).lambda().orderByAsc(Menu::getSort)); return R.data(MenuWrapper.build().listNodeVO(list)); } @@ -84,14 +88,14 @@ public class MenuController extends BladeController { * 菜单列表 */ @GetMapping("/menu-list") - @ApiImplicitParams({ - @ApiImplicitParam(name = "code", value = "菜单编号", paramType = "query", dataType = "string"), - @ApiImplicitParam(name = "name", value = "菜单名称", paramType = "query", dataType = "string") + @Parameters({ + @Parameter(name = "code", description = "菜单编号", in = ParameterIn.QUERY, schema = @Schema(type = "string")), + @Parameter(name = "name", description = "菜单名称", in = ParameterIn.QUERY, schema = @Schema(type = "string")) }) @PreAuth(RoleConstant.HAS_ROLE_ADMIN) @ApiOperationSupport(order = 3) - @ApiOperation(value = "菜单列表", notes = "传入menu") - public R> menuList(@ApiIgnore @RequestParam Map menu) { + @Operation(summary = "菜单列表", description = "传入menu") + public R> menuList(@Parameter(hidden = true) @RequestParam Map menu) { List list = menuService.list(Condition.getQueryWrapper(menu, Menu.class).lambda().eq(Menu::getCategory, 1).orderByAsc(Menu::getSort)); return R.data(MenuWrapper.build().listNodeVO(list)); } @@ -100,14 +104,14 @@ public class MenuController extends BladeController { * 懒加载菜单列表 */ @GetMapping("/lazy-menu-list") - @ApiImplicitParams({ - @ApiImplicitParam(name = "code", value = "菜单编号", paramType = "query", dataType = "string"), - @ApiImplicitParam(name = "name", value = "菜单名称", paramType = "query", dataType = "string") + @Parameters({ + @Parameter(name = "code", description = "菜单编号", in = ParameterIn.QUERY, schema = @Schema(type = "string")), + @Parameter(name = "name", description = "菜单名称", in = ParameterIn.QUERY, schema = @Schema(type = "string")) }) @PreAuth(RoleConstant.HAS_ROLE_ADMIN) @ApiOperationSupport(order = 4) - @ApiOperation(value = "懒加载菜单列表", notes = "传入menu") - public R> lazyMenuList(Long parentId, @ApiIgnore @RequestParam Map menu) { + @Operation(summary = "懒加载菜单列表", description = "传入menu") + public R> lazyMenuList(Long parentId, @Parameter(hidden = true) @RequestParam Map menu) { List list = menuService.lazyMenuList(parentId, menu); return R.data(MenuWrapper.build().listNodeLazyVO(list)); } @@ -118,7 +122,7 @@ public class MenuController extends BladeController { @PostMapping("/submit") @PreAuth(RoleConstant.HAS_ROLE_ADMIN) @ApiOperationSupport(order = 5) - @ApiOperation(value = "新增或修改", notes = "传入menu") + @Operation(summary = "新增或修改", description = "传入menu") public R submit(@Valid @RequestBody Menu menu) { return R.status(menuService.saveOrUpdate(menu)); } @@ -130,8 +134,8 @@ public class MenuController extends BladeController { @PostMapping("/remove") @PreAuth(RoleConstant.HAS_ROLE_ADMIN) @ApiOperationSupport(order = 6) - @ApiOperation(value = "删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + @Operation(summary = "删除", description = "传入ids") + public R remove(@Parameter(name = "主键集合", required = true) @RequestParam String ids) { return R.status(menuService.removeByIds(Func.toLongList(ids))); } @@ -140,7 +144,7 @@ public class MenuController extends BladeController { */ @GetMapping("/routes") @ApiOperationSupport(order = 7) - @ApiOperation(value = "前端菜单数据", notes = "前端菜单数据") + @Operation(summary = "前端菜单数据", description = "前端菜单数据") public R> routes(BladeUser user) { List list = menuService.routes((user == null || user.getUserId() == 0L) ? null : user.getRoleId()); return R.data(list); @@ -151,7 +155,7 @@ public class MenuController extends BladeController { */ @GetMapping("/buttons") @ApiOperationSupport(order = 8) - @ApiOperation(value = "前端按钮数据", notes = "前端按钮数据") + @Operation(summary = "前端按钮数据", description = "前端按钮数据") public R> buttons(BladeUser user) { List list = menuService.buttons(user.getRoleId()); return R.data(list); @@ -162,7 +166,7 @@ public class MenuController extends BladeController { */ @GetMapping("/tree") @ApiOperationSupport(order = 9) - @ApiOperation(value = "树形结构", notes = "树形结构") + @Operation(summary = "树形结构", description = "树形结构") public R> tree() { List tree = menuService.tree(); return R.data(tree); @@ -173,7 +177,7 @@ public class MenuController extends BladeController { */ @GetMapping("/grant-tree") @ApiOperationSupport(order = 10) - @ApiOperation(value = "权限分配树形结构", notes = "权限分配树形结构") + @Operation(summary = "权限分配树形结构", description = "权限分配树形结构") public R grantTree(BladeUser user) { GrantTreeVO vo = new GrantTreeVO(); vo.setMenu(menuService.grantTree(user)); @@ -186,7 +190,7 @@ public class MenuController extends BladeController { */ @GetMapping("/role-tree-keys") @ApiOperationSupport(order = 11) - @ApiOperation(value = "角色所分配的树", notes = "角色所分配的树") + @Operation(summary = "角色所分配的树", description = "角色所分配的树") public R roleTreeKeys(String roleIds) { CheckedTreeVO vo = new CheckedTreeVO(); vo.setMenu(menuService.roleTreeKeys(roleIds)); @@ -199,7 +203,7 @@ public class MenuController extends BladeController { */ @GetMapping("auth-routes") @ApiOperationSupport(order = 12) - @ApiOperation(value = "菜单的角色权限") + @Operation(summary = "菜单的角色权限") public R> authRoutes(BladeUser user) { if (Func.isEmpty(user) || user.getUserId() == 0L) { return null; diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/ParamController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/ParamController.java index b456937..f49a3f5 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/controller/ParamController.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/controller/ParamController.java @@ -17,7 +17,13 @@ package org.springblade.system.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.mp.support.Condition; @@ -29,9 +35,7 @@ import org.springblade.core.tool.utils.Func; import org.springblade.system.entity.Param; import org.springblade.system.service.IParamService; import org.springframework.web.bind.annotation.*; -import springfox.documentation.annotations.ApiIgnore; -import javax.validation.Valid; import java.util.Map; /** @@ -42,7 +46,7 @@ import java.util.Map; @RestController @AllArgsConstructor @RequestMapping("/param") -@Api(value = "参数管理", tags = "接口") +@Tag(name = "参数管理", description = "接口") public class ParamController extends BladeController { private IParamService paramService; @@ -52,7 +56,7 @@ public class ParamController extends BladeController { */ @GetMapping("/detail") @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入param") + @Operation(summary = "详情", description = "传入param") public R detail(Param param) { Param detail = paramService.getOne(Condition.getQueryWrapper(param)); return R.data(detail); @@ -62,15 +66,15 @@ public class ParamController extends BladeController { * 分页 */ @GetMapping("/list") - @ApiImplicitParams({ - @ApiImplicitParam(name = "paramName", value = "参数名称", paramType = "query", dataType = "string"), - @ApiImplicitParam(name = "paramKey", value = "参数键名", paramType = "query", dataType = "string"), - @ApiImplicitParam(name = "paramValue", value = "参数键值", paramType = "query", dataType = "string") + @Parameters({ + @Parameter(name = "paramName", description = "参数名称", in = ParameterIn.QUERY, schema = @Schema(type = "string")), + @Parameter(name = "paramKey", description = "参数键名", in = ParameterIn.QUERY, schema = @Schema(type = "string")), + @Parameter(name = "paramValue", description = "参数键值", in = ParameterIn.QUERY, schema = @Schema(type = "string")) }) @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页", notes = "传入param") + @Operation(summary = "分页", description = "传入param") @PreAuth(RoleConstant.HAS_ROLE_ADMIN) - public R> list(@ApiIgnore @RequestParam Map param, Query query) { + public R> list(@Parameter(hidden = true) @RequestParam Map param, Query query) { IPage pages = paramService.page(Condition.getPage(query), Condition.getQueryWrapper(param, Param.class)); return R.data(pages); } @@ -80,7 +84,7 @@ public class ParamController extends BladeController { */ @PostMapping("/submit") @ApiOperationSupport(order = 3) - @ApiOperation(value = "新增或修改", notes = "传入param") + @Operation(summary = "新增或修改", description = "传入param") public R submit(@Valid @RequestBody Param param) { return R.status(paramService.saveOrUpdate(param)); } @@ -91,8 +95,8 @@ public class ParamController extends BladeController { */ @PostMapping("/remove") @ApiOperationSupport(order = 4) - @ApiOperation(value = "逻辑删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + @Operation(summary = "逻辑删除", description = "传入ids") + public R remove(@Parameter(name = "主键集合", required = true) @RequestParam String ids) { return R.status(paramService.deleteLogic(Func.toLongList(ids))); } diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/PostController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/PostController.java index 88ea440..dae2537 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/controller/PostController.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/controller/PostController.java @@ -18,9 +18,9 @@ package org.springblade.system.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.mp.support.Condition; @@ -35,7 +35,7 @@ import org.springblade.system.vo.PostVO; import org.springblade.system.wrapper.PostWrapper; import org.springframework.web.bind.annotation.*; -import javax.validation.Valid; +import jakarta.validation.Valid; import java.util.List; /** @@ -46,7 +46,7 @@ import java.util.List; @RestController @AllArgsConstructor @RequestMapping("/post") -@Api(value = "岗位表", tags = "岗位表接口") +@Tag(name = "岗位表", description = "岗位表接口") public class PostController extends BladeController { private IPostService postService; @@ -56,7 +56,7 @@ public class PostController extends BladeController { */ @GetMapping("/detail") @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入post") + @Operation(summary = "详情", description = "传入post") public R detail(Post post) { Post detail = postService.getOne(Condition.getQueryWrapper(post)); return R.data(PostWrapper.build().entityVO(detail)); @@ -67,7 +67,7 @@ public class PostController extends BladeController { */ @GetMapping("/list") @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页", notes = "传入post") + @Operation(summary = "分页", description = "传入post") public R> list(Post post, Query query) { IPage pages = postService.page(Condition.getPage(query), Condition.getQueryWrapper(post)); return R.data(PostWrapper.build().pageVO(pages)); @@ -79,7 +79,7 @@ public class PostController extends BladeController { */ @GetMapping("/page") @ApiOperationSupport(order = 3) - @ApiOperation(value = "分页", notes = "传入post") + @Operation(summary = "分页", description = "传入post") public R> page(PostVO post, Query query) { IPage pages = postService.selectPostPage(Condition.getPage(query), post); return R.data(pages); @@ -90,7 +90,7 @@ public class PostController extends BladeController { */ @PostMapping("/save") @ApiOperationSupport(order = 4) - @ApiOperation(value = "新增", notes = "传入post") + @Operation(summary = "新增", description = "传入post") public R save(@Valid @RequestBody Post post) { return R.status(postService.save(post)); } @@ -100,7 +100,7 @@ public class PostController extends BladeController { */ @PostMapping("/update") @ApiOperationSupport(order = 5) - @ApiOperation(value = "修改", notes = "传入post") + @Operation(summary = "修改", description = "传入post") public R update(@Valid @RequestBody Post post) { return R.status(postService.updateById(post)); } @@ -110,7 +110,7 @@ public class PostController extends BladeController { */ @PostMapping("/submit") @ApiOperationSupport(order = 6) - @ApiOperation(value = "新增或修改", notes = "传入post") + @Operation(summary = "新增或修改", description = "传入post") public R submit(@Valid @RequestBody Post post) { post.setTenantId(SecureUtil.getTenantId()); return R.status(postService.saveOrUpdate(post)); @@ -122,8 +122,8 @@ public class PostController extends BladeController { */ @PostMapping("/remove") @ApiOperationSupport(order = 7) - @ApiOperation(value = "逻辑删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + @Operation(summary = "逻辑删除", description = "传入ids") + public R remove(@Parameter(name = "主键集合", required = true) @RequestParam String ids) { return R.status(postService.deleteLogic(Func.toLongList(ids))); } @@ -132,7 +132,7 @@ public class PostController extends BladeController { */ @GetMapping("/select") @ApiOperationSupport(order = 8) - @ApiOperation(value = "下拉数据源", notes = "传入post") + @Operation(summary = "下拉数据源", description = "传入post") public R> select(String tenantId, BladeUser bladeUser) { List list = postService.list(Wrappers.query().lambda().eq(Post::getTenantId, Func.toStr(tenantId, bladeUser.getTenantId()))); return R.data(list); diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/RegionController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/RegionController.java index 68e3b2c..fb2e730 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/controller/RegionController.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/controller/RegionController.java @@ -18,7 +18,13 @@ package org.springblade.system.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.mp.support.Condition; @@ -29,9 +35,7 @@ import org.springblade.system.service.IRegionService; import org.springblade.system.vo.RegionVO; import org.springblade.system.wrapper.RegionWrapper; import org.springframework.web.bind.annotation.*; -import springfox.documentation.annotations.ApiIgnore; -import javax.validation.Valid; import java.util.List; import java.util.Map; @@ -43,7 +47,7 @@ import java.util.Map; @RestController @AllArgsConstructor @RequestMapping("/region") -@Api(value = "行政区划表", tags = "行政区划表接口") +@Tag(name = "行政区划表", description = "行政区划表接口") public class RegionController extends BladeController { private final IRegionService regionService; @@ -53,7 +57,7 @@ public class RegionController extends BladeController { */ @GetMapping("/detail") @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入region") + @Operation(summary = "详情", description = "传入region") public R detail(Region region) { Region detail = regionService.getOne(Condition.getQueryWrapper(region)); return R.data(RegionWrapper.build().entityVO(detail)); @@ -64,7 +68,7 @@ public class RegionController extends BladeController { */ @GetMapping("/list") @ApiOperationSupport(order = 2) - @ApiOperation(value = "分页", notes = "传入region") + @Operation(summary = "分页", description = "传入region") public R> list(Region region, Query query) { IPage pages = regionService.page(Condition.getPage(query), Condition.getQueryWrapper(region)); return R.data(pages); @@ -74,13 +78,13 @@ public class RegionController extends BladeController { * 懒加载列表 */ @GetMapping("/lazy-list") - @ApiImplicitParams({ - @ApiImplicitParam(name = "code", value = "区划编号", paramType = "query", dataType = "string"), - @ApiImplicitParam(name = "name", value = "区划名称", paramType = "query", dataType = "string") + @Parameters({ + @Parameter(name = "code", description = "区划编号", in = ParameterIn.QUERY, schema = @Schema(type = "string")), + @Parameter(name = "name", description = "区划名称", in = ParameterIn.QUERY, schema = @Schema(type = "string")) }) @ApiOperationSupport(order = 3) - @ApiOperation(value = "懒加载列表", notes = "传入menu") - public R> lazyList(String parentCode, @ApiIgnore @RequestParam Map menu) { + @Operation(summary = "懒加载列表", description = "传入menu") + public R> lazyList(String parentCode, @Parameter(hidden = true) @RequestParam Map menu) { List list = regionService.lazyList(parentCode, menu); return R.data(RegionWrapper.build().listNodeLazyVO(list)); } @@ -89,13 +93,13 @@ public class RegionController extends BladeController { * 懒加载列表 */ @GetMapping("/lazy-tree") - @ApiImplicitParams({ - @ApiImplicitParam(name = "code", value = "区划编号", paramType = "query", dataType = "string"), - @ApiImplicitParam(name = "name", value = "区划名称", paramType = "query", dataType = "string") + @Parameters({ + @Parameter(name = "code", description = "区划编号", in = ParameterIn.QUERY, schema = @Schema(type = "string")), + @Parameter(name = "name", description = "区划名称", in = ParameterIn.QUERY, schema = @Schema(type = "string")) }) @ApiOperationSupport(order = 4) - @ApiOperation(value = "懒加载列表", notes = "传入menu") - public R> lazyTree(String parentCode, @ApiIgnore @RequestParam Map menu) { + @Operation(summary = "懒加载列表", description = "传入menu") + public R> lazyTree(String parentCode, @Parameter(hidden = true) @RequestParam Map menu) { List list = regionService.lazyTree(parentCode, menu); return R.data(RegionWrapper.build().listNodeLazyVO(list)); } @@ -105,7 +109,7 @@ public class RegionController extends BladeController { */ @PostMapping("/save") @ApiOperationSupport(order = 5) - @ApiOperation(value = "新增", notes = "传入region") + @Operation(summary = "新增", description = "传入region") public R save(@Valid @RequestBody Region region) { return R.status(regionService.save(region)); } @@ -115,7 +119,7 @@ public class RegionController extends BladeController { */ @PostMapping("/update") @ApiOperationSupport(order = 6) - @ApiOperation(value = "修改", notes = "传入region") + @Operation(summary = "修改", description = "传入region") public R update(@Valid @RequestBody Region region) { return R.status(regionService.updateById(region)); } @@ -125,7 +129,7 @@ public class RegionController extends BladeController { */ @PostMapping("/submit") @ApiOperationSupport(order = 7) - @ApiOperation(value = "新增或修改", notes = "传入region") + @Operation(summary = "新增或修改", description = "传入region") public R submit(@Valid @RequestBody Region region) { return R.status(regionService.submit(region)); } @@ -136,8 +140,8 @@ public class RegionController extends BladeController { */ @PostMapping("/remove") @ApiOperationSupport(order = 8) - @ApiOperation(value = "删除", notes = "传入主键") - public R remove(@ApiParam(value = "主键", required = true) @RequestParam String id) { + @Operation(summary = "删除", description = "传入主键") + public R remove(@Parameter(name = "主键", required = true) @RequestParam String id) { return R.status(regionService.removeRegion(id)); } @@ -146,7 +150,7 @@ public class RegionController extends BladeController { */ @GetMapping("/select") @ApiOperationSupport(order = 9) - @ApiOperation(value = "下拉数据源", notes = "传入tenant") + @Operation(summary = "下拉数据源", description = "传入tenant") public R> select(@RequestParam(required = false, defaultValue = "00") String code) { List list = regionService.list(Wrappers.query().lambda().eq(Region::getParentCode, code)); return R.data(list); diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/RoleController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/RoleController.java index 4e747b2..e5d54e7 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/controller/RoleController.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/controller/RoleController.java @@ -17,7 +17,13 @@ package org.springblade.system.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.mp.support.Condition; @@ -32,9 +38,7 @@ import org.springblade.system.vo.GrantVO; import org.springblade.system.vo.RoleVO; import org.springblade.system.wrapper.RoleWrapper; import org.springframework.web.bind.annotation.*; -import springfox.documentation.annotations.ApiIgnore; -import javax.validation.Valid; import java.util.List; import java.util.Map; @@ -48,7 +52,7 @@ import static org.springblade.core.tool.utils.CacheUtil.SYS_CACHE; @RestController @AllArgsConstructor @RequestMapping("/role") -@Api(value = "角色", tags = "角色") +@Tag(name = "角色", description = "角色") public class RoleController extends BladeController { private IRoleService roleService; @@ -58,7 +62,7 @@ public class RoleController extends BladeController { */ @GetMapping("/detail") @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入role") + @Operation(summary = "详情", description = "传入role") public R detail(Role role) { Role detail = roleService.getOne(Condition.getQueryWrapper(role)); return R.data(RoleWrapper.build().entityVO(detail)); @@ -68,13 +72,13 @@ public class RoleController extends BladeController { * 列表 */ @GetMapping("/list") - @ApiImplicitParams({ - @ApiImplicitParam(name = "roleName", value = "参数名称", paramType = "query", dataType = "string"), - @ApiImplicitParam(name = "roleAlias", value = "角色别名", paramType = "query", dataType = "string") + @Parameters({ + @Parameter(name = "roleName", description = "参数名称", in = ParameterIn.QUERY, schema = @Schema(type = "string")), + @Parameter(name = "roleAlias", description = "角色别名", in = ParameterIn.QUERY, schema = @Schema(type = "string")) }) @ApiOperationSupport(order = 2) - @ApiOperation(value = "列表", notes = "传入role") - public R> list(@ApiIgnore @RequestParam Map role, BladeUser bladeUser) { + @Operation(summary = "列表", description = "传入role") + public R> list(@Parameter(hidden = true) @RequestParam Map role, BladeUser bladeUser) { QueryWrapper queryWrapper = Condition.getQueryWrapper(role, Role.class); List list = roleService.list((!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.lambda().eq(Role::getTenantId, bladeUser.getTenantId()) : queryWrapper); return R.data(RoleWrapper.build().listNodeVO(list)); @@ -85,7 +89,7 @@ public class RoleController extends BladeController { */ @GetMapping("/tree") @ApiOperationSupport(order = 3) - @ApiOperation(value = "树形结构", notes = "树形结构") + @Operation(summary = "树形结构", description = "树形结构") public R> tree(String tenantId, BladeUser bladeUser) { List tree = roleService.tree(Func.toStr(tenantId, bladeUser.getTenantId())); return R.data(tree); @@ -97,7 +101,7 @@ public class RoleController extends BladeController { */ @GetMapping("/tree-by-id") @ApiOperationSupport(order = 4) - @ApiOperation(value = "树形结构", notes = "树形结构") + @Operation(summary = "树形结构", description = "树形结构") public R> treeById(Long roleId, BladeUser bladeUser) { Role role = roleService.getById(roleId); List tree = roleService.tree(Func.notNull(role) ? role.getTenantId() : bladeUser.getTenantId()); @@ -109,7 +113,7 @@ public class RoleController extends BladeController { */ @PostMapping("/submit") @ApiOperationSupport(order = 5) - @ApiOperation(value = "新增或修改", notes = "传入role") + @Operation(summary = "新增或修改", description = "传入role") public R submit(@Valid @RequestBody Role role, BladeUser user) { CacheUtil.clear(SYS_CACHE); if (Func.isEmpty(role.getId())) { @@ -123,8 +127,8 @@ public class RoleController extends BladeController { */ @PostMapping("/remove") @ApiOperationSupport(order = 6) - @ApiOperation(value = "删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + @Operation(summary = "删除", description = "传入ids") + public R remove(@Parameter(name = "主键集合", required = true) @RequestParam String ids) { CacheUtil.clear(SYS_CACHE); return R.status(roleService.removeByIds(Func.toLongList(ids))); } @@ -134,7 +138,7 @@ public class RoleController extends BladeController { */ @PostMapping("/grant") @ApiOperationSupport(order = 7) - @ApiOperation(value = "权限设置", notes = "传入roleId集合以及menuId集合") + @Operation(summary = "权限设置", description = "传入roleId集合以及menuId集合") public R grant(@RequestBody GrantVO grantVO) { CacheUtil.clear(SYS_CACHE); boolean temp = roleService.grant(grantVO.getRoleIds(), grantVO.getMenuIds(), grantVO.getDataScopeIds()); diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/TenantController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/TenantController.java index 5341b11..520b6ac 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/controller/TenantController.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/controller/TenantController.java @@ -18,7 +18,14 @@ package org.springblade.system.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.Hidden; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.mp.support.Condition; @@ -31,9 +38,7 @@ import org.springblade.core.tool.utils.Func; import org.springblade.system.entity.Tenant; import org.springblade.system.service.ITenantService; import org.springframework.web.bind.annotation.*; -import springfox.documentation.annotations.ApiIgnore; -import javax.validation.Valid; import java.util.List; import java.util.Map; @@ -45,8 +50,8 @@ import java.util.Map; @RestController @AllArgsConstructor @RequestMapping("/tenant") -@ApiIgnore -@Api(value = "租户管理", tags = "接口") +@Hidden +@Tag(name = "租户管理", description = "接口") public class TenantController extends BladeController { private ITenantService tenantService; @@ -55,7 +60,7 @@ public class TenantController extends BladeController { * 详情 */ @GetMapping("/detail") - @ApiOperation(value = "详情", notes = "传入tenant") + @Operation(summary = "详情", description = "传入tenant") public R detail(Tenant tenant) { Tenant detail = tenantService.getOne(Condition.getQueryWrapper(tenant)); return R.data(detail); @@ -65,13 +70,13 @@ public class TenantController extends BladeController { * 分页 */ @GetMapping("/list") - @ApiImplicitParams({ - @ApiImplicitParam(name = "tenantId", value = "参数名称", paramType = "query", dataType = "string"), - @ApiImplicitParam(name = "tenantName", value = "角色别名", paramType = "query", dataType = "string"), - @ApiImplicitParam(name = "contactNumber", value = "联系电话", paramType = "query", dataType = "string") + @Parameters({ + @Parameter(name = "tenantId", description = "参数名称", in = ParameterIn.QUERY, schema = @Schema(type = "string")), + @Parameter(name = "tenantName", description = "角色别名", in = ParameterIn.QUERY, schema = @Schema(type = "string")), + @Parameter(name = "contactNumber", description = "联系电话", in = ParameterIn.QUERY, schema = @Schema(type = "string")) }) - @ApiOperation(value = "分页", notes = "传入tenant") - public R> list(@ApiIgnore @RequestParam Map tenant, Query query, BladeUser bladeUser) { + @Operation(summary = "分页", description = "传入tenant") + public R> list(@Parameter(hidden = true) @RequestParam Map tenant, Query query, BladeUser bladeUser) { QueryWrapper queryWrapper = Condition.getQueryWrapper(tenant, Tenant.class); IPage pages = tenantService.page(Condition.getPage(query), (!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.lambda().eq(Tenant::getTenantId, bladeUser.getTenantId()) : queryWrapper); return R.data(pages); @@ -81,7 +86,7 @@ public class TenantController extends BladeController { * 下拉数据源 */ @GetMapping("/select") - @ApiOperation(value = "下拉数据源", notes = "传入tenant") + @Operation(summary = "下拉数据源", description = "传入tenant") public R> select(Tenant tenant, BladeUser bladeUser) { QueryWrapper queryWrapper = Condition.getQueryWrapper(tenant); List list = tenantService.list((!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.lambda().eq(Tenant::getTenantId, bladeUser.getTenantId()) : queryWrapper); @@ -92,7 +97,7 @@ public class TenantController extends BladeController { * 自定义分页 */ @GetMapping("/page") - @ApiOperation(value = "分页", notes = "传入tenant") + @Operation(summary = "分页", description = "传入tenant") public R> page(Tenant tenant, Query query) { IPage pages = tenantService.selectTenantPage(Condition.getPage(query), tenant); return R.data(pages); @@ -102,7 +107,7 @@ public class TenantController extends BladeController { * 新增或修改 */ @PostMapping("/submit") - @ApiOperation(value = "新增或修改", notes = "传入tenant") + @Operation(summary = "新增或修改", description = "传入tenant") public R submit(@Valid @RequestBody Tenant tenant) { return R.status(tenantService.saveTenant(tenant)); } @@ -112,8 +117,8 @@ public class TenantController extends BladeController { * 删除 */ @PostMapping("/remove") - @ApiOperation(value = "逻辑删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + @Operation(summary = "逻辑删除", description = "传入ids") + public R remove(@Parameter(name = "主键集合", required = true) @RequestParam String ids) { return R.status(tenantService.deleteLogic(Func.toLongList(ids))); } @@ -123,7 +128,7 @@ public class TenantController extends BladeController { * @param domain 域名 */ @GetMapping("/info") - @ApiOperation(value = "配置信息", notes = "传入domain") + @Operation(summary = "配置信息", description = "传入domain") public R info(String domain) { Tenant tenant = tenantService.getOne(Wrappers.query().lambda().eq(Tenant::getDomain, domain)); Kv kv = Kv.init(); diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/feign/DataScopeClient.java b/blade-service/blade-system/src/main/java/org/springblade/system/feign/DataScopeClient.java index 9167bc4..ba9fc69 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/feign/DataScopeClient.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/feign/DataScopeClient.java @@ -24,7 +24,7 @@ import org.springframework.jdbc.core.BeanPropertyRowMapper; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; -import springfox.documentation.annotations.ApiIgnore; +import io.swagger.v3.oas.annotations.Hidden; import java.util.ArrayList; import java.util.Collections; @@ -35,7 +35,7 @@ import java.util.List; * * @author Chill */ -@ApiIgnore +@Hidden @RestController @RequiredArgsConstructor public class DataScopeClient implements IDataScopeClient { diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/feign/DictClient.java b/blade-service/blade-system/src/main/java/org/springblade/system/feign/DictClient.java index b10e0b1..a921158 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/feign/DictClient.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/feign/DictClient.java @@ -22,7 +22,7 @@ import org.springblade.system.entity.Dict; import org.springblade.system.service.IDictService; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; -import springfox.documentation.annotations.ApiIgnore; +import io.swagger.v3.oas.annotations.Hidden; import java.util.List; @@ -32,7 +32,7 @@ import java.util.List; * * @author Chill */ -@ApiIgnore +@Hidden @RestController @AllArgsConstructor public class DictClient implements IDictClient { diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/feign/SysClient.java b/blade-service/blade-system/src/main/java/org/springblade/system/feign/SysClient.java index add563a..cc2ec46 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/feign/SysClient.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/feign/SysClient.java @@ -26,7 +26,7 @@ import org.springblade.system.service.IRoleService; import org.springblade.system.service.ITenantService; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; -import springfox.documentation.annotations.ApiIgnore; +import io.swagger.v3.oas.annotations.Hidden; import java.util.List; @@ -35,7 +35,7 @@ import java.util.List; * * @author Chill */ -@ApiIgnore +@Hidden @RestController @AllArgsConstructor public class SysClient implements ISysClient { diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/service/IRoleService.java b/blade-service/blade-system/src/main/java/org/springblade/system/service/IRoleService.java index 48ca2d6..d061eae 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/service/IRoleService.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/service/IRoleService.java @@ -20,7 +20,7 @@ import com.baomidou.mybatisplus.extension.service.IService; import org.springblade.system.entity.Role; import org.springblade.system.vo.RoleVO; -import javax.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotEmpty; import java.util.List; /** diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/RoleServiceImpl.java b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/RoleServiceImpl.java index 1beaf07..907c92e 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/RoleServiceImpl.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/RoleServiceImpl.java @@ -35,7 +35,7 @@ import org.springblade.system.vo.RoleVO; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; -import javax.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotEmpty; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/DataScopeWrapper.java b/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/DataScopeWrapper.java index a4e0b93..9729da1 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/DataScopeWrapper.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/DataScopeWrapper.java @@ -44,7 +44,7 @@ public class DataScopeWrapper extends BaseEntityWrapper @Override public DataScopeVO entityVO(DataScope dataScope) { - DataScopeVO dataScopeVO = Objects.requireNonNull(BeanUtil.copy(dataScope, DataScopeVO.class)); + DataScopeVO dataScopeVO = Objects.requireNonNull(BeanUtil.copyProperties(dataScope, DataScopeVO.class)); String scopeTypeName = dictService.getValue("data_scope_type", dataScope.getScopeType()); dataScopeVO.setScopeTypeName(scopeTypeName); return dataScopeVO; diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/DeptWrapper.java b/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/DeptWrapper.java index deb91a4..bdd5ff5 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/DeptWrapper.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/DeptWrapper.java @@ -47,7 +47,7 @@ public class DeptWrapper extends BaseEntityWrapper { @Override public DeptVO entityVO(Dept dept) { - DeptVO deptVO = BeanUtil.copy(dept, DeptVO.class); + DeptVO deptVO = BeanUtil.copyProperties(dept, DeptVO.class); if (Func.equals(dept.getParentId(), CommonConstant.TOP_PARENT_ID)) { deptVO.setParentName(CommonConstant.TOP_PARENT_NAME); } else { @@ -58,7 +58,7 @@ public class DeptWrapper extends BaseEntityWrapper { } public List listNodeVO(List list) { - List collect = list.stream().map(dept -> BeanUtil.copy(dept, DeptVO.class)).collect(Collectors.toList()); + List collect = list.stream().map(dept -> BeanUtil.copyProperties(dept, DeptVO.class)).collect(Collectors.toList()); return ForestNodeMerger.merge(collect); } diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/DictWrapper.java b/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/DictWrapper.java index e45b7a6..ac50242 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/DictWrapper.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/DictWrapper.java @@ -47,7 +47,7 @@ public class DictWrapper extends BaseEntityWrapper { @Override public DictVO entityVO(Dict dict) { - DictVO dictVO = BeanUtil.copy(dict, DictVO.class); + DictVO dictVO = BeanUtil.copyProperties(dict, DictVO.class); if (Func.equals(dict.getParentId(), CommonConstant.TOP_PARENT_ID)) { dictVO.setParentName(CommonConstant.TOP_PARENT_NAME); } else { @@ -58,7 +58,7 @@ public class DictWrapper extends BaseEntityWrapper { } public List listNodeVO(List list) { - List collect = list.stream().map(dict -> BeanUtil.copy(dict, DictVO.class)).collect(Collectors.toList()); + List collect = list.stream().map(dict -> BeanUtil.copyProperties(dict, DictVO.class)).collect(Collectors.toList()); return ForestNodeMerger.merge(collect); } diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/MenuWrapper.java b/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/MenuWrapper.java index 5935308..2839c24 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/MenuWrapper.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/MenuWrapper.java @@ -52,7 +52,7 @@ public class MenuWrapper extends BaseEntityWrapper { @Override public MenuVO entityVO(Menu menu) { - MenuVO menuVO = BeanUtil.copy(menu, MenuVO.class); + MenuVO menuVO = BeanUtil.copyProperties(menu, MenuVO.class); if (Func.equals(menu.getParentId(), CommonConstant.TOP_PARENT_ID)) { menuVO.setParentName(CommonConstant.TOP_PARENT_NAME); } else { @@ -76,7 +76,7 @@ public class MenuWrapper extends BaseEntityWrapper { public List listNodeVO(List list) { - List collect = list.stream().map(menu -> BeanUtil.copy(menu, MenuVO.class)).collect(Collectors.toList()); + List collect = list.stream().map(menu -> BeanUtil.copyProperties(menu, MenuVO.class)).collect(Collectors.toList()); return ForestNodeMerger.merge(collect); } diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/PostWrapper.java b/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/PostWrapper.java index 6707aaa..73fa2b8 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/PostWrapper.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/PostWrapper.java @@ -43,7 +43,7 @@ public class PostWrapper extends BaseEntityWrapper { @Override public PostVO entityVO(Post post) { - PostVO postVO = Objects.requireNonNull(BeanUtil.copy(post, PostVO.class)); + PostVO postVO = Objects.requireNonNull(BeanUtil.copyProperties(post, PostVO.class)); String categoryName = dictService.getValue("post_category", post.getCategory()); postVO.setCategoryName(categoryName); return postVO; diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/RegionWrapper.java b/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/RegionWrapper.java index 4c036dc..2bcdbb0 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/RegionWrapper.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/RegionWrapper.java @@ -45,7 +45,7 @@ public class RegionWrapper extends BaseEntityWrapper { @Override public RegionVO entityVO(Region region) { - RegionVO regionVO = Objects.requireNonNull(BeanUtil.copy(region, RegionVO.class)); + RegionVO regionVO = Objects.requireNonNull(BeanUtil.copyProperties(region, RegionVO.class)); Region parentRegion = regionService.getById(region.getParentCode()); regionVO.setParentName(parentRegion.getName()); return regionVO; diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/RoleWrapper.java b/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/RoleWrapper.java index b3250a8..3f2bd24 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/RoleWrapper.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/wrapper/RoleWrapper.java @@ -47,7 +47,7 @@ public class RoleWrapper extends BaseEntityWrapper { @Override public RoleVO entityVO(Role role) { - RoleVO roleVO = BeanUtil.copy(role, RoleVO.class); + RoleVO roleVO = BeanUtil.copyProperties(role, RoleVO.class); if (Func.equals(role.getParentId(), CommonConstant.TOP_PARENT_ID)) { roleVO.setParentName(CommonConstant.TOP_PARENT_NAME); } else { diff --git a/blade-service/blade-user/Dockerfile b/blade-service/blade-user/Dockerfile index fd34191..2df08e7 100644 --- a/blade-service/blade-user/Dockerfile +++ b/blade-service/blade-user/Dockerfile @@ -1,6 +1,6 @@ -FROM anapsix/alpine-java:8_server-jre_unlimited +FROM bladex/alpine-java:openjdk17_cn_slim -MAINTAINER smallchill@163.com +MAINTAINER bladejava@qq.com RUN mkdir -p /blade/user @@ -10,6 +10,6 @@ EXPOSE 8102 ADD ./target/blade-user.jar ./app.jar -ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"] +ENTRYPOINT ["java", "--add-opens java.base/java.lang.reflect=ALL-UNNAMED", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"] CMD ["--spring.profiles.active=test"] diff --git a/blade-service/blade-user/pom.xml b/blade-service/blade-user/pom.xml index ab5eff8..6253841 100644 --- a/blade-service/blade-user/pom.xml +++ b/blade-service/blade-user/pom.xml @@ -5,7 +5,7 @@ blade-service org.springblade - 3.7.1 + 4.0.0 4.0.0 @@ -53,22 +53,6 @@ org.apache.maven.plugins maven-antrun-plugin - - - package - - run - - - - - - - - - diff --git a/blade-service/blade-user/src/main/java/org/springblade/system/user/controller/UserController.java b/blade-service/blade-user/src/main/java/org/springblade/system/user/controller/UserController.java index 0b842f9..df7fcc3 100644 --- a/blade-service/blade-user/src/main/java/org/springblade/system/user/controller/UserController.java +++ b/blade-service/blade-user/src/main/java/org/springblade/system/user/controller/UserController.java @@ -21,10 +21,13 @@ import com.alibaba.excel.read.builder.ExcelReaderBuilder; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.Valid; import lombok.AllArgsConstructor; import lombok.SneakyThrows; import org.springblade.core.mp.support.Condition; @@ -45,10 +48,7 @@ import org.springblade.system.user.wrapper.UserWrapper; import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; -import springfox.documentation.annotations.ApiIgnore; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; import java.io.BufferedInputStream; import java.io.IOException; import java.io.InputStream; @@ -74,7 +74,7 @@ public class UserController { * 查询单条 */ @ApiOperationSupport(order = 1) - @ApiOperation(value = "查看详情", notes = "传入id") + @Operation(summary = "查看详情", description = "传入id") @GetMapping("/detail") public R detail(User user) { User detail = userService.getOne(Condition.getQueryWrapper(user)); @@ -85,7 +85,7 @@ public class UserController { * 查询单条 */ @ApiOperationSupport(order =2) - @ApiOperation(value = "查看详情", notes = "传入id") + @Operation(summary = "查看详情", description = "传入id") @GetMapping("/info") public R info(BladeUser user) { User detail = userService.getById(user.getUserId()); @@ -96,13 +96,13 @@ public class UserController { * 用户列表 */ @GetMapping("/list") - @ApiImplicitParams({ - @ApiImplicitParam(name = "account", value = "账号名", paramType = "query", dataType = "string"), - @ApiImplicitParam(name = "realName", value = "姓名", paramType = "query", dataType = "string") + @Parameters({ + @Parameter(name = "account", description = "账号名", in = ParameterIn.QUERY, schema = @Schema(type = "string")), + @Parameter(name = "realName", description = "姓名", in = ParameterIn.QUERY, schema = @Schema(type = "string")) }) @ApiOperationSupport(order = 3) - @ApiOperation(value = "列表", notes = "传入account和realName") - public R> list(@ApiIgnore @RequestParam Map user, Query query, BladeUser bladeUser) { + @Operation(summary = "列表", description = "传入account和realName") + public R> list(@Parameter(hidden = true) @RequestParam Map user, Query query, BladeUser bladeUser) { QueryWrapper queryWrapper = Condition.getQueryWrapper(user, User.class); IPage pages = userService.page(Condition.getPage(query), (!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.lambda().eq(User::getTenantId, bladeUser.getTenantId()) : queryWrapper); return R.data(UserWrapper.build().pageVO(pages)); @@ -113,7 +113,7 @@ public class UserController { */ @PostMapping("/submit") @ApiOperationSupport(order = 4) - @ApiOperation(value = "新增或修改", notes = "传入User") + @Operation(summary = "新增或修改", description = "传入User") public R submit(@Valid @RequestBody User user) { return R.status(userService.submit(user)); } @@ -123,7 +123,7 @@ public class UserController { */ @PostMapping("/update") @ApiOperationSupport(order = 5) - @ApiOperation(value = "修改", notes = "传入User") + @Operation(summary = "修改", description = "传入User") public R update(@Valid @RequestBody User user) { return R.status(userService.updateById(user)); } @@ -133,7 +133,7 @@ public class UserController { */ @PostMapping("/remove") @ApiOperationSupport(order = 6) - @ApiOperation(value = "删除", notes = "传入地基和") + @Operation(summary = "删除", description = "传入地基和") public R remove(@RequestParam String ids) { return R.status(userService.deleteLogic(Func.toLongList(ids))); } @@ -148,17 +148,17 @@ public class UserController { */ @PostMapping("/grant") @ApiOperationSupport(order = 7) - @ApiOperation(value = "权限设置", notes = "传入roleId集合以及menuId集合") - public R grant(@ApiParam(value = "userId集合", required = true) @RequestParam String userIds, - @ApiParam(value = "roleId集合", required = true) @RequestParam String roleIds) { + @Operation(summary = "权限设置", description = "传入roleId集合以及menuId集合") + public R grant(@Parameter(name = "userId集合", required = true) @RequestParam String userIds, + @Parameter(name = "roleId集合", required = true) @RequestParam String roleIds) { boolean temp = userService.grant(userIds, roleIds); return R.status(temp); } @PostMapping("/reset-password") @ApiOperationSupport(order = 8) - @ApiOperation(value = "初始化密码", notes = "传入userId集合") - public R resetPassword(@ApiParam(value = "userId集合", required = true) @RequestParam String userIds) { + @Operation(summary = "初始化密码", description = "传入userId集合") + public R resetPassword(@Parameter(name = "userId集合", required = true) @RequestParam String userIds) { boolean temp = userService.resetPassword(userIds); return R.status(temp); } @@ -173,10 +173,10 @@ public class UserController { */ @PostMapping("/update-password") @ApiOperationSupport(order = 9) - @ApiOperation(value = "修改密码", notes = "传入密码") - public R updatePassword(BladeUser user, @ApiParam(value = "旧密码", required = true) @RequestParam String oldPassword, - @ApiParam(value = "新密码", required = true) @RequestParam String newPassword, - @ApiParam(value = "新密码", required = true) @RequestParam String newPassword1) { + @Operation(summary = "修改密码", description = "传入密码") + public R updatePassword(BladeUser user, @Parameter(name = "旧密码", required = true) @RequestParam String oldPassword, + @Parameter(name = "新密码", required = true) @RequestParam String newPassword, + @Parameter(name = "新密码", required = true) @RequestParam String newPassword1) { boolean temp = userService.updatePassword(user.getUserId(), oldPassword, newPassword, newPassword1); return R.status(temp); } @@ -189,7 +189,7 @@ public class UserController { */ @GetMapping("/user-list") @ApiOperationSupport(order = 10) - @ApiOperation(value = "用户列表", notes = "传入user") + @Operation(summary = "用户列表", description = "传入user") public R> userList(User user) { List list = userService.list(Condition.getQueryWrapper(user)); return R.data(list); @@ -201,7 +201,7 @@ public class UserController { */ @PostMapping("import-user") @ApiOperationSupport(order = 12) - @ApiOperation(value = "导入用户", notes = "传入excel") + @Operation(summary = "导入用户", description = "传入excel") public R importUser(MultipartFile file, Integer isCovered) { String filename = file.getOriginalFilename(); if (StringUtils.isEmpty(filename)) { @@ -228,9 +228,9 @@ public class UserController { @SneakyThrows @GetMapping("export-user") @ApiOperationSupport(order = 13) - @ApiOperation(value = "导出用户", notes = "传入user") + @Operation(summary = "导出用户", description = "传入user") @PreAuth(RoleConstant.HAS_ROLE_ADMIN) - public void exportUser(@ApiIgnore @RequestParam Map user, BladeUser bladeUser, HttpServletResponse response) { + public void exportUser(@Parameter(hidden = true) @RequestParam Map user, BladeUser bladeUser, HttpServletResponse response) { QueryWrapper queryWrapper = Condition.getQueryWrapper(user, User.class); if (!SecureUtil.isAdministrator()){ queryWrapper.lambda().eq(User::getTenantId, bladeUser.getTenantId()); @@ -250,7 +250,7 @@ public class UserController { @SneakyThrows @GetMapping("export-template") @ApiOperationSupport(order = 14) - @ApiOperation(value = "导出模板") + @Operation(summary = "导出模板") public void exportUser(HttpServletResponse response) { List list = new ArrayList<>(); response.setContentType("application/vnd.ms-excel"); @@ -265,7 +265,7 @@ public class UserController { */ @PostMapping("/register-guest") @ApiOperationSupport(order = 15) - @ApiOperation(value = "第三方注册用户", notes = "传入user") + @Operation(summary = "第三方注册用户", description = "传入user") public R registerGuest(User user, Long oauthId) { return R.status(userService.registerGuest(user, oauthId)); } diff --git a/blade-service/blade-user/src/main/java/org/springblade/system/user/excel/UserExcel.java b/blade-service/blade-user/src/main/java/org/springblade/system/user/excel/UserExcel.java index aee68b5..f460391 100644 --- a/blade-service/blade-user/src/main/java/org/springblade/system/user/excel/UserExcel.java +++ b/blade-service/blade-user/src/main/java/org/springblade/system/user/excel/UserExcel.java @@ -22,6 +22,7 @@ import com.alibaba.excel.annotation.write.style.ContentRowHeight; import com.alibaba.excel.annotation.write.style.HeadRowHeight; import lombok.Data; +import java.io.Serial; import java.io.Serializable; import java.util.Date; @@ -35,6 +36,7 @@ import java.util.Date; @HeadRowHeight(20) @ContentRowHeight(18) public class UserExcel implements Serializable { + @Serial private static final long serialVersionUID = 1L; @ColumnWidth(15) diff --git a/blade-service/blade-user/src/main/java/org/springblade/system/user/feign/UserClient.java b/blade-service/blade-user/src/main/java/org/springblade/system/user/feign/UserClient.java index ccda47b..310ac3e 100644 --- a/blade-service/blade-user/src/main/java/org/springblade/system/user/feign/UserClient.java +++ b/blade-service/blade-user/src/main/java/org/springblade/system/user/feign/UserClient.java @@ -15,6 +15,7 @@ */ package org.springblade.system.user.feign; +import io.swagger.v3.oas.annotations.Hidden; import lombok.AllArgsConstructor; import org.springblade.core.tool.api.R; import org.springblade.system.user.entity.User; @@ -30,6 +31,7 @@ import org.springframework.web.bind.annotation.RestController; * * @author Chill */ +@Hidden @RestController @AllArgsConstructor public class UserClient implements IUserClient { diff --git a/blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java b/blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java index 425b285..f8b64a7 100644 --- a/blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java +++ b/blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java @@ -160,7 +160,7 @@ public class UserServiceImpl extends BaseServiceImpl implement @Override public void importUser(List data) { data.forEach(userExcel -> { - User user = Objects.requireNonNull(BeanUtil.copy(userExcel, User.class)); + User user = Objects.requireNonNull(BeanUtil.copyProperties(userExcel, User.class)); // 设置部门ID user.setDeptId(sysClient.getDeptIds(userExcel.getTenantId(), userExcel.getDeptName())); // 设置岗位ID diff --git a/blade-service/blade-user/src/main/java/org/springblade/system/user/wrapper/UserWrapper.java b/blade-service/blade-user/src/main/java/org/springblade/system/user/wrapper/UserWrapper.java index c1495e8..e064084 100644 --- a/blade-service/blade-user/src/main/java/org/springblade/system/user/wrapper/UserWrapper.java +++ b/blade-service/blade-user/src/main/java/org/springblade/system/user/wrapper/UserWrapper.java @@ -49,7 +49,7 @@ public class UserWrapper extends BaseEntityWrapper { @Override public UserVO entityVO(User user) { - UserVO userVO = BeanUtil.copy(user, UserVO.class); + UserVO userVO = BeanUtil.copyProperties(user, UserVO.class); List roleName = userService.getRoleName(user.getRoleId()); List deptName = userService.getDeptName(user.getDeptId()); userVO.setRoleName(Func.join(roleName)); diff --git a/blade-service/pom.xml b/blade-service/pom.xml index 667ec23..a190fa9 100644 --- a/blade-service/pom.xml +++ b/blade-service/pom.xml @@ -7,12 +7,12 @@ org.springblade SpringBlade - 3.7.1 + 4.0.0 blade-service ${project.artifactId} - 3.7.1 + 4.0.0 pom SpringBlade 微服务集合 diff --git a/doc/docker/README.md b/doc/docker/README.md deleted file mode 100644 index c37106f..0000000 --- a/doc/docker/README.md +++ /dev/null @@ -1,95 +0,0 @@ -#使用docker构建工程步骤 -###1. 使用docker-harbor作为私有库,需要配置maven,找到setting.xml( `linux可以使用find / -name settings.xml`)加入以下配置 - -``` - - - 10.211.55.5 - admin - Harbor12345 - - smallchill@163.com - - - - - - com.spotify - -``` - -###2. docker开启远程访问 - -如果没有远程访问,会报 `Connect to 10.211.55.5:2375 [/10.211.55.5] failed: Connection refused: connect` - -在`/usr/lib/systemd/system/docker.service`,配置远程访问。主要是在[Service]这个部分,加上下面两个参数: - -``` -cd /usr/lib/systemd/system - -vi docker.service - -ExecStart= -ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock -``` - - - -###3. 在每个需要构建子项目的pom.xml下加入配置,内容可参考如下 - -``` - - - - com.spotify - docker-maven-plugin - ${docker.plugin.version} - - ${docker.registry.url}/blade/${project.artifactId}:${project.version} - ${project.basedir} - ${docker.registry.host} - - - / - ${project.build.directory} - ${project.build.finalName}.jar - - - ${docker.registry.url} - ${docker.registry.url} - true - - - - -``` - -###4. 在每个需要构建子项目的根目录下加入Dockerfile,内容可参考如下 - -``` -FROM anapsix/alpine-java:8_server-jre_unlimited - -MAINTAINER smallchill@163.com - -RUN mkdir -p /blade/gateway - -WORKDIR /blade/gateway - -EXPOSE 80 - -ADD ./target/blade-gateway.jar ./app.jar - -CMD java -Djava.security.egd=file:/dev/./urandom -jar app.jar --spring.profiles.active=test - -``` - -###5. 在工程根目录的docker-compose.yml下加入配置,内容可参考如下 -``` -blade-gateway: - image: "${REGISTER}/blade-gateway:${TAG}" - ports: - - 80:80 - networks: - blade_net: - ipv4_address: 192.168.2.1 -``` diff --git a/doc/nacos/blade-dev.yaml b/doc/nacos/blade-dev.yaml index ee93b8a..9d315f6 100644 --- a/doc/nacos/blade-dev.yaml +++ b/doc/nacos/blade-dev.yaml @@ -1,16 +1,18 @@ #spring配置 spring: - redis: - ##redis 单机环境配置 - host: 127.0.0.1 - port: 6379 - password: - database: 0 - ssl: false - ##redis 集群环境配置 - #cluster: - # nodes: 127.0.0.1:7001,127.0.0.1:7002,127.0.0.1:7003 - # commandTimeout: 5000 + data: + redis: + ##redis 单机环境配置 + host: 127.0.0.1 + port: 6379 + password: + database: 0 + ssl: + enabled: false + ##redis 集群环境配置 + #cluster: + # nodes: 127.0.0.1:7001,127.0.0.1:7002,127.0.0.1:7003 + # commandTimeout: 5000 #项目模块集中配置 blade: diff --git a/doc/nacos/blade-prod.yaml b/doc/nacos/blade-prod.yaml index b833ea9..0f088b7 100644 --- a/doc/nacos/blade-prod.yaml +++ b/doc/nacos/blade-prod.yaml @@ -1,16 +1,18 @@ #spring配置 spring: - redis: - ##redis 单机环境配置 - host: 10.211.55.5 - port: 3379 - password: - database: 0 - ssl: false - ##redis 集群环境配置 - #cluster: - # nodes: 127.0.0.1:7001,127.0.0.1:7002,127.0.0.1:7003 - # commandTimeout: 5000 + data: + redis: + ##redis 单机环境配置 + host: 10.211.55.5 + port: 3379 + password: + database: 0 + ssl: + enabled: false + ##redis 集群环境配置 + #cluster: + # nodes: 127.0.0.1:7001,127.0.0.1:7002,127.0.0.1:7003 + # commandTimeout: 5000 #项目模块集中配置 blade: diff --git a/doc/nacos/blade-test.yaml b/doc/nacos/blade-test.yaml index c428cf6..7b5544a 100644 --- a/doc/nacos/blade-test.yaml +++ b/doc/nacos/blade-test.yaml @@ -1,16 +1,18 @@ #spring配置 spring: - redis: - ##redis 单机环境配置 - host: 10.211.55.5 - port: 3379 - password: - database: 0 - ssl: false - ##redis 集群环境配置 - #cluster: - # nodes: 127.0.0.1:7001,127.0.0.1:7002,127.0.0.1:7003 - # commandTimeout: 5000 + data: + redis: + ##redis 单机环境配置 + host: 10.211.55.5 + port: 3379 + password: + database: 0 + ssl: + enabled: false + ##redis 集群环境配置 + #cluster: + # nodes: 127.0.0.1:7001,127.0.0.1:7002,127.0.0.1:7003 + # commandTimeout: 5000 #项目模块集中配置 blade: diff --git a/doc/nacos/blade.yaml b/doc/nacos/blade.yaml index 2ad3705..3ffc1a0 100644 --- a/doc/nacos/blade.yaml +++ b/doc/nacos/blade.yaml @@ -63,13 +63,13 @@ knife4j: language: zh_cn enableFooter: false enableFooterCustom: true - footerCustomContent: Copyright © 2023 SpringBlade All Rights Reserved + footerCustomContent: Copyright © 2024 SpringBlade All Rights Reserved #swagger配置信息 swagger: title: SpringBlade 接口文档系统 description: SpringBlade 接口文档系统 - version: 3.7.1 + version: 4.0.0 license: Powered By SpringBlade licenseUrl: https://bladex.cn terms-of-service-url: https://bladex.cn diff --git a/doc/sql/blade/blade-saber-mysql.sql b/doc/sql/blade/blade-saber-mysql.sql index 45fbfba..6a53d55 100644 --- a/doc/sql/blade/blade-saber-mysql.sql +++ b/doc/sql/blade/blade-saber-mysql.sql @@ -92,6 +92,7 @@ CREATE TABLE `blade_datasource` ( `password` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '密码', `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', `create_user` bigint(20) NULL DEFAULT NULL COMMENT '创建人', + `create_dept` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', `update_user` bigint(20) NULL DEFAULT NULL COMMENT '修改人', `update_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', @@ -104,7 +105,7 @@ CREATE TABLE `blade_datasource` ( -- Records of blade_datasource -- ---------------------------- BEGIN; -INSERT INTO `blade_datasource` VALUES (1123598812738675201, 'mysql', 'com.mysql.cj.jdbc.Driver', 'jdbc:mysql://localhost:3306/blade?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true', 'root', 'root', 'mysql', 1, '2019-08-14 11:43:06', 1, '2019-08-14 11:43:06', 1, 0), (1123598812738675202, 'postgresql', 'org.postgresql.Driver', 'jdbc:postgresql://127.0.0.1:5432/blade', 'postgres', '123456', 'postgresql', 1, '2019-08-14 11:43:41', 1, '2019-08-14 11:43:41', 1, 0), (1123598812738675203, 'oracle', 'oracle.jdbc.OracleDriver', 'jdbc:oracle:thin:@127.0.0.1:49161:orcl', 'BLADE', 'blade', 'oracle', 1, '2019-08-14 11:44:03', 1, '2019-08-14 11:44:03', 1, 0); +INSERT INTO `blade_datasource` VALUES (1123598812738675201, 'mysql', 'com.mysql.cj.jdbc.Driver', 'jdbc:mysql://localhost:3306/blade?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true', 'root', 'root', 'mysql', 1, 1123598813738675201, '2019-08-14 11:43:06', 1, '2019-08-14 11:43:06', 1, 0), (1123598812738675202, 'postgresql', 'org.postgresql.Driver', 'jdbc:postgresql://127.0.0.1:5432/blade', 'postgres', '123456', 'postgresql', 1, 1123598813738675201, '2019-08-14 11:43:41', 1, '2019-08-14 11:43:41', 1, 0), (1123598812738675203, 'oracle', 'oracle.jdbc.OracleDriver', 'jdbc:oracle:thin:@127.0.0.1:49161:orcl', 'BLADE', 'blade', 'oracle', 1, 1123598813738675201, '2019-08-14 11:44:03', 1, '2019-08-14 11:44:03', 1, 0); COMMIT; -- ---------------------------- diff --git a/doc/sql/blade/blade-sword-mysql.sql b/doc/sql/blade/blade-sword-mysql.sql index 6e3f047..df40355 100644 --- a/doc/sql/blade/blade-sword-mysql.sql +++ b/doc/sql/blade/blade-sword-mysql.sql @@ -92,6 +92,7 @@ CREATE TABLE `blade_datasource` ( `password` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '密码', `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', `create_user` bigint(20) NULL DEFAULT NULL COMMENT '创建人', + `create_dept` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', `update_user` bigint(20) NULL DEFAULT NULL COMMENT '修改人', `update_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', @@ -104,7 +105,7 @@ CREATE TABLE `blade_datasource` ( -- Records of blade_datasource -- ---------------------------- BEGIN; -INSERT INTO `blade_datasource` VALUES (1123598812738675201, 'mysql', 'com.mysql.cj.jdbc.Driver', 'jdbc:mysql://localhost:3306/blade?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true', 'root', 'root', 'mysql', 1, '2019-08-14 11:43:06', 1, '2019-08-14 11:43:06', 1, 0), (1123598812738675202, 'postgresql', 'org.postgresql.Driver', 'jdbc:postgresql://127.0.0.1:5432/blade', 'postgres', '123456', 'postgresql', 1, '2019-08-14 11:43:41', 1, '2019-08-14 11:43:41', 1, 0), (1123598812738675203, 'oracle', 'oracle.jdbc.OracleDriver', 'jdbc:oracle:thin:@127.0.0.1:49161:orcl', 'BLADE', 'blade', 'oracle', 1, '2019-08-14 11:44:03', 1, '2019-08-14 11:44:03', 1, 0); +INSERT INTO `blade_datasource` VALUES (1123598812738675201, 'mysql', 'com.mysql.cj.jdbc.Driver', 'jdbc:mysql://localhost:3306/blade?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true', 'root', 'root', 'mysql', 1, 1123598813738675201, '2019-08-14 11:43:06', 1, '2019-08-14 11:43:06', 1, 0), (1123598812738675202, 'postgresql', 'org.postgresql.Driver', 'jdbc:postgresql://127.0.0.1:5432/blade', 'postgres', '123456', 'postgresql', 1, 1123598813738675201, '2019-08-14 11:43:41', 1, '2019-08-14 11:43:41', 1, 0), (1123598812738675203, 'oracle', 'oracle.jdbc.OracleDriver', 'jdbc:oracle:thin:@127.0.0.1:49161:orcl', 'BLADE', 'blade', 'oracle', 1, 1123598813738675201, '2019-08-14 11:44:03', 1, '2019-08-14 11:44:03', 1, 0); COMMIT; -- ---------------------------- diff --git a/pom.xml b/pom.xml index e5730ab..0d8dd48 100644 --- a/pom.xml +++ b/pom.xml @@ -5,29 +5,29 @@ org.springblade SpringBlade - 3.7.1 + 4.0.0 pom - 3.7.1 - 3.7.1 + 4.0.0 + 4.0.0 - 1.8 - 3.8.1 + 17 + 3.11.0 - 4.3.0 + 4.5.0 1.6.0 1.6.2 - 2.2.11 - 2.3.2 - 8.0.32 + 3.3.4 + 3.1.3 - 5.3.31 - 2.7.18 - 2.7.14 - 2021.0.8 - 2021.0.5.0 - 2.1.2 + 6.1.5 + 3.2.4 + 3.2.3 + 2023.0.1 + + 2022.0.0.0 + 2.3.1 10.211.55.5 @@ -122,6 +122,27 @@ + + org.apache.maven.plugins + maven-antrun-plugin + 3.1.0 + + + package + + run + + + + + + + + + + @@ -141,6 +162,23 @@ + + org.commonjava.maven.plugins + directory-maven-plugin + 1.0 + + + directories + + highest-basedir + + initialize + + project.root.directory + + + + diff --git a/script/docker/.env b/script/docker/.env index 8c7cd9a..b1a9ae1 100644 --- a/script/docker/.env +++ b/script/docker/.env @@ -1,2 +1,2 @@ REGISTER=192.168.0.157/blade -TAG=3.7.1 +TAG=4.0.0 diff --git a/script/docker/deploy.sh b/script/docker/deploy.sh index 05ab558..9d6858e 100644 --- a/script/docker/deploy.sh +++ b/script/docker/deploy.sh @@ -46,7 +46,7 @@ base(){ #启动程序模块 modules(){ - docker-compose up -d blade-gateway1 blade-gateway2 blade-admin blade-swagger blade-auth1 blade-auth2 blade-user blade-desk blade-system blade-log blade-report blade-develop + docker-compose up -d blade-gateway1 blade-gateway2 blade-admin blade-auth1 blade-auth2 blade-user blade-desk blade-system blade-log blade-report blade-develop } #关闭所有模块 diff --git a/script/docker/docker-compose.yml b/script/docker/docker-compose.yml index 79931ca..be82eb7 100644 --- a/script/docker/docker-compose.yml +++ b/script/docker/docker-compose.yml @@ -1,9 +1,13 @@ version: '3' services: nacos: - image: nacos/nacos-server:v2.1.2 + image: nacos/nacos-server:v2.3.1 hostname: "nacos-standalone" environment: + - NACOS_AUTH_ENABLE=true + - NACOS_AUTH_CACHE_ENABLE=true + - NACOS_AUTH_IDENTITY_KEY=nacos + - NACOS_AUTH_IDENTITY_VALUE=nacos - MODE=standalone - TZ=Asia/Shanghai volumes: @@ -74,15 +78,6 @@ services: networks: - blade_net - blade-swagger: - image: "${REGISTER}/blade-swagger:${TAG}" - ports: - - 18000:18000 - privileged: true - restart: always - networks: - - blade_net - blade-gateway1: image: "${REGISTER}/blade-gateway:${TAG}" privileged: true diff --git a/script/docker/nacos/conf/application.properties b/script/docker/nacos/conf/application.properties index ac357a5..971c82f 100644 --- a/script/docker/nacos/conf/application.properties +++ b/script/docker/nacos/conf/application.properties @@ -4,31 +4,39 @@ server.contextPath=/nacos server.port=${NACOS_APPLICATION_PORT:8848} server.tomcat.accesslog.max-days=30 server.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D %{User-Agent}i %{Request-Source}i -spring.datasource.platform=${SPRING_DATASOURCE_PLATFORM:""} +server.tomcat.accesslog.enabled=${TOMCAT_ACCESSLOG_ENABLED:false} +server.error.include-message=ALWAYS +# default current work dir +server.tomcat.basedir=file:. +#*************** Config Module Related Configurations ***************# +### Deprecated configuration property, it is recommended to use `spring.sql.init.platform` replaced. +#spring.datasource.platform=${SPRING_DATASOURCE_PLATFORM:} +spring.sql.init.platform=${SPRING_DATASOURCE_PLATFORM:} nacos.cmdb.dumpTaskInterval=3600 nacos.cmdb.eventTaskInterval=10 nacos.cmdb.labelTaskInterval=300 nacos.cmdb.loadDataAtStart=false db.num=${MYSQL_DATABASE_NUM:1} db.url.0=jdbc:mysql://${MYSQL_SERVICE_HOST}:${MYSQL_SERVICE_PORT:3306}/${MYSQL_SERVICE_DB_NAME}?${MYSQL_SERVICE_DB_PARAM:characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useSSL=false} -db.url.1=jdbc:mysql://${MYSQL_SERVICE_HOST}:${MYSQL_SERVICE_PORT:3306}/${MYSQL_SERVICE_DB_NAME}?${MYSQL_SERVICE_DB_PARAM:characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useSSL=false} -db.user=${MYSQL_SERVICE_USER} -db.password=${MYSQL_SERVICE_PASSWORD} +db.user.0=${MYSQL_SERVICE_USER} +db.password.0=${MYSQL_SERVICE_PASSWORD} +## DB connection pool settings +db.pool.config.connectionTimeout=${DB_POOL_CONNECTION_TIMEOUT:30000} +db.pool.config.validationTimeout=10000 +db.pool.config.maximumPoolSize=20 +db.pool.config.minimumIdle=2 ### The auth system to use, currently only 'nacos' and 'ldap' is supported: nacos.core.auth.system.type=${NACOS_AUTH_SYSTEM_TYPE:nacos} ### worked when nacos.core.auth.system.type=nacos ### The token expiration in seconds: nacos.core.auth.plugin.nacos.token.expire.seconds=${NACOS_AUTH_TOKEN_EXPIRE_SECONDS:18000} ### The default token: -nacos.core.auth.plugin.nacos.token.secret.key=${NACOS_AUTH_TOKEN:SecretKey012345678901234567890123456789012345678901234567890123456789} +nacos.core.auth.plugin.nacos.token.secret.key=${NACOS_AUTH_TOKEN:} ### Turn on/off caching of auth information. By turning on this switch, the update of auth information would have a 15 seconds delay. nacos.core.auth.caching.enabled=${NACOS_AUTH_CACHE_ENABLE:false} nacos.core.auth.enable.userAgentAuthWhite=${NACOS_AUTH_USER_AGENT_AUTH_WHITE_ENABLE:false} -nacos.core.auth.server.identity.key=${NACOS_AUTH_IDENTITY_KEY:serverIdentity} -nacos.core.auth.server.identity.value=${NACOS_AUTH_IDENTITY_VALUE:security} -server.tomcat.accesslog.enabled=${TOMCAT_ACCESSLOG_ENABLED:false} -# default current work dir -server.tomcat.basedir=file:. +nacos.core.auth.server.identity.key=${NACOS_AUTH_IDENTITY_KEY:} +nacos.core.auth.server.identity.value=${NACOS_AUTH_IDENTITY_VALUE:} ## spring security config ### turn off security nacos.security.ignore.urls=${NACOS_SECURITY_IGNORE_URLS:/,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**} @@ -41,6 +49,7 @@ nacos.naming.distro.batchSyncKeyCount=1000 nacos.naming.distro.initDataRatio=0.9 nacos.naming.distro.syncRetryDelay=5000 nacos.naming.data.warmup=true - +nacos.console.ui.enabled=true +nacos.core.param.check.enabled=true diff --git a/script/kuboard/kuboard_spring-blade.yaml b/script/kuboard/kuboard_spring-blade.yaml index cc506ba..323e165 100644 --- a/script/kuboard/kuboard_spring-blade.yaml +++ b/script/kuboard/kuboard_spring-blade.yaml @@ -152,7 +152,7 @@ spec: spec: containers: - name: blade-admin - image: 'swr.cn-east-2.myhuaweicloud.com/blade/blade-admin:3.7.1' + image: 'swr.cn-east-2.myhuaweicloud.com/blade/blade-admin:4.0.0' args: - '--spring.profiles.active=${PROFILE}' - '--spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}' @@ -386,7 +386,7 @@ spec: spec: containers: - name: blade-auth - image: 'swr.cn-east-2.myhuaweicloud.com/blade/blade-auth:3.7.1' + image: 'swr.cn-east-2.myhuaweicloud.com/blade/blade-auth:4.0.0' args: - '--spring.profiles.active=${PROFILE}' - '--spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}' @@ -625,7 +625,7 @@ spec: spec: containers: - name: blade-desk - image: 'swr.cn-east-2.myhuaweicloud.com/blade/blade-desk:3.7.1' + image: 'swr.cn-east-2.myhuaweicloud.com/blade/blade-desk:4.0.0' args: - '--spring.profiles.active=${PROFILE}' - '--spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}' @@ -864,7 +864,7 @@ spec: spec: containers: - name: blade-develop - image: 'swr.cn-east-2.myhuaweicloud.com/blade/blade-develop:3.7.1' + image: 'swr.cn-east-2.myhuaweicloud.com/blade/blade-develop:4.0.0' args: - '--spring.profiles.active=${PROFILE}' - '--spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}' @@ -1096,7 +1096,7 @@ spec: spec: containers: - name: blade-gateway - image: 'swr.cn-east-2.myhuaweicloud.com/blade/blade-gateway:3.7.1' + image: 'swr.cn-east-2.myhuaweicloud.com/blade/blade-gateway:4.0.0' args: - '--spring.profiles.active=${PROFILE}' - '--spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}' @@ -1331,7 +1331,7 @@ spec: spec: containers: - name: blade-log - image: 'swr.cn-east-2.myhuaweicloud.com/blade/blade-log:3.7.1' + image: 'swr.cn-east-2.myhuaweicloud.com/blade/blade-log:4.0.0' args: - '--spring.profiles.active=${PROFILE}' - '--spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}' @@ -1565,7 +1565,7 @@ spec: spec: containers: - name: blade-report - image: 'swr.cn-east-2.myhuaweicloud.com/blade/blade-report:3.7.1' + image: 'swr.cn-east-2.myhuaweicloud.com/blade/blade-report:4.0.0' args: - '--spring.profiles.active=${PROFILE}' - '--spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}' @@ -1799,7 +1799,7 @@ spec: spec: containers: - name: blade-resource - image: 'swr.cn-east-2.myhuaweicloud.com/blade/blade-resource:3.7.1' + image: 'swr.cn-east-2.myhuaweicloud.com/blade/blade-resource:4.0.0' args: - '--spring.profiles.active=${PROFILE}' - '--spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}' @@ -2033,7 +2033,7 @@ spec: spec: containers: - name: blade-system - image: 'swr.cn-east-2.myhuaweicloud.com/blade/blade-system:3.7.1' + image: 'swr.cn-east-2.myhuaweicloud.com/blade/blade-system:4.0.0' args: - '--spring.profiles.active=${PROFILE}' - '--spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}' @@ -2267,7 +2267,7 @@ spec: spec: containers: - name: blade-user - image: 'swr.cn-east-2.myhuaweicloud.com/blade/blade-user:3.7.1' + image: 'swr.cn-east-2.myhuaweicloud.com/blade/blade-user:4.0.0' args: - '--spring.profiles.active=${PROFILE}' - '--spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}' @@ -2496,7 +2496,7 @@ spec: spec: containers: - name: saber-web - image: 'swr.cn-east-2.myhuaweicloud.com/blade/saber-web:3.7.1' + image: 'swr.cn-east-2.myhuaweicloud.com/blade/saber-web:4.0.0' ports: - name: web containerPort: 80 @@ -2721,7 +2721,7 @@ spec: spec: containers: - name: blade-swagger - image: 'swr.cn-east-2.myhuaweicloud.com/blade/blade-swagger:3.7.1' + image: 'swr.cn-east-2.myhuaweicloud.com/blade/blade-swagger:4.0.0' args: - '--spring.profiles.active=${PROFILE}' - '--spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}' @@ -3749,7 +3749,7 @@ spec: spec: containers: - name: mysql - image: 'swr.cn-east-2.myhuaweicloud.com/blade/saber-db:v3.7.1' + image: 'swr.cn-east-2.myhuaweicloud.com/blade/saber-db:v4.0.0' ports: - name: mysql containerPort: 3306 diff --git a/script/service/rename.sh b/script/service/rename.sh new file mode 100755 index 0000000..4d74b9c --- /dev/null +++ b/script/service/rename.sh @@ -0,0 +1,96 @@ +#!/bin/bash + +# Copyright (c) 2018-2028, Chill Zhuang 庄骞 (bladejava@qq.com). +#

+# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +#

+# http://www.apache.org/licenses/LICENSE-2.0 +#

+# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +################################################################ +# BladeX 一键修改包名与引用路径(注意需要同时将blade-tool修改并安装依赖) # +################################################################ +# original_project_path: 填写你需要修改的项目全路径 # +# new_project_suffix: 源工程文件拷贝至新目录的后缀名 # +# old_package: 需要替换的原包名 # +# new_package: 需要设置的新包名 # +################################################################ + +# 原始工程目录路径 +original_project_path="/your/project/path/here" +# 新工程目录名后缀 +new_project_suffix="-new" +# 设置原始包名 +old_package="org.springblade" +# 设置新包名 +new_package="com.example" + +echo "copying project..." + +# 新工程目录路径 +new_project_path="${original_project_path}${new_project_suffix}" + +# 拷贝工程目录 +cp -r "$original_project_path" "$new_project_path" + +# 将包名转换为路径 +old_package_path=$(echo "$old_package" | sed 's/\./\//g') +new_package_path=$(echo "$new_package" | sed 's/\./\//g') + +# 检查操作系统 +os_name=$(uname) +sed_i_option="-i" +if [ "$os_name" = "Darwin" ]; then + # MacOS 需要一个空的扩展名来避免创建备份文件 + sed_i_option="-i ''" +else + # 对于非MacOS系统,使用-i选项,不提供扩展名,避免创建备份文件 + sed_i_option="-i" +fi + +echo "replacing package names and moving files..." +# 查找并替换Java、XML、Properties和YAML文件中的包名 +# 同时移动文件到新的目录结构 +find "$new_project_path" \( -iname "*.java" -o -iname "*.xml" -o -iname "*.properties" -o -iname "*.yml" -o -iname "*.yaml" \) -print0 | while IFS= read -r -d $'\0' file; do + # 替换文件中的包名 + if [ "$os_name" = "Darwin" ]; then + sed -i '' "s|$old_package|$new_package|g" "$file" + else + sed -i "s|$old_package|$new_package|g" "$file" + fi + echo "modified: $file" + + # 如果文件路径包含旧包名路径,则移动文件 + if echo "$file" | grep -q "$old_package_path"; then + new_file=$(echo "$file" | sed "s|$old_package_path|$new_package_path|g") + new_dir=$(dirname "$new_file") + mkdir -p "$new_dir" + mv "$file" "$new_file" + echo "moved to: $new_file" + fi +done + +# 删除空目录的逻辑,确保包括顶层目录在内的所有空目录都被删除 +echo "removing empty directories..." +find "$new_project_path" -type d -empty -delete 2>/dev/null + +# 从新工程目录的根部开始,递归删除所有空的目录 +# 这个过程需要重复,直到没有更多的空目录为止 +while IFS= read -r -d '' dir; do + find "$dir" -type d -empty -delete 2>/dev/null +done < <(find "$new_project_path" -type d -print0 | sort -rz) + +# 检查并删除原始包名的顶级目录 +top_level_old_package_dir="$new_project_path/$(echo "$old_package" | cut -d '.' -f 1)" +if [ -d "$top_level_old_package_dir" ] && [ ! "$(ls -A "$top_level_old_package_dir")" ]; then + rm -r "$top_level_old_package_dir" +fi + +echo "package name and paths have been updated in the new project directory." diff --git a/script/fatjar/service.cmd b/script/service/service.cmd similarity index 100% rename from script/fatjar/service.cmd rename to script/service/service.cmd diff --git a/script/fatjar/service.sh b/script/service/service.sh similarity index 100% rename from script/fatjar/service.sh rename to script/service/service.sh