Pārlūkot izejas kodu

:tada: 2.0.0-RC1.

smallchill 6 gadi atpakaļ
vecāks
revīzija
a62e541c21
100 mainītis faili ar 4906 papildinājumiem un 263 dzēšanām
  1. 21 0
      .editorconfig
  2. 1 1
      LICENSE
  3. 99 262
      README.md
  4. 15 0
      blade-auth/Dockerfile
  5. 73 0
      blade-auth/pom.xml
  6. 37 0
      blade-auth/src/main/java/org/springblade/auth/AuthApplication.java
  7. 37 0
      blade-auth/src/main/java/org/springblade/auth/config/RegistryConfiguration.java
  8. 99 0
      blade-auth/src/main/java/org/springblade/auth/controller/AuthController.java
  9. 10 0
      blade-auth/src/main/resources/banner.txt
  10. 12 0
      blade-auth/src/main/resources/bootstrap.yml
  11. 38 0
      blade-common/pom.xml
  12. 30 0
      blade-common/src/main/java/org/springblade/common/cache/CacheNames.java
  13. 38 0
      blade-common/src/main/java/org/springblade/common/config/BladeCommonConfiguration.java
  14. 25 0
      blade-common/src/main/java/org/springblade/common/constant/CommonConstant.java
  15. 25 0
      blade-common/src/main/java/org/springblade/common/tool/CommonUtil.java
  16. 24 0
      blade-common/src/main/java/org/springblade/common/tool/DictUtil.java
  17. 1 0
      blade-common/src/main/resources/META-INF/spring-devtools.properties
  18. 2 0
      blade-common/src/main/resources/META-INF/spring.factories
  19. 15 0
      blade-gateway/Dockerfile
  20. 97 0
      blade-gateway/pom.xml
  21. 38 0
      blade-gateway/src/main/java/org/springblade/gateway/GateWayApplication.java
  22. 82 0
      blade-gateway/src/main/java/org/springblade/gateway/config/ErrorHandlerConfiguration.java
  23. 37 0
      blade-gateway/src/main/java/org/springblade/gateway/config/RateLimiterConfiguration.java
  24. 114 0
      blade-gateway/src/main/java/org/springblade/gateway/config/RouterFunctionConfiguration.java
  25. 105 0
      blade-gateway/src/main/java/org/springblade/gateway/controller/DiscoveryClientController.java
  26. 63 0
      blade-gateway/src/main/java/org/springblade/gateway/filter/RequestGlobalFilter.java
  27. 115 0
      blade-gateway/src/main/java/org/springblade/gateway/handler/ErrorExceptionHandler.java
  28. 43 0
      blade-gateway/src/main/java/org/springblade/gateway/handler/HystrixFallbackHandler.java
  29. 54 0
      blade-gateway/src/main/java/org/springblade/gateway/handler/SwaggerResourceHandler.java
  30. 59 0
      blade-gateway/src/main/java/org/springblade/gateway/handler/SwaggerSecurityHandler.java
  31. 59 0
      blade-gateway/src/main/java/org/springblade/gateway/handler/SwaggerUiHandler.java
  32. 77 0
      blade-gateway/src/main/java/org/springblade/gateway/provider/SwaggerProvider.java
  33. 10 0
      blade-gateway/src/main/resources/banner.txt
  34. 91 0
      blade-gateway/src/main/resources/bootstrap.yml
  35. 15 0
      blade-ops/blade-admin/Dockerfile
  36. 57 0
      blade-ops/blade-admin/pom.xml
  37. 32 0
      blade-ops/blade-admin/src/main/java/org/springblade/admin/BladeAdminApplication.java
  38. 10 0
      blade-ops/blade-admin/src/main/resources/banner.txt
  39. 30 0
      blade-ops/blade-admin/src/main/resources/bootstrap.yml
  40. 77 0
      blade-ops/blade-codegen/pom.xml
  41. 49 0
      blade-ops/blade-codegen/src/main/java/org/springblade/generate/CodeGenerator.java
  42. 249 0
      blade-ops/blade-codegen/src/main/java/org/springblade/support/BladeGenerator.java
  43. 5 0
      blade-ops/blade-codegen/src/main/resources/generator.properties
  44. 154 0
      blade-ops/blade-codegen/src/main/resources/templates/controller.java.vm
  45. 161 0
      blade-ops/blade-codegen/src/main/resources/templates/entity.java.vm
  46. 38 0
      blade-ops/blade-codegen/src/main/resources/templates/entityDTO.java.vm
  47. 44 0
      blade-ops/blade-codegen/src/main/resources/templates/entityVO.java.vm
  48. 46 0
      blade-ops/blade-codegen/src/main/resources/templates/mapper.java.vm
  49. 44 0
      blade-ops/blade-codegen/src/main/resources/templates/mapper.xml.vm
  50. 45 0
      blade-ops/blade-codegen/src/main/resources/templates/service.java.vm
  51. 47 0
      blade-ops/blade-codegen/src/main/resources/templates/serviceImpl.java.vm
  52. 51 0
      blade-ops/blade-codegen/src/main/resources/templates/wrapper.java.vm
  53. 15 0
      blade-ops/blade-config-server/Dockerfile
  54. 24 0
      blade-ops/blade-config-server/README.md
  55. 56 0
      blade-ops/blade-config-server/pom.xml
  56. 32 0
      blade-ops/blade-config-server/src/main/java/org/springblade/config/BladeConfigApplication.java
  57. 10 0
      blade-ops/blade-config-server/src/main/resources/banner.txt
  58. 42 0
      blade-ops/blade-config-server/src/main/resources/bootstrap.yml
  59. 83 0
      blade-ops/blade-config-server/src/main/resources/config/application-dev.yml
  60. 83 0
      blade-ops/blade-config-server/src/main/resources/config/application-prod.yml
  61. 83 0
      blade-ops/blade-config-server/src/main/resources/config/application-test.yml
  62. 4 0
      blade-ops/blade-config-server/src/main/resources/config/blade-dashboard-dev.yml
  63. 4 0
      blade-ops/blade-config-server/src/main/resources/config/blade-dashboard-prod.yml
  64. 4 0
      blade-ops/blade-config-server/src/main/resources/config/blade-dashboard-test.yml
  65. 20 0
      blade-ops/pom.xml
  66. 17 0
      blade-service-api/blade-desk-api/pom.xml
  67. 63 0
      blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/entity/Notice.java
  68. 45 0
      blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/feign/INoticeClient.java
  69. 20 0
      blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/vo/NoticeVO.java
  70. 18 0
      blade-service-api/blade-dict-api/pom.xml
  71. 35 0
      blade-service-api/blade-dict-api/src/main/java/org/springblade/system/config/DictFeignConfiguration.java
  72. 33 0
      blade-service-api/blade-dict-api/src/main/java/org/springblade/system/dto/DictDTO.java
  73. 92 0
      blade-service-api/blade-dict-api/src/main/java/org/springblade/system/entity/Dict.java
  74. 57 0
      blade-service-api/blade-dict-api/src/main/java/org/springblade/system/feign/IDictClient.java
  75. 33 0
      blade-service-api/blade-dict-api/src/main/java/org/springblade/system/feign/IDictClientFallback.java
  76. 67 0
      blade-service-api/blade-dict-api/src/main/java/org/springblade/system/vo/DictVO.java
  77. 1 0
      blade-service-api/blade-dict-api/src/main/resources/META-INF/spring-devtools.properties
  78. 2 0
      blade-service-api/blade-dict-api/src/main/resources/META-INF/spring.factories
  79. 18 0
      blade-service-api/blade-system-api/pom.xml
  80. 33 0
      blade-service-api/blade-system-api/src/main/java/org/springblade/system/dto/CodeDTO.java
  81. 33 0
      blade-service-api/blade-system-api/src/main/java/org/springblade/system/dto/DeptDTO.java
  82. 33 0
      blade-service-api/blade-system-api/src/main/java/org/springblade/system/dto/MenuDTO.java
  83. 33 0
      blade-service-api/blade-system-api/src/main/java/org/springblade/system/dto/ParamDTO.java
  84. 33 0
      blade-service-api/blade-system-api/src/main/java/org/springblade/system/dto/RoleDTO.java
  85. 33 0
      blade-service-api/blade-system-api/src/main/java/org/springblade/system/dto/RoleMenuDTO.java
  86. 98 0
      blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Code.java
  87. 86 0
      blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Dept.java
  88. 138 0
      blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Menu.java
  89. 64 0
      blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Param.java
  90. 80 0
      blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Role.java
  91. 60 0
      blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/RoleMenu.java
  92. 35 0
      blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/CodeVO.java
  93. 69 0
      blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/DeptVO.java
  94. 83 0
      blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/MenuVO.java
  95. 35 0
      blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/ParamVO.java
  96. 35 0
      blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/RoleMenuVO.java
  97. 68 0
      blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/RoleVO.java
  98. 17 0
      blade-service-api/blade-user-api/pom.xml
  99. 79 0
      blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/entity/User.java
  100. 0 0
      blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/entity/UserInfo.java

+ 21 - 0
.editorconfig

@@ -0,0 +1,21 @@
+# http://editorconfig.org
+root = true
+
+# 空格替代Tab缩进在各种编辑工具下效果一致
+[*]
+indent_style = space
+indent_size = 4
+charset = utf-8
+end_of_line = lf
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[*.java]
+indent_style = tab
+
+[*.{json,yml}]
+indent_size = 2
+
+[*.md]
+insert_final_newline = false
+trim_trailing_whitespace = false

+ 1 - 1
LICENSE

@@ -176,7 +176,7 @@ 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 2016 smallchill
+   Copyright 2017 smallchill
 
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.

+ 99 - 262
README.md

