Giter Site home page Giter Site logo

tenght / springboot-project Goto Github PK

View Code? Open in Web Editor NEW

This project forked from martindai/springboot-project

0.0 0.0 0.0 908 KB

开箱即用的SpringBoot项目,整合了常规业务所需的框架功能,可自由组合各个模块

License: MIT License

Java 90.32% HTML 9.68%

springboot-project's Introduction

SpringBoot-Project

一个整合了一些常用功能开箱即用的SpringBoot项目,模块划分清晰易懂,可按需自由组合各个模块运行。

注意:本项目使用了lombok来简化Getter/Setter,所以需要安装lombok插件才能保证编译不报错

本项目整合了Swagger,启动web模块后可以通过http://127.0.0.1:2019/doc.html查看

涉及的重要框架和组件清单

打包编译

./mvnw clean install

模块介绍

docker

docker目录里面包含了本项目部分模块需要依赖的的组件环境,可通过脚本一键启动,README.md有详细使用介绍

springboot-cache

包含缓存相关的操作案例

  • Memcached,整合Memcached-Java-Client和xmemcached两种客户端实现基本操作
  • Redis,使用Redisson客户端,包含常规操作、分布式锁和布隆过滤器使用示例

springboot-common

包含一些通用的工具类等

springboot-common-web

通用web模块,封装服务于HTTP接口通用的一些类,所有需要对外提供HTTP服务的模块都会依赖此模块

springboot-dao

数据访问模块,基于MyBatis封装了包含User和UserLogin两个表的基本操作

SQL部分是基于sharding-jdbc分库分表写的,数据库表初始化文件为spring_project_1.sql和spring_project_2.sql

部分需要操作数据库的模块会依赖此模块

springboot-db-controller

依赖于springboot-dao,对外提供访问数据库相关操作的接口,主要是为了方便把dao做成可选的灵活组合,一般整合在web模块的

部分需要操作数据库的模块会依赖此模块

springboot-dubbo-api

dubbo服务的api模块,dubbo-provider和dubbo-consumer会依赖此模块

springboot-dubbo-consumer

dubbo服务消费者,内容包含

  • 简单的dubbo服务调用示例
  • 整合Hystrix熔断
  • 整合Sentinel限流
  • 自定义Filter统计服务调用耗时日志

springboot-dubbo-provider

dubbo服务提供者,包含基于dubbo-api模块实现的dubbo服务,提供了两种协议(dubbo和rest)

可单独启动,入口为DubboApplication

rest协议调用

curl --location --request POST 'http://127.0.0.1:8080/dubbo-rest/getDubboInfo' \
--header 'Content-Type: application/json' \
--data-raw '{
    "id": 1
}'

springboot-elasticsearch

包含elasticsearch服务基本crud操作

springboot-feign-consumer

feign服务消费者,包含简单的feign服务调用示例,使用consul做服务发现

springboot-feign-provider

feign服务提供者,包含简单的基于feign实现的服务,使用consul做服务注册,可单独启动,入口为FeignApplication

springboot-leaf

整合美团开源的分布式ID生成服务leaf,包含记录HTTP接口耗时日志切面,数据库表初始化文件为leaf.sql

springboot-netty

包含基于netty+websocket实现的简易聊天室功能,入口页面为chat-netty.html

springboot-rocketmq-consumer

包含RocketMQ的消费者使用示例,消息来自于rocketmq-producer模块

  • 普通消息并发消费示例
  • 事务消息使用示例(可实现最终一致性分布式事务)
  • 顺序消息消费示例

springboot-rocketmq-producer

RocketMQ的消息生产者模块,内容包含

  • 使用tomcat提供的ServerEndpoint注解基于websocket实现的简单聊天室功能,聊天消息会发送RocketMQ普通消息,入口页面为chat-websocket.html
  • 提供了简单的用户操作HTTP接口,其中删除用户会发送RocketMQ事务消息

springboot-seata

seata示例的TM服务,可单独启动,docker目录下有seata-server的容器配置

springboot-seata-common

seata功能的通用模块

springboot-seata-order

seata功能的订单RM服务,可单独启动

springboot-seata-storage

seata功能的商品库存RM服务,可单独启动

springboot-web

Web模块,默认整合依赖了其他所有不支持单独启动的功能模块,可根据实际需要进行增删调整,启动入口为WebApplication,里面包含了所有其他模块需要的注解配置

本模块内容包括

  • 基于长轮训实现的简单聊天室功能,入口页面为chat-long-polling.html
  • 基于xhttp实现页面动态内容回传
  • 简单的Excel上传下载功能
  • 堆和直接内存使用情况监控接口

springboot-zookeeper

包含基于zookeeper实现的分布式锁示例

感谢赞助

jetbrains

springboot-project's People

Contributors

dependabot[bot] avatar martindai avatar yiminta avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.