From dc464ebee8ef65fcc687ef2c1b3933b3027eb9b4 Mon Sep 17 00:00:00 2001 From: Bunny <1319900154@qq.com> Date: Sat, 27 Jul 2024 23:18:30 +0800 Subject: [PATCH] =?UTF-8?q?=20feat(=E4=BF=AE=E6=94=B9):=20:art:=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8C=85=E9=BB=84=E8=89=B2=E8=AD=A6=E5=91=8A?= =?UTF-8?q?;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/common-generator/pom.xml | 20 ------- common/pom.xml | 9 ++++ common/service-utils/pom.xml | 19 ------- .../service/config/MybatisPlusConfig.java | 6 --- .../cn/bunny/entity/system/log/SystemLog.java | 25 ++------- module/pom.xml | 4 ++ pom.xml | 20 ++++--- server-gateway/pom.xml | 54 +++++++++++++++++-- .../src/main/resources/application-dev.yml | 4 +- .../src/main/resources/application-prod.yml | 4 +- service-client/pom.xml | 5 +- service/pom.xml | 23 ++++---- service/service-admin/pom.xml | 13 ++++- .../service/admin/config/Knife4jConfig.java | 9 +--- .../src/main/resources/application-dev.yml | 8 +-- .../src/main/resources/application-prod.yml | 8 +-- .../src/main/resources/application.yml | 1 + service/service-web/pom.xml | 4 +- .../service/web/config/Knife4jConfig.java | 3 +- .../src/main/resources/application-dev.yml | 10 ++-- .../src/main/resources/application-prod.yml | 10 ++-- 21 files changed, 135 insertions(+), 124 deletions(-) diff --git a/common/common-generator/pom.xml b/common/common-generator/pom.xml index 0b2d1ba..7f9528f 100644 --- a/common/common-generator/pom.xml +++ b/common/common-generator/pom.xml @@ -18,10 +18,6 @@ - - org.projectlombok - lombok - javax.xml.bind jaxb-api @@ -36,22 +32,6 @@ org.apache.velocity.tools velocity-tools-generic - - - mysql - mysql-connector-java - - - - com.zaxxer - HikariCP - 5.1.0 - - - - com.baomidou - mybatis-plus-spring-boot3-starter - com.baomidou diff --git a/common/pom.xml b/common/pom.xml index 2569da4..a253a67 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -18,6 +18,15 @@ + + cn.bunny + dao + 0.0.1-SNAPSHOT + + + org.springframework.boot + spring-boot-starter-web + com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/common/service-utils/pom.xml b/common/service-utils/pom.xml index 8cc554e..e46a239 100644 --- a/common/service-utils/pom.xml +++ b/common/service-utils/pom.xml @@ -17,11 +17,6 @@ - - cn.bunny - dao - 0.0.1-SNAPSHOT - org.apache.httpcomponents @@ -34,15 +29,6 @@ jaxb-api 2.3.1 - - - com.github.xiaoymin - knife4j-openapi3-jakarta-spring-boot-starter - - - org.springframework.boot - spring-boot-starter-web - org.springframework.boot @@ -54,11 +40,6 @@ redisson 3.26.1 - - - com.github.pagehelper - pagehelper - org.lionsoul diff --git a/common/service-utils/src/main/java/cn/bunny/common/service/config/MybatisPlusConfig.java b/common/service-utils/src/main/java/cn/bunny/common/service/config/MybatisPlusConfig.java index 013c778..519a465 100644 --- a/common/service-utils/src/main/java/cn/bunny/common/service/config/MybatisPlusConfig.java +++ b/common/service-utils/src/main/java/cn/bunny/common/service/config/MybatisPlusConfig.java @@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; import com.baomidou.mybatisplus.extension.plugins.inner.BlockAttackInnerInterceptor; import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor; import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; -import com.github.pagehelper.PageInterceptor; import lombok.extern.slf4j.Slf4j; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -34,9 +33,4 @@ public class MybatisPlusConfig { return interceptor; } - - @Bean// pagehelper分页插件需要配的拦截器 - public PageInterceptor pageInterceptor() { - return new PageInterceptor(); - } } diff --git a/dao/src/main/java/cn/bunny/entity/system/log/SystemLog.java b/dao/src/main/java/cn/bunny/entity/system/log/SystemLog.java index 02a0f00..1e06d23 100644 --- a/dao/src/main/java/cn/bunny/entity/system/log/SystemLog.java +++ b/dao/src/main/java/cn/bunny/entity/system/log/SystemLog.java @@ -1,7 +1,6 @@ package cn.bunny.entity.system.log; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; +import cn.bunny.entity.base.BaseEntity; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -11,7 +10,6 @@ import lombok.experimental.Accessors; import java.io.Serial; import java.io.Serializable; -import java.time.LocalDateTime; /** *