@@ -1,262 +1,99 @@
-#SpringBlade java开发平台
-## 平台简介
-SpringBlade是基于多个优秀的开源项目,将各个亮点设计融于一体的快速开发平台。构建稳定的生态圈,对各大底层框架无代码侵入。
-
-## 鸣谢
-1.[JFinal](http://www.oschina.net/p/jfinal)
-2.[eova](http://www.oschina.net/p/eova)
-3.[hutool](http://www.oschina.net/p/hutool)
-4.[beetl](http://www.oschina.net/p/beetl)
-5.[beetlsql](http://www.oschina.net/p/beetlsql)
-6.[dreamlu](http://www.oschina.net/p/dreamlu)
-7.[kisso](http://www.oschina.net/p/kisso)
-8.[spring-shiro-training](https://git.oschina.net/wangzhixuan/spring-shiro-training)
-
-## 内置功能
-
-1.	用户管理
-2.	角色管理
-3.	菜单管理
-4.	字典管理
-5.	部门管理
-6.	附件管理
-7.	参数管理
-8.	连接池监视
-9.	日志管理
-10.	代码生成
-
-## 技术选型
-
-1、后端
-
-* 核心框架:Spring Framework
-* 安全框架:Apache Shiro
-* 视图框架:Spring MVC
-* 服务端验证:Blade Validator
-* 任务调度:Spring Task
-* 持久层框架:beetlsql
-* 模板引擎:beetl
-* 数据库连接池:Alibaba Druid
-* 缓存框架:Ehcache
-* 日志管理:SLF4J、LOGBACKUP
-* 工具类:Apache Commons、FastJson、EASYPOI、BladeToolBox
-
-2、前端
-
-* JS框架:jQuery
-* CSS框架:Twitter Bootstrap
-* 客户端验证:JQuery-html5Validate
-* 富文本:KindEcitor
-* 数据表格:jqGrid
-* 树结构控件:jQuery zTree
-* 弹出层:Layer
-* 日期控件: LayDate
-* 图表控件:echarts
-
-## 后台界面
-![后台界面](http://git.oschina.net/uploads/images/2016/1216/101843_390413c3_474499.png "后台界面")
-![后台界面](http://git.oschina.net/uploads/images/2016/1216/101859_f8602cd4_474499.png "后台界面")
-![后台界面](http://git.oschina.net/uploads/images/2016/1216/101906_23f5cac9_474499.png "后台界面")
-![后台界面](http://git.oschina.net/uploads/images/2016/1216/101918_2d2f2b09_474499.png "后台界面")
-![后台界面](http://git.oschina.net/uploads/images/2016/1216/101926_2fed83a4_474499.png "后台界面")
-![后台界面](http://git.oschina.net/uploads/images/2016/1216/101936_51942583_474499.png "后台界面")
-![后台界面](http://git.oschina.net/uploads/images/2016/1216/101944_17417a87_474499.png "后台界面")
-
-## 代码示例
-实体类
-```
-@Table(name = "notice")
-@BindID(name = "id")
-@SuppressWarnings("serial")
-public class Notice extends BaseModel {
-	private String id;
-	private Integer creater;
-	private String content;
-	private String title;
-	private Date createTime;
-
-	@AutoID
-	@SeqID(name = "SEQ_NOTICE")
-	public String getId() {
-		return id;
-	}
-
-	public void setId(String id) {
-		this.id = id;
-	}	
-	.....................
-		
-}
-```
-
- 新增
-```
-	@Json
-	@RequestMapping(KEY_SAVE)
-	public AjaxResult save() {
-		Notice notice = mapping(PREFIX, Notice.class);
-		boolean temp = Blade.create(Notice.class).save(notice);
-		if (temp) {
-			return success(SAVE_SUCCESS_MSG);
-		} else {
-			return error(SAVE_FAIL_MSG);
-		}
-	}
-```
-
- 修改
-```
-	@Json
-	@RequestMapping(KEY_UPDATE)
-	public AjaxResult update() {
-		Notice notice = mapping(PREFIX, Notice.class);
-		boolean temp = Blade.create(Notice.class).update(notice);
-		if (temp) {
-			return success(UPDATE_SUCCESS_MSG);
-		} else {
-			return error(UPDATE_FAIL_MSG);
-		}
-	}
-```
-
- 删除
-```
-	@Json
-	@RequestMapping(KEY_REMOVE)
-	public AjaxResult remove(@RequestParam String ids) {
-		int cnt = Blade.create(Notice.class).deleteByIds(ids);
-		if (cnt > 0) {
-			return success(DEL_SUCCESS_MSG);
-		} else {
-			return error(DEL_FAIL_MSG);
-		}
-	}
-```
-
- 自定义sql查询,返回map
-```
-	List<Map> list = Db.selectList("select * form news where title = #{title}", CMap.init().set("title", "标题测试"));
-```
-
- 自定义sql查询,返回String(使用多数据源)
-```
-	String editor = Db.init("otherDb").queryStr("select editor form news where newsId = #{newsId}", CMap.init().set("newsId", 123));
-```
-
- 根据md文件的sql执行修改
-```
-	int cnt = Md.update("news.update", CMap.init().set("title", "标题测试").set("id", "1"));
-```
-
- 根据条件修改
-```
-	boolean temp = Blade.create(News.class).updateBy("editor = #{editor}", "title = #{title}", CMap.init().set("title", "测试标题").set("editor", "编辑一"));
-```
-
- 根据条件删除
-```
-	String ids = "1,2,3,4,5";
-	String[] idArr = ids.split(",");
-	int cnt = Blade.create(News.class).deleteBy("status in (#{join(ids)})", CMap.init().set("ids", idArr));
-```
-
-## 通用Service
-```
-	public interface NoticeService extends IService<Notice> {
-	
-	}
-	
-	
-	@Service
-	public class NoticeServiceImpl extends BaseService<Notice> implements NoticeService {
-	
-	}
-
-
-	@Autowired
-	NoticeService service;
-
-	@Json
-	@RequestMapping(KEY_SAVE)
-	public AjaxResult save() {
-		Notice notice = mapping(PREFIX, Notice.class);
-		boolean temp = service.save(notice);
-		if (temp) {
-			return success(SAVE_SUCCESS_MSG);
-		} else {
-			return error(SAVE_FAIL_MSG);
-		}
-	}
-
-```
-
-## 分页
-```
-	@Json
-	@RequestMapping(KEY_LIST)
-	public Object list() {
-		Object grid = paginate(LIST_SOURCE, new IQuery() {
-			
-			@Override
-			public void queryBefore(AopContext ac) {
-				if (ShiroKit.lacksRole(ConstShiro.ADMINISTRATOR)) {
-					String condition = "and creater = #{creater}";
-					ac.setCondition(condition);
-					ac.getParam().put("creater", ShiroKit.getUser().getId());
-				}
-			}
-			
-			@Override
-			public void queryAfter(AopContext ac) {
-				@SuppressWarnings("unchecked")
-				BladePage<Map<String, Object>> page = (BladePage<Map<String, Object>>) ac.getObject();
-				List<Map<String, Object>> list = page.getRows();
-				for (Map<String, Object> map : list) {
-					map.put("createrName", SysCache.getDictName(102, map.get("creater")));
-				}
-			}
-		});
-		
-		return grid;
-	}
-```
-
-注:
-=======
-
-欢迎提出更好的意见, 大家共同进步  
-SpringBlade主要用于交流学习, 开源协议署名为smallchill的代码也可以进行商用
-但是如果因为商业用途引起的纠纷和造成的一切后果请自行承担
-登陆名密码:两个 admin
-
-SpringBlade交流群:`477853168`  主要给大家交流学习, 本人工作比较忙, 回复的少请见谅
-
-SpringBlade不搞捐赠, 不打广告, 只做最单纯的开源项目
-
-如果需要非maven版,请点击[SpringBlade](http://git.oschina.net/smallc/SpringBlade_General)
-
-常见问题
-=======
-##1.linux下登陆报未知错误
-发布在linux的小伙伴需要做如下操作:
-`vi /etc/my.cnf`
-在[mysqld]节点下增加`lower_case_table_names = 1`
-`:wq`
-`service mysqld restart`
-取消大小写敏感,就可以正常运行了
-
-##2.连接oracle报未知错误
-到resource文件夹下config.properties修改oracle链接,然后到resource/spring/applicationContext.xml找到
-```
-<property name="dbStyle">
-    <bean class="org.beetl.sql.core.db.MySqlStyle"></bean>
-</property>
-```
-将`MySqlStyle`改为`OracleStyle`
-
-##3.创建model后有没有自动生成javabean字段和sql的办法?
-有,访问如下两个地址:
-`localhost:8080/blade/generate/pojo/blade_menu`
-`localhost:8080/blade/generate/sql/org.springblade.system.model.Menu`
-查看控制台打印结果,按自己需求复制粘贴到model和md文件中
-
+## 简介
+SpringBlade 2.0 是一个基于 Spring Boot 2 & Spring Cloud Finchley & Mybatis 等核心技术,用于快速构建中大型系统的基础框架。
+
+注意事项
+* 注册中心为 Consul 
+* 基于 SpringBoot2.x 版本 以及 SpringCloud Finchley 版本
+
+技术选型&文档
+* Spring Boot([查看Spring Boot学习&使用指南](http://www.jianshu.com/p/1a9fd8936bd8))
+* Spring Cloud([查看Spring Cloud学习&使用指南](https://springcloud.cc/))
+* Mybatis-Plus([查看官方文档](https://mp.baomidou.com/guide/))
+* JsonWebToken([查看官方文档](https://jwt.io/)) 
+
+## 工程结构
+``` 
+bladex
+├── blade-auth -- 授权服务提供
+├── blade-common -- 常用工具封装包
+├── blade-gateway -- Spring Cloud 网关
+├── blade-ops -- 运维中心
+├    ├── blade-admin -- spring-cloud后台管理
+├    ├── blade-codegen -- 代码生成
+├    └── blade-config-server -- 配置中心
+├── blade-service -- 业务模块
+├    ├── blade-desk -- 工作台模块 
+├    ├── blade-log -- 日志模块 
+├    ├── blade-system -- 系统模块 
+├    └── blade-user -- 用户模块 
+├── blade-service-api -- 业务模块api封装
+├    ├── blade-desk-api -- 工作台api 
+├    ├── blade-dict-api -- 字典api 
+├    ├── blade-system-api -- 系统api 
+└──  └── blade-user-api -- 用户api 
+```
+
+# 开源协议
+Apache Licence 2.0 ([英文原文](http://www.apache.org/licenses/LICENSE-2.0.html))
+
+Apache Licence是著名的非盈利开源组织Apache采用的协议。该协议和BSD类似,同样鼓励代码共享和尊重原作者的著作权,同样允许代码修改,再发布(作为开源或商业软件)。
+
+需要满足的条件如下:
+
+* 需要给代码的用户一份Apache Licence
+
+* 如果你修改了代码,需要在被修改的文件中说明。
+
+* 在延伸的代码中(修改和有源代码衍生的代码中)需要带有原来代码中的协议,商标,专利声明和其他原来作者规定需要包含的说明。
+
+* 如果再发布的产品中包含一个Notice文件,则在Notice文件中需要带有Apache Licence。你可以在Notice中增加自己的许可,但不可以表现为对Apache Licence构成更改。
+
+Apache Licence也是对商业应用友好的许可。使用者也可以在需要的时候修改代码来满足需要并作为开源或商业产品发布/销售。
+
+## 用户权益
+* 允许免费用于学习、毕设、公司项目、私活等。
+* 代码文件需保留相关license信息。
+
+## 禁止事项
+* 直接将本项目挂淘宝等商业平台出售。
+* 非界面代码50%以上相似度的二次开源,二次开源需先联系作者。
+
+注意:若禁止条款被发现有权追讨19999的授权费。
+
+## 如何启动
+* 开启consul,redis,mysql
+* fork ([bladex-config](https://gitee.com/smallc/bladex-config))项目,修改数据库等相关链接
+* 修改 `blade-config-server` 工程 `bootstrap.yml中config.server.git.uri` 的值为新fork项目的地址
+* 先启动 `blade-config-server`
+* 再依次启动其余模块
+
+## 技术文档
+* 即将发布,敬请期待
+
+## 注
+* SpringBlade前端UI项目地址:[Sword](https://gitee.com/smallc/Sword)
+* SpringBlade交流群:`477853168`
+
+
+# 界面一览
+![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/springblade-k8s.png "业务系统")
+![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/springblade-traefik.png "业务系统")
+![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/springblade-traefik-health.png "业务系统")
+![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/springblade-harbor.png "业务系统")
+![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/springblade-consul.png "业务系统")
+![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/springblade-consul-nodes1.png "业务系统")
+![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/springblade-consul-nodes2.png "业务系统")
+![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/springblade-admin1.png "业务系统")
+![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/springblade-admin2.png "业务系统")
+![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/springblade-swagger1.png "业务系统")
+![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/springblade-swagger2.png "业务系统")
+![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/sword-main.png "业务系统")
+![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/sword-menu.png "业务系统")
+![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/sword-menu-edit.png "业务系统")
+![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/sword-menu-icon.png "业务系统")
+![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/sword-role.png "业务系统")
+![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/sword-user.png "业务系统")
+![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/sword-dict.png "业务系统")
+![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/sword-locale-cn.png "业务系统")
+![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/sword-locale-us.png "业务系统")
+![业务系统](https://raw.githubusercontent.com/chillzhuang/blade-tool/master/pic/sword-log.png "业务系统")

+ 15 - 0
blade-auth/Dockerfile

@@ -0,0 +1,15 @@
+FROM anapsix/alpine-java:8_server-jre_unlimited
+
+MAINTAINER smallchill@163.com
+
+RUN mkdir -p /blade/auth
+
+WORKDIR /blade/auth
+
+EXPOSE 8010
+
+ADD ./target/blade-auth.jar ./app.jar
+
+ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"]
+
+CMD ["--spring.profiles.active=test"]

+ 73 - 0
blade-auth/pom.xml

@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <artifactId>SpringBlade</artifactId>
+        <groupId>org.springblade</groupId>
+        <version>2.0.0-RC1</version>
+    </parent>
+
+    <artifactId>blade-auth</artifactId>
+    <name>${project.artifactId}</name>
+    <version>${blade.project.version}</version>
+    <packaging>jar</packaging>
+
+    <dependencies>
+        <!--Blade-->
+        <dependency>
+            <groupId>org.springblade</groupId>
+            <artifactId>blade-core-secure</artifactId>
+            <version>${blade.tool.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springblade</groupId>
+            <artifactId>blade-core-log</artifactId>
+            <version>${blade.tool.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springblade</groupId>
+            <artifactId>blade-user-api</artifactId>
+            <version>${blade.project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springblade</groupId>
+            <artifactId>blade-core-swagger</artifactId>
+            <version>${blade.tool.version}</version>
+        </dependency>
+        <!--Config-->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-config</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+			<plugin>
+				<groupId>com.spotify</groupId>
+				<artifactId>docker-maven-plugin</artifactId>
+				<version>${docker.plugin.version}</version>
+				<configuration>
+					<imageName>${docker.registry.url}/blade/${project.artifactId}:${project.version}</imageName>
+					<dockerDirectory>${project.basedir}</dockerDirectory>
+					<dockerHost>${docker.registry.host}</dockerHost>
+					<resources>
+						<resource>
+							<targetPath>/</targetPath>
+							<directory>${project.build.directory}</directory>
+							<include>${project.build.finalName}.jar</include>
+						</resource>
+					</resources>
+					<registryUrl>${docker.registry.url}</registryUrl>
+					<serverId>${docker.registry.url}</serverId>
+					<pushImage>true</pushImage>
+				</configuration>
+			</plugin>
+        </plugins>
+    </build>
+
+</project>

+ 37 - 0
blade-auth/src/main/java/org/springblade/auth/AuthApplication.java

@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.auth;
+
+
+import org.springblade.core.launch.BladeApplication;
+import org.springblade.core.launch.constant.AppConstant;
+import org.springframework.cloud.client.SpringCloudApplication;
+import org.springframework.cloud.openfeign.EnableFeignClients;
+
+/**
+ * 用户认证服务器
+ *
+ * @author Chill
+ */
+@SpringCloudApplication
+@EnableFeignClients(AppConstant.BASE_PACKAGES)
+public class AuthApplication {
+
+	public static void main(String[] args) {
+		BladeApplication.run(AppConstant.APPLICATION_AUTH_NAME, AuthApplication.class, args);
+	}
+
+}

+ 37 - 0
blade-auth/src/main/java/org/springblade/auth/config/RegistryConfiguration.java

@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.auth.config;
+
+
+import org.springblade.core.secure.registry.SecureRegistry;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+/**
+ * secure模块api放行配置
+ */
+@Configuration
+public class RegistryConfiguration implements WebMvcConfigurer {
+
+    @Bean
+    public SecureRegistry secureRegistry() {
+        SecureRegistry secureRegistry = new SecureRegistry();
+        secureRegistry.excludePathPatterns("/token/**");
+        return secureRegistry;
+    }
+
+}

+ 99 - 0
blade-auth/src/main/java/org/springblade/auth/controller/AuthController.java

@@ -0,0 +1,99 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.auth.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+import org.springblade.core.log.annotation.ApiLog;
+import org.springblade.core.secure.AuthInfo;
+import org.springblade.core.secure.utils.SecureUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.DigestUtil;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.core.tool.utils.StringUtil;
+import org.springblade.system.user.entity.User;
+import org.springblade.system.user.entity.UserInfo;
+import org.springblade.system.user.feign.IUserClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 认证模块
+ *
+ * @author Chill
+ */
+@RestController
+@AllArgsConstructor
+@Api(value = "用户授权认证", tags = "授权接口")
+public class AuthController {
+
+	IUserClient client;
+
+	@ApiLog("登录用户验证")
+	@PostMapping("token")
+	@ApiOperation(value = "获取认证token", notes = "传入账号:account,密码:password")
+	public R<AuthInfo> token(@ApiParam(value = "账号", required = true) @RequestParam String account,
+							 @ApiParam(value = "密码", required = true) @RequestParam String password) {
+
+		if (Func.hasEmpty(account, password)) {
+			return R.failure("接口调用不合法");
+		}
+
+		R<UserInfo> res = client.userInfo(account, DigestUtil.encrypt(password));
+
+		User user = res.getData().getUser();
+
+		//验证用户
+		if (user == null) {
+			return R.failure("用户名或密码不正确");
+		} else {
+			String digestPassword = DigestUtil.encrypt(password);
+			if (!StringUtil.equalsIgnoreCase(Func.toStr(user.getPassword()), digestPassword)) {
+				return R.failure("用户名或密码不正确");
+			}
+		}
+
+		//设置jwt参数
+		Map<String, String> param = new HashMap<>(16);
+		param.put(SecureUtil.USER_ID, Func.toStr(user.getId()));
+		param.put(SecureUtil.ROLE_ID, user.getRoleId());
+		param.put(SecureUtil.ACCOUNT, user.getAccount());
+		param.put(SecureUtil.USER_NAME, user.getRealName());
+		param.put(SecureUtil.ROLE_NAME, Func.join(res.getData().getRoles()));
+
+		//拼装accessToken
+		String accessToken = SecureUtil.createJWT(param, "audience", "issuser", true);
+
+		//返回accessToken
+		AuthInfo authInfo = new AuthInfo();
+		authInfo.setAccount(user.getAccount());
+		authInfo.setUserName(user.getRealName());
+		authInfo.setAuthority(Func.join(res.getData().getRoles()));
+		authInfo.setAccessToken(accessToken);
+		authInfo.setTokenType(SecureUtil.BEARER);
+		//设置token过期时间
+		authInfo.setExpiresIn(SecureUtil.getExpire());
+		return R.data(authInfo);
+
+	}
+
+}

+ 10 - 0
blade-auth/src/main/resources/banner.txt

@@ -0,0 +1,10 @@
+${AnsiColor.BRIGHT_CYAN} _____               _                ${AnsiColor.BLUE} ______  _             _
+${AnsiColor.BRIGHT_CYAN}/  ___|             (_)               ${AnsiColor.BLUE} | ___ \| |           | |
+${AnsiColor.BRIGHT_CYAN}\ `--.  _ __   _ __  _  _ __    __ _  ${AnsiColor.BLUE} | |_/ /| |  __ _   __| |  ___
+${AnsiColor.BRIGHT_CYAN} `--. \| '_ \ | '__|| || '_ \  / _` | ${AnsiColor.BLUE} | ___ \| | / _` | / _` | / _ \
+${AnsiColor.BRIGHT_CYAN}/\__/ /| |_) || |   | || | | || (_| | ${AnsiColor.BLUE} | |_/ /| || (_| || (_| ||  __/
+${AnsiColor.BRIGHT_CYAN}\____/ | .__/ |_|   |_||_| |_| \__, | ${AnsiColor.BLUE} \____/ |_| \__,_| \__,_| \___|
+${AnsiColor.BRIGHT_CYAN}       | |                      __/ |
+${AnsiColor.BRIGHT_CYAN}       |_|                     |___/
+
+${AnsiColor.BLUE}:: SpringBlade :: ${spring.application.name}:${AnsiColor.RED}${blade.env}${AnsiColor.BLUE} :: Running SpringBoot ${spring-boot.version} :: ${AnsiColor.BRIGHT_BLACK}

+ 12 - 0
blade-auth/src/main/resources/bootstrap.yml

@@ -0,0 +1,12 @@
+server:
+  port: 8100
+
+spring:
+  cloud:
+    config:
+      label: master
+      profile: ${blade.env}
+      fail-fast: true
+      discovery:
+        enabled: true
+        service-id: blade-config-server

+ 38 - 0
blade-common/pom.xml

@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+		 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<parent>
+		<artifactId>SpringBlade</artifactId>
+		<groupId>org.springblade</groupId>
+		<version>2.0.0-RC1</version>
+	</parent>
+	<modelVersion>4.0.0</modelVersion>
+
+	<artifactId>blade-common</artifactId>
+	<name>${project.artifactId}</name>
+	<version>${blade.project.version}</version>
+	<packaging>jar</packaging>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.springframework.boot</groupId>
+				<artifactId>spring-boot-maven-plugin</artifactId>
+				<configuration>
+					<skip>true</skip>
+					<finalName>${project.name}</finalName>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>com.spotify</groupId>
+				<artifactId>docker-maven-plugin</artifactId>
+				<version>${docker.plugin.version}</version>
+				<configuration>
+					<skipDockerBuild>true</skipDockerBuild>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+
+</project>

+ 30 - 0
blade-common/src/main/java/org/springblade/common/cache/CacheNames.java

@@ -0,0 +1,30 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.common.cache;
+
+/**
+ * 缓存名
+ *
+ * @author Chill
+ */
+public interface CacheNames {
+
+	String NOTICE_ONE = "NOTICE_ONE";
+
+	String DICT_VALUE = "DICT_VALUE";
+	String DICT_LIST = "DICT_LIST";
+
+}

+ 38 - 0
blade-common/src/main/java/org/springblade/common/config/BladeCommonConfiguration.java

@@ -0,0 +1,38 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.common.config;
+
+
+import lombok.AllArgsConstructor;
+import org.springblade.common.tool.DictUtil;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * 公共封装包配置类
+ *
+ * @author Chill
+ */
+@Configuration
+@AllArgsConstructor
+public class BladeCommonConfiguration {
+
+	@Bean
+	public DictUtil dictUtil() {
+		return new DictUtil();
+	}
+
+}

+ 25 - 0
blade-common/src/main/java/org/springblade/common/constant/CommonConstant.java

@@ -0,0 +1,25 @@
+package org.springblade.common.constant;
+
+/**
+ * 通用常量
+ *
+ * @author Chill
+ */
+public interface CommonConstant {
+
+	/**
+	 * 顶级父节点id
+	 */
+	Integer TOP_PARENT_ID = 0;
+
+	/**
+	 * 顶级父节点名称
+	 */
+	String TOP_PARENT_NAME = "顶级";
+
+
+	/**
+	 * 默认密码
+	 */
+	String DEFAULT_PASSWORD = "123456";
+}

+ 25 - 0
blade-common/src/main/java/org/springblade/common/tool/CommonUtil.java

@@ -0,0 +1,25 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.common.tool;
+
+/**
+ * 通用工具类
+ *
+ * @author Chill
+ */
+public class CommonUtil {
+
+}

+ 24 - 0
blade-common/src/main/java/org/springblade/common/tool/DictUtil.java

@@ -0,0 +1,24 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.common.tool;
+
+/**
+ * 字典工具类
+ *
+ * @author Chill
+ */
+public class DictUtil {
+}

+ 1 - 0
blade-common/src/main/resources/META-INF/spring-devtools.properties

@@ -0,0 +1 @@
+restart.include.blade-common=/blade-common[\\w-]+\.jar

+ 2 - 0
blade-common/src/main/resources/META-INF/spring.factories

@@ -0,0 +1,2 @@
+org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
+  org.springblade.common.config.BladeCommonConfiguration

+ 15 - 0
blade-gateway/Dockerfile

@@ -0,0 +1,15 @@
+FROM anapsix/alpine-java:8_server-jre_unlimited
+
+MAINTAINER smallchill@163.com
+
+RUN mkdir -p /blade/gateway
+
+WORKDIR /blade/gateway
+
+EXPOSE 80
+
+ADD ./target/blade-gateway.jar ./app.jar
+
+ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"]
+
+CMD ["--spring.profiles.active=test"]

+ 97 - 0
blade-gateway/pom.xml

@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>SpringBlade</artifactId>
+        <groupId>org.springblade</groupId>
+        <version>2.0.0-RC1</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>blade-gateway</artifactId>
+    <name>${project.artifactId}</name>
+    <version>${blade.project.version}</version>
+    <packaging>jar</packaging>
+
+    <dependencies>
+        <!--Blade-->
+        <dependency>
+            <groupId>org.springblade</groupId>
+            <artifactId>blade-core-launch</artifactId>
+            <version>${blade.tool.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-web</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-undertow</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <!--Spring-->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-gateway</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis-reactive</artifactId>
+        </dependency>
+        <!--Swagger-->
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger2</artifactId>
+            <version>${swagger.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>io.swagger</groupId>
+                    <artifactId>swagger-models</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>io.swagger</groupId>
+            <artifactId>swagger-models</artifactId>
+            <version>${swagger.models.version}</version>
+        </dependency>
+        <!--<dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger-ui</artifactId>
+            <version>${swagger.version}</version>
+        </dependency>-->
+        <dependency>
+            <groupId>com.github.xiaoymin</groupId>
+            <artifactId>swagger-bootstrap-ui</artifactId>
+            <version>${swagger.bootstrapui.version}</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+			<plugin>
+				<groupId>com.spotify</groupId>
+				<artifactId>docker-maven-plugin</artifactId>
+				<version>${docker.plugin.version}</version>
+				<configuration>
+					<imageName>${docker.registry.url}/blade/${project.artifactId}:${project.version}</imageName>
+					<dockerDirectory>${project.basedir}</dockerDirectory>
+					<dockerHost>${docker.registry.host}</dockerHost>
+					<resources>
+						<resource>
+							<targetPath>/</targetPath>
+							<directory>${project.build.directory}</directory>
+							<include>${project.build.finalName}.jar</include>
+						</resource>
+					</resources>
+					<registryUrl>${docker.registry.url}</registryUrl>
+					<serverId>${docker.registry.url}</serverId>
+					<pushImage>true</pushImage>
+				</configuration>
+			</plugin>
+        </plugins>
+    </build>
+
+</project>

+ 38 - 0
blade-gateway/src/main/java/org/springblade/gateway/GateWayApplication.java

@@ -0,0 +1,38 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.gateway;
+
+import org.springblade.core.launch.constant.AppConstant;
+import org.springblade.core.launch.BladeApplication;
+import org.springframework.cloud.client.SpringCloudApplication;
+import org.springframework.cloud.netflix.hystrix.EnableHystrix;
+import org.springframework.scheduling.annotation.EnableScheduling;
+
+/**
+ * 项目启动
+ *
+ * @author Chill
+ */
+@EnableHystrix
+@EnableScheduling
+@SpringCloudApplication
+public class GateWayApplication {
+
+	public static void main(String[] args) {
+		BladeApplication.run(AppConstant.APPLICATION_GATEWAY_NAME, GateWayApplication.class, args);
+	}
+
+}

+ 82 - 0
blade-gateway/src/main/java/org/springblade/gateway/config/ErrorHandlerConfiguration.java

@@ -0,0 +1,82 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.gateway.config;
+
+
+import org.springblade.gateway.handler.ErrorExceptionHandler;
+import org.springframework.beans.factory.ObjectProvider;
+import org.springframework.boot.autoconfigure.web.ResourceProperties;
+import org.springframework.boot.autoconfigure.web.ServerProperties;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.boot.web.reactive.error.ErrorAttributes;
+import org.springframework.boot.web.reactive.error.ErrorWebExceptionHandler;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.Ordered;
+import org.springframework.core.annotation.Order;
+import org.springframework.http.codec.ServerCodecConfigurer;
+import org.springframework.web.reactive.result.view.ViewResolver;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * 异常处理配置类
+ *
+ * @author Chill
+ */
+@Configuration
+@EnableConfigurationProperties({ServerProperties.class, ResourceProperties.class})
+public class ErrorHandlerConfiguration {
+
+	private final ServerProperties serverProperties;
+
+	private final ApplicationContext applicationContext;
+
+	private final ResourceProperties resourceProperties;
+
+	private final List<ViewResolver> viewResolvers;
+
+	private final ServerCodecConfigurer serverCodecConfigurer;
+
+	public ErrorHandlerConfiguration(ServerProperties serverProperties,
+									 ResourceProperties resourceProperties,
+									 ObjectProvider<List<ViewResolver>> viewResolversProvider,
+									 ServerCodecConfigurer serverCodecConfigurer,
+									 ApplicationContext applicationContext) {
+		this.serverProperties = serverProperties;
+		this.applicationContext = applicationContext;
+		this.resourceProperties = resourceProperties;
+		this.viewResolvers = viewResolversProvider.getIfAvailable(Collections::emptyList);
+		this.serverCodecConfigurer = serverCodecConfigurer;
+	}
+
+	@Bean
+	@Order(Ordered.HIGHEST_PRECEDENCE)
+	public ErrorWebExceptionHandler errorWebExceptionHandler(ErrorAttributes errorAttributes) {
+		ErrorExceptionHandler exceptionHandler = new ErrorExceptionHandler(
+			errorAttributes,
+			this.resourceProperties,
+			this.serverProperties.getError(),
+			this.applicationContext);
+		exceptionHandler.setViewResolvers(this.viewResolvers);
+		exceptionHandler.setMessageWriters(this.serverCodecConfigurer.getWriters());
+		exceptionHandler.setMessageReaders(this.serverCodecConfigurer.getReaders());
+		return exceptionHandler;
+	}
+
+}

+ 37 - 0
blade-gateway/src/main/java/org/springblade/gateway/config/RateLimiterConfiguration.java

@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+
+package org.springblade.gateway.config;
+
+import org.springframework.cloud.gateway.filter.ratelimit.KeyResolver;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import reactor.core.publisher.Mono;
+
+/**
+ * 路由限流配置
+ *
+ * @author Chill
+ */
+@Configuration
+public class RateLimiterConfiguration {
+
+	@Bean(value = "remoteAddrKeyResolver")
+	public KeyResolver remoteAddrKeyResolver() {
+		return exchange -> Mono.just(exchange.getRequest().getRemoteAddress().getAddress().getHostAddress());
+	}
+
+}

+ 114 - 0
blade-gateway/src/main/java/org/springblade/gateway/config/RouterFunctionConfiguration.java

@@ -0,0 +1,114 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+
+package org.springblade.gateway.config;
+
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springblade.gateway.handler.*;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.server.reactive.ServerHttpRequest;
+import org.springframework.http.server.reactive.ServerHttpResponse;
+import org.springframework.web.cors.reactive.CorsUtils;
+import org.springframework.web.filter.reactive.HiddenHttpMethodFilter;
+import org.springframework.web.reactive.function.server.RequestPredicates;
+import org.springframework.web.reactive.function.server.RouterFunction;
+import org.springframework.web.reactive.function.server.RouterFunctions;
+import org.springframework.web.server.ServerWebExchange;
+import org.springframework.web.server.WebFilter;
+import org.springframework.web.server.WebFilterChain;
+import reactor.core.publisher.Mono;
+
+/**
+ * 路由配置信息
+ *
+ * @author Chill
+ */
+@Slf4j
+@Configuration
+@AllArgsConstructor
+public class RouterFunctionConfiguration {
+
+	/**
+	 * 这里为支持的请求头,如果有自定义的header字段请自己添加
+	 */
+	private static final String ALLOWED_HEADERS = "x-requested-with, blade-auth, Content-Type, Authorization, credential, X-XSRF-TOKEN, token, username, client";
+	private static final String ALLOWED_METHODS = "*";
+	private static final String ALLOWED_ORIGIN = "*";
+	private static final String ALLOWED_EXPOSE = "*";
+	private static final String MAX_AGE = "18000L";
+
+	private final HystrixFallbackHandler hystrixFallbackHandler;
+	private final SwaggerResourceHandler swaggerResourceHandler;
+	private final SwaggerSecurityHandler swaggerSecurityHandler;
+	private final SwaggerUiHandler swaggerUiHandler;
+
+	@Bean
+	public WebFilter corsFilter() {
+		return (ServerWebExchange ctx, WebFilterChain chain) -> {
+			ServerHttpRequest request = ctx.getRequest();
+			if (CorsUtils.isCorsRequest(request)) {
+				ServerHttpResponse response = ctx.getResponse();
+				HttpHeaders headers = response.getHeaders();
+				headers.add("Access-Control-Allow-Headers", ALLOWED_HEADERS);
+				headers.add("Access-Control-Allow-Methods", ALLOWED_METHODS);
+				headers.add("Access-Control-Allow-Origin", ALLOWED_ORIGIN);
+				headers.add("Access-Control-Expose-Headers", ALLOWED_EXPOSE);
+				headers.add("Access-Control-Max-Age", MAX_AGE);
+				headers.add("Access-Control-Allow-Credentials", "true");
+				if (request.getMethod() == HttpMethod.OPTIONS) {
+					response.setStatusCode(HttpStatus.OK);
+					return Mono.empty();
+				}
+			}
+			return chain.filter(ctx);
+		};
+	}
+
+	@Bean
+	public RouterFunction routerFunction() {
+		return RouterFunctions.route(
+			RequestPredicates.path("/fallback")
+				.and(RequestPredicates.accept(MediaType.TEXT_PLAIN)), hystrixFallbackHandler)
+			.andRoute(RequestPredicates.GET("/swagger-resources")
+				.and(RequestPredicates.accept(MediaType.ALL)), swaggerResourceHandler)
+			.andRoute(RequestPredicates.GET("/swagger-resources/configuration/ui")
+				.and(RequestPredicates.accept(MediaType.ALL)), swaggerUiHandler)
+			.andRoute(RequestPredicates.GET("/swagger-resources/configuration/security")
+				.and(RequestPredicates.accept(MediaType.ALL)), swaggerSecurityHandler);
+
+	}
+
+	/**
+	 * 解决springboot2.0.5版本出现的 Only one connection receive subscriber allowed.
+	 * 参考:https://github.com/spring-cloud/spring-cloud-gateway/issues/541
+	 */
+	@Bean
+	public HiddenHttpMethodFilter hiddenHttpMethodFilter() {
+		return new HiddenHttpMethodFilter() {
+			@Override
+			public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain) {
+				return chain.filter(exchange);
+			}
+		};
+	}
+
+}

+ 105 - 0
blade-gateway/src/main/java/org/springblade/gateway/controller/DiscoveryClientController.java

@@ -0,0 +1,105 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.gateway.controller;
+
+import com.ecwid.consul.v1.ConsulClient;
+import com.ecwid.consul.v1.health.model.Check;
+import com.ecwid.consul.v1.health.model.HealthService;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.cloud.client.ServiceInstance;
+import org.springframework.cloud.client.discovery.DiscoveryClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 服务发现控制器
+ *
+ * @author Chill
+ */
+@Slf4j
+@RestController
+@AllArgsConstructor
+@RequestMapping("/discovery")
+public class DiscoveryClientController {
+
+	private final DiscoveryClient discoveryClient;
+
+	private final ConsulClient consulClient;
+
+	/**
+	 * 获取服务实例
+	 */
+	@GetMapping("/instances")
+	public Map<String, List<ServiceInstance>> instances() {
+		Map<String, List<ServiceInstance>> instances = new HashMap<>(16);
+		List<String> services = discoveryClient.getServices();
+		services.forEach(s -> {
+			List<ServiceInstance> list = discoveryClient.getInstances(s);
+			instances.put(s, list);
+		});
+		return instances;
+	}
+
+	/**
+	 * 删除指定无效服务
+	 *
+	 * @param serviceName 服务名
+	 * @return
+	 */
+	@RequestMapping("/deRegister/{serviceName}")
+	public String deRegister(@PathVariable String serviceName) {
+		serviceDeregister(serviceName);
+		return "服务删除成功";
+	}
+
+	/**
+	 * 删除所有无效服务
+	 *
+	 * @return
+	 */
+	@RequestMapping("/deRegisterAll")
+	public String deRegisterAll() {
+		consulClient.getAgentChecks().getValue().forEach((k, v) -> serviceDeregister(v.getServiceName()));
+		return "服务删除成功";
+	}
+
+	/**
+	 * 根据serviceName删除无效服务
+	 *
+	 * @param serviceName
+	 */
+	public void serviceDeregister(String serviceName) {
+		List<HealthService> response = consulClient.getHealthServices(serviceName, false, null).getValue();
+		for (HealthService service : response) {
+			// 创建一个用来剔除无效实例的ConsulClient,连接到无效实例注册的agent
+			ConsulClient clearClient = new ConsulClient(service.getNode().getAddress());
+			service.getChecks().forEach(check -> {
+				if (check.getStatus() != Check.CheckStatus.PASSING) {
+					log.info("deregister : {}", check.getServiceId());
+					clearClient.agentServiceDeregister(check.getServiceId());
+				}
+			});
+		}
+	}
+
+}

+ 63 - 0
blade-gateway/src/main/java/org/springblade/gateway/filter/RequestGlobalFilter.java

@@ -0,0 +1,63 @@
+package org.springblade.gateway.filter;
+
+import org.springframework.cloud.gateway.filter.GatewayFilterChain;
+import org.springframework.cloud.gateway.filter.GlobalFilter;
+import org.springframework.core.Ordered;
+import org.springframework.http.server.reactive.ServerHttpRequest;
+import org.springframework.stereotype.Component;
+import org.springframework.util.StringUtils;
+import org.springframework.web.server.ServerWebExchange;
+import reactor.core.publisher.Mono;
+
+import java.util.Arrays;
+import java.util.stream.Collectors;
+
+import static org.springframework.cloud.gateway.support.ServerWebExchangeUtils.GATEWAY_REQUEST_URL_ATTR;
+import static org.springframework.cloud.gateway.support.ServerWebExchangeUtils.addOriginalRequestUrl;
+
+/**
+ * <p>
+ * 全局拦截器,作用所有的微服务
+ * <p>
+ * 1. 对请求头中参数进行处理 from 参数进行清洗
+ * 2. 重写StripPrefix = 1,支持全局
+ *
+ * @author lengleng
+ */
+@Component
+public class RequestGlobalFilter implements GlobalFilter, Ordered {
+
+	/**
+	 * Process the Web request and (optionally) delegate to the next
+	 * {@code WebFilter} through the given {@link GatewayFilterChain}.
+	 *
+	 * @param exchange the current server exchange
+	 * @param chain    provides a way to delegate to the next filter
+	 * @return {@code Mono<Void>} to indicate when request processing is complete
+	 */
+	@Override
+	public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
+		// 1. 清洗请求头中from 参数
+		ServerHttpRequest request = exchange.getRequest().mutate()
+			.headers(httpHeaders -> httpHeaders.remove("X"))
+			.build();
+
+		// 2. 重写StripPrefix
+		addOriginalRequestUrl(exchange, request.getURI());
+		String rawPath = request.getURI().getRawPath();
+		String newPath = "/" + Arrays.stream(StringUtils.tokenizeToStringArray(rawPath, "/"))
+			.skip(1L).collect(Collectors.joining("/"));
+		ServerHttpRequest newRequest = request.mutate()
+			.path(newPath)
+			.build();
+		exchange.getAttributes().put(GATEWAY_REQUEST_URL_ATTR, newRequest.getURI());
+
+		return chain.filter(exchange.mutate().request(newRequest.mutate().build()).build());
+	}
+
+	@Override
+	public int getOrder() {
+		return -1000;
+	}
+
+}

+ 115 - 0
blade-gateway/src/main/java/org/springblade/gateway/handler/ErrorExceptionHandler.java

@@ -0,0 +1,115 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.gateway.handler;
+
+import org.springframework.boot.autoconfigure.web.ErrorProperties;
+import org.springframework.boot.autoconfigure.web.ResourceProperties;
+import org.springframework.boot.autoconfigure.web.reactive.error.DefaultErrorWebExceptionHandler;
+import org.springframework.boot.web.reactive.error.ErrorAttributes;
+import org.springframework.cloud.gateway.support.NotFoundException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.reactive.function.server.*;
+import org.springframework.web.server.ResponseStatusException;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 异常处理
+ *
+ * @author Chill
+ */
+public class ErrorExceptionHandler extends DefaultErrorWebExceptionHandler {
+
+	public ErrorExceptionHandler(ErrorAttributes errorAttributes, ResourceProperties resourceProperties,
+								 ErrorProperties errorProperties, ApplicationContext applicationContext) {
+		super(errorAttributes, resourceProperties, errorProperties, applicationContext);
+	}
+
+	/**
+	 * 获取异常属性
+	 */
+	@Override
+	protected Map<String, Object> getErrorAttributes(ServerRequest request, boolean includeStackTrace) {
+		int code = 500;
+		Throwable error = super.getError(request);
+		if (error instanceof NotFoundException) {
+			code = 404;
+		}
+		if (error instanceof ResponseStatusException) {
+			code = ((ResponseStatusException) error).getStatus().value();
+		}
+		return response(code, this.buildMessage(request, error));
+	}
+
+	/**
+	 * 指定响应处理方法为JSON处理的方法
+	 *
+	 * @param errorAttributes
+	 */
+	@Override
+	protected RouterFunction<ServerResponse> getRoutingFunction(ErrorAttributes errorAttributes) {
+		return RouterFunctions.route(RequestPredicates.all(), this::renderErrorResponse);
+	}
+
+	/**
+	 * 根据code获取对应的HttpStatus
+	 *
+	 * @param errorAttributes
+	 */
+	@Override
+	protected HttpStatus getHttpStatus(Map<String, Object> errorAttributes) {
+		int statusCode = (int) errorAttributes.get("code");
+		return HttpStatus.valueOf(statusCode);
+	}
+
+	/**
+	 * 构建异常信息
+	 *
+	 * @param request
+	 * @param ex
+	 * @return
+	 */
+	private String buildMessage(ServerRequest request, Throwable ex) {
+		StringBuilder message = new StringBuilder("Failed to handle request [");
+		message.append(request.methodName());
+		message.append(" ");
+		message.append(request.uri());
+		message.append("]");
+		if (ex != null) {
+			message.append(": ");
+			message.append(ex.getMessage());
+		}
+		return message.toString();
+	}
+
+	/**
+	 * 构建返回的JSON数据格式
+	 *
+	 * @param status       状态码
+	 * @param errorMessage 异常信息
+	 * @return
+	 */
+	public static Map<String, Object> response(int status, String errorMessage) {
+		Map<String, Object> map = new HashMap<>(16);
+		map.put("code", status);
+		map.put("message", errorMessage);
+		map.put("data", null);
+		return map;
+	}
+
+}

+ 43 - 0
blade-gateway/src/main/java/org/springblade/gateway/handler/HystrixFallbackHandler.java

@@ -0,0 +1,43 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+
+package org.springblade.gateway.handler;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.stereotype.Component;
+import org.springframework.web.reactive.function.BodyInserters;
+import org.springframework.web.reactive.function.server.HandlerFunction;
+import org.springframework.web.reactive.function.server.ServerRequest;
+import org.springframework.web.reactive.function.server.ServerResponse;
+import reactor.core.publisher.Mono;
+
+/**
+ * Hystrix 降级处理
+ *
+ * @author lengleng
+ */
+@Slf4j
+@Component
+public class HystrixFallbackHandler implements HandlerFunction<ServerResponse> {
+	@Override
+	public Mono<ServerResponse> handle(ServerRequest serverRequest) {
+		log.error("网关执行请求:{}失败,hystrix服务降级处理", serverRequest.uri());
+		return ServerResponse.status(HttpStatus.INTERNAL_SERVER_ERROR.value())
+			.contentType(MediaType.TEXT_PLAIN).body(BodyInserters.fromObject("服务异常"));
+	}
+}

+ 54 - 0
blade-gateway/src/main/java/org/springblade/gateway/handler/SwaggerResourceHandler.java

@@ -0,0 +1,54 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+
+package org.springblade.gateway.handler;
+
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.stereotype.Component;
+import org.springframework.web.reactive.function.BodyInserters;
+import org.springframework.web.reactive.function.server.HandlerFunction;
+import org.springframework.web.reactive.function.server.ServerRequest;
+import org.springframework.web.reactive.function.server.ServerResponse;
+import reactor.core.publisher.Mono;
+import springfox.documentation.swagger.web.SwaggerResourcesProvider;
+
+/**
+ * SwaggerResourceHandler
+ *
+ * @author lengleng
+ */
+@Slf4j
+@Component
+@AllArgsConstructor
+public class SwaggerResourceHandler implements HandlerFunction<ServerResponse> {
+	private final SwaggerResourcesProvider swaggerResources;
+
+	/**
+	 * Handle the given request.
+	 *
+	 * @param request the request to handler
+	 * @return the response
+	 */
+	@Override
+	public Mono<ServerResponse> handle(ServerRequest request) {
+		return ServerResponse.status(HttpStatus.OK)
+			.contentType(MediaType.APPLICATION_JSON_UTF8)
+			.body(BodyInserters.fromObject(swaggerResources.get()));
+	}
+}

+ 59 - 0
blade-gateway/src/main/java/org/springblade/gateway/handler/SwaggerSecurityHandler.java

@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+
+package org.springblade.gateway.handler;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.stereotype.Component;
+import org.springframework.web.reactive.function.BodyInserters;
+import org.springframework.web.reactive.function.server.HandlerFunction;
+import org.springframework.web.reactive.function.server.ServerRequest;
+import org.springframework.web.reactive.function.server.ServerResponse;
+import reactor.core.publisher.Mono;
+import springfox.documentation.swagger.web.SecurityConfiguration;
+import springfox.documentation.swagger.web.SecurityConfigurationBuilder;
+
+import java.util.Optional;
+
+/**
+ * SwaggerSecurityHandler
+ *
+ * @author lengleng
+ */
+@Slf4j
+@Component
+public class SwaggerSecurityHandler implements HandlerFunction<ServerResponse> {
+	@Autowired(required = false)
+	private SecurityConfiguration securityConfiguration;
+
+	/**
+	 * Handle the given request.
+	 *
+	 * @param request the request to handler
+	 * @return the response
+	 */
+	@Override
+	public Mono<ServerResponse> handle(ServerRequest request) {
+		return ServerResponse.status(HttpStatus.OK)
+			.contentType(MediaType.APPLICATION_JSON_UTF8)
+			.body(BodyInserters.fromObject(
+				Optional.ofNullable(securityConfiguration)
+					.orElse(SecurityConfigurationBuilder.builder().build())));
+	}
+}

+ 59 - 0
blade-gateway/src/main/java/org/springblade/gateway/handler/SwaggerUiHandler.java

@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+
+package org.springblade.gateway.handler;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.stereotype.Component;
+import org.springframework.web.reactive.function.BodyInserters;
+import org.springframework.web.reactive.function.server.HandlerFunction;
+import org.springframework.web.reactive.function.server.ServerRequest;
+import org.springframework.web.reactive.function.server.ServerResponse;
+import reactor.core.publisher.Mono;
+import springfox.documentation.swagger.web.UiConfiguration;
+import springfox.documentation.swagger.web.UiConfigurationBuilder;
+
+import java.util.Optional;
+
+/**
+ * SwaggerUiHandler
+ *
+ * @author lengleng
+ */
+@Slf4j
+@Component
+public class SwaggerUiHandler implements HandlerFunction<ServerResponse> {
+	@Autowired(required = false)
+	private UiConfiguration uiConfiguration;
+
+	/**
+	 * Handle the given request.
+	 *
+	 * @param request the request to handler
+	 * @return the response
+	 */
+	@Override
+	public Mono<ServerResponse> handle(ServerRequest request) {
+		return ServerResponse.status(HttpStatus.OK)
+			.contentType(MediaType.APPLICATION_JSON_UTF8)
+			.body(BodyInserters.fromObject(
+				Optional.ofNullable(uiConfiguration)
+					.orElse(UiConfigurationBuilder.builder().build())));
+	}
+}

+ 77 - 0
blade-gateway/src/main/java/org/springblade/gateway/provider/SwaggerProvider.java

@@ -0,0 +1,77 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+
+package org.springblade.gateway.provider;
+
+import lombok.AllArgsConstructor;
+import org.springblade.core.launch.constant.AppConstant;
+import org.springframework.cloud.gateway.config.GatewayProperties;
+import org.springframework.cloud.gateway.route.RouteLocator;
+import org.springframework.cloud.gateway.support.NameUtils;
+import org.springframework.context.annotation.Primary;
+import org.springframework.stereotype.Component;
+import springfox.documentation.swagger.web.SwaggerResource;
+import springfox.documentation.swagger.web.SwaggerResourcesProvider;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 聚合接口文档注册
+ *
+ * @author Sywd
+ */
+@Primary
+@Component
+@AllArgsConstructor
+public class SwaggerProvider implements SwaggerResourcesProvider {
+	public static final String API_URI = "/v2/api-docs-ext";
+	private final RouteLocator routeLocator;
+	private final GatewayProperties gatewayProperties;
+
+	private static Map<String, String> routeMap = new HashMap<>();
+
+	static {
+		routeMap.put(AppConstant.APPLICATION_AUTH_NAME, "授权模块");
+		routeMap.put(AppConstant.APPLICATION_DESK_NAME, "工作台模块");
+		routeMap.put(AppConstant.APPLICATION_SYSTEM_NAME, "系统模块");
+	}
+
+	@Override
+	public List<SwaggerResource> get() {
+		List<SwaggerResource> resources = new ArrayList<>();
+		List<String> routes = new ArrayList<>();
+		routeLocator.getRoutes().subscribe(route -> routes.add(route.getId()));
+		gatewayProperties.getRoutes().stream().filter(routeDefinition -> routes.contains(routeDefinition.getId()))
+			.forEach(routeDefinition -> routeDefinition.getPredicates().stream()
+				.filter(predicateDefinition -> "Path".equalsIgnoreCase(predicateDefinition.getName()))
+				.forEach(predicateDefinition -> resources.add(swaggerResource(routeDefinition.getId(),
+					predicateDefinition.getArgs().get(NameUtils.GENERATED_NAME_PREFIX + "0")
+						.replace("/**", API_URI)))));
+		return resources;
+	}
+
+	private SwaggerResource swaggerResource(String name, String location) {
+		SwaggerResource swaggerResource = new SwaggerResource();
+		swaggerResource.setName((routeMap.get(name) == null ? name : routeMap.get(name)));
+		swaggerResource.setLocation(location);
+		swaggerResource.setSwaggerVersion("2.0");
+		return swaggerResource;
+	}
+
+}

+ 10 - 0
blade-gateway/src/main/resources/banner.txt

@@ -0,0 +1,10 @@
+${AnsiColor.BRIGHT_CYAN} _____               _                ${AnsiColor.BLUE} ______  _             _
+${AnsiColor.BRIGHT_CYAN}/  ___|             (_)               ${AnsiColor.BLUE} | ___ \| |           | |
+${AnsiColor.BRIGHT_CYAN}\ `--.  _ __   _ __  _  _ __    __ _  ${AnsiColor.BLUE} | |_/ /| |  __ _   __| |  ___
+${AnsiColor.BRIGHT_CYAN} `--. \| '_ \ | '__|| || '_ \  / _` | ${AnsiColor.BLUE} | ___ \| | / _` | / _` | / _ \
+${AnsiColor.BRIGHT_CYAN}/\__/ /| |_) || |   | || | | || (_| | ${AnsiColor.BLUE} | |_/ /| || (_| || (_| ||  __/
+${AnsiColor.BRIGHT_CYAN}\____/ | .__/ |_|   |_||_| |_| \__, | ${AnsiColor.BLUE} \____/ |_| \__,_| \__,_| \___|
+${AnsiColor.BRIGHT_CYAN}       | |                      __/ |
+${AnsiColor.BRIGHT_CYAN}       |_|                     |___/
+
+${AnsiColor.BLUE}:: SpringBlade :: ${spring.application.name}:${AnsiColor.RED}${blade.env}${AnsiColor.BLUE} :: Running SpringBoot ${spring-boot.version} :: ${AnsiColor.BRIGHT_BLACK}

+ 91 - 0
blade-gateway/src/main/resources/bootstrap.yml

@@ -0,0 +1,91 @@
+server:
+  port: 80
+
+# 需要配置的服务名
+blade:
+  service:
+    blade-auth: blade-auth
+    blade-desk: blade-desk
+    blade-system: blade-system
+
+spring:
+  cloud:
+    gateway:
+      routes:
+      # 认证中心
+      - id: ${blade.service.blade-auth}
+        uri: lb://${blade.service.blade-auth}
+        predicates:
+        - Path=/${blade.service.blade-auth}/**
+        filters:
+        - name: RequestRateLimiter
+          args:
+            # 使用SpEL按名称引用bean
+            key-resolver: '#{@remoteAddrKeyResolver}'
+            # 允许用户每秒处理多少个请求
+            redis-rate-limiter.replenishRate: 10
+            # 允许在一秒钟内完成的最大请求数
+            redis-rate-limiter.burstCapacity: 20
+        - StripPrefix=1
+      # 首页模块
+      - id: ${blade.service.blade-desk}
+        uri: lb://${blade.service.blade-desk}
+        predicates:
+        - Path=/${blade.service.blade-desk}/**
+      # 系统模块
+      - id: ${blade.service.blade-system}
+        uri: lb://${blade.service.blade-system}
+        predicates:
+        - Path=/${blade.service.blade-system}/**
+      discovery:
+        locator:
+          enabled: true
+    loadbalancer:
+      retry:
+        enabled: true
+
+#feign配置
+feign:
+  hystrix:
+    enabled: true
+  okhttp:
+    enabled: true
+  httpclient:
+    enabled: false
+
+#hystrix配置
+hystrix:
+  threadpool:
+    default:
+      coreSize: 300
+      maxQueueSize: 1000
+      queueSizeRejectionThreshold: 800
+  command:
+    default:
+      execution:
+        isolation:
+          thread:
+            timeoutInMilliseconds: 720000
+
+#ribbon配置
+ribbon:
+  #对当前实例的重试次数
+  MaxAutoRetries: 1
+  #切换实例的重试次数
+  MaxAutoRetriesNextServer: 2
+  #请求处理的超时时间
+  ReadTimeout: 60000
+  #请求连接的超时时间
+  ConnectTimeout: 60000
+  #对所有操作请求都进行重试
+  OkToRetryOnAllOperations: true
+
+#对外暴露端口
+management:
+  endpoints:
+    web:
+      exposure:
+        include: "*"
+  endpoint:
+    health:
+      show-details: always

+ 15 - 0
blade-ops/blade-admin/Dockerfile

@@ -0,0 +1,15 @@
+FROM anapsix/alpine-java:8_server-jre_unlimited
+
+MAINTAINER smallchill@163.com
+
+RUN mkdir -p /blade/admin
+
+WORKDIR /blade/admin
+
+EXPOSE 7002
+
+ADD ./target/blade-admin.jar ./app.jar
+
+ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"]
+
+CMD ["--spring.profiles.active=test"]

+ 57 - 0
blade-ops/blade-admin/pom.xml

@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>blade-ops</artifactId>
+        <groupId>org.springblade</groupId>
+        <version>2.0.0-RC1</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>blade-admin</artifactId>
+    <name>${project.artifactId}</name>
+    <version>${blade.project.version}</version>
+    <packaging>jar</packaging>
+
+    <dependencies>
+        <!--Blade-->
+        <dependency>
+            <groupId>org.springblade</groupId>
+            <artifactId>blade-core-launch</artifactId>
+            <version>${blade.tool.version}</version>
+        </dependency>
+        <!--Admin-Server-->
+        <dependency>
+            <groupId>de.codecentric</groupId>
+            <artifactId>spring-boot-admin-starter-server</artifactId>
+            <version>${spring.boot.admin.version}</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+				<groupId>com.spotify</groupId>
+				<artifactId>docker-maven-plugin</artifactId>
+				<version>${docker.plugin.version}</version>
+				<configuration>
+					<imageName>${docker.registry.url}/blade/${project.artifactId}:${project.version}</imageName>
+					<dockerDirectory>${project.basedir}</dockerDirectory>
+					<dockerHost>${docker.registry.host}</dockerHost>
+					<resources>
+						<resource>
+							<targetPath>/</targetPath>
+							<directory>${project.build.directory}</directory>
+							<include>${project.build.finalName}.jar</include>
+						</resource>
+					</resources>
+					<registryUrl>${docker.registry.url}</registryUrl>
+					<serverId>${docker.registry.url}</serverId>
+					<pushImage>true</pushImage>
+				</configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 32 - 0
blade-ops/blade-admin/src/main/java/org/springblade/admin/BladeAdminApplication.java

@@ -0,0 +1,32 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.admin;
+
+import de.codecentric.boot.admin.server.config.EnableAdminServer;
+import org.springblade.core.launch.constant.AppConstant;
+import org.springblade.core.launch.BladeApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+
+@EnableAdminServer
+@SpringBootApplication
+public class BladeAdminApplication {
+
+	public static void main(String[] args) {
+        BladeApplication.run(AppConstant.APPLICATION_ADMIN_NAME, BladeAdminApplication.class, args);
+	}
+
+}

+ 10 - 0
blade-ops/blade-admin/src/main/resources/banner.txt

@@ -0,0 +1,10 @@
+${AnsiColor.BRIGHT_CYAN} _____               _                ${AnsiColor.BLUE} ______  _             _
+${AnsiColor.BRIGHT_CYAN}/  ___|             (_)               ${AnsiColor.BLUE} | ___ \| |           | |
+${AnsiColor.BRIGHT_CYAN}\ `--.  _ __   _ __  _  _ __    __ _  ${AnsiColor.BLUE} | |_/ /| |  __ _   __| |  ___
+${AnsiColor.BRIGHT_CYAN} `--. \| '_ \ | '__|| || '_ \  / _` | ${AnsiColor.BLUE} | ___ \| | / _` | / _` | / _ \
+${AnsiColor.BRIGHT_CYAN}/\__/ /| |_) || |   | || | | || (_| | ${AnsiColor.BLUE} | |_/ /| || (_| || (_| ||  __/
+${AnsiColor.BRIGHT_CYAN}\____/ | .__/ |_|   |_||_| |_| \__, | ${AnsiColor.BLUE} \____/ |_| \__,_| \__,_| \___|
+${AnsiColor.BRIGHT_CYAN}       | |                      __/ |
+${AnsiColor.BRIGHT_CYAN}       |_|                     |___/
+
+${AnsiColor.BLUE}:: SpringBlade :: ${spring.application.name}:${AnsiColor.RED}${blade.env}${AnsiColor.BLUE} :: Running SpringBoot ${spring-boot.version} :: ${AnsiColor.BRIGHT_BLACK}

+ 30 - 0
blade-ops/blade-admin/src/main/resources/bootstrap.yml

@@ -0,0 +1,30 @@
+server:
+  port: 7002
+  undertow:
+    # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
+    io-threads: 4
+    # 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
+    worker-threads: 20
+    # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
+    buffer-size: 1024
+    # 是否分配的直接内存
+    direct-buffers: true
+
+spring:
+  cloud:
+    zookeeper:
+      discovery:
+        register: false
+  boot:
+    admin:
+      discovery:
+        ignored-services: consul
+
+management:
+  endpoints:
+    web:
+      exposure:
+        include: "*"
+  endpoint:
+    health:
+      show-details: always

+ 77 - 0
blade-ops/blade-codegen/pom.xml

@@ -0,0 +1,77 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    <parent>
+        <groupId>org.springblade</groupId>
+        <artifactId>blade-ops</artifactId>
+        <version>2.0.0-RC1</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>blade-codegen</artifactId>
+    <name>${project.artifactId}</name>
+    <version>${blade.project.version}</version>
+    <packaging>jar</packaging>
+
+    <dependencies>
+        <!--Blade-->
+        <dependency>
+            <groupId>org.springblade</groupId>
+            <artifactId>blade-core-boot</artifactId>
+            <version>${blade.tool.version}</version>
+        </dependency>
+        <!--Velocity-->
+        <dependency>
+            <groupId>org.apache.velocity</groupId>
+            <artifactId>velocity</artifactId>
+            <version>1.7</version>
+        </dependency>
+		<!--Swagger-->
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger2</artifactId>
+            <version>${swagger.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>io.swagger</groupId>
+                    <artifactId>swagger-models</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>io.swagger</groupId>
+            <artifactId>swagger-models</artifactId>
+            <version>${swagger.models.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springblade</groupId>
+            <artifactId>blade-dict-api</artifactId>
+            <version>${blade.project.version}</version>
+        </dependency>
+    </dependencies>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.springframework.boot</groupId>
+				<artifactId>spring-boot-maven-plugin</artifactId>
+				<configuration>
+					<skip>true</skip>
+					<finalName>${project.name}</finalName>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>com.spotify</groupId>
+				<artifactId>docker-maven-plugin</artifactId>
+				<version>${docker.plugin.version}</version>
+				<configuration>
+					<skipDockerBuild>true</skipDockerBuild>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+
+</project>

+ 49 - 0
blade-ops/blade-codegen/src/main/java/org/springblade/generate/CodeGenerator.java

@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.generate;
+
+
+import org.springblade.support.BladeGenerator;
+
+/**
+ * 代码生成器
+ */
+public class CodeGenerator {
+
+	public static String PACKAGE_NAME = "org.springblade.system";
+	public static String PACKAGE_DIR = "/blade-ops/blade-codegen/src/main/java";
+	public static String[] TABLE_PREFIX = {"blade_"};
+	public static String[] INCLUDE_TABLES = {"blade_param"};
+	public static String[] EXCLUDE_TABLES = {};
+	public static Boolean HAS_SUPER_ENTITY = Boolean.TRUE;
+	public static String[] SUPER_ENTITY_COLUNMS = {"id", "create_time", "create_user", "update_time", "update_user", "status", "is_deleted"};
+
+	/**
+	 * RUN THIS
+	 */
+	public static void main(String[] args) {
+		BladeGenerator generator = new BladeGenerator();
+		generator.setPackageName(PACKAGE_NAME);
+		generator.setPackageDir(PACKAGE_DIR);
+		generator.setTablePrefix(TABLE_PREFIX);
+		generator.setIncludeTables(INCLUDE_TABLES);
+		generator.setExcludeTables(EXCLUDE_TABLES);
+		generator.setHasSuperEntity(HAS_SUPER_ENTITY);
+		generator.setSuperEntityColumns(SUPER_ENTITY_COLUNMS);
+		generator.run();
+	}
+
+}

+ 249 - 0
blade-ops/blade-codegen/src/main/java/org/springblade/support/BladeGenerator.java

@@ -0,0 +1,249 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.support;
+
+import com.baomidou.mybatisplus.annotation.DbType;
+import com.baomidou.mybatisplus.core.toolkit.StringPool;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.baomidou.mybatisplus.generator.AutoGenerator;
+import com.baomidou.mybatisplus.generator.InjectionConfig;
+import com.baomidou.mybatisplus.generator.config.*;
+import com.baomidou.mybatisplus.generator.config.converts.MySqlTypeConvert;
+import com.baomidou.mybatisplus.generator.config.converts.PostgreSqlTypeConvert;
+import com.baomidou.mybatisplus.generator.config.po.TableInfo;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.springblade.core.tool.utils.StringUtil;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.Resource;
+import org.springframework.core.io.support.PropertiesLoaderUtils;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+/**
+ * 代码生成器配置类
+ *
+ * @author Chill
+ */
+@Data
+@Slf4j
+public class BladeGenerator {
+
+	private String packageName = "org.springblade.test";
+	private String packageDir = "/blade-ops/blade-codegen/src/main/java";
+	private String[] tablePrefix = {"blade_"};
+	private String[] includeTables = {"blade_test"};
+	private String[] excludeTables = {};
+	private Boolean hasSuperEntity = Boolean.TRUE;
+	private String[] superEntityColumns = {"id", "create_time", "create_user", "update_time", "update_user", "status", "is_deleted"};
+	private Boolean isSwagger2 = Boolean.TRUE;
+
+	public void run() {
+		// 获取配置文件
+		Properties props = getProperties();
+		// 代码生成器
+		AutoGenerator mpg = new AutoGenerator();
+
+		// 全局配置
+		GlobalConfig gc = new GlobalConfig();
+		String outputDir = getOutputDir();
+		String author = props.getProperty("author");
+		gc.setOutputDir(outputDir);
+		gc.setAuthor(author);
+		gc.setFileOverride(true);
+		gc.setOpen(false);
+		/**
+		 * 开启 activeRecord 模式
+		 */
+		gc.setActiveRecord(false);
+		/**
+		 * XML 二级缓存
+		 */
+		gc.setEnableCache(false);
+		/**
+		 * XML ResultMap
+		 */
+		gc.setBaseResultMap(true);
+		/**
+		 * XML columList
+		 */
+		gc.setBaseColumnList(true);
+		/**
+		 * 自定义文件命名,注意 %s 会自动填充表实体属性!
+		 */
+		gc.setMapperName("%sMapper");
+		gc.setXmlName("%sMapper");
+		gc.setServiceName("I%sService");
+		gc.setServiceImplName("%sServiceImpl");
+		gc.setControllerName("%sController");
+		gc.setSwagger2(isSwagger2);
+		mpg.setGlobalConfig(gc);
+
+		// 数据源配置
+		DataSourceConfig dsc = new DataSourceConfig();
+		String driverName = props.getProperty("spring.datasource.driver-class-name");
+		if (StringUtil.containsAny(driverName, DbType.MYSQL.getDb())) {
+			dsc.setDbType(DbType.MYSQL);
+			dsc.setTypeConvert(new MySqlTypeConvert());
+		} else {
+			dsc.setDbType(DbType.POSTGRE_SQL);
+			dsc.setTypeConvert(new PostgreSqlTypeConvert());
+		}
+		dsc.setUrl(props.getProperty("spring.datasource.url"));
+
+		dsc.setDriverName(driverName);
+		dsc.setUsername(props.getProperty("spring.datasource.username"));
+		dsc.setPassword(props.getProperty("spring.datasource.password"));
+		mpg.setDataSource(dsc);
+
+		// 策略配置
+		StrategyConfig strategy = new StrategyConfig();
+		// strategy.setCapitalMode(true);// 全局大写命名
+		// strategy.setDbColumnUnderline(true);//全局下划线命名
+
+		/**
+		 * 表名生成策略
+		 */
+		strategy.setNaming(NamingStrategy.underline_to_camel);
+		/**
+		 * 字段名生成策略
+		 */
+		strategy.setColumnNaming(NamingStrategy.underline_to_camel);
+		/**
+		 * 此处可以修改为您的表前缀
+		 */
+		strategy.setTablePrefix(tablePrefix);
+
+		if (includeTables.length > 0) {
+			/**
+			 * 需要生成的表
+			 */
+			strategy.setInclude(includeTables);
+		}
+
+		if (excludeTables.length > 0) {
+			/**
+			 * 排除生成的表
+			 */
+			strategy.setExclude(excludeTables);
+		}
+
+
+		if (hasSuperEntity) {
+			strategy.setSuperEntityClass("org.springblade.core.mp.base.BaseEntity");
+			strategy.setSuperEntityColumns(superEntityColumns);
+			strategy.setSuperServiceClass("org.springblade.core.mp.base.BaseService");
+			strategy.setSuperServiceImplClass("org.springblade.core.mp.base.BaseServiceImpl");
+		} else {
+			strategy.setSuperServiceClass("com.baomidou.mybatisplus.extension.service.IService");
+			strategy.setSuperServiceImplClass("com.baomidou.mybatisplus.extension.service.impl.ServiceImpl");
+		}
+
+		// 自定义 controller 父类
+		strategy.setSuperControllerClass("org.springblade.core.boot.ctrl.BladeController");
+
+		strategy.setEntityBuilderModel(false);
+		strategy.setEntityLombokModel(true);
+		strategy.setControllerMappingHyphenStyle(true);
+		mpg.setStrategy(strategy);
+
+		// 包配置
+		PackageConfig pc = new PackageConfig();
+		// 控制台扫描
+		pc.setModuleName(null);
+		pc.setParent(packageName);
+		pc.setController("controller");
+		pc.setEntity("entity");
+		pc.setXml("mapper");
+		mpg.setPackageInfo(pc);
+
+		// 自定义配置
+		InjectionConfig cfg = new InjectionConfig() {
+			@Override
+			public void initMap() {
+				// to do nothing
+			}
+		};
+		List<FileOutConfig> focList = new ArrayList<>();
+		focList.add(new FileOutConfig("/templates/entityVO.java.vm") {
+			@Override
+			public String outputFile(TableInfo tableInfo) {
+				return getOutputDir() + "/" + packageName.replace(".", "/") + "/" + "vo" + "/" + tableInfo.getEntityName() + "VO" + StringPool.DOT_JAVA;
+			}
+		});
+		focList.add(new FileOutConfig("/templates/entityDTO.java.vm") {
+			@Override
+			public String outputFile(TableInfo tableInfo) {
+				return getOutputDir() + "/" + packageName.replace(".", "/") + "/" + "dto" + "/" + tableInfo.getEntityName() + "DTO" + StringPool.DOT_JAVA;
+			}
+		});
+		focList.add(new FileOutConfig("/templates/wrapper.java.vm") {
+			@Override
+			public String outputFile(TableInfo tableInfo) {
+				return getOutputDir() + "/" + packageName.replace(".", "/") + "/" + "wrapper" + "/" + tableInfo.getEntityName() + "Wrapper" + StringPool.DOT_JAVA;
+			}
+		});
+		cfg.setFileOutConfigList(focList);
+		mpg.setCfg(cfg);
+
+		mpg.execute();
+	}
+
+	/**
+	 * 获取配置文件
+	 *
+	 * @return 配置Props
+	 */
+	private Properties getProperties() {
+		// 读取配置文件
+		Resource resource = new ClassPathResource("generator.properties");
+		Properties props = new Properties();
+		try {
+			props = PropertiesLoaderUtils.loadProperties(resource);
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+		return props;
+	}
+
+	/**
+	 * 生成到项目中
+	 *
+	 * @return outputDir
+	 */
+	public String getOutputDir() {
+		return System.getProperty("user.dir") + packageDir;
+	}
+
+	/**
+	 * 页面生成的文件名
+	 */
+	private String getGeneratorViewPath(String viewOutputDir, TableInfo tableInfo, String suffixPath) {
+		String name = StringUtils.firstToLowerCase(tableInfo.getEntityName());
+		String path = viewOutputDir + "/" + name + "/" + name + suffixPath;
+		File viewDir = new File(path).getParentFile();
+		if (!viewDir.exists()) {
+			viewDir.mkdirs();
+		}
+		return path;
+	}
+
+}

+ 5 - 0
blade-ops/blade-codegen/src/main/resources/generator.properties

@@ -0,0 +1,5 @@
+spring.datasource.driver-class-name=com.mysql.jdbc.Driver
+spring.datasource.url=jdbc:mysql://localhost:3306/bladex?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false
+spring.datasource.username=root
+spring.datasource.password=root
+author=BladeX

+ 154 - 0
blade-ops/blade-codegen/src/main/resources/templates/controller.java.vm

@@ -0,0 +1,154 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package ${package.Controller};
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.system.feign.IDictClient;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+#if(${superEntityClass})
+import org.springframework.web.bind.annotation.RequestParam;
+#end
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import ${package.Entity}.${entity};
+#set($voPackage=$package.Entity.replace("entity","vo"))
+import ${voPackage}.${entity}VO;
+#set($wrapperPackage=$package.Entity.replace("entity","wrapper"))
+import ${wrapperPackage}.${entity}Wrapper;
+import ${package.Service}.${table.serviceName};
+#if(${superControllerClassPackage})
+import ${superControllerClassPackage};
+#end
+#if(!${superEntityClass})
+#end
+import java.util.List;
+
+/**
+ * $!{table.comment} 控制器
+ *
+ * @author ${author}
+ * @since ${date}
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("#if(${package.ModuleName})/${package.ModuleName}#end/${table.entityPath}")
+@Api(value = "$!{table.comment}", tags = "$!{table.comment}接口")
+#if(${superControllerClass})
+public class ${table.controllerName} extends ${superControllerClass} {
+#else
+public class ${table.controllerName} {
+#end
+
+	private ${table.serviceName} ${table.entityPath}Service;
+
+	private IDictClient dictClient;
+
+	/**
+	* 详情
+	*/
+	@GetMapping("/detail")
+	@ApiOperation(value = "详情", notes = "传入${table.entityPath}", position = 1)
+	public R<${entity}VO> detail(${entity} ${table.entityPath}) {
+		${entity} detail = ${table.entityPath}Service.getOne(Condition.getQueryWrapper(${table.entityPath}));
+		${entity}Wrapper ${table.entityPath}Wrapper = new ${entity}Wrapper(dictClient);
+		return R.data(${table.entityPath}Wrapper.entityVO(detail));
+	}
+
+	/**
+	* 分页 $!{table.comment}
+	*/
+	@GetMapping("/list")
+	@ApiOperation(value = "分页", notes = "传入${table.entityPath}", position = 2)
+	public R<IPage<${entity}VO>> list(${entity} ${table.entityPath}, Query query) {
+		IPage<${entity}> pages = ${table.entityPath}Service.page(Condition.getPage(query), Condition.getQueryWrapper(${table.entityPath}));
+		${entity}Wrapper ${table.entityPath}Wrapper = new ${entity}Wrapper(dictClient);
+		return R.data(${table.entityPath}Wrapper.pageVO(pages));
+	}
+
+	/**
+	* 自定义分页 $!{table.comment}
+	*/
+	@GetMapping("/page")
+	@ApiOperation(value = "分页", notes = "传入${table.entityPath}", position = 3)
+	public R<IPage<${entity}VO>> page(${entity}VO ${table.entityPath}, Query query) {
+		IPage<${entity}VO> pages = ${table.entityPath}Service.select${entity}Page(Condition.getPage(query), ${table.entityPath});
+		return R.data(pages);
+	}
+
+	/**
+	* 新增 $!{table.comment}
+	*/
+	@PostMapping("/save")
+	@ApiOperation(value = "新增", notes = "传入${table.entityPath}", position = 4)
+	public R save(@Valid @RequestBody ${entity} ${table.entityPath}) {
+		return R.status(${table.entityPath}Service.save(${table.entityPath}));
+	}
+
+	/**
+	* 修改 $!{table.comment}
+	*/
+	@PostMapping("/update")
+	@ApiOperation(value = "修改", notes = "传入${table.entityPath}", position = 5)
+	public R update(@Valid @RequestBody ${entity} ${table.entityPath}) {
+		return R.status(${table.entityPath}Service.updateById(${table.entityPath}));
+	}
+
+	/**
+	* 新增或修改 $!{table.comment}
+	*/
+	@PostMapping("/submit")
+	@ApiOperation(value = "新增或修改", notes = "传入${table.entityPath}", position = 6)
+	public R submit(@Valid @RequestBody ${entity} ${table.entityPath}) {
+		return R.status(${table.entityPath}Service.saveOrUpdate(${table.entityPath}));
+	}
+
+	#if(${superEntityClass})
+
+	/**
+	* 删除 $!{table.comment}
+	*/
+	@PostMapping("/remove")
+	@ApiOperation(value = "逻辑删除", notes = "传入ids", position = 7)
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(${table.entityPath}Service.deleteLogic(Func.toIntList(ids)));
+	}
+
+	#else
+
+	/**
+	* 删除 $!{table.comment}
+	*/
+	@PostMapping("/remove")
+	@ApiOperation(value = "物理删除", notes = "传入ids", position = 7)
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(${table.entityPath}Service.removeByIds(Func.toIntList(ids)));
+	}
+
+	#end
+
+}

+ 161 - 0
blade-ops/blade-codegen/src/main/resources/templates/entity.java.vm

@@ -0,0 +1,161 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package ${package.Entity};
+
+#foreach($pkg in ${table.importPackages})
+import ${pkg};
+#end
+#if(${entityLombokModel})
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+#end
+#if(${swagger2})
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+#end
+
+/**
+ * $!{table.comment}实体类
+ *
+ * @author ${author}
+ * @since ${date}
+ */
+#if(${entityLombokModel})
+@Data
+#end
+#if(${table.convert})
+@TableName("${table.name}")
+#end
+#if(${superEntityClass})
+@EqualsAndHashCode(callSuper = true)
+#end
+#if(${swagger2})
+@ApiModel(value = "${entity}对象", description = #if ("$!{table.comment}"=="")"${entity}对象"#else"$!{table.comment}"#end)
+#end
+#if(${superEntityClass})
+public class ${entity} extends ${superEntityClass}#if(${activeRecord})<${entity}>#end {
+#elseif(${activeRecord})
+@Accessors(chain = true)
+public class ${entity} extends Model<${entity}> {
+#else
+public class ${entity} implements Serializable {
+#end
+
+    private static final long serialVersionUID = 1L;
+
+## ----------  BEGIN 字段循环遍历  ----------
+#foreach($field in ${table.fields})
+#if(${field.keyFlag})
+#set($keyPropertyName=${field.propertyName})
+#end
+#if("$!field.comment" != "")
+    /**
+     * ${field.comment}
+     */
+  #if(${swagger2})
+  @ApiModelProperty(value = "${field.comment}")
+  #end
+#end
+#if(${field.keyFlag})
+## 主键
+#if(${field.keyIdentityFlag})
+  @TableId(value = "${field.name}", type = IdType.AUTO)
+#elseif(!$null.isNull(${idType}) && "$!idType" != "")
+  @TableId(value = "${field.name}", type = IdType.${idType})
+#elseif(${field.convert})
+  @TableId("${field.name}")
+#end
+## 普通字段
+#elseif(${field.fill})
+## -----   存在字段填充设置   -----
+#if(${field.convert})
+  @TableField(value = "${field.name}", fill = FieldFill.${field.fill})
+#else
+  @TableField(fill = FieldFill.${field.fill})
+#end
+#elseif(${field.convert})
+  @TableField("${field.name}")
+#end
+## 乐观锁注解
+#if(${versionFieldName}==${field.name})
+  @Version
+#end
+## 逻辑删除注解
+#if(${logicDeleteFieldName}==${field.name})
+  @TableLogic
+#end
+  private ${field.propertyType} ${field.propertyName};
+
+#end
+## ----------  END 字段循环遍历  ----------
+
+#if(!${entityLombokModel})
+#foreach($field in ${table.fields})
+#if(${field.propertyType.equals("boolean")})
+#set($getprefix="is")
+#else
+#set($getprefix="get")
+#end
+
+    public ${field.propertyType} ${getprefix}${field.capitalName}() {
+        return ${field.propertyName};
+    }
+
+#if(${entityBuilderModel})
+    public ${entity} set${field.capitalName}(${field.propertyType} ${field.propertyName}) {
+#else
+    public void set${field.capitalName}(${field.propertyType} ${field.propertyName}) {
+#end
+        this.${field.propertyName} = ${field.propertyName};
+#if(${entityBuilderModel})
+        return this;
+#end
+    }
+#end
+#end
+
+#if(${entityColumnConstant})
+#foreach($field in ${table.fields})
+    public static final String ${field.name.toUpperCase()} = "${field.name}";
+
+#end
+#end
+#if(${activeRecord})
+    @Override
+    protected Serializable pkVal() {
+#if(${keyPropertyName})
+        return this.${keyPropertyName};
+#else
+        return this.id;
+#end
+    }
+
+#end
+#if(!${entityLombokModel})
+    @Override
+    public String toString() {
+        return "${entity}{" +
+#foreach($field in ${table.fields})
+#if($!{velocityCount}==1)
+        "${field.propertyName}=" + ${field.propertyName} +
+#else
+        ", ${field.propertyName}=" + ${field.propertyName} +
+#end
+#end
+        "}";
+    }
+#end
+}

+ 38 - 0
blade-ops/blade-codegen/src/main/resources/templates/entityDTO.java.vm

@@ -0,0 +1,38 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+#set($dtoPackage=$package.Entity.replace("entity","dto"))
+package ${dtoPackage};
+
+import ${package.Entity}.${entity};
+#if(${entityLombokModel})
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+#end
+
+/**
+ * $!{table.comment}数据传输对象实体类
+ *
+ * @author ${author}
+ * @since ${date}
+ */
+#if(${entityLombokModel})
+@Data
+@EqualsAndHashCode(callSuper = true)
+#end
+public class ${entity}DTO extends ${entity} {
+    private static final long serialVersionUID = 1L;
+
+}

+ 44 - 0
blade-ops/blade-codegen/src/main/resources/templates/entityVO.java.vm

@@ -0,0 +1,44 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+#set($voPackage=$package.Entity.replace("entity","vo"))
+package ${voPackage};
+
+import ${package.Entity}.${entity};
+#if(${entityLombokModel})
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+#end
+#if(${swagger2})
+import io.swagger.annotations.ApiModel;
+#end
+
+/**
+ * $!{table.comment}视图实体类
+ *
+ * @author ${author}
+ * @since ${date}
+ */
+#if(${entityLombokModel})
+@Data
+@EqualsAndHashCode(callSuper = true)
+#end
+#if(${swagger2})
+@ApiModel(value = "${entity}VO对象", description = #if ("$!{table.comment}"=="")"${entity}VO对象"#else"$!{table.comment}"#end)
+#end
+public class ${entity}VO extends ${entity} {
+    private static final long serialVersionUID = 1L;
+
+}

+ 46 - 0
blade-ops/blade-codegen/src/main/resources/templates/mapper.java.vm

@@ -0,0 +1,46 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package ${package.Mapper};
+
+import ${package.Entity}.${entity};
+#set($voPackage=$package.Entity.replace("entity","vo"))
+import ${voPackage}.${entity}VO;
+import ${superMapperClassPackage};
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * $!{table.comment} Mapper 接口
+ *
+ * @author ${author}
+ * @since ${date}
+ */
+#if(${kotlin})
+interface ${table.mapperName} : ${superMapperClass}<${entity}>
+#else
+public interface ${table.mapperName} extends ${superMapperClass}<${entity}> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param ${table.entityPath}
+	 * @return
+	 */
+	List<${entity}VO> select${entity}Page(IPage page, ${entity}VO ${table.entityPath});
+
+}
+#end

+ 44 - 0
blade-ops/blade-codegen/src/main/resources/templates/mapper.xml.vm

@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="${package.Mapper}.${table.mapperName}">
+
+#if(${enableCache})
+    <!-- 开启二级缓存 -->
+    <cache type="org.mybatis.caches.ehcache.LoggingEhcache"/>
+
+#end
+#if(${baseResultMap})
+    <!-- 通用查询映射结果 -->
+    <resultMap id="${table.entityPath}ResultMap" type="${package.Entity}.${entity}">
+#foreach($field in ${table.fields})
+#if(${field.keyFlag})##生成主键排在第一位
+        <id column="${field.name}" property="${field.propertyName}"/>
+#end
+#end
+#foreach($field in ${table.commonFields})##生成公共字段
+        <result column="${field.name}" property="${field.propertyName}"/>
+#end
+#foreach($field in ${table.fields})
+#if(!${field.keyFlag})##生成普通字段
+        <result column="${field.name}" property="${field.propertyName}"/>
+#end
+#end
+    </resultMap>
+
+#end
+#if(${baseColumnList})
+    <!-- 通用查询结果列 -->
+    <sql id="baseColumnList">
+        select
+    #foreach($field in ${table.commonFields})
+    #if(${field.name} == ${field.propertyName})${field.name}#else${field.name} AS ${field.propertyName}#end,
+    #end
+    ${table.fieldNames}
+    </sql>
+
+    <select id="select${entity}Page" resultMap="${table.entityPath}ResultMap">
+        select * from ${table.name} where is_deleted = 0
+    </select>
+
+#end
+</mapper>

+ 45 - 0
blade-ops/blade-codegen/src/main/resources/templates/service.java.vm

@@ -0,0 +1,45 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package ${package.Service};
+
+import ${package.Entity}.${entity};
+#set($voPackage=$package.Entity.replace("entity","vo"))
+import ${voPackage}.${entity}VO;
+import ${superServiceClassPackage};
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * $!{table.comment} 服务类
+ *
+ * @author ${author}
+ * @since ${date}
+ */
+#if(${kotlin})
+interface ${table.serviceName} : ${superServiceClass}<${entity}>
+#else
+public interface ${table.serviceName} extends ${superServiceClass}<${entity}> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param ${table.entityPath}
+	 * @return
+	 */
+	IPage<${entity}VO> select${entity}Page(IPage<${entity}VO> page, ${entity}VO ${table.entityPath});
+
+}
+#end

+ 47 - 0
blade-ops/blade-codegen/src/main/resources/templates/serviceImpl.java.vm

@@ -0,0 +1,47 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package ${package.ServiceImpl};
+
+import ${package.Entity}.${entity};
+#set($voPackage=$package.Entity.replace("entity","vo"))
+import ${voPackage}.${entity}VO;
+import ${package.Mapper}.${table.mapperName};
+import ${package.Service}.${table.serviceName};
+import ${superServiceImplClassPackage};
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * $!{table.comment} 服务实现类
+ *
+ * @author ${author}
+ * @since ${date}
+ */
+@Service
+#if(${kotlin})
+open class ${table.serviceImplName} : ${superServiceImplClass}<${table.mapperName}, ${entity}>(), ${table.serviceName} {
+
+}
+#else
+public class ${table.serviceImplName} extends ${superServiceImplClass}<${table.mapperName}, ${entity}> implements ${table.serviceName} {
+
+	@Override
+	public IPage<${entity}VO> select${entity}Page(IPage<${entity}VO> page, ${entity}VO ${table.entityPath}) {
+		return page.setRecords(baseMapper.select${entity}Page(page, ${table.entityPath}));
+	}
+
+}
+#end

+ 51 - 0
blade-ops/blade-codegen/src/main/resources/templates/wrapper.java.vm

@@ -0,0 +1,51 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+#set($wrapperPackage=$package.Entity.replace("entity","wrapper"))
+package ${wrapperPackage};
+
+import lombok.AllArgsConstructor;
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.system.feign.IDictClient;
+import ${package.Entity}.${entity};
+#set($voPackage=$package.Entity.replace("entity","vo"))
+import ${voPackage}.${entity}VO;
+
+/**
+ * $!{table.comment}包装类,返回视图层所需的字段
+ *
+ * @author ${author}
+ * @since ${date}
+ */
+@AllArgsConstructor
+public class ${entity}Wrapper extends BaseEntityWrapper<${entity}, ${entity}VO>  {
+
+	private IDictClient dictClient;
+
+	@Override
+	public ${entity}VO entityVO(${entity} ${table.entityPath}) {
+		${entity}VO ${table.entityPath}VO = BeanUtil.copy(${table.entityPath}, ${entity}VO.class);
+
+		/*R<String> dict = dictClient.getValue("${table.entityPath}" , ${table.entityPath}VO.getCategory());
+		if (dict.isSuccess()) {
+			String categoryName = dict.getData();
+			${table.entityPath}VO.setCategoryName(categoryName);
+		}*/
+
+		return ${table.entityPath}VO;
+	}
+
+}

+ 15 - 0
blade-ops/blade-config-server/Dockerfile

@@ -0,0 +1,15 @@
+FROM anapsix/alpine-java:8_server-jre_unlimited
+
+MAINTAINER smallchill@163.com
+
+RUN mkdir -p /blade/config
+
+WORKDIR /blade/config
+
+EXPOSE 7005
+
+ADD ./target/blade-config-server.jar ./app.jar
+
+ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"]
+
+CMD ["--spring.profiles.active=test"]

+ 24 - 0
blade-ops/blade-config-server/README.md

@@ -0,0 +1,24 @@
+# bladex-config
+
+##bladex配置文件仓库部署步骤
+
+1.建好git仓库,并建好文件夹,如:respo
+
+2.将/config下的文件放到respo文件夹下,并push到git
+
+3.到/resources/bootstrap.yml文件,修改spring.cloud.config.git节点下对应的配置
+
+4.启动工程,开启config-server服务
+
+##访问请求
+
+在浏览器里输入:http://localhost:7005/application/dev/master
+           或 http://localhost:7005/application-dev.yml
+           或 http://localhost:7005/application-dev.properties
+
+证明配置服务中心可以从远程程序获取配置信息,http请求地址和资源文件映射如下:
+·        /{application}/{profile}/{label}
+·        /{application}-{profile}.yml
+·        /{label}/{application}-{profile}.yml
+·        /{application}-{profile}.properties
+·        /{label}/{application}-{profile}.properties

+ 56 - 0
blade-ops/blade-config-server/pom.xml

@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+		 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<parent>
+		<artifactId>blade-ops</artifactId>
+		<groupId>org.springblade</groupId>
+		<version>2.0.0-RC1</version>
+	</parent>
+	<modelVersion>4.0.0</modelVersion>
+
+	<artifactId>blade-config-server</artifactId>
+	<name>${project.artifactId}</name>
+	<version>${blade.project.version}</version>
+	<packaging>jar</packaging>
+
+	<dependencies>
+		<!--Blade-->
+		<dependency>
+			<groupId>org.springblade</groupId>
+			<artifactId>blade-core-launch</artifactId>
+			<version>${blade.tool.version}</version>
+		</dependency>
+		<!--Config-Server-->
+		<dependency>
+			<groupId>org.springframework.cloud</groupId>
+			<artifactId>spring-cloud-config-server</artifactId>
+		</dependency>
+	</dependencies>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>com.spotify</groupId>
+				<artifactId>docker-maven-plugin</artifactId>
+				<version>${docker.plugin.version}</version>
+				<configuration>
+					<imageName>${docker.registry.url}/blade/${project.artifactId}:${project.version}</imageName>
+					<dockerDirectory>${project.basedir}</dockerDirectory>
+					<dockerHost>${docker.registry.host}</dockerHost>
+					<resources>
+						<resource>
+							<targetPath>/</targetPath>
+							<directory>${project.build.directory}</directory>
+							<include>${project.build.finalName}.jar</include>
+						</resource>
+					</resources>
+					<registryUrl>${docker.registry.url}</registryUrl>
+					<serverId>${docker.registry.url}</serverId>
+					<pushImage>true</pushImage>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+
+</project>

+ 32 - 0
blade-ops/blade-config-server/src/main/java/org/springblade/config/BladeConfigApplication.java

@@ -0,0 +1,32 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.config;
+
+import org.springblade.core.launch.constant.AppConstant;
+import org.springblade.core.launch.BladeApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.config.server.EnableConfigServer;
+
+
+@EnableConfigServer
+@SpringBootApplication
+public class BladeConfigApplication {
+
+	public static void main(String[] args) {
+        BladeApplication.run(AppConstant.APPLICATION_CONFIG_NAME, BladeConfigApplication.class, args);
+	}
+
+}

+ 10 - 0
blade-ops/blade-config-server/src/main/resources/banner.txt

@@ -0,0 +1,10 @@
+${AnsiColor.BRIGHT_CYAN} _____               _                ${AnsiColor.BLUE} ______  _             _
+${AnsiColor.BRIGHT_CYAN}/  ___|             (_)               ${AnsiColor.BLUE} | ___ \| |           | |
+${AnsiColor.BRIGHT_CYAN}\ `--.  _ __   _ __  _  _ __    __ _  ${AnsiColor.BLUE} | |_/ /| |  __ _   __| |  ___
+${AnsiColor.BRIGHT_CYAN} `--. \| '_ \ | '__|| || '_ \  / _` | ${AnsiColor.BLUE} | ___ \| | / _` | / _` | / _ \
+${AnsiColor.BRIGHT_CYAN}/\__/ /| |_) || |   | || | | || (_| | ${AnsiColor.BLUE} | |_/ /| || (_| || (_| ||  __/
+${AnsiColor.BRIGHT_CYAN}\____/ | .__/ |_|   |_||_| |_| \__, | ${AnsiColor.BLUE} \____/ |_| \__,_| \__,_| \___|
+${AnsiColor.BRIGHT_CYAN}       | |                      __/ |
+${AnsiColor.BRIGHT_CYAN}       |_|                     |___/
+
+${AnsiColor.BLUE}:: SpringBlade :: ${spring.application.name}:${AnsiColor.RED}${blade.env}${AnsiColor.BLUE} :: Running SpringBoot ${spring-boot.version} :: ${AnsiColor.BRIGHT_BLACK}

+ 42 - 0
blade-ops/blade-config-server/src/main/resources/bootstrap.yml

@@ -0,0 +1,42 @@
+server:
+  port: 7005
+  undertow:
+    # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
+    io-threads: 4
+    # 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
+    worker-threads: 20
+    # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
+    buffer-size: 1024
+    # 是否分配的直接内存
+    direct-buffers: true
+
+spring:
+  # 配置中心
+  cloud:
+    #config:
+    #  server:
+    #    native:
+    #      search-locations: classpath:/config/
+    config:
+      server:
+        git:
+          uri: https://gitee.com/smallc/bladex-config
+          search-paths: respo
+          default-label: master
+          #username: username
+          #password: password
+    loadbalancer:
+      retry:
+        enabled: true
+  devtools:
+    restart:
+      log-condition-evaluation-delta: false
+
+management:
+  endpoints:
+    web:
+      exposure:
+        include: "*"
+  endpoint:
+    health:
+      show-details: always

+ 83 - 0
blade-ops/blade-config-server/src/main/resources/config/application-dev.yml

@@ -0,0 +1,83 @@
+#服务器配置
+server:
+  undertow:
+    # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
+    io-threads: 4
+    # 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
+    worker-threads: 20
+    # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
+    buffer-size: 1024
+    # 是否分配的直接内存
+    direct-buffers: true
+
+#spring配置
+spring:
+  redis:
+    ##redis 单机环境配置
+    host: 127.0.0.1
+    port: 6379
+    password:
+    database: 0
+    ssl: false
+    ##redis 集群环境配置
+    #cluster:
+    #  nodes: 127.0.0.1:7001,127.0.0.1:7002,127.0.0.1:7003
+    #  commandTimeout: 5000
+  devtools:
+    restart:
+      log-condition-evaluation-delta: false
+
+#feign配置
+feign:
+  hystrix:
+    enabled: true
+  okhttp:
+    enabled: true
+  httpclient:
+    enabled: false
+
+#hystrix配置
+hystrix:
+  threadpool:
+    default:
+      coreSize: 300
+      maxQueueSize: 1000
+      queueSizeRejectionThreshold: 800
+  command:
+    default:
+      execution:
+        isolation:
+          thread:
+            timeoutInMilliseconds: 720000
+
+#ribbon配置
+ribbon:
+  #对当前实例的重试次数
+  MaxAutoRetries: 1
+  #切换实例的重试次数
+  MaxAutoRetriesNextServer: 2
+  #请求处理的超时时间
+  ReadTimeout: 60000
+  #请求连接的超时时间
+  ConnectTimeout: 60000
+  #对所有操作请求都进行重试
+  OkToRetryOnAllOperations: true
+
+#对外暴露端口
+management:
+  endpoints:
+    web:
+      exposure:
+        include: "*"
+  endpoint:
+    health:
+      show-details: always
+
+#项目模块集中配置
+blade:
+  #通用开发生产环境数据库地址(特殊情况可在对应的子工程里配置覆盖)
+  datasource:
+    dev:
+      url: jdbc:mysql://localhost:3306/bladex?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true
+      username: root
+      password: root

+ 83 - 0
blade-ops/blade-config-server/src/main/resources/config/application-prod.yml

@@ -0,0 +1,83 @@
+#服务器配置
+server:
+  undertow:
+    # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
+    io-threads: 4
+    # 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
+    worker-threads: 20
+    # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
+    buffer-size: 1024
+    # 是否分配的直接内存
+    direct-buffers: true
+
+#spring配置
+spring:
+  redis:
+    ##redis 单机环境配置
+    host: 192.168.186.129
+    port: 3379
+    password:
+    database: 0
+    ssl: false
+    ##redis 集群环境配置
+    #cluster:
+    #  nodes: 127.0.0.1:7001,127.0.0.1:7002,127.0.0.1:7003
+    #  commandTimeout: 5000
+  devtools:
+    restart:
+      log-condition-evaluation-delta: false
+
+#feign配置
+feign:
+  hystrix:
+    enabled: true
+  okhttp:
+    enabled: true
+  httpclient:
+    enabled: false
+
+#hystrix配置
+hystrix:
+  threadpool:
+    default:
+      coreSize: 300
+      maxQueueSize: 1000
+      queueSizeRejectionThreshold: 800
+  command:
+    default:
+      execution:
+        isolation:
+          thread:
+            timeoutInMilliseconds: 720000
+
+#ribbon配置
+ribbon:
+  #对当前实例的重试次数
+  MaxAutoRetries: 1
+  #切换实例的重试次数
+  MaxAutoRetriesNextServer: 2
+  #请求处理的超时时间
+  ReadTimeout: 60000
+  #请求连接的超时时间
+  ConnectTimeout: 60000
+  #对所有操作请求都进行重试
+  OkToRetryOnAllOperations: true
+
+#对外暴露端口
+management:
+  endpoints:
+    web:
+      exposure:
+        include: "*"
+  endpoint:
+    health:
+      show-details: always
+
+#项目模块集中配置
+blade:
+  #通用开发生产环境数据库地址(特殊情况可在对应的子工程里配置覆盖)
+  datasource:
+    prod:
+      url: jdbc:mysql://192.168.186.129:3306/bladex?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true
+      username: root
+      password: root

+ 83 - 0
blade-ops/blade-config-server/src/main/resources/config/application-test.yml

@@ -0,0 +1,83 @@
+#服务器配置
+server:
+  undertow:
+    # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
+    io-threads: 4
+    # 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
+    worker-threads: 20
+    # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
+    buffer-size: 1024
+    # 是否分配的直接内存
+    direct-buffers: true
+
+#spring配置
+spring:
+  redis:
+    ##redis 单机环境配置
+    host: 192.168.186.129
+    port: 3379
+    password:
+    database: 0
+    ssl: false
+    ##redis 集群环境配置
+    #cluster:
+    #  nodes: 127.0.0.1:7001,127.0.0.1:7002,127.0.0.1:7003
+    #  commandTimeout: 5000
+  devtools:
+    restart:
+      log-condition-evaluation-delta: false
+
+#feign配置
+feign:
+  hystrix:
+    enabled: true
+  okhttp:
+    enabled: true
+  httpclient:
+    enabled: false
+
+#hystrix配置
+hystrix:
+  threadpool:
+    default:
+      coreSize: 300
+      maxQueueSize: 1000
+      queueSizeRejectionThreshold: 800
+  command:
+    default:
+      execution:
+        isolation:
+          thread:
+            timeoutInMilliseconds: 720000
+
+#ribbon配置
+ribbon:
+  #对当前实例的重试次数
+  MaxAutoRetries: 1
+  #切换实例的重试次数
+  MaxAutoRetriesNextServer: 2
+  #请求处理的超时时间
+  ReadTimeout: 60000
+  #请求连接的超时时间
+  ConnectTimeout: 60000
+  #对所有操作请求都进行重试
+  OkToRetryOnAllOperations: true
+
+#对外暴露端口
+management:
+  endpoints:
+    web:
+      exposure:
+        include: "*"
+  endpoint:
+    health:
+      show-details: always
+
+#项目模块集中配置
+blade:
+  #通用开发生产环境数据库地址(特殊情况可在对应的子工程里配置覆盖)
+  datasource:
+    test:
+      url: jdbc:mysql://192.168.186.129:3306/bladex?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true
+      username: root
+      password: root

+ 4 - 0
blade-ops/blade-config-server/src/main/resources/config/blade-dashboard-dev.yml

@@ -0,0 +1,4 @@
+blade:
+  modules:
+    id: 1
+    name: dashboard-dev

+ 4 - 0
blade-ops/blade-config-server/src/main/resources/config/blade-dashboard-prod.yml

@@ -0,0 +1,4 @@
+blade:
+  modules:
+    id: 1
+    name: dashboard-prod

+ 4 - 0
blade-ops/blade-config-server/src/main/resources/config/blade-dashboard-test.yml

@@ -0,0 +1,4 @@
+blade:
+  modules:
+    id: 3
+    name: dashboard-test

+ 20 - 0
blade-ops/pom.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>SpringBlade</artifactId>
+        <groupId>org.springblade</groupId>
+        <version>2.0.0-RC1</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>blade-ops</artifactId>
+    <packaging>pom</packaging>
+    <modules>
+        <module>blade-admin</module>
+        <module>blade-codegen</module>
+        <module>blade-config-server</module>
+	</modules>
+
+</project>

+ 17 - 0
blade-service-api/blade-desk-api/pom.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>blade-service-api</artifactId>
+        <groupId>org.springblade</groupId>
+        <version>2.0.0-RC1</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>blade-desk-api</artifactId>
+    <name>${project.artifactId}</name>
+    <version>${blade.project.version}</version>
+    <packaging>jar</packaging>
+
+</project>

+ 63 - 0
blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/entity/Notice.java

@@ -0,0 +1,63 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.desk.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+import java.util.Date;
+
+/**
+ * 实体类
+ *
+ * @author Chill
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("blade_notice")
+public class Notice extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 标题
+	 */
+	@ApiModelProperty(value = "标题")
+	private String title;
+
+	/**
+	 * 通知类型
+	 */
+	@ApiModelProperty(value = "通知类型")
+	private Integer category;
+
+	/**
+	 * 发布日期
+	 */
+	@ApiModelProperty(value = "发布日期")
+	private Date date;
+
+	/**
+	 * 内容
+	 */
+	@ApiModelProperty(value = "内容")
+	private String content;
+
+
+}

+ 45 - 0
blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/feign/INoticeClient.java

@@ -0,0 +1,45 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.desk.feign;
+
+import org.springblade.core.launch.constant.AppConstant;
+import org.springblade.core.tool.api.R;
+import org.springblade.desk.entity.Notice;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.List;
+
+/**
+ *  Feign接口类
+ */
+@FeignClient(
+        value = AppConstant.APPLICATION_DESK_NAME
+)
+public interface INoticeClient {
+
+    String API_PREFIX = "/dashboard";
+
+    /**
+     * 获取notice列表
+     * @param number
+     * @return
+     */
+	@GetMapping(API_PREFIX + "/top")
+    R<List<Notice>> top(@RequestParam("number") Integer number);
+
+}

+ 20 - 0
blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/vo/NoticeVO.java

@@ -0,0 +1,20 @@
+package org.springblade.desk.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.desk.entity.Notice;
+
+/**
+ * 通知公告视图类
+ *
+ * @author Chill
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class NoticeVO extends Notice {
+
+	@ApiModelProperty(value = "通知类型名")
+	private String categoryName;
+
+}

+ 18 - 0
blade-service-api/blade-dict-api/pom.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>blade-service-api</artifactId>
+        <groupId>org.springblade</groupId>
+        <version>2.0.0-RC1</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>blade-dict-api</artifactId>
+    <name>${project.artifactId}</name>
+    <version>${blade.project.version}</version>
+    <packaging>jar</packaging>
+
+
+</project>

+ 35 - 0
blade-service-api/blade-dict-api/src/main/java/org/springblade/system/config/DictFeignConfiguration.java

@@ -0,0 +1,35 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.system.config;
+
+import org.springblade.system.feign.IDictClientFallback;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * 字典feign失败配置
+ *
+ * @author Chill
+ */
+@Configuration
+public class DictFeignConfiguration {
+
+	@Bean
+	public IDictClientFallback dictClientFallback() {
+		return new IDictClientFallback();
+	}
+
+}

+ 33 - 0
blade-service-api/blade-dict-api/src/main/java/org/springblade/system/dto/DictDTO.java

@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.system.dto;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.system.entity.Dict;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class DictDTO extends Dict {
+    private static final long serialVersionUID = 1L;
+
+}

+ 92 - 0
blade-service-api/blade-dict-api/src/main/java/org/springblade/system/entity/Dict.java

@@ -0,0 +1,92 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.system.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 实体类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Data
+@TableName("blade_dict")
+@ApiModel(value = "Dict对象", description = "Dict对象")
+public class Dict implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 主键
+	 */
+	@ApiModelProperty(value = "主键")
+	@TableId(value = "id", type = IdType.AUTO)
+	private Integer id;
+
+	/**
+	 * 父主键
+	 */
+	@ApiModelProperty(value = "父主键")
+	private Integer parentId;
+
+	/**
+	 * 字典码
+	 */
+	@ApiModelProperty(value = "字典码")
+	private String code;
+
+	/**
+	 * 字典值
+	 */
+	@ApiModelProperty(value = "字典值")
+	private Integer dictKey;
+
+	/**
+	 * 字典名称
+	 */
+	@ApiModelProperty(value = "字典名称")
+	private String dictValue;
+
+	/**
+	 * 排序
+	 */
+	@ApiModelProperty(value = "排序")
+	private Integer sort;
+
+	/**
+	 * 字典备注
+	 */
+	@ApiModelProperty(value = "字典备注")
+	private String remark;
+
+	/**
+	 * 是否已删除
+	 */
+	@TableLogic
+	@ApiModelProperty(value = "是否已删除")
+	private Integer isDeleted;
+
+
+}

+ 57 - 0
blade-service-api/blade-dict-api/src/main/java/org/springblade/system/feign/IDictClient.java

@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.system.feign;
+
+
+import org.springblade.core.launch.constant.AppConstant;
+import org.springblade.core.tool.api.R;
+import org.springblade.system.entity.Dict;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.List;
+
+/**
+ *  Feign接口类
+ */
+@FeignClient(
+        value = AppConstant.APPLICATION_SYSTEM_NAME,
+		fallback = IDictClientFallback.class
+)
+public interface IDictClient {
+
+    String API_PREFIX = "/dict";
+
+    /**
+     * 获取字典表对应值
+     *
+     * @param code     字典编号
+     * @param dictKey 字典序号
+     * @return
+     */
+	@GetMapping(API_PREFIX + "/getValue")
+	R<String> getValue(@RequestParam("code") String code, @RequestParam("dictKey") Integer dictKey);
+
+    /**
+     * 获取字典表
+     * @param code 字典编号
+     * @return
+     */
+	@GetMapping(API_PREFIX + "/getList")
+	R<List<Dict>> getList(@RequestParam("code") String code);
+
+}

+ 33 - 0
blade-service-api/blade-dict-api/src/main/java/org/springblade/system/feign/IDictClientFallback.java

@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.system.feign;
+
+import org.springblade.core.tool.api.R;
+import org.springblade.system.entity.Dict;
+
+import java.util.List;
+
+public class IDictClientFallback implements IDictClient {
+	@Override
+	public R<String> getValue(String code, Integer dictKey) {
+		return R.failure("获取数据失败");
+	}
+
+	@Override
+	public R<List<Dict>> getList(String code) {
+		return R.failure("获取数据失败");
+	}
+}

+ 67 - 0
blade-service-api/blade-dict-api/src/main/java/org/springblade/system/vo/DictVO.java

@@ -0,0 +1,67 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.system.vo;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.tool.node.INode;
+import org.springblade.system.entity.Dict;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 视图实体类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "DictVO对象", description = "DictVO对象")
+public class DictVO extends Dict implements INode {
+	private static final long serialVersionUID = 1L;
+	/**
+	 * 主键ID
+	 */
+	private Integer id;
+
+	/**
+	 * 父节点ID
+	 */
+	private Integer parentId;
+
+	/**
+	 * 子孙节点
+	 */
+	@JsonInclude(JsonInclude.Include.NON_EMPTY)
+	private List<INode> children;
+
+	@Override
+	public List<INode> getChildren() {
+		if (this.children == null) {
+			this.children = new ArrayList<>();
+		}
+		return this.children;
+	}
+
+	/**
+	 * 上级字典
+	 */
+	private String parentName;
+}

+ 1 - 0
blade-service-api/blade-dict-api/src/main/resources/META-INF/spring-devtools.properties

@@ -0,0 +1 @@
+restart.include.blade-dict-api=/blade-dict-api[\\w-]+\.jar

+ 2 - 0
blade-service-api/blade-dict-api/src/main/resources/META-INF/spring.factories

@@ -0,0 +1,2 @@
+org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
+  org.springblade.system.config.DictFeignConfiguration

+ 18 - 0
blade-service-api/blade-system-api/pom.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>blade-service-api</artifactId>
+        <groupId>org.springblade</groupId>
+        <version>2.0.0-RC1</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>blade-system-api</artifactId>
+    <name>${project.artifactId}</name>
+    <version>${blade.project.version}</version>
+    <packaging>jar</packaging>
+
+
+</project>

+ 33 - 0
blade-service-api/blade-system-api/src/main/java/org/springblade/system/dto/CodeDTO.java

@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.system.dto;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.system.entity.Code;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class CodeDTO extends Code {
+    private static final long serialVersionUID = 1L;
+
+}

+ 33 - 0
blade-service-api/blade-system-api/src/main/java/org/springblade/system/dto/DeptDTO.java

@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.system.dto;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.system.entity.Dept;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class DeptDTO extends Dept {
+    private static final long serialVersionUID = 1L;
+
+}

+ 33 - 0
blade-service-api/blade-system-api/src/main/java/org/springblade/system/dto/MenuDTO.java

@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.system.dto;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.system.entity.Menu;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class MenuDTO extends Menu {
+    private static final long serialVersionUID = 1L;
+
+}

+ 33 - 0
blade-service-api/blade-system-api/src/main/java/org/springblade/system/dto/ParamDTO.java

@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.system.dto;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.system.entity.Param;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author Chill
+ * @since 2018-12-28
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ParamDTO extends Param {
+	private static final long serialVersionUID = 1L;
+
+}

+ 33 - 0
blade-service-api/blade-system-api/src/main/java/org/springblade/system/dto/RoleDTO.java

@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.system.dto;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.system.entity.Role;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class RoleDTO extends Role {
+    private static final long serialVersionUID = 1L;
+
+}

+ 33 - 0
blade-service-api/blade-system-api/src/main/java/org/springblade/system/dto/RoleMenuDTO.java

@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.system.dto;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.system.entity.RoleMenu;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class RoleMenuDTO extends RoleMenu {
+    private static final long serialVersionUID = 1L;
+
+}

+ 98 - 0
blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Code.java

@@ -0,0 +1,98 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.system.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 实体类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Data
+@TableName("blade_code")
+@ApiModel(value = "Code对象", description = "Code对象")
+public class Code implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 主键
+	 */
+	@ApiModelProperty(value = "主键")
+	@TableId(value = "id", type = IdType.AUTO)
+	private Integer id;
+
+	/**
+	 * 模块名称
+	 */
+	@ApiModelProperty(value = "模块名称")
+	private String codeName;
+
+	/**
+	 * 表名
+	 */
+	@ApiModelProperty(value = "表名")
+	private String tableName;
+
+	/**
+	 * 主键名
+	 */
+	@ApiModelProperty(value = "主键名")
+	private String pkName;
+
+	/**
+	 * 实体名
+	 */
+	@ApiModelProperty(value = "实体名")
+	private String modelName;
+
+	/**
+	 * 后端包名
+	 */
+	@ApiModelProperty(value = "后端包名")
+	private String packageName;
+
+	/**
+	 * 后端路径
+	 */
+	@ApiModelProperty(value = "后端路径")
+	private String apiPath;
+
+	/**
+	 * 前端路径
+	 */
+	@ApiModelProperty(value = "前端路径")
+	private String webPath;
+
+	/**
+	 * 是否已删除
+	 */
+	@TableLogic
+	@ApiModelProperty(value = "是否已删除")
+	private Integer isDeleted;
+
+
+}

+ 86 - 0
blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Dept.java

@@ -0,0 +1,86 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.system.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 实体类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Data
+@TableName("blade_dept")
+@ApiModel(value = "Dept对象", description = "Dept对象")
+public class Dept implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 主键
+	 */
+	@ApiModelProperty(value = "主键")
+	@TableId(value = "id", type = IdType.AUTO)
+	private Integer id;
+
+	/**
+	 * 父主键
+	 */
+	@ApiModelProperty(value = "父主键")
+	private Integer parentId;
+
+	/**
+	 * 部门名
+	 */
+	@ApiModelProperty(value = "部门名")
+	private String deptName;
+
+	/**
+	 * 部门全程
+	 */
+	@ApiModelProperty(value = "部门全程")
+	private String fullName;
+
+	/**
+	 * 排序
+	 */
+	@ApiModelProperty(value = "排序")
+	private Integer sort;
+
+	/**
+	 * 备注
+	 */
+	@ApiModelProperty(value = "备注")
+	private String remark;
+
+	/**
+	 * 是否已删除
+	 */
+	@TableLogic
+	@ApiModelProperty(value = "是否已删除")
+	private Integer isDeleted;
+
+
+}

+ 138 - 0
blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Menu.java

@@ -0,0 +1,138 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.system.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springblade.core.tool.utils.Func;
+
+import java.io.Serializable;
+
+/**
+ * 实体类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Data
+@TableName("blade_menu")
+@ApiModel(value = "Menu对象", description = "Menu对象")
+public class Menu implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 主键
+	 */
+	@ApiModelProperty(value = "主键")
+	@TableId(value = "id", type = IdType.AUTO)
+	private Integer id;
+
+	/**
+	 * 菜单父主键
+	 */
+	@ApiModelProperty(value = "菜单父主键")
+	private Integer parentId;
+
+	/**
+	 * 菜单编号
+	 */
+	@ApiModelProperty(value = "菜单编号")
+	private String code;
+
+	/**
+	 * 菜单名称
+	 */
+	@ApiModelProperty(value = "菜单名称")
+	private String name;
+
+	/**
+	 * 菜单别名
+	 */
+	@ApiModelProperty(value = "菜单别名")
+	private String alias;
+
+	/**
+	 * 请求地址
+	 */
+	@ApiModelProperty(value = "请求地址")
+	private String path;
+
+	/**
+	 * 菜单资源
+	 */
+	@ApiModelProperty(value = "菜单资源")
+	private String source;
+
+	/**
+	 * 排序
+	 */
+	@ApiModelProperty(value = "排序")
+	private Integer sort;
+
+	/**
+	 * 菜单类型
+	 */
+	@ApiModelProperty(value = "菜单类型")
+	private Integer category;
+
+	/**
+	 * 操作按钮类型
+	 */
+	@ApiModelProperty(value = "操作按钮类型")
+	private Integer action;
+
+	/**
+	 * 是否打开新页面
+	 */
+	@ApiModelProperty(value = "是否打开新页面")
+	private Integer isOpen;
+
+	/**
+	 * 备注
+	 */
+	@ApiModelProperty(value = "备注")
+	private String remark;
+
+	/**
+	 * 是否已删除
+	 */
+	@TableLogic
+	@ApiModelProperty(value = "是否已删除")
+	private Integer isDeleted;
+
+
+	@Override
+	public boolean equals(Object obj) {
+		if (this == obj) {
+			return true;
+		}
+		if (obj == null) {
+			return false;
+		}
+		Menu other = (Menu) obj;
+		if (Func.equals(this.getId(), other.getId())) {
+			return true;
+		}
+		return false;
+	}
+
+}

+ 64 - 0
blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Param.java

@@ -0,0 +1,64 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.system.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+/**
+ * 实体类
+ *
+ * @author Chill
+ * @since 2018-12-28
+ */
+@Data
+@TableName("blade_param")
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "Param对象", description = "Param对象")
+public class Param extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 参数名
+	 */
+	@ApiModelProperty(value = "参数名")
+	private String paramName;
+
+	/**
+	 * 参数键
+	 */
+	@ApiModelProperty(value = "参数键")
+	private String paramKey;
+
+	/**
+	 * 参数值
+	 */
+	@ApiModelProperty(value = "参数值")
+	private String paramValue;
+
+	/**
+	 * 备注
+	 */
+	@ApiModelProperty(value = "备注")
+	private String remark;
+
+
+}

+ 80 - 0
blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Role.java

@@ -0,0 +1,80 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.system.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 实体类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Data
+@TableName("blade_role")
+@ApiModel(value = "Role对象", description = "Role对象")
+public class Role implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 主键
+	 */
+	@ApiModelProperty(value = "主键")
+	@TableId(value = "id", type = IdType.AUTO)
+	private Integer id;
+
+	/**
+	 * 父主键
+	 */
+	@ApiModelProperty(value = "父主键")
+	private Integer parentId;
+
+	/**
+	 * 角色名
+	 */
+	@ApiModelProperty(value = "角色名")
+	private String roleName;
+
+	/**
+	 * 排序
+	 */
+	@ApiModelProperty(value = "排序")
+	private Integer sort;
+
+	/**
+	 * 角色别名
+	 */
+	@ApiModelProperty(value = "角色别名")
+	private String roleAlias;
+
+	/**
+	 * 是否已删除
+	 */
+	@TableLogic
+	@ApiModelProperty(value = "是否已删除")
+	private Integer isDeleted;
+
+
+}

+ 60 - 0
blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/RoleMenu.java

@@ -0,0 +1,60 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.system.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 实体类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Data
+@TableName("blade_role_menu")
+@ApiModel(value = "RoleMenu对象", description = "RoleMenu对象")
+public class RoleMenu implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 主键
+	 */
+	@ApiModelProperty(value = "主键")
+	@TableId(value = "id", type = IdType.AUTO)
+	private Integer id;
+
+	/**
+	 * 菜单id
+	 */
+	@ApiModelProperty(value = "菜单id")
+	private Integer menuId;
+
+	/**
+	 * 角色id
+	 */
+	@ApiModelProperty(value = "角色id")
+	private Integer roleId;
+
+
+}

+ 35 - 0
blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/CodeVO.java

@@ -0,0 +1,35 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.system.vo;
+
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.system.entity.Code;
+
+/**
+ * 视图实体类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "CodeVO对象", description = "CodeVO对象")
+public class CodeVO extends Code {
+    private static final long serialVersionUID = 1L;
+
+}

+ 69 - 0
blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/DeptVO.java

@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.system.vo;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.tool.node.INode;
+import org.springblade.system.entity.Dept;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 视图实体类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "DeptVO对象", description = "DeptVO对象")
+public class DeptVO extends Dept implements INode {
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 主键ID
+	 */
+	private Integer id;
+
+	/**
+	 * 父节点ID
+	 */
+	private Integer parentId;
+
+	/**
+	 * 子孙节点
+	 */
+	@JsonInclude(JsonInclude.Include.NON_EMPTY)
+	private List<INode> children;
+
+	@Override
+	public List<INode> getChildren() {
+		if (this.children == null) {
+			this.children = new ArrayList<>();
+		}
+		return this.children;
+	}
+
+	/**
+	 * 上级部门
+	 */
+	private String parentName;
+
+}

+ 83 - 0
blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/MenuVO.java

@@ -0,0 +1,83 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.system.vo;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.tool.node.INode;
+import org.springblade.system.entity.Menu;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 视图实体类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "MenuVO对象", description = "MenuVO对象")
+public class MenuVO extends Menu implements INode {
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 主键ID
+	 */
+	private Integer id;
+
+	/**
+	 * 父节点ID
+	 */
+	private Integer parentId;
+
+	/**
+	 * 子孙节点
+	 */
+	@JsonInclude(JsonInclude.Include.NON_EMPTY)
+	private List<INode> children;
+
+	@Override
+	public List<INode> getChildren() {
+		if (this.children == null) {
+			this.children = new ArrayList<>();
+		}
+		return this.children;
+	}
+
+	/**
+	 * 上级菜单
+	 */
+	private String parentName;
+
+	/**
+	 * 菜单类型
+	 */
+	private String categoryName;
+
+	/**
+	 * 按钮功能
+	 */
+	private String actionName;
+
+	/**
+	 * 是否新窗口打开
+	 */
+	private String isOpenName;
+}

+ 35 - 0
blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/ParamVO.java

@@ -0,0 +1,35 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.system.vo;
+
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.system.entity.Param;
+
+/**
+ * 视图实体类
+ *
+ * @author Chill
+ * @since 2018-12-28
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "ParamVO对象", description = "ParamVO对象")
+public class ParamVO extends Param {
+	private static final long serialVersionUID = 1L;
+
+}

+ 35 - 0
blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/RoleMenuVO.java

@@ -0,0 +1,35 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.system.vo;
+
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.system.entity.RoleMenu;
+
+/**
+ * 视图实体类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "RoleMenuVO对象", description = "RoleMenuVO对象")
+public class RoleMenuVO extends RoleMenu {
+    private static final long serialVersionUID = 1L;
+
+}

+ 68 - 0
blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/RoleVO.java

@@ -0,0 +1,68 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.system.vo;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.tool.node.INode;
+import org.springblade.system.entity.Role;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 视图实体类
+ *
+ * @author Chill
+ * @since 2018-12-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "RoleVO对象", description = "RoleVO对象")
+public class RoleVO extends Role implements INode {
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 主键ID
+	 */
+	private Integer id;
+
+	/**
+	 * 父节点ID
+	 */
+	private Integer parentId;
+
+	/**
+	 * 子孙节点
+	 */
+	@JsonInclude(JsonInclude.Include.NON_EMPTY)
+	private List<INode> children;
+
+	@Override
+	public List<INode> getChildren() {
+		if (this.children == null) {
+			this.children = new ArrayList<>();
+		}
+		return this.children;
+	}
+
+	/**
+	 * 上级角色
+	 */
+	private String parentName;
+}

+ 17 - 0
blade-service-api/blade-user-api/pom.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>blade-service-api</artifactId>
+        <groupId>org.springblade</groupId>
+        <version>2.0.0-RC1</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>blade-user-api</artifactId>
+    <name>${project.artifactId}</name>
+    <version>${blade.project.version}</version>
+    <packaging>jar</packaging>
+
+</project>

+ 79 - 0
blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/entity/User.java

@@ -0,0 +1,79 @@
+/**
+ * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.springblade.system.user.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+import java.time.LocalDateTime;
+
+/**
+ *  实体类
+ *
+ * @author Chill
+ */
+@Data
+@TableName("blade_user")
+@EqualsAndHashCode(callSuper = true)
+public class User extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 账号
+     */
+    private String account;
+    /**
+     * 密码
+     */
+    private String password;
+    /**
+     * 昵称
+     */
+    private String name;
+    /**
+     * 真名
+     */
+    private String realName;
+    /**
+     * 邮箱
+     */
+    private String email;
+    /**
+     * 手机
+     */
+    private String phone;
+    /**
+     * 生日
+     */
+    private LocalDateTime birthday;
+    /**
+     * 性别
+     */
+    private Integer sex;
+    /**
+     * 角色id
+     */
+    private String roleId;
+    /**
+     * 部门id
+     */
+    private String deptId;
+
+
+}

+ 0 - 0
blade-service-api/blade-user-api/src/main/java/org/springblade/system/user/entity/UserInfo.java


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels