31 Star 304 Fork 176

码匠君 / dante-engine

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
contribute
Sync branch
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md
LGPL-3.0

logo

简洁优雅 · 稳定高效 | 宁静致远 · 精益求精

Dante Engine 基于 Spring Boot 3.X, 是 Dante Cloud 微服务架构内核核心组件库,可用于任何 Spring Boot 工程


Spring Authorization Server 1.2.2 Spring Boot 3.2.3 Spring Cloud 2023.0.0 Spring Cloud Alibaba 2023.0.0.0 Spring Cloud Tencent 1.13.0-2023.0.0-SNAPSHOT Nacos 2.3.0

Version 3.2.3.1 Java 17 License LGPL-3.0 Total Visits 码匠君 Github star Github fork Gitee star Gitee fork

Github 仓库   |   Gitee 仓库   |   文档

如果您觉得有帮助,请点右上角 "Star" 支持一下,谢谢!

重要说明

因 Spring Boot 2.7.X 和 3.0.X 已于 2023年11月24日 和 2023年11月24日 停止维护,考虑到技术发展趋势,决定停止 Dante Cloud 2.7.X 版本代码的维护,专注 3.1.X 维护及 3.2.X 开发。2.7.16.Final 版本是 Dante Cloud 2.7.X 系列最后一个版本,代码仍旧会保留,可在工程 2.7.X 分支中获取。

项目由来

作者本人过往工作,主要专注企业信息化项目建设,经手过大大小小、各式各样、规模各异的项目粗略估算也有 180+。这些项目经历,足以让我体会IT行业的千滋百味。回顾过往,发现其中很多工作,特别是很多会占用技术人员大量时间和精力的工作,大多数情况下并不是像技术攻关、新技术研究、业务架构设计、并发性能调优等有挑战性的工作,而往往都是因细节考虑欠缺、代码质量不高、在用技术老旧、欠缺优化迭代、系统难于维护、项目管理不善等问题产生的需要长期投入的、低效、低意义工作。

这也是为什么做 Dante Cloud 的初衷:一方面是以 Dante Cloud 为载体,潜移默化地将过往经验教训融入其中,尽可能地帮助使用者规避或者减少无效工作,提升工作效率和质量,有跟多的时间做更有意义的事情;另一方面不断地融合和使用各类新兴技术,帮助使用者尽可能多的了解、学习和运用新技术,让技术不再成为禁锢变为进步和提升的基石。

这也是为什么 Dante Cloud 与其它项目不同:Dante Cloud 并不关注常规应用功能的堆叠与丰富化,因为作者认为纯开发工作仅占整个项目建设投入的 20%,减少开发投入、提升开发效率未必就能减少整个项目建设周期剩余80%工作投入。Dante Cloud 的远景目标是可以帮助使用者缩短整个项目的建设周期和减少无意义的工作投入,而不仅仅只是在开发效率方面的提升。

Dante Cloud 一直秉承“简洁、高效、包容、务实”的理念,不会采取任何额外的手段来获取更多的 Star,绝对真实就像其产品一样。如果你认可和喜欢 Dante Cloud,请不要吝啬你的赞美,项目右上角点颗小星星。

项目特点

  1. 严格遵照“单一职责”原则,进行各个模块的划分和代码拆解。
  2. 严格遵循 Spring Boot 编码规则和命名规则。
  3. 大多数模块均支持 @EnableXXX注解 和 starter,让 Spring Bean 的注入顺序更加可控。
  4. 模块化设计思想,通过 Bean 注入、以及丰富的自定义 @ConditionalXXX 注解,让模块的添加和删除更加灵活。
  5. 各模块既可以综合在一起使用,也可以在其它 Spring Boot 工程中独立使用。

很多朋友不理解这样做的好处,明明很多代码都可以放在一起,为什么要拆分出这么多包、拆这么细?

这样做主要有以下优势:

  1. 虽然模块看似很多,但是每个模块职责单一、代码清晰,更有利于聚焦和定位问题。
  2. 通过对微服务架构的“庖丁解牛”,初学者不再需要在代码的海洋里“遨游”,通过针对性地了解各个模块,以点带面快速掌握微服务架构整体结构。
  3. 模块间的依赖极大的降低,想要替换为 Spring Authorization Server ,影响到的代码和范围将会很小。该工程也是使用 Spring Authorization Server 的前序工作
  4. 每个模块均是最小化依赖第三包,规避依赖包过度依赖,特别是 starter 过多依赖,导致不可预知、难以调试、不好修改等问题。
  5. 降低微服务系统代码量,独立组件可提前编译并上传至Maven仓库,降低工程代码编译耗时,改进 CICD 效率。

工程结构

dante-engine
├── dependencies -- 工程Maven顶级依赖,统一控制版本和依赖
├── engine-access -- 外部登录接入模块
├    ├── access-core -- 外部登录通用代码
├    ├── access-sdk-all -- 外部登录集成
├    ├── access-sdk-justauth -- JustAuth登录
├    ├── access-sdk-wxapp -- 微信小程序登录
├    ├── access-sdk-wxmpp -- 微信公众号登录
├    └── access-spring-boot-starter -- 外部登录  模块统一 Starter
├── engine-assistant -- 核心通用代码包
├    ├── assistant-core -- 核心通用代码
├    ├── assistant-sdk-ip2region -- IP离线定位组件核心代码模块
├    └── assistant-autoconfigure -- Assistant  模块统一 Starter
├── engine-cache -- 缓存模块
├    ├── cache-core -- 缓存通用代码
├    ├── cache-sdk-caffeine -- Caffeine 缓存配置相关代码模块
├    ├── cache-sdk-jetcache -- JetCache 相关代码模块
├    ├── cache-sdk-redis -- Redis 缓存配置相关代码模块
├    ├── cache-sdk-redisson -- Redisson 相关代码模块
├    └── cache-spring-boot-starter -- Cache  模块统一 Starter
├── engine-captcha -- 验证码模块
├    ├── captcha-core -- 验证码共性通用代码
├    ├── captcha-sdk-behavior -- 行为验证码(包括拼图滑块、文字点选)
├    ├── captcha-sdk-graphic -- 传统图形验证码(包括算数类型、中文类型、字母类型、GIF类型)
├    ├── captcha-sdk-hutool -- Hutool验证码(包括圆圈干扰、扭曲干扰、线段干扰)
├    └── captcha-spring-boot-starter -- Captcha  模块统一 Starter
├── engine-data -- 数据访问模块
├    ├── data-core -- 数据访问共性通用代码
├    ├── data-sdk-jpa -- JPA 及Hibernate 配置代码模块
├    ├── data-sdk-mybatis-plus -- MybatisPlus 相关代码模块
├    ├── data-sdk-tenant -- 基于JPA的多租户核心代码模块
├    └── data-spring-boot-starter -- Data 模块统一 Starter
├── engine-facility -- 微服务基础设施模块
├    ├── facility-alibaba-spring-boot-starter -- 面向 Spring Cloud Alibaba 的微服务基础设施适配模块
├    ├── facility-core -- 基础设施共性通用代码
├    ├── facility-gateway-spring-boot-starter -- Alibaba Sentinel 在 Gateway 环境下基础设施适配模块
├    ├── facility-original-spring-boot-starter -- 面向 Spring Cloud 原生全家桶的微服务基础设施适配模块
├    └── facility-tencent-spring-boot-starter -- 面向 Spring Cloud Tencent 的微服务基础设施适配模块
├── engine-message -- 消息模块
├    ├── message-core -- 消息共性通用代码
├    ├── message-kafka-spring-boot-starter -- 基础 Kafka 配置 Starter
├    ├── message-rabbitmaq-spring-boot-starter -- 基础 RabbitMQ 配置 Starter
├    ├── message-sdk-websocket -- 基于 WebSocket 的消息代码模块
├    └── message-spring-boot-starter -- Message  模块统一 Starter
├── engine-oauth2 -- OAuth2 认证模块
├    ├── oauth2-authorization-server-autoconfigure -- OAuth2 授权服务器基础内容自动配置模块
├    ├── oauth2-core -- OAuth2 共性通用代码模块
├    ├── oauth2-resource-server-autoconfigure -- OAuth2 资源服务器基础内容自动配置模块
├    ├── oauth2-sdk-authentication -- Spring Authorization Server 认证逻辑处理模块
├    ├── oauth2-sdk-authorization -- Spring Authorization Server 授权逻辑处理模块
├    ├── oauth2-sdk-data-jpa -- 基于 Spring Data JPA 封装的 Spring Authorization Server 数据访问代码模块
├    └── oauth2-sdk-management -- Spring Authorization Server 应用管理模块
├── engine-rest -- 服务Rest接口模块
├    ├── rest-core -- 服务 Rest 接口共性通用代码
├    ├── rest-sdk-condition -- 服务级 REST 相关自定义条件注解模块
├    ├── rest-sdk-protect -- 前后端数据加密、接口幂等、防刷、Xss 和 SQL 注入 Rest API 防护模块
├    ├── rest-sdk-service -- 基于 REST 的服务基础内容配置代码模块
├    ├── rest-spring-boot-starter -- Rest 模块统一 Starter(包括通用CRUD代码)
├    └── web-server-spring-boot-starter -- 基础 Web Server 配置模块
├── engine-sms -- 短信接入模块
├    ├── sms-core -- 短信共性通用代码模块
├    ├── sms-sdk-aliyun -- 阿里云短信发送模块
├    ├── sms-sdk-chinamobile -- 移动短信发送模块
├    ├── sms-sdk-huawei -- 华为短信发送模块
├    ├── sms-sdk-netease -- 网易短信发送模块
├    ├── sms-sdk-qiniu -- 七牛短信发送模块
├    ├── sms-sdk-tencent -- 腾讯短信发送模块
├    ├── sms-sdk-upyun -- 又拍短信发送模块
├    └── sms-spring-boot-starter -- SMS 模块统一 Starter
├── engine-supplier -- 应用支持模块
├    ├── supplier-sdk-message -- 消息功能支持模块
├    ├── supplier-sdk-upms-logic -- UPMS 基础服务支持模块
├    └── supplier-sdk-upms-rest -- UPMS 基础服务 REST 模块
└──  readme -- README 相关素材放置目录

安全测试

Dante Cloud 已通过由第三方进行的软件出厂安全测试。详情参见:安全测试

开源协议

开源协议

协议解释

LGPL (GNU Lesser General Public License)

LGPL 是 GPL 的一个为主要为类库使用设计的开源协议。和 GPL 要求任何使用/修改/衍生之 GPL 类库的的软件必须采用 GPL 协议不同。LGPL 允许商业软件通过类库引用(link)方式使用 LGPL 类库而不需要开源商业软件的代码。这使得采用 LGPL 协议的开源代码可以被商业软件作为类库引用并发布和销售。

但是如果修改 LGPL 协议的代码或者衍生,则所有修改的代码,涉及修改部分的额外代码和衍生的代码都必须采用 LGPL 协议。因此 LGPL 协议的开源代码很适合作为第三方类库被商业软件引用,但不适合希望以 LGPL 协议代码为基础,通过修改和衍生的方式做二次开发的商业软件采用。

授权声明

本项目基于 GNU LESSER GENERAL PUBLIC LICENSE Version 3 (LGPL V3) 开源协议,可用于商业项目,但必须遵守以下补充条款。

  • 不得将本软件应用于危害国家安全、荣誉和利益的行为,不能以任何形式用于非法为目的的行为。
  • 允许以引入、不改源码的形式免费用于学习、毕设、公司项目、私活等。 特殊情况修改代码,但仍然想闭源需经过作者同意。
  • 对未经过授权和不遵循 LGPL 协议二次开源或者商业化我们将追究到底。
  • 任何基于本软件而产生的一切法律纠纷和责任,均与作者无关。
  • 如果你对本软件有改进,希望可以贡献给我们,双向奔赴互相成就才是王道。
  • 参考请注明:参考自 Dante Cloud:https://gitee.com/dromara/dante-cloud 或 Dante Engine:https://gitee.com/herodotus/dante-engine ,另请遵循 LGPL V3 协议。

阅读顺序

一、关联性阅读

部分组件存在关联和组合性,建议按照以下顺序阅读和了解代码:

  1. engine-assistant
  2. engine-cache
  3. engine-data
  4. engine-rest
  5. engine-oauth2
  6. engine-facility
  7. engine-message

二、独立性阅读

部分组件都是相对独立的,组件间的关联性非常弱。可分开独立阅读和了解代码:

  • engine-access
  • engine-captcha
  • engine-supplier

技术解析

Dante Cloud 技术内幕高阶文档专栏(Cookbook)

因目前所使用的阅读产品支持度有限,想要购买阅读全文请点击对应文章链接,在电脑浏览器中打开后进行购买。购买后即可在小程序阅读全文,否则小程序端仅能阅读试读章节。

序号 文章标题 付费 说明 扫码阅读
1 Dante Cloud 及相关知识学习方法和学习路径的建议V2 免费 Dante Cloud 及相关知识学习方法和学习路径的建议V2
2 OAuth 2 中的 Scope 与 Role 深度解析 付费,有试读章节 全网独家,深度解析 OAuth2 协议中和 Spring Security 生态各组件中 Scope 和 Role 概念与原理,以及在实战中的应用 OAuth 2 中的 Scope 与 Role 深度解析
3 Spring Boot 3 之自动配置与注入顺序控制 付费,有试读章节 Spring 生态重要知识点,掌握步入微服务的关键开关 Spring Boot 3 之自动配置与注入顺序控制
4 Spring Cloud 之 Session 共享及一致性处理 付费,有试读章节 深入浅出剖析微服务架构 Session 共享技术难点 Spring Cloud 之 Session 共享及一致性处理
5 OAuth 2 中的鉴权和动态接口鉴权 付费,有试读章节 带您跟随 Dante Cloud 源代码,由浅入深全面掌握 Spring Security 5 & 6 以及基于 OAuth2 的微服务动态接口鉴权的原理与实现 OAuth 2 中的鉴权和动态接口鉴权
6 Spring Boot 3 之 Rest 接口传参方式详解 付费,有试读章节 一文让你彻底掌握 Spring Boot Rest 各种传参方式和方法的“正确打开方式” Spring Boot 3 之 Rest 接口传参方式详解

版本分支

一、版本号说明

本系统版本号,分为四段。

  • 第一段和第二段,与 Spring Boot 版本对应,根据采用的 Spring Boot 版本变更。例如,当前采用 Spring Boot 2.4.6 版本,那么就以 2.4.X.X 开头
  • 第三段,表示系统功能的变化
  • 第四段,表示系统功能维护及优化情况

二、分支说明

分支名称 对应 Spring 生态版本 对应 JDK 版本 用途 现状
master Spring Boot 3.2 和 Spring Cloud 2023.0.0 JDK 17 主要发布分支 可使用,但 Spring Cloud Alibaba、Tencent 等生态并未发布正式适配版,请谨慎选择使用
develop Spring Boot 3.2 和 Spring Cloud 2023.0.0 JDK 17 Development 分支 新功能、ISSUE 均以此分支作为开发,发布后会 PR 至 master 分支
3.1.X Spring Boot 3.1 和 Spring Cloud 2022.0.X JDK 17 Stable 代码分支 稳定可用版本分支,2024年5月,Spring Boot 3.3 发布后将会停止维护
2.7.X Spring Boot 2.7 和 Spring Cloud 2021.0.X JDK 8 历史版本分支 基于 Spring Boot 2.7 时代开发的代码分支,不再维护

参与贡献

  1. 在 Gitee fork 项目到自己的 repo
  2. 把 fork 过去的项目也就是你的项目 clone 到你的本地
  3. 修改代码(记得一定要修改 develop 分支)
  4. commit 代码,push 到自己的库(develop 分支)
  5. 登录 Gitee 在你首页可以看到一个 pull request 按钮,点击它,填写一些说明信息,然后提交即可。
  6. 等待维护者合并

交流反馈

  • 欢迎提交ISSUE ,请写清楚问题的具体原因,重现步骤和环境

关联项目

赞助人列表

序号 赞助人 赞助时间 序号 赞助人 赞助时间 序号 赞助人 赞助时间
1 ご沉默菋噵 2021-10-25 2 偷土豆的人 2021-11-24 3 lorron 2022-04-04
4 在云端 2022-12-26 5 西晽 2022-12-27 6 p911gt3rs 2023-01-03
7 jacsty 2023-01-31 8 hubert_rust 2023-03-16 9 Zkey Z 2023-03-18
10 志国欧巴 2023-03-27 11 michael 2023-04-07 12 大叔丨小巷 2023-04-11
13 sun_left 2023-04-19 14 time 丶 sand 2023-07-06 15 印第安老斑鸠 2023-09-09
16 一阵风 2023-12-10 17 18
GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (c) 2020-2030 郑庚伟 ZHENGGENGWEI (码匠君) (herodotus@aliyun.com & www.herodotus.cn) Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. "The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library.

About

Dante Cloud 是一款企业级微服务架构和服务能力开发平台,是采用领域驱动模型(DDD)设计思想的、全面拥抱 Spring Authorization Server 的、基于 OAuth2.1 协议的、支持智能电视、IoT等物联网设备认证的多租户微服务解决方案组件库 expand collapse
Cancel

Releases (170)

All

Contributors

All

Activities

Load More
can not load any more
Java
1
https://gitee.com/herodotus/dante-engine.git
git@gitee.com:herodotus/dante-engine.git
herodotus
dante-engine
dante-engine
master

Search