From 1cab4d1a8e3af572d384e895861009f9f6f7ad97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=B7=E8=A8=80?= <2439534736@qq.com> Date: Tue, 9 Sep 2025 16:11:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 121 ++++++++++++----------------- src/main/resources/application.yml | 77 ++++-------------- src/main/resources/bootstrap.yml | 13 ---- 3 files changed, 66 insertions(+), 145 deletions(-) delete mode 100644 src/main/resources/bootstrap.yml diff --git a/pom.xml b/pom.xml index 444cf3a..ef99405 100644 --- a/pom.xml +++ b/pom.xml @@ -12,145 +12,122 @@ xf-boot-base 1.0.1 xf-boot-base - xf-boot-base + 拿来即用springboot单体脚手架项目 1.8 - - + 8.1.0 + 3.5.8 + 4.3.1 + 2.6.0 + 3.19.2 + 2.11.1 + 2.0.8 + 5.3 + 2023.0.1.0 + 2023.0.1 + 8.16.0 + 4.0.1 org.springframework.boot spring-boot-starter-web - + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.boot + spring-boot-starter-actuator + + + org.springframework.boot + spring-boot-starter-data-redis + + + + net.logstash.logback + logstash-logback-encoder + ${logstash.version} + com.mysql mysql-connector-j - 8.1.0 + ${mysql.version} org.projectlombok lombok true - - org.springframework.boot - spring-boot-starter-test - test - - - com.baomidou mybatis-plus-spring-boot3-starter - 3.5.8 + ${mybatis-plus.version} - - com.baomidou dynamic-datasource-spring-boot3-starter - 4.3.1 + ${dynamic-datasource.version} - - - - - - - - - org.springdoc springdoc-openapi-starter-webmvc-ui - 2.6.0 + ${springdoc.version} - - - org.springframework.boot - spring-boot-starter-actuator - - com.auth0 java-jwt - 3.19.2 - - - - - org.springframework.boot - spring-boot-starter-data-redis + ${jwt.version} - org.apache.commons commons-pool2 - 2.11.1 + ${commons-pool2.version} - - com.alibaba fastjson - 2.0.8 + ${fastjson.version} - - - - org.springframework.boot - spring-boot-starter-thymeleaf - - - - - net.logstash.logback - logstash-logback-encoder - 5.3 - - com.alibaba.cloud spring-cloud-starter-alibaba-nacos-discovery - 2020.0.RC1 + ${spring-cloud-alibaba.version} com.alibaba.cloud spring-cloud-starter-alibaba-nacos-config - 2020.0.RC1 + ${spring-cloud-alibaba.version} org.springframework.cloud spring-cloud-dependencies - Hoxton.RELEASE + ${spring-cloud.version} pom import - - - org.springframework.cloud - spring-cloud-starter-bootstrap - 3.0.1 - - javax.servlet javax.servlet-api - 4.0.1 + ${sverlet.version} provided - co.elastic.clients elasticsearch-java - 8.16.0 + ${elasticsearch.version} - diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 1c17631..ef49c74 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,4 +1,3 @@ - server: port: 8089 shutdown: graceful @@ -7,63 +6,21 @@ spring: active: dev application: name: xf-boot-base - servlet: - multipart: - max-file-size: 20MB - max-request-size: 20MB - jackson: - date-format: yyyy-MM-dd HH:mm:ss - time-zone: GMT+8 - serialization: - WRITE_DATES_AS_TIMESTAMPS: false - FAIL_ON_EMPTY_BEANS: false + cloud: + nacos: + config: + server-addr: ${NACOS_SERVER_ADDR:127.0.0.1:8848} + username: ${NACOS_USERNAME:nacos} + password: ${NACOS_PWD:nacos} + file-extension: yml + namespace: 34f368d5-a6c6-4f57-a80a-5402de295695 + group: DEFAULT_GROUP + discovery: + server-addr: ${NACOS_SERVER_ADDR:127.0.0.1:8848} + username: ${NACOS_USERNAME:nacos} + password: ${NACOS_PWD:nacos} + namespace: 34f368d5-a6c6-4f57-a80a-5402de295695 + config: + import: + - nacos:${spring.application.name}-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} -elasticsearch: - host: localhost - port: 9200 - username: elastic - password: kVgA7eeLyNQKh_IyV*mW #window系统本地启动 es8.x 重置密码命令:.\elasticsearch-reset-password -u elastic - -springdoc: - api-docs: - path: /v3/api-docs # 自定义 API 文档路径 - swagger-ui: - path: /swagger-ui.html # 自定义 Swagger UI 路径 - enabled: true - info: - title: 文撩 API 文档 - description: 这是文撩平台的 API 文档 - version: v1.0 - -mybatis-plus: - configuration: - map-underscore-to-camel-case: false - auto-mapping-behavior: full - #log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #开启SQL语句打印 - mapper-locations: classpath*:mapper/**/*Mapper.xml - global-config: - # 逻辑删除配置 - db-config: - update-strategy: IGNORED - # 删除前 - logic-not-delete-value: 1 - # 删除后 - logic-delete-value: 0 - -# 参考文章 https://zhuanlan.zhihu.com/p/145359625 -management: - health: - elasticsearch: #禁用健康检查 - enabled: false - endpoints: - web: - exposure: - include: "health" - endpoint: - health: - show-details: always - -# 日志设置 -#logging: -# level: -# root: DEBUG \ No newline at end of file diff --git a/src/main/resources/bootstrap.yml b/src/main/resources/bootstrap.yml deleted file mode 100644 index b0fb062..0000000 --- a/src/main/resources/bootstrap.yml +++ /dev/null @@ -1,13 +0,0 @@ - -spring: - application: - name: xf-boot-base - cloud: - nacos: - config: - server-addr: ${nacos.address}:8848 - file-extension: yml - namespace: 34f368d5-a6c6-4f57-a80a-5402de295695 - group: DEFAULT_GROUP - username: nacos - password: ${nacos.password} \ No newline at end of file