1 Star 0 Fork 805

开发团队 / orange-admin

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

橙单简介

橙单低代码生成器由知视科技团队研发,团队经过多年大型企业中台化改造项目的沉淀,不断总结经验教训,不断努力提升产能,不断积极应对微服务改造过程中出现的分分合合。历经无数日夜的持续迭代和优化,终于可以实现生成 70% 的适用于微服务架构的高质量范式化工程级代码。此后,我们就很少加班,热爱工作,并与领导成为了战友,与客户成为了朋友。

橙单生成器

如果说基础框架是技术轮子,那么我们就是生产线。不仅可以造出各种尺寸的轮子,通过我们的在线配置工具,还能生成您的更多业务所需,如:

  • 创建多个数据库链接,并从中导入数据表。
  • 创建多个微服务,再关联到一到多个数据库链接。
  • 数据表之间可建立服务内和跨服务的“一对一、一对多、多对多、字典和分组聚合计算”等关联关系。
  • 生成 Job 业务代码,目前已支持“全量同步、增量同步、增量分组聚合转换同步”等代码模板。
  • 创建表单并对接后台接口,操作并显示后台数据。

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

在线资源

主要功能

  • 提供前后端主流技术栈组件,可按需选择生成您的工程基础架构。
  • 可创建多数据库、多应用服务,并导入业务数据表,配置服务内或跨服务的复杂表关系。
  • 前端支持基于 Fragment 和 Block 的嵌套布局,配置后即可生成多样化的表单页面,并可预览。
  • 操作权限和数据权限,灵活可配、运行时性能高度优化。
  • 有别于其他产品,我们不仅提供了Job框架的集成,更能生成任务处理器的业务逻辑代码。
  • 微服务和单体服务的接口命名规则和参数定义完全一致,便于您今后的平滑升级。

竞争优势

  • 排在首位的就是15万字以上的专业、详尽、完善和暗黑护眼的操作指南、开发文档和教学视频。
  • 真正的代码生成器,而非脚手架,可生成相对复杂的中台化业务代码。
  • 浅显易懂的高质量生成后工程代码,经过SonarQube和Alibaba代码规范的严格扫描。
  • 合理、全网超低价的教学版和企业版商业授权。(请我们撸一次串的价格)

关于我们

  • S.L 老师,20年开发经验,后台全栈架构师,代码强迫症、性能洁癖、能看出一像素偏差。精通C++/Java/Scala/Web高并发/大数据/C++服务器/视频直播网络技术,略懂容器。
  • J.T 老师,15年开发经验,前端全栈架构师,思维极缜密、号边界王。精通C++/Java/Javascript/Vue & React/C++客户端/Android原生/小程序/视频直播编解码技术。
  • 欢迎加入我们的技术交流QQ群 (788581363)。

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 + 通用Mapper。
  • 服务组件: Redis + Zookeeper + Consul + Apollo + XXL-Job + Kafka + Nacos + Sentinel + Seata + Nepxion Discovery。
  • 系统监控: ELK + PinPoint / SkyWalking + Grafana + Prometheus。

基础功能

  • 前端框架:单页面、多标签、多栏目和子路由,多套高颜值样式模式可供选择。
  • 前端能力:列表编辑、统计图表、明细数据下钻、上传下载、数据导出、自定义打印样式模板、富文本等。
  • 页面布局:支持基于 Fragment 和 Block 的灵活布局方式,通过配置即可生成多样化的表单页面,并可预览。
  • 接口规范:微服务和单体服务的接口命名规则和参数定义完全一致,便于日后的平滑升级。
  • 后台架构:分布式锁、分布式 Id 生成器、分布式缓存、分布式事务、分布式限流和灰度发布等,按需集成。
  • 用户管理:支持基于OAuth2的单点登录。
  • 操作权限:前端控制可精确到按钮级的操作和标签级的显示,后台统一拦截验证更加安全。
  • 数据权限:基于 Mybatis 拦截器 + JSqlParser 的实现方式,配置更灵活,代码侵入性更低。
  • 多数据源:可根据配置动态生成,路由策略灵活可扩展。
  • 数据组装:Java 注解方式实现数据组装,支持统一接口的服务内和跨服务的一对一、一对多、多对多、字典、聚合计算等关系数据组合。
  • 定时任务:我们不仅提供了 Job 基础框架的集成,更能生成灵活可配、高度优化、便于二次开发的 Job 业务逻辑代码。
  • 系统监控:基于 Kafka + ELK 的日志收集,基于 PinPoint/SkyWalking 的服务链路跟踪,基于 GPE 的服务性能指标监控。

设计理念

  • 前沿的单表组合式设计,使业务服务的拆分与再合并 SO EASY。
  • 先代码,后SQL的原则,让服务横向扩充更具弹性。
  • 标准化的服务间调用接口,使业务服务组合更具正交性。
  • 前后端基于约定各司其职,默契配合,让系统运行飞起来。
  • 可平滑的逐步演化为云原生架构。

代码质量

  • 无任何二次封装,只生成您最懂的代码。
  • 遵循阿里巴巴标准的代码规范。
  • SonarQube 基于最严格检测规则的代码扫描。
  • 产品级代码质量,层次清晰、滴水不漏。
  • 近乎于0的代码重复率,35%以上的注释覆盖率。
  • 15年架构师优化的每一处细节。

规则扫描

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

  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-orange-demo.sql文件。
  • 导入脚本主要负责,数据库创建、数据表创建和测试数据的插入。
  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。
  • 具体可参考我们的开发文档教学版前端工程启动段落

主要截图

橙单生成器

开发文档

演示工程

微服务中间件

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一下!欢迎加入QQ支持群 (788581363)。 展开 收起
Java
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

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

搜索帮助