1 Star 0 Fork 805

netgod / orange-admin

forked from orange-form / orange-admin 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

选择橙单

  • 有助于中台化平台架构梳理,支持微服务池共享,可生成 70% 以上相对复杂的中台化业务代码。
  • 纯手工打造、合理驾驭模式、教科书般的 5A 级代码质量,顺利通过 SonarQube 和 Alibaba Code Guide 的最严格扫描。
  • 优质的代码、前沿高效的设计、成熟的套路和策略,在提升前期开发效率的同时,也将极大的降低后期维护成本。
  • 专业、完善、详尽、暗黑护眼、完全免费开放且同步更新的近 18 万字在线文档。
  • 宽松、合理、透明、全网超低价的商业授权。(请我们撸一次串的价格)
  • 技术问题的反馈、咨询和交流,我们都会及时回复,经常在开车等灯时答疑。
  • 生成后工程无任何 License 限制,可进行任意修改,并用于任意数量的商用项目。

代码样例

下图均为橙单生成的代码,纯手工打造,强烈推荐展开看大图

最新优惠

活动截止日期 2021-04-15,购买【橙单微服务教学版299元】工程,赠【橙单微服务多租户教学版329元】工程!
同时赠送两张企业版 10 元购优惠券,通过优惠券,原有 999 元的费用仅需 10 元即可创建属于您的企业版项目。

橙单生成器

如果说基础框架是技术轮子,那么我们就是生产线。不仅可以造出各种尺寸的轮子,通过我们的在线配置工具,还能生成您的更多业务所需。为了使轮子更为贴近项目的架构需求,我们目前已支持多种类型的工程结构模板,如多应用、多租户、多渠道等。架构师们通过选择最为适合的项目类型,可最大程度的降低对生成后工程进行裁剪和改造的工作量。

下图所示的微服务组件,在创建项目时可正交化组合。生成后的工程不仅可用于企业中台化改造,同样也适用于开发者进行微服务全技术栈的快速学习。

在线资源

多应用支持

  • 生成器支持多应用功能,应用和服务之间保持多对多关系,服务池功能已基本支持,后续版本会持续优化。
  • 单体工程可同时创建 WebAdmin 后台应用和面向前端 App 的 WebApi 应用。
  • 微服务工程可创建非常典型的单体后台 WebAdmin 应用,及面向前端 App 的 WebApi 微服务应用。补充说明,WebAdmin 后台应用也可以配置为微服务应用,并可与 WebApi 应用共享服务池中的通用业务服务。
  • 对于上述介绍的 WebAdmin 后台服务,与之前版本一致,仍然提供表单和权限功能。而 WebApi 作为面向前端的接口应用,为了降低架构师们的工程裁剪工作量,该类应用将不提供表单和权限功能。

多租户支持

  • 多租户工程可同时创建三个应用,分别为租户运营管理后台应用 TenantAdmin,租户运营后台应用,以及面向租户前端 App 的 WebApi 应用。
  • 对于多租户运营管理后台应用 TenantAdmin,不仅内置了自身的权限管理和租户运营管理等功能,同时也支持配置自定义的业务表单和租户统计表单。
  • 支持全局公用字典和租户字典,前者由租户运营管理后台统一管理,租户字典数据可由租户管理员自行维护。为了保证整体运行时效率,两者均支持缓存 Redis。
  • 租户数据支持逻辑隔离、物理隔离和混合隔离等多种方式,租户权限数据由租户运营管理服务统一管理,实时同步到多个租户运行系统数据库中。不仅非常有利于租户数据的迁移。同时也保证了运行时效率。业务逻辑代码与非多租户系统相比,差异也降至最低。
  • 可配置定时任务 Job 服务,并将不同租户数据库中的业务行为数据,分组统计后刷新到租户运营管理数据库中,再由配置的统计表单进行显示。
  • 可与现有的单点登录服务 (uaa) 无缝集成。

关于我们

  • S.L 老师,20年开发经验,后台全栈架构师,代码强迫症、性能洁癖、能看出一像素偏差。精通 C++/Java/Scala/Web高并发/大数据/C++服务器/视频直播网络技术,略懂容器。
  • J.T 老师,15年开发经验,前端全栈架构师,思维极缜密、号边界王。精通 C++/Java/Javascript/Vue & React/C++客户端/Android原生/小程序/视频直播编解码技术。
  • 欢迎加入我们的技术交流 QQ 群,如遇任何使用中的问题我们都将第一时间为您答疑。 加入QQ群
  • 由于被恶意举报,如果您通过群号搜索不到,请添加作者的 QQ (3510245832),我们会将您拉入群中。 QQ群

生成后工程

可无限制的用于学习、培训、接私活、公司自用和开发商业项目等场景,其中基础框架代码将永久免费,并持续更新。

开箱即用

项目信息如您所愿,工程名称、目录结构、基础包名、common模块、代码注释中的 @author 信息等,在创建工程时即已配置,不会留有橙单的任何信息。因此无需二次修改,前后端直接编译运行即可。如编译期和运行时出现问题,那一定是我们的 bug,在得到您反馈后,我们将及时修复。

技术选型

  • 前端: Element (Vue) / Ant Design (React) + ECharts / AntV + Axios + Webpack。
  • 后端: Spring Boot / Spring Cloud / Spring Cloud Alibaba + Spring Security OAuth2 + Mybatis + Jwt。
  • 工具库: Hutool + Guava + Caffeine + Lombok + MapStruct + Mybatis Plus + tk mapper + Knife4j + qdox。
  • 服务组件: Redis + Zookeeper + Consul + Apollo + XXL-Job + Quartz + Seata + Minio + Canal + RocketMQ + Kafka + Nacos + Sentinel + Nepxion Discovery。
  • 系统监控: ELK + PinPoint / SkyWalking + Grafana + Prometheus。

基础功能

  • 前端框架:单页面、多标签、多栏目和子路由,多套高颜值样式主题可供选择。
  • 前端能力:列表编辑、统计图表、多表联动、明细数据下钻、上传下载、数据导出、自定义打印样式模板、富文本等。
  • 页面布局:支持基于 Fragment 和 Block 的灵活布局方式,通过配置即可生成多样化的表单页面,并可预览。
  • 接口规范:微服务和单体服务的接口命名和参数定义规范完全一致,便于日后的平滑升级。
  • 后台架构:分布式锁、分布式 Id、分布式缓存、分布式事务、分布式限流和灰度发布等,按需集成。
  • 用户管理:支持基于 OAuth2 的单点登录。
  • 操作权限:前端控制可精确到按钮级的操作和标签级的显示,同时提供了多维度的权限分配路径查询能力。
  • 数据权限:基于 Mybatis 拦截器 + JSqlParser 的实现方式,配置更灵活,代码侵入性更低。
  • 租户管理:租户权限管理数据、字典等通用数据,均由租户运营管理服务统一管理,并实时同步到多个租户运营库,具有极高的数据库级别容错性。
  • 多数据源:支持简单和复杂两种多数据源注解。复杂注解可灵活自定义,并应对复杂的业务场景。
  • 数据组装:Java 注解方式实现数据组装,支持统一接口的服务内和跨服务的一对一、一对多、多对多、字典、聚合计算等关系数据组合。
  • 定时任务:我们不仅提供了多套 Job 基础框架的集成,更能生成灵活可配、高度优化、便于二次开发的 Job 业务逻辑代码。
  • 系统监控:基于 Kafka + ELK 的日志收集,基于 PinPoint/SkyWalking 的服务链路跟踪,基于 GPE 的服务性能指标监控。
  • 接口文档:目前已集成 Knife4j,同时支持基于 qdox 逆推 Java 工程代码,实现 0 注解导出 Postman 接口文件和 Markdown 文档。
  • 操作日志:灵活可配置。统一拦截每次请求调用的输入输出,及各种调用数据细节,以便于后期的统计分析和问题定位。微服务工程由 Kafka 消费者服务统一批量处理,并与 ELK + SkyWalking/PinPoint 等日志监控系统完全打通。单体工程则异步的存入数据库表中。
  • 缓存同步:同时集成了 Canal-Admin 和 Canal-Server,以便于用户的 Canal Instance 管理。目前已实现字典变化数据到 Redis 的实时缓存同步。

规则扫描

此为在线演示工程的代码审查报告,而非当前开源示例工程。前者代码量更大,结构更复杂。

  1. SonarQube 扫描
  • 基于 SonarQube8.2 缺省最严格的代码扫描规则,其中代码复杂度要求为 15。
  • 有气味代码共90处,其中85处为DTO、Model、常量字典、RPC接口等定义出现重复名称所致,均与模拟实际业务有关。
  • 其余气味代码,是在权衡性能、可读性和易修改性等因素后保留下来的,具体见图4。
  1. Alibaba Code Guide 扫描
  • 下载最新版本IDEA插件,同时打开所有审查条件。
  • 全部代码扫描通过。
  1. Statistic 代码统计
  • 生成代码总量约为86000多行,主要包括Java、XML、YAML和SQL初始化脚本等。
  • Java代码覆盖率为37%。

开源工程部署

  1. 目录说明
  • 微服务后端工程:orange-demo-multi-service
  • 微服务前端工程:orange-demo-multi-web
  • 单体服务后端工程:orange-demo-single-service
  • 单体服务前端工程:orange-demo-single-web
  1. 数据初始化。
  • 通过常用的数据库访问工具(如:navicat),执行工程目录下的zz-resource/db-scripts/zz-orange-demo.sql文件。
  • 导入脚本主要负责,数据库创建、数据表创建和测试数据的插入。
  1. Api接口文档
  1. 环境准备。
    docker是必选组件。通过docker-compose命令,可快速启停服务所依赖的服务中间件,如nacos、redis、zookeeper、kafka和sentinel dashboard等。中间件的控制台访问方式,可参考工程目录下的README文件。
# 假定当前目录为工程根目录。
cd zz-resource/docker-files
# 启动和停止带有基础服务中间件的docker-compose.yml文件
docker-compose up -d
# 彻底终止容器
docker-compose down
# 在第一次启动之后,可以考虑每次执行下面的命令启动和停止容器。
docker-compose start
docker-compose stop
  1. 后台工程导入。
    以Maven的形式导入IDE,直接编译运行即可。具体可参考我们的开发文档教学版微服务工程导入章节

  2. 后台服务配置。

  • 进入工程目录下的 zz-resource/config-data/ 子目录,修改和数据库相关的配置,具体操作详见下图及文字注释。
  • 将该目录下的所有配置文件导入nacos。nacos控制台访问地址 localhost:8848/nacos,用户名和密码 nacos/nacos。
  • 具体导入方式可参考我们的开发文档服务配置章节
  1. 后台服务启动。
    这里仅以upms服务为例。在开发环境中,为每个微服务启动项配置main class,下图为IntelliJ IDEA中的配置截图,配置后点击Debug/Run按钮即可启动。

  2. 前端工程导入和启动。

  • 将前端工程导入vscode。
  • 修改 src -> core -> config 下的配置文件,将baseUrl修改为您服务器地址。
  • 安装依赖,执行 npm install。
  • 启动前端服务,执行 npm run dev。
  • 具体可参考我们的开发文档教学版前端工程启动段落

主要截图

多租户演示

微服务演示

集成组件

开发文档

价值理念

都看到这里了,如果看的仔细,至少要花 20 分钟,非常感谢您的坚持和耐心,希望能再花 1 秒钟的时间在下面 star 一下。

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

我们在橙单生成器中创建了一个Spring Cloud Alibaba项目,此后又配置了一些数据模型关联关系,现在将生成后的项目开源。希望通过工程中的高质量代码,能让我们彼此间有些许了解。方便的话,Fork同时也Star一下! 展开 收起
Java
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/netgod/orange-admin.git
git@gitee.com:netgod/orange-admin.git
netgod
orange-admin
orange-admin
master

搜索帮助