{"id":19075226,"url":"https://github.com/martindai/springboot-project","last_synced_at":"2025-04-09T23:16:42.567Z","repository":{"id":38052092,"uuid":"185742293","full_name":"MartinDai/SpringBoot-Project","owner":"MartinDai","description":"开箱即用的SpringBoot项目，整合了常规业务所需的框架功能，可自由组合各个模块","archived":false,"fork":false,"pushed_at":"2025-02-24T08:04:31.000Z","size":953,"stargazers_count":42,"open_issues_count":0,"forks_count":26,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-09T23:16:34.677Z","etag":null,"topics":["consul","dubbo","elasticsearch","feign","memcached","mybatis","netty","redis","rocketmq","springboot","springcloud","zookeeper"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MartinDai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-09T06:47:14.000Z","updated_at":"2025-03-11T07:14:43.000Z","dependencies_parsed_at":"2024-01-17T08:38:46.118Z","dependency_job_id":"7cfdb598-5f7f-4f55-8a1d-39a2fe95c6c2","html_url":"https://github.com/MartinDai/SpringBoot-Project","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MartinDai%2FSpringBoot-Project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MartinDai%2FSpringBoot-Project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MartinDai%2FSpringBoot-Project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MartinDai%2FSpringBoot-Project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MartinDai","download_url":"https://codeload.github.com/MartinDai/SpringBoot-Project/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248125593,"owners_count":21051771,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["consul","dubbo","elasticsearch","feign","memcached","mybatis","netty","redis","rocketmq","springboot","springcloud","zookeeper"],"created_at":"2024-11-09T01:53:56.246Z","updated_at":"2025-04-09T23:16:42.546Z","avatar_url":"https://github.com/MartinDai.png","language":"Java","readme":"# SpringBoot-Project\n\n一个整合了一些常用功能开箱即用的SpringBoot项目，模块划分清晰易懂，可按需自由组合各个模块运行。\n\n[![Release](https://img.shields.io/github/v/release/martindai/SpringBoot-Project?color=369eff\u0026labelColor=black\u0026logo=github\u0026style=flat-square)](https://github.com/martindai/SpringBoot-Project/releases)\n[![License](https://img.shields.io/github/license/MartinDai/SpringBoot-Project)](LICENSE)\n\n## 涉及的重要框架和组件清单\n\n- [Consul](https://github.com/hashicorp/consul)\n- [Druid](https://github.com/alibaba/druid)\n- [Dubbo](https://github.com/apache/dubbo)\n- [ElasticSearch](https://github.com/elastic/elasticsearch)\n- [FastExcel](https://github.com/fast-excel/fastexcel)\n- [Feign](https://github.com/OpenFeign/feign)\n- [Grafana](https://github.com/grafana/grafana)\n- [Guava](https://github.com/google/guava)\n- [Hutool](https://github.com/dromara/hutool)\n- [Hystrix](https://github.com/Netflix/Hystrix)\n- [Knife4j](https://github.com/xiaoymin/swagger-bootstrap-ui)\n- [Leaf](https://github.com/Meituan-Dianping/Leaf)\n- [Memcached](https://github.com/memcached/memcached)\n- [MyBatis](https://github.com/mybatis/mybatis-3)\n- [MyBatis-Plus](https://github.com/baomidou/mybatis-plus)\n- [MySQL](https://github.com/mysql/mysql-server)\n- [Netty](https://github.com/netty/netty)\n- [OpenTelemetry-Java](https://github.com/open-telemetry/opentelemetry-java)\n- [Prometheus](https://github.com/prometheus/prometheus)\n- [Redis](https://github.com/redis/redis)\n- [Redisson](https://github.com/redisson/redisson)\n- [RocketMQ](https://github.com/apache/rocketmq)\n- [RocketMQ-Spring](https://github.com/apache/rocketmq-spring)\n- [Seata](https://github.com/seata/seata)\n- [Sentinel](https://github.com/alibaba/Sentinel)\n- [Sharding-Jdbc](https://github.com/apache/shardingsphere)\n- [SpringBoot](https://github.com/spring-projects/spring-boot)\n- [Springdoc-openapi](https://github.com/springdoc/springdoc-openapi)\n- [Swagger-ui](https://github.com/swagger-api/swagger-ui)\n- [Xmemcached](https://github.com/killme2008/xmemcached)\n- [ZooKeeper](https://github.com/apache/zookeeper)\n\n## 提示\n\n- 项目使用了lombok来简化Getter/Setter，所以需要安装lombok插件才能保证编译不报错\n- 项目整合了Swagger，启动web模块后可以通过[http://127.0.0.1:2019/doc.html](http://127.0.0.1:2019/doc.html)查看\n- 项目中用到的第三方组件，可以从`docker`目录和项目[docker-compose-environment](https://github.com/MartinDai/docker-compose-environment)找到相关配置文件使用`docker-compose`命令一键启动\n\n## 打包编译\n\n```shell\n./mvnw clean install\n```\n\n## 模块介绍\n\n### springboot-cache\n\n包含缓存相关的操作案例\n\n- Memcached，整合Memcached-Java-Client和xmemcached两种客户端实现基本操作\n- Redis，使用Redisson客户端，包含常规操作、分布式锁和布隆过滤器使用示例\n\n### springboot-common\n\n包含一些通用的工具类等\n\n### springboot-common-web\n\n通用web模块，封装服务于HTTP接口通用的一些类，所有需要对外提供HTTP服务的模块都会依赖此模块\n\n### springboot-dao\n\n数据访问模块，基于MyBatis封装了包含User和UserLogin两个表的基本操作\n\nSQL部分是基于sharding-jdbc分库分表写的，数据库表初始化文件为spring_project_1.sql和spring_project_2.sql\n\n部分需要操作数据库的模块会依赖此模块\n\n### springboot-db-controller\n\n依赖于springboot-dao，对外提供访问数据库相关操作的接口，主要是为了方便把dao做成可选的灵活组合，一般整合在web模块的\n\n部分需要操作数据库的模块会依赖此模块\n\n### springboot-dubbo-api\n\ndubbo服务的api模块，dubbo-provider和dubbo-consumer会依赖此模块\n\n### springboot-dubbo-consumer\n\ndubbo服务消费者，内容包含\n\n- 简单的dubbo服务调用示例\n- 整合Hystrix熔断\n- 整合Sentinel限流\n- 自定义Filter统计服务调用耗时日志\n\n### springboot-dubbo-provider\n\ndubbo服务提供者，包含基于dubbo-api模块实现的dubbo服务，提供了两种协议（dubbo和rest）\n\n可单独启动，入口为DubboApplication\n\nrest协议调用\n```shell\ncurl --location --request POST 'http://127.0.0.1:8080/dubbo-rest/getDubboInfo' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n    \"id\": 1\n}'\n```\n\n### springboot-elasticsearch\n\n包含elasticsearch服务基本crud操作\n\n### springboot-feign-consumer\n\nfeign服务消费者，包含简单的feign服务调用示例，使用consul做服务发现\n\n### springboot-feign-provider\n\nfeign服务提供者，包含简单的基于feign实现的服务，使用consul做服务注册，可单独启动，入口为FeignApplication\n\n### springboot-leaf\n\n整合美团开源的分布式ID生成服务leaf，包含记录HTTP接口耗时日志切面，数据库表初始化文件为leaf.sql\n\n### springboot-opentelemetry\n\n集成OpenTelemetry的SDK采集上报可观测相关数据\n\n- 支持Metrics推送至VictoriaMetrics(需在application.yml配置victoriaMetrics.url)\n\n### springboot-netty\n\n包含基于netty+websocket实现的简易聊天室功能，入口页面为chat-netty.html\n\n### springboot-rocketmq-consumer\n\n包含RocketMQ的消费者使用示例，消息来自于rocketmq-producer模块\n\n- 普通消息并发消费示例\n- 事务消息使用示例（可实现最终一致性分布式事务）\n- 顺序消息消费示例\n\n### springboot-rocketmq-producer\n\nRocketMQ的消息生产者模块，内容包含\n\n- 使用tomcat提供的ServerEndpoint注解基于websocket实现的简单聊天室功能，聊天消息会发送RocketMQ普通消息，入口页面为chat-websocket.html\n- 提供了简单的用户操作HTTP接口，其中删除用户会发送RocketMQ事务消息\n\n### springboot-seata\n\nseata示例的TM服务，可单独启动，docker目录下有seata-server的容器配置\n\n### springboot-seata-common\n\nseata功能的通用模块\n\n### springboot-seata-order\n\nseata功能的订单RM服务，可单独启动\n\n### springboot-seata-storage\n\nseata功能的商品库存RM服务，可单独启动\n\n### springboot-web\n\nWeb模块，默认整合依赖了其他所有不支持单独启动的功能模块，可根据实际需要进行增删调整，启动入口为WebApplication，里面包含了所有其他模块需要的注解配置\n\n本模块内容包括\n\n- 基于长轮训实现的简单聊天室功能，入口页面为chat-long-polling.html\n- 基于xhttp实现页面动态内容回传\n- 基于EventStream实现动态事件内容响应\n- 简单的Excel上传下载功能\n- 堆和直接内存使用情况监控接口\n\n### springboot-zookeeper\n\n包含基于zookeeper实现的分布式锁示例\n\n## 感谢赞助\n\n[\u003cimg src=\"https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg\" width=\"140\" height=\"140\" alt=\"jetbrains\"/\u003e](https://www.jetbrains.com/community/opensource/#support)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartindai%2Fspringboot-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmartindai%2Fspringboot-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartindai%2Fspringboot-project/lists"}