单体架构
| Swagger在线接口文档 |
| CodeGenerator 代码生成器 |
| 统一返回 |
| 通用的分页对象 |
| 常用工具类 |
| 全局异常拦截 |
| 错误枚举 |
| 自定义异常 |
| 多环境配置文件 |
| Maven多环境配置 |
| 日志配置 |
| JenkinsFile(centos安装JenkinsFile,构建部署spring boot项目)[参考](https: |
| flyway |
| |
| # 参考:https: |
cloudalibaba
| |
| maven |
| shiro |
| springboot |
| cloudalibaba |
| mybtis-plus |
| nacos |
| sentinel |
| gateway |
| openFeign |
| redis |
| mysql |
| swagger |
| rabbitmq |
| sleuth |
| seata |
| |
| |
| gradle、security、springboot、cloudalibaba、mybtis-plus、nacos、sentinel、gateway、openFeign、redis、mysql、swagger、rabbitmq、sleuth、seata |
| |
| # IDEA自带的gradle与当前系统中配置的gradle版本不一致,会导致某些依赖无法导入 |
| |
| # 使用maven3.6.1及其一下版本,如3.8.2在拉取mybatis plus依赖时会报错 |
| |
| # 每个子模块的pom.xml中配置如下,方便之后每个微服务都能打成jar包部署 |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>org.springframework.boot</groupId> |
| <artifactId>spring-boot-maven-plugin</artifactId> |
| <configuration> |
| <excludes> |
| <exclude> |
| <groupId>org.projectlombok</groupId> |
| <artifactId>lombok</artifactId> |
| </exclude> |
| </excludes> |
| </configuration> |
| </plugin> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-compiler-plugin</artifactId> |
| <version>3.8.1</version> |
| <configuration> |
| <source>1.8</source> |
| <target>1.8</target> |
| </configuration> |
| </plugin> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-resources-plugin</artifactId> |
| <version>3.1.0</version> |
| </plugin> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-surefire-plugin</artifactId> |
| <version>2.22.1</version> |
| <configuration> |
| <skipTests>true</skipTests> |
| </configuration> |
| </plugin> |
| </plugins> |
| </build> |
| |
| # 依赖冲突,可[参考](https://gitee.com/chnq/chnx/tree/master/cloud/seata/seata01)构建一个简单的分布式微服务项目,之后在该项目基础上不断集成框架 |
| |
| # cloud跨域问题 |
| |
| └── cloud-alibaba-demo |
| ├── system |
| ├── common |
| ├── file |
| ├── gateway |
| ├── provider |
| ├── consumer |
| ├── business |
| | ├── java |
| | | ├── config |
| | | ├── mapper |
| | | ├── controller |
| | | ├── service |
| | | | └── impl |
| | | ├── model |
| | | ├── vo |
| | | ├── utils |
| | | └── Application |
| | | |
| | └── resouces |
| | | ├── mapper.xml |
| | | └── application.yml |
| | | |
| │ ├── README.md |
| │ └── pom.xml |
| ├── README.md |
| └── pom.xml |
| |
| # 将某些后台监控页面显示在后台管理页面 |
| 1. sleuth |
| 2. sentinel |
| 3. nacos |
| 4. Prometheus + Grafana:https://cloud.tencent.com/developer/article/1769920 |
| 5. swagger |
| 6. rabbitmq |
| |
参考
每个微服务resource路径下配置多个yml外部配置文件
指标监控可视化
ddd + cloud + mybatis plus
| <build> |
| <plugins> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-compiler-plugin</artifactId> |
| <version>3.8.1</version> |
| <configuration> |
| <source>11</source> |
| <target>11</target> |
| <encoding>UTF-8</encoding> |
| </configuration> |
| </plugin> |
| <plugin> |
| <groupId>org.springframework.boot</groupId> |
| <artifactId>spring-boot-maven-plugin</artifactId> |
| <version>2.3.7.RELEASE</version> |
| <configuration> |
| <mainClass>com.example.demo.DemoApplication</mainClass> |
| </configuration> |
| <executions> |
| <execution> |
| <id>repackage</id> |
| <goals> |
| <goal>repackage</goal> |
| </goals> |
| </execution> |
| </executions> |
| </plugin> |
| </plugins> |
| </build> |
| mybatis-plus: |
| configuration: |
| log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| mapper-locations: classpath:com/chnq/provide/domain/repository/mapper/xml/*.xml |
| @SpringBootApplication |
| @EnableDiscoveryClient |
| @ComponentScan("com.chnq") |
| @MapperScan("com.chnq.provide.domain.repository.mapper") |
| public class Provide8081Application { |
| public static void main(String[] args) { |
| SpringApplication.run(Provide8081Application.class, args); |
| } |
| } |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 字符编码:从基础到乱码解决
· 提示词工程——AI应用必不可少的技术