4 Star 9 Fork 1

section2014 / matilda

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

Matilda

你是我一生只会遇见一次的爱情

关于名字

Matilda,其实我也一直很好奇她的由来,或许是来自为之绞尽脑汁之后的灵光一闪。很庆幸她来了,带着我的遗憾和倔强。希望之于开源世界我也能也尽到绵薄之力,为了一切更加美好。

一部电影

image-20200830235250832这个杀手不太冷》,这是一个温暖又悲伤的故事。故事中有一个小女孩,玛蒂达(matilda)。她像一束光照亮和温暖着身为杀手里昂的内心世界,或者是两个人互相温暖了彼此。我真的是超爱这部电影的,特别是这个敢爱敢恨的女孩。

玛蒂达:是不是人生总是如此艰难,还是只有童年如此? 里昂:总是如此。

里昂:还有不要总是说“好”! 玛蒂达:好

玛蒂达:里昂,我想我爱上你了。 这是我第一次爱上一个人。你知道吗?

里昂:你从没爱过,你怎么知道这是爱?

玛蒂达:因为我感觉到了。

里昂:哪?

玛蒂达:我的胃,它现在很暖和,以前这儿有个结……现在没了。

里昂:玛蒂达,我很高兴你的胃痛好了,但是那不能代表什么。

一份执念

很久之前,或许在我刚刚接触软件开发的时候开始,心中就有这样一个想法:要做一个完美的应用系统软件。 尽管时过境迁,这个想法经常搁浅;随着软件开发技术日新月异,我也渐渐明白没有最好只有更好的道理。真正完美的东西应该只存在于自己的想象中吧。

此时此刻,她来了,更像是我给自己的一个交代。正如前面说的那样,Matilda,她代表这世间一切的美好(至少在我心中)。

言归正传

Matilda,其实她也没有什么与众不同。她就是一个基于 Springboot 的权限管理系统,采用了 Spring SecurityMybatis Plus,采用插件化的方式开发,依赖 Hutool ,模版引擎用的 Thymeleaf

应用特点

  • 高效 是的不要怀疑你看到的。相对于现在流行的分布式应用,因为她是单体应用,没有中间商赚差价,所以更高效。一开始我们需要的可能不是微服务化的,前后端分离的应用。不管是开发还是运维,微服务对人员素质和数量的要求都太高了。 本应用致力于单体架构下的开发、部署、维护。目前,暂不涉及cloud、微服务的内容。

  • 职责单一 controller,负责请求参数的封装和检验,查询结果和处理结果的返回。service,专注业务逻辑的处理。这样应该可以提高service层的复用几率吧。坏了,强迫症又犯了

  • 插件化 借助于maven天然的插件化优势,结合我对微服务业务拆分的理解,实现了后台业务代码的隔离。这一点,我相信对于咱们的单体应用往微服务演进会有很大的帮助。 遥想 Spring Boot 诞生之前,更新功能的时候都是 class 文件逐个备份替换,这个时候插件化的优势相当明显。现在,我依然认为插件化在 业务功能解耦功能的更新和维护 方面还是有很大帮助的。每次总是更新整个包含所有依赖的jar文件还是没那么方便的吧。 更重要的是,后面会不会有很多的奇奇怪怪的功能插件,然后形成一个生态呀。(想多了吧)

  • 后台统一返回结果封装 虽然她采用了 Easyui 做页面的展示,但是借助 Easyui 的相关特性,实现了后台统一返回结果的封装。像是datagrid、treegrid、combotree……。这是做前后端分离必要一步吧。

  • Restful 同一路径,通过不同方式请求,实现不同的处理。

  • 异常处理 除了实现异常结果的统一封装返回外,她明确了系统异常和异常代码的对应关系。01xxxxx 的异常码已被系统承包

        ……
        // 系统异常:同一上级部门下存在相同名称的部门
        DEPT_REPORT_AT_SAME_PARENT("0100401", "同一上级部门下存在相同名称的部门"),
        // 系统异常:要操作的部门不存在。id:{}。
        DEPT_NO_EXIST("0100402", "要操作的部门不存在。id:{}。"),
        // 系统异常:部门[{}]下含有子部门无法删除。
        DEPT_HAS_CHILDREN("0100403", "部门[{}]下含有子部门无法删除。"),
        // 系统异常:部门[{}]下含有用户无法删除。
        DEPT_HAS_USER("0100404", "部门[{}]下含有用户无法删除。"),
        // 系统异常:上级部门不能是自身
        DEPT_SAME_AS_PARENT("0100405", "上级部门不能是自身")
        ……
  • 全方位的权限查看 用户、角色、权限,任何一方均可以查看和其它两方的关系。

  • 角色资源授权 当前用户只能将自己拥有的资源授予其它用户。自己未拥有的,无法操作。