@@ -26,14 +24,11 @@ import java.time.LocalDateTime; @Accessors(chain = true) @TableName("system_log") @ApiModel(value = "SystemLog对象", description = "系统日志表") -public class SystemLog implements Serializable { +public class SystemLog extends BaseEntity implements Serializable { @Serial private static final long serialVersionUID = 1L; - @TableId(value = "id", type = IdType.ASSIGN_ID) - private Long id; - @ApiModelProperty("所在类路径") private String classPath; @@ -44,7 +39,7 @@ public class SystemLog implements Serializable { private String args; @ApiModelProperty("返回参数") - private String result; + private Object result; @ApiModelProperty("报错堆栈") private String errorStack; @@ -63,16 +58,4 @@ public class SystemLog implements Serializable { @ApiModelProperty("当前用户IP地址") private String ipAddress; - - @ApiModelProperty("创建时间") - private LocalDateTime createTime; - - @ApiModelProperty("更新时间") - private LocalDateTime updateTime; - - @ApiModelProperty("更新用户") - private Long updateUser; - - @ApiModelProperty("是否被删除") - private Boolean isDeleted; -} +} \ No newline at end of file diff --git a/module/pom.xml b/module/pom.xml index e042973..cc91545 100644 --- a/module/pom.xml +++ b/module/pom.xml @@ -31,5 +31,9 @@ service-utils 0.0.1-SNAPSHOT + + org.springframework.boot + spring-boot-starter-web + \ No newline at end of file diff --git a/pom.xml b/pom.xml index eb20355..18e610a 100644 --- a/pom.xml +++ b/pom.xml @@ -33,6 +33,8 @@ 3.8.1 3.5.6 8.0.30 + 5.1.0 + 4.3.1 4.5.0 2.0.47 8.5.9 @@ -46,7 +48,6 @@ 2023.0.1.0 2023.0.0.0-RC1 4.1.2 - 6.1.0 2.3 3.1 @@ -81,6 +82,18 @@ mysql-connector-java ${mysql.version} + + + com.zaxxer + HikariCP + ${HikariCP.version} + + + + com.baomidou + dynamic-datasource-spring-boot3-starter + ${dynamic.datasource.version} + com.github.xiaoymin @@ -178,11 +191,6 @@ jackson-datatype-jsr310 2.12.3 - - com.github.pagehelper - pagehelper - ${pagehelper.version} - diff --git a/server-gateway/pom.xml b/server-gateway/pom.xml index 8d1d521..3bbbb18 100644 --- a/server-gateway/pom.xml +++ b/server-gateway/pom.xml @@ -15,8 +15,8 @@ UTF-8 - 192.168.3.98:1100 - 192.168.3.98:2375 + 192.168.3.100:1100 + 192.168.3.100:2375 bunny-service-gateway @@ -25,7 +25,6 @@ org.springframework.cloud spring-cloud-starter-gateway - 4.1.2 org.projectlombok @@ -47,7 +46,6 @@ com.alibaba.cloud spring-cloud-starter-alibaba-sentinel - 2023.0.1.0 @@ -55,6 +53,52 @@ - + + + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + com.spotify + docker-maven-plugin + 1.2.2 + + + + build-image + + package + + build + push + + + + + harbor + http://${docker.repostory} + + http://${docker.host} + + + ${docker.repostory}/${docker.registry.name}/${project.artifactId}:${project.version} + + + ${project.basedir} + + false + + + + diff --git a/server-gateway/src/main/resources/application-dev.yml b/server-gateway/src/main/resources/application-dev.yml index da4c8ab..c374462 100644 --- a/server-gateway/src/main/resources/application-dev.yml +++ b/server-gateway/src/main/resources/application-dev.yml @@ -1,13 +1,13 @@ bunny: nacos: - server-addr: 192.168.3.98:8848 + server-addr: 192.168.3.100:8848 discovery: namespace: bunnyBBS username: nacos password: "02120212" redis: - host: 192.168.3.98 + host: 192.168.3.100 port: 6379 database: 1 password: "123456" \ No newline at end of file diff --git a/server-gateway/src/main/resources/application-prod.yml b/server-gateway/src/main/resources/application-prod.yml index da4c8ab..c374462 100644 --- a/server-gateway/src/main/resources/application-prod.yml +++ b/server-gateway/src/main/resources/application-prod.yml @@ -1,13 +1,13 @@ bunny: nacos: - server-addr: 192.168.3.98:8848 + server-addr: 192.168.3.100:8848 discovery: namespace: bunnyBBS username: nacos password: "02120212" redis: - host: 192.168.3.98 + host: 192.168.3.100 port: 6379 database: 1 password: "123456" \ No newline at end of file diff --git a/service-client/pom.xml b/service-client/pom.xml index 8ef5227..3a11a97 100644 --- a/service-client/pom.xml +++ b/service-client/pom.xml @@ -23,12 +23,15 @@ dao 0.0.1-SNAPSHOT + + org.springframework.boot + spring-boot-starter-web + org.springframework.cloud spring-cloud-starter-openfeign - org.springframework.cloud diff --git a/service/pom.xml b/service/pom.xml index 45d8e0e..bccdaa1 100644 --- a/service/pom.xml +++ b/service/pom.xml @@ -21,6 +21,15 @@ + + cn.bunny + dao + 0.0.1-SNAPSHOT + + + org.springframework.boot + spring-boot-starter-web + junit @@ -46,6 +55,10 @@ org.aspectj aspectjrt + + org.aspectj + aspectjweaver + mysql @@ -55,16 +68,6 @@ com.zaxxer HikariCP - 5.1.0 - - - - com.baomidou - mybatis-plus-spring-boot3-starter - - - org.aspectj - aspectjweaver diff --git a/service/service-admin/pom.xml b/service/service-admin/pom.xml index b894921..58ab42b 100644 --- a/service/service-admin/pom.xml +++ b/service/service-admin/pom.xml @@ -15,8 +15,8 @@ UTF-8 - 192.168.3.98:1100 - 192.168.3.98:2375 + 192.168.3.100:1100 + 192.168.3.100:2375 bunny-admin @@ -35,6 +35,15 @@ module-minio 0.0.1-SNAPSHOT + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.security + spring-security-test + diff --git a/service/service-admin/src/main/java/cn/bunny/service/admin/config/Knife4jConfig.java b/service/service-admin/src/main/java/cn/bunny/service/admin/config/Knife4jConfig.java index d1b84ea..9621031 100644 --- a/service/service-admin/src/main/java/cn/bunny/service/admin/config/Knife4jConfig.java +++ b/service/service-admin/src/main/java/cn/bunny/service/admin/config/Knife4jConfig.java @@ -15,13 +15,12 @@ import org.springframework.context.annotation.Configuration; public class Knife4jConfig { @Bean public OpenAPI openAPI() { - log.info("Knife4jConfig===>配置knife4j"); // 作者等信息 Contact contact = new Contact().name("Bunny").email("1319900154@qq.com").url("http://z-bunny.com"); // 使用协议 License license = new License().name("MIT").url("http://MUT.com"); // 相关信息 - Info info = new Info().title("Bunny-Java-Template").description("Bunny的Java模板").version("v1.0.0").contact(contact).license(license); + Info info = new Info().title("Bunny-Java-Template").description("Bunny的Java模板").version("v1.0.0").contact(contact).license(license).termsOfService("记得给我start"); return new OpenAPI().info(info).externalDocs(new ExternalDocumentation()); } @@ -31,10 +30,4 @@ public class Knife4jConfig { public GroupedOpenApi groupedOpenAdminApi() { return GroupedOpenApi.builder().group("管理员接口请求").pathsToMatch("/admin/**").build(); } - - // 测试相关分类接口 - @Bean - public GroupedOpenApi testGroupedOpenApi() { - return GroupedOpenApi.builder().group("测试相关分类接口").pathsToMatch("/test/**").build(); - } } diff --git a/service/service-admin/src/main/resources/application-dev.yml b/service/service-admin/src/main/resources/application-dev.yml index b2647c4..1d8defb 100644 --- a/service/service-admin/src/main/resources/application-dev.yml +++ b/service/service-admin/src/main/resources/application-dev.yml @@ -1,25 +1,25 @@ bunny: datasource: - host: 192.168.3.98 + host: 192.168.3.100 port: 3305 sqlData: bunny_docs username: root password: "02120212" redis: - host: 192.168.3.98 + host: 192.168.3.100 port: 6379 database: 1 password: "123456" minio: - endpointUrl: "http://192.168.3.98:9000" + endpointUrl: "http://192.168.3.100:9000" accessKey: bunny secretKey: "02120212" bucket-name: bunny-bbs nacos: - server-addr: 192.168.3.98:8848 + server-addr: 192.168.3.100:8848 discovery: namespace: bunnyBBS username: nacos diff --git a/service/service-admin/src/main/resources/application-prod.yml b/service/service-admin/src/main/resources/application-prod.yml index cda8af1..31e4a4e 100644 --- a/service/service-admin/src/main/resources/application-prod.yml +++ b/service/service-admin/src/main/resources/application-prod.yml @@ -1,25 +1,25 @@ bunny: datasource: - host: 192.168.3.98 + host: 192.168.3.100 port: 3306 sqlData: bunny_docs username: root password: "02120212" redis: - host: 192.168.3.98 + host: 192.168.3.100 port: 6379 database: 1 password: "123456" minio: - endpointUrl: "http://192.168.3.98:9000" + endpointUrl: "http://192.168.3.100:9000" accessKey: bunny secretKey: "02120212" bucket-name: bunny-bbs nacos: - server-addr: 192.168.3.98:8848 + server-addr: 192.168.3.100:8848 discovery: namespace: bunnyBBS username: nacos diff --git a/service/service-admin/src/main/resources/application.yml b/service/service-admin/src/main/resources/application.yml index ca481c8..7e4251a 100644 --- a/service/service-admin/src/main/resources/application.yml +++ b/service/service-admin/src/main/resources/application.yml @@ -10,6 +10,7 @@ spring: lazy-initialization: true jmx: enabled: false + datasource: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.cj.jdbc.Driver diff --git a/service/service-web/pom.xml b/service/service-web/pom.xml index f7eb809..e3e4ca5 100644 --- a/service/service-web/pom.xml +++ b/service/service-web/pom.xml @@ -15,8 +15,8 @@ UTF-8 - 192.168.3.98:1100 - 192.168.3.98:2375 + 192.168.3.100:1100 + 192.168.3.100:2375 bunny-web diff --git a/service/service-web/src/main/java/cn/bunny/service/web/config/Knife4jConfig.java b/service/service-web/src/main/java/cn/bunny/service/web/config/Knife4jConfig.java index 5d354de..9da12dc 100644 --- a/service/service-web/src/main/java/cn/bunny/service/web/config/Knife4jConfig.java +++ b/service/service-web/src/main/java/cn/bunny/service/web/config/Knife4jConfig.java @@ -15,13 +15,12 @@ import org.springframework.context.annotation.Configuration; public class Knife4jConfig { @Bean public OpenAPI openAPI() { - log.info("Knife4jConfig===>配置knife4j"); // 作者等信息 Contact contact = new Contact().name("Bunny").email("1319900154@qq.com").url("http://z-bunny.com"); // 使用协议 License license = new License().name("MIT").url("http://MUT.com"); // 相关信息 - Info info = new Info().title("Bunny-Java-Template").description("Bunny的Java模板").version("v1.0.0").contact(contact).license(license); + Info info = new Info().title("Bunny-Java-Template").description("Bunny的Java模板").version("v1.0.0").contact(contact).license(license).termsOfService("记得给我start"); return new OpenAPI().info(info).externalDocs(new ExternalDocumentation()); } diff --git a/service/service-web/src/main/resources/application-dev.yml b/service/service-web/src/main/resources/application-dev.yml index b2647c4..c41e1a6 100644 --- a/service/service-web/src/main/resources/application-dev.yml +++ b/service/service-web/src/main/resources/application-dev.yml @@ -1,25 +1,25 @@ bunny: datasource: - host: 192.168.3.98 + host: 192.168.3.100 port: 3305 sqlData: bunny_docs username: root password: "02120212" redis: - host: 192.168.3.98 + host: 192.168.3.100 port: 6379 database: 1 password: "123456" minio: - endpointUrl: "http://192.168.3.98:9000" + endpointUrl: "http://192.168.3.100:9000" accessKey: bunny secretKey: "02120212" - bucket-name: bunny-bbs + bucket-name: test nacos: - server-addr: 192.168.3.98:8848 + server-addr: 192.168.3.100:8848 discovery: namespace: bunnyBBS username: nacos diff --git a/service/service-web/src/main/resources/application-prod.yml b/service/service-web/src/main/resources/application-prod.yml index cda8af1..a629da2 100644 --- a/service/service-web/src/main/resources/application-prod.yml +++ b/service/service-web/src/main/resources/application-prod.yml @@ -1,25 +1,25 @@ bunny: datasource: - host: 192.168.3.98 + host: 192.168.3.100 port: 3306 sqlData: bunny_docs username: root password: "02120212" redis: - host: 192.168.3.98 + host: 192.168.3.100 port: 6379 database: 1 password: "123456" minio: - endpointUrl: "http://192.168.3.98:9000" + endpointUrl: "http://192.168.3.100:9000" accessKey: bunny secretKey: "02120212" - bucket-name: bunny-bbs + bucket-name: test nacos: - server-addr: 192.168.3.98:8848 + server-addr: 192.168.3.100:8848 discovery: namespace: bunnyBBS username: nacos