3 Star 22 Fork 1

lg翔 / lg-soar

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

平台简介

lg-soar是一套全部开源的快速高性能的开发平台,推崇默认为主兼顾扩展个性化配置,具有简单易用不失灵活的特性,具有微服务与单体无缝切换,同一套代码既可以部署成微服务也可以部署成单体、多租户、多数据源、多规则IP白名单拦截、好用的前端查询器、自动签名验签 、自动数据脱敏、敏感数据加密、枚举字典翻译、分布式锁、统一异常处理、统一响应数据格式、丰富的开发工具、redis + caffeine + spring cache的缓存实现 、可插拔的redis支持等丰富的功能,毫无保留给个人及企业免费使用。https://gitee.com/lgx1992/lg-soar

  • 采用前后端分离的模式
  • 后端采用 Spring Boot、MyBatis-plus、swagger、knife4j、easyexcel、redis、mysql
  • 微服务 Spring cloud、spring gateway、nacos、feign
  • 前端使用 vue3、tdesign、axios、uniapp
  • 开发文档 https://gitee.com/lgx1992/lg-soar/wikis/pages
  • 项目预览 https://lgsoar.cn

架构图

业务功能

  1. 用户管理:用户是系统操作者,该功能主要完成系统用户配置(系统用户只代表当前操作系统的对象,包括但不仅限于人)
  2. 组织机构:配置系统组织机构(公司、部门、科室、用户组等),树结构展现。配置角色,角色向上继承
  3. 岗位职位:配置系统岗位(CEO、总经理、普通职员),树结构展现。配置角色,角色向下包含
  4. 角色管理:角色菜单分配、数据权限分配、支持常规角色和向上继承向下包含(RBAC1)
  5. 菜单管理:配置系统菜单、分配权限(前端可见菜单、元素)。(可自动扫描前端路由配置生成菜单数据)
  6. 权限管理:配置系统权限(接口访问权限)。(可自动扫描系统接口生成权限数据)
  7. 字典管理:对系统中经常使用的一些较为固定的数据进行维护。(可自动扫描系统枚举生成字典数据)
  8. 参数管理:对系统(或用户的)动态配置常用参数。
  9. 操作日志:系统操作日志记录和查询;可通过注解或动态配置(无需编码部署,实时生效)的方式实现操作日志记录。
  10. 在线用户:当前系统中有效token的管理
  11. 代码生成:前后端代码的生成(java、vue),可自动生成到对应的目录下
  12. 系统接口:根据业务代码自动生成相关的api接口文档。
  13. 服务监控:监视当前系统CPU、内存、磁盘、堆栈等相关信息。
  14. 多种登录方式:账号密码登录、临时密码登录、多账户绑定登录、授权码登录(扫码登录)、单点登录、可作为认证中心
  15. 文件服务:文件上传、图片缩略图、图片裁剪、文件秒传、业务文件关联管理
  16. 信息服务:邮件发送、websocket

系统模块

server                                  // 后端服务
├── soar-base                           // soar 基础模块(共享)
│   └── soar-common                     // soar 基础包(工具、枚举、常量)
│   └── soar-core                       // soar 核心功能模块
│   └── soar-database                   // soar 数据库访问模块
│   └── soar-redis                      // soar redis功能模块
│   └── soar-spring-mvc                 // soar spring-mvc模块()
├── soar-api                            // 功能模块对外开放的api定义(共享)
│   └── soar-system-api                 // system 对外开放的api
│   └── soar-general-api                // general 对外开放的api
│   └── soar-message-api                // message 对外开放的api
├── soar-modules                        // soar 服务功能模块(共享)
│   └── soar-system                     // system  系统业务模块(用户、组织职位、角色、权限、菜单、登录、登出、字典、日志等)
│   └── soar-general                    // general 通用服务模块,文件、地区、网站元素
│   └── soar-message                    // message 信息通信模块,消息、邮件、websocket、消息模板、公告、通知、提醒

├── soar-feign                          // api 的 feign 模块(只需要单体时可删除该模块)
│    └── soar-system-feign              // system-api 的 feign实现
│    └── soar-general-feign             // general-api 的 feign实现
│    └── soar-message-feign             // message-api 的 feign实现
├── soar-cloud                          // soar 微服务实现模块(只需要单体时可删除该模块)
│   ├── soar-cloud-core                 // 微服务核心,提供微服务公共实现(异常处理、当前用户) 
│   ├── soar-gateway-cloud              // [9000] 微服务网关                               
│   ├── soar-system-cloud               // [9001] system 的微服务启动入口
│   ├── soar-general-cloud              // [9002] general 的微服务启动入口
│   └── soar-message-cloud              // [9003] message 的微服务启动入口 