技术架构

开发环境

  • 语言:Java 8
  • 依赖管理:Maven 3.6
  • IDE: IDEA 安装lombok插件
  • 数据库:MySQL 8.0.19。因为使用 Mybatis Plus,原则上适配 Oracle。

后端

  • 基础框架:Spring Boot 2.3.3.RELEASE
  • 持久层框架:Mybatis Plus 3.3.0
  • 安全框架:Spring Security(版本随 Spring Boot)
  • 模版引擎:Thymeleaf (版本随 Spring Boot)
  • 数据库连接池:druid-spring-boot-starter 1.1.23
  • 工具类:hutool-all 5.2.1
  • 其他:poi,Swagger-ui, lombok(简化代码)等。

前端

  • jQuery
  • jQuery Easyui
  • Bootstrap
  • Bootstrap-duallistbox

数据库表规范

待补充

开发原则

尽可能遵循设计模式七大在原则。下面是我的理解:

开口合里最单依

  1. 开闭原则 => 对扩展开放,对修改关闭
  2. 接口隔离原则
    • 客户端不要使用它不需要的接口
    • 类间的依赖应该建立在最小的接口上
  3. 组合/聚合原则 => 复用已有的对象时,多用组合,少用继承。
  4. 里氏替换原则
    • 子类不应该随便破坏(重写和重载)父类定义好的结构(方法)
    • 能用父类的地方,就能使用子类。反之,不行
  5. 最小知识原则 => 知道的越少越好。封装
  6. 单一职责原则 => 引起类发生改变的原因只有一个(一个类只做一种事,一个方法只做一件事)
  7. 依赖倒置原则 => 面向接口编程。依赖于抽象,不依赖于具体。

内置功能

  1. 用户管理。用户是系统操作者,该功能主要完成系统用户配置。
  2. 角色管理。用户角色配置。
  3. 菜单资源管理。配置系统菜单,操作权限,按钮权限标识等。
  4. 授权管理。角色用户授权和角色资源授权。
  5. 部门管理。配置系统部门,树结构展现,可随意调整上下级。
  6. 日志管理。系统正常操作日志记录和查询;系统异常信息日志记录和查询。
  7. 字典管理。对系统中经常使用的一些较为固定的数据进行维护,如:是否、男女、类别、级别等。
  8. 连接池监视。监视当期系统数据库连接池状态,可进行分析SQL找出系统性能瓶颈。
  9. 接口文档。

模块划分与后期规划

模块 说明
matilda-app 应用启动入口
matilda-dependencies 应用依赖管理
matilda-commons 通用工具、配置
matilda-modules-system 用户、角色、菜单、授权、部门、日志(其实是独立的,没有单独拿出来)、字典管理
matilda-modules-security Spring Security 权限控制(基于 session)
matilda-modules-schedule 定时任务调度管理(基于 Spring scheduling api)
demo-* (坑位)常用功能示例
matilda-modules-services (坑位)处理模块之间的耦合部分的公共依赖。有这个想法。
matilda-modules-gencode (坑位)代码生成。这个有点重复造轮子了。主要个人感觉这里可以很好的应用面向对象的编程思想。
matilda-modules-security-token (坑位)Spring Security 权限控制(基于 token)
matilda-modules-quartz (坑位)定时任务调度管理(基于 quartz)

功能演示

界面采用 thymeleaf +easyui-super-theme【感谢作者】,我觉得是够看了。相较layui,个人更倾向于vue,这是后话了。

  • 登录

登录

  • 用户管理

用户管理

  • 角色管理

角色管理

  • 权限管理

权限管理

  • 授权管理-角色与权限

授权管理-角色与权限

  • 授权管理-角色与用户

授权管理-角色与用户

  • 部门管理

部门管理

  • 数据字典

数据字典

  • 调度任务

调度任务

  • 接口文档

接口文档

  • 系统日志

系统日志

  • 主题设置

主题设置

最后

如果喜欢,欢迎点赞关注。我深知她并不完美。欢迎你与我一起并肩同行。谢谢大家。希望未来,Matilda 会越来越好,不负初心!!!

来吧,欢迎志同道合的伙伴。其他的,还希望各位大佬多多指教(* ̄︶ ̄)。

联系我:

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.

简介

基于 Springboot 的权限管理系统,采用了 Spring Security 和 Mybatis Plus,采用插件化的方式开发,依赖 Hutool,模版引擎用的 Thymeleaf。 展开 收起
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/section2014/matilda.git
git@gitee.com:section2014/matilda.git
section2014
matilda
matilda
master

搜索帮助