└── demo-boot                       // [9000] 单体版 demo(你的业务代码写在这里 或 参考这里创建自己的业务模块)     
└── demo-cloud                      // [9004] 微服务版 demo(你的业务代码写在这里 或 参考这里创建自己的业务模块)    

注解

@Log:实现简单操作日志功能,并使用线程池保存异步保存操作日志不影响业务功能
@ClusterLock:实现分布式锁功能,key支持el表达式
@ClusterFairLock:分布式公平锁
@ClusterReadLock:分布式读锁
@ClusterWriteLock:分布式写锁
@IdempotentByParam:通过请求数据信息摘要的方式实现接口幂等性校验功能
@IdempotentByToken:通过后端生成唯一key的方式实现接口幂等性
@IdempotentByKey:通过前端生成唯一key的方式实现接口幂等性
@DictDefine:在实现 IDict 接口的枚举类加上该注解,可通过扫描生成指定字典信息
@SignatureVerification 接口验签
@SignatureIssue 接口数据签名
@SignContain 数据签名包含字段
@SignExclude 数据签名排除字段
@Translate 用于字段和方法:翻译、绑定数据,用于自定义注解:绑定翻译处理器
@TranslateByEnum 字段翻译注解,根据枚举翻译
@TranslateByString 字段翻译注解,根据字符串翻译
@TranslateByDict 字段翻译注解,根据数据字典翻译
@TranslateByEntity 字段翻译注解,根据实体类翻译
@TranslateName 自定义翻译后的字段名,默认目标字段名+Name
@Desensitization:字段脱敏注解,用于配置字段脱敏方式
@NumberSerialize 数值序列化(基于 java.text.NumberFormat)
@DecimalSerialize 小数序列化(基于 java.text.DecimalFormat)
@SoarFormat json格式化,
    日期时间:@SoarFormat("yyyy-MM-dd HH:mm:ss")、@SoarFormat("yyyy-MM-dd")
    数值:@SoarFormat(",##0.00")、@SoarFormat(",##0吨")、@SoarFormat("#.##%")
    脱敏:@SoarFormat("$TM:3****4")、@SoarFormat("$TM:1*1")、@SoarFormat("$TM:3···4")
    自定义替换:@SoarFormat({"<", "&lt;"})、@SoarFormat({"<", "&lt;", ">", "&gt;"})

@BankCard 验证银行卡
@Chinese 验证中文
@ContactPhone 验证联系方式(固话和手机)
@Distinct 验证数据是否重复(前端数组元素是否唯一)
@Enum 验证提供数据是否符合枚举值
@FixedPhone 验证固话
@IdCard 验证身份证号码
@IP 验证IP地址
@License 验证营业执照号
@MobilePhone 验证手机号
@Id 验证数值id是否有效

@CountMapping 相当于@RequestMapping(path = "count", method = RequestMethod.GET, name = "统计")
@CreateMapping 相当于@RequestMapping(path = "create", method = RequestMethod.POST, name = "创建")
@DetailMapping 相当于@RequestMapping(path = "detail", method = RequestMethod.GET, name = "详情")
@ExistMapping 相当于@RequestMapping(path = "exist", method = RequestMethod.GET, name = "是否存在")
@ExportMapping 相当于@RequestMapping(path = "export", method = RequestMethod.GET, name = "导出")
@ImportMapping 相当于@RequestMapping(path = "import", method = RequestMethod.POST, name = "导入")
@QueryMapping 相当于@RequestMapping(path = "query", method = RequestMethod.GET, name = "查询")
@RemoveMapping 相当于@RequestMapping(path = "remove", method = RequestMethod.POST, name = "删除")
@UpdateDisabledMapping 相当于@RequestMapping(path = "updateDisabled", method = RequestMethod.POST, name = "启/禁用")
@UpdateMapping 相当于@RequestMapping(path = "update", method = RequestMethod.POST, name = "更新")
@UpdateSortMapping 相当于@RequestMapping(path = "updateSort", method = RequestMethod.POST, name = "修改排序")

@ResourceScanIgnore 系统扫描路径生成权限时忽略,放在类上忽略类内的所有接口,放在方法上忽略当前方法接口
@SoarQueryIgnore 放在实体属性上,在SoarQuery构造查询条件时忽略该属性
@SoarQueryField 放在实体属性上,可控制SoarQuery构造查询条件时的行为

工具

SignatureData 数据签名工具
SpringUtils 用于非Spring bean 类获取 spring bean
DatetimeUtil 时间工具(格式化、格式解析、时间戳生成)
AssertUtil 断言工具
ClassUtils 类扫描工具
DesensitizationUtil 脱敏工具
SignatureUtils 数据签名工具(签名、验签)
TranslateUtils 字段翻译工具
SpelExpressionUtils spring el表达式支持工具
DictEnumUtils 
ExceptionUtil 异常格式工具
FileUtil 文件工具
IpUtil IP工具
ParameterUtil 参数验证工具(类似断言工具)
PojoUtil 类复制转换工具
ReflectUtil 反射工具
SerializeUtil 序列化工具
Validator 验证器(校验数据)
DataUtil 数据工具(base64、hex)
NumberUtil 数值工具
RandomUtil 随机数工具(随机int、随机long、随机字符串等)
StringUtil 字符串工具
SystemUtils 系统工具(内存、硬盘、jvm信息)
PathMatcher 路径匹配器
JacksonUtil json工具(对jackson进行封装)
AESUtil 对称加密工具
CRCUtil crc算法工具
CryptoUtils hash加密工具(信息摘要算法工具)
RSAUtils 非对称加密工具
ExcelUtil Excel导出导入工具,基于阿里EasyExcel
SoarQueryUtil 查询条件组装工具
SoarJWT 自定义jwt实现,具有更简短更快速的特性
Soar64 类似base64,需要压缩数据存储传输时使用,比如redis key
TreeData 树形数据接口
BitSet 位数据set,jdk有类似实现,本实现基于byte,jdk实现基于long,空间利用率比jdk实现高,性能比jdk实现差
TwoBitSet 双数据set,类似BitSet,但支持四种状态

CurrentUser:当前登录用户

mybatis 类型处理器

DynamicJsonTypeHandler 动态json类型数据处理器,数据类型不固定的
AutoJsonTypeHandler 自动json类型数据处理器(类型固定的)
AbstractAesHandler Aes对称加密类型处理器(抽象类)
IntegerAesHandler int类型数据对称加密处理器
LongAesHandler long类型数据对称加密处理器
StringAesHandler 字符串类型数据对称加密处理器

easy-excel 类型转换器

TranslateConverter 翻译处理转换器需配合翻译注解实现导入导出翻译功能(@Translate系列)
BooleanConverter 布尔类型转换器

异常

BaseAException 用户异常基础异常类,异常码A开头,表示用户操作或数据不合法等用户原因产生的异常,用户可通过调整操作自行解决
BaseBException 系统异常基础异常类,异常码B开头,表示系统内部问题,表示系统编码不够完善产生的异常,用户无法解决
BaseCException 第三方异常基础异常类,异常码C开头,表示调用第三方服务时出现异常,用户无法解决
AuthenticationException 未登录异常(用户异常)
PermissionException 无权限异常(用户异常)
ParameterException 参数不正确异常(用户异常)
AlgorithmException 加密工具产生的异常(系统异常)

前端安装启动

前端安装

 yarn install
 或者
 npm install

前端启动

yarn run serve
或者
npm run serve

nginx 配置示例

server {
    listen 80;  
    server_name 你的域名;
    rewrite ^(.*) https://$server_name$1 permanent;     
}

server {
    listen 443 ssl;
    server_name 你的域名;
    # ssl
    # 改成你的证书的名字
    ssl_certificate  你的域名证书.pem文件;
    # 你的证书的名字
    ssl_certificate_key 你的域名证书.key文件;
    ssl_session_cache    shared:SSL:1m;
    ssl_session_timeout  5m;
    ssl_ciphers  HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers  on;

    #charset koi8-r;

    # 访问日志
    #access_log  logs/host.access.log  main;

    # 前端配置
    location / {
        root  /www/apps/szsw/dist/; # 前端根目录
        try_files $uri $uri/ /index.html last;
        index  index.html;
    }
    # 接口配置
    location ^~ /soar-api {
        proxy_pass http://localhost:9001/; # 你的后端服务
        # 请求头设置
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;  #获取客户端真实IP
        proxy_set_header REMOTE-HOST $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
    # 附件配置(通过nginx直接访问文件)
    location /file-root {
        root  /www/apps/szsw/upload; # 文件上传根目录
        rewrite	"^\/file-root(.*)$" $1 break;
        try_files $uri @file-root; # 文件未找到的通过后端服务访问
        expires 7d; 
    }
    # 未发现附件则匹配以下规则(通过后端服务访问文件)
    location @file-root {
        proxy_pass http://localhost:9001/file/preview?path=/file-root$uri;
    }
    
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }
    
    gzip  on;
}

演示图

友情链接:

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.

简介

lg-soar(翱翔)高度封装统一,使用简单,却不失灵活和扩展性 展开 收起
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/lgx1992/lg-soar.git
git@gitee.com:lgx1992/lg-soar.git
lgx1992
lg-soar
lg-soar
master

搜索帮助