Browse Source

数据初始化

hongchuangyanfa 1 year ago
parent
commit
6cff285fc1
100 changed files with 3306 additions and 3301 deletions
  1. 16 21
      blade-auth/README.md
  2. 3 3
      blade-auth/src/main/java/org/springblade/auth/AuthApplication.java
  3. 60 60
      blade-auth/src/main/java/org/springblade/auth/config/BladeAuthorizationServerConfiguration.java
  4. 22 22
      blade-auth/src/main/java/org/springblade/auth/config/BladeResourceServerConfiguration.java
  5. 24 24
      blade-auth/src/main/java/org/springblade/auth/config/JwtTokenStoreConfiguration.java
  6. 15 15
      blade-auth/src/main/java/org/springblade/auth/config/SecurityConfiguration.java
  7. 22 22
      blade-auth/src/main/java/org/springblade/auth/constant/AuthConstant.java
  8. 34 34
      blade-auth/src/main/java/org/springblade/auth/endpoint/BladeSocialEndpoint.java
  9. 41 41
      blade-auth/src/main/java/org/springblade/auth/endpoint/BladeTokenEndPoint.java
  10. 13 13
      blade-auth/src/main/java/org/springblade/auth/granter/BladeTokenGranter.java
  11. 45 46
      blade-auth/src/main/java/org/springblade/auth/granter/CaptchaTokenGranter.java
  12. 63 63
      blade-auth/src/main/java/org/springblade/auth/granter/SocialTokenGranter.java
  13. 17 17
      blade-auth/src/main/java/org/springblade/auth/service/BladeClientDetailsServiceImpl.java
  14. 68 68
      blade-auth/src/main/java/org/springblade/auth/service/BladeUserDetails.java
  15. 39 39
      blade-auth/src/main/java/org/springblade/auth/support/BladeJwtTokenEnhancer.java
  16. 21 21
      blade-auth/src/main/java/org/springblade/auth/support/BladeNoOpPasswordEncoder.java
  17. 8 8
      blade-auth/src/main/java/org/springblade/auth/support/BladePasswordEncoder.java
  18. 28 28
      blade-auth/src/main/java/org/springblade/auth/support/BladePasswordEncoderFactories.java
  19. 29 29
      blade-common/src/main/java/org/springblade/common/cache/CacheNames.java
  20. 45 45
      blade-common/src/main/java/org/springblade/common/constant/CommonConstant.java
  21. 1 1
      blade-common/src/main/java/org/springblade/common/constant/EVisaConstant.java
  22. 206 206
      blade-common/src/main/java/org/springblade/common/constant/LauncherConstant.java
  23. 1 1
      blade-common/src/main/java/org/springblade/common/constant/RegexConstant.java
  24. 30 30
      blade-common/src/main/java/org/springblade/common/constant/TenantConstant.java
  25. 23 23
      blade-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java
  26. 6 5
      blade-common/src/main/java/org/springblade/common/utils/BaiduApiUtil.java
  27. 21 20
      blade-common/src/main/java/org/springblade/common/utils/BaseUtils.java
  28. 35 30
      blade-common/src/main/java/org/springblade/common/utils/CommonUtil.java
  29. 15 14
      blade-common/src/main/java/org/springblade/common/utils/FileUtils.java
  30. 2 2
      blade-common/src/main/java/org/springblade/common/utils/ForestNodeManagerEx.java
  31. 62 66
      blade-common/src/main/java/org/springblade/common/utils/ForestNodeMergerEx.java
  32. 2 2
      blade-common/src/main/java/org/springblade/common/utils/IDUtils.java
  33. 2 1
      blade-common/src/main/java/org/springblade/common/utils/INodeEx.java
  34. 32 31
      blade-common/src/main/java/org/springblade/common/utils/MathUtil.java
  35. 4 3
      blade-common/src/main/java/org/springblade/common/utils/SystemUtils.java
  36. 3 2
      blade-common/src/main/java/org/springblade/common/vo/DataVO.java
  37. 3 3
      blade-gateway/src/main/java/org/springblade/gateway/GateWayApplication.java
  38. 4 4
      blade-gateway/src/main/java/org/springblade/gateway/config/ErrorHandlerConfiguration.java
  39. 32 32
      blade-gateway/src/main/java/org/springblade/gateway/config/RouterFunctionConfiguration.java
  40. 55 55
      blade-gateway/src/main/java/org/springblade/gateway/dynamic/DynamicRouteService.java
  41. 41 41
      blade-gateway/src/main/java/org/springblade/gateway/dynamic/DynamicRouteServiceListener.java
  42. 8 8
      blade-gateway/src/main/java/org/springblade/gateway/dynamic/GatewayFilter.java
  43. 8 8
      blade-gateway/src/main/java/org/springblade/gateway/dynamic/GatewayPredicate.java
  44. 24 24
      blade-gateway/src/main/java/org/springblade/gateway/dynamic/GatewayRoute.java
  45. 56 56
      blade-gateway/src/main/java/org/springblade/gateway/filter/AuthFilter.java
  46. 49 49
      blade-gateway/src/main/java/org/springblade/gateway/filter/GlobalRequestLogFilter.java
  47. 45 45
      blade-gateway/src/main/java/org/springblade/gateway/filter/GlobalResponseLogFilter.java
  48. 32 32
      blade-gateway/src/main/java/org/springblade/gateway/filter/RequestFilter.java
  49. 45 45
      blade-gateway/src/main/java/org/springblade/gateway/handler/ErrorExceptionHandler.java
  50. 4 4
      blade-gateway/src/main/java/org/springblade/gateway/props/AuthProperties.java
  51. 35 35
      blade-gateway/src/main/java/org/springblade/gateway/provider/AuthProvider.java
  52. 13 13
      blade-gateway/src/main/java/org/springblade/gateway/provider/RequestProvider.java
  53. 50 50
      blade-gateway/src/main/java/org/springblade/gateway/provider/ResponseProvider.java
  54. 0 1
      blade-ops-api/blade-flow-api/pom.xml
  55. 34 34
      blade-ops-api/blade-flow-api/src/main/java/org/springblade/flow/core/constant/ProcessConstant.java
  56. 147 147
      blade-ops-api/blade-flow-api/src/main/java/org/springblade/flow/core/entity/BladeFlow.java
  57. 8 8
      blade-ops-api/blade-flow-api/src/main/java/org/springblade/flow/core/entity/FlowEntity.java
  58. 11 11
      blade-ops-api/blade-flow-api/src/main/java/org/springblade/flow/core/enums/FlowModeEnum.java
  59. 57 56
      blade-ops-api/blade-flow-api/src/main/java/org/springblade/flow/core/feign/IFlowClient.java
  60. 24 24
      blade-ops-api/blade-flow-api/src/main/java/org/springblade/flow/core/feign/IFlowClientFallback.java
  61. 3 3
      blade-ops-api/blade-flow-api/src/main/java/org/springblade/flow/core/feign/NewFlowClient.java
  62. 30 30
      blade-ops-api/blade-flow-api/src/main/java/org/springblade/flow/core/utils/FlowUtil.java
  63. 34 34
      blade-ops-api/blade-flow-api/src/main/java/org/springblade/flow/core/utils/TaskUtil.java
  64. 12 12
      blade-ops-api/blade-flow-api/src/main/java/org/springblade/flow/core/vo/FlowProcessVO.java
  65. 31 31
      blade-ops-api/blade-resource-api/src/main/java/org/springblade/resource/entity/Attach.java
  66. 33 34
      blade-ops-api/blade-resource-api/src/main/java/org/springblade/resource/entity/LargeFile.java
  67. 46 46
      blade-ops-api/blade-resource-api/src/main/java/org/springblade/resource/entity/Oss.java
  68. 41 41
      blade-ops-api/blade-resource-api/src/main/java/org/springblade/resource/entity/Sms.java
  69. 28 28
      blade-ops-api/blade-resource-api/src/main/java/org/springblade/resource/enums/SmsCodeEnum.java
  70. 10 9
      blade-ops-api/blade-resource-api/src/main/java/org/springblade/resource/feign/IOSSClient.java
  71. 36 36
      blade-ops-api/blade-resource-api/src/main/java/org/springblade/resource/feign/ISmsClient.java
  72. 12 12
      blade-ops-api/blade-resource-api/src/main/java/org/springblade/resource/feign/ISmsClientFallback.java
  73. 68 68
      blade-ops-api/blade-resource-api/src/main/java/org/springblade/resource/utils/SmsUtil.java
  74. 1 1
      blade-ops-api/blade-resource-api/src/main/java/org/springblade/resource/vo/AttachVO.java
  75. 9 9
      blade-ops-api/blade-resource-api/src/main/java/org/springblade/resource/vo/OssVO.java
  76. 9 9
      blade-ops-api/blade-resource-api/src/main/java/org/springblade/resource/vo/SmsVO.java
  77. 3 2
      blade-ops-api/blade-resource-api/src/main/java/org/springblade/resource/vo/ToPdfVO.java
  78. 2 1
      blade-ops/blade-admin/README.md
  79. 3 3
      blade-ops/blade-admin/src/main/java/org/springblade/admin/AdminApplication.java
  80. 12 12
      blade-ops/blade-admin/src/main/java/org/springblade/admin/config/DingTalkConfiguration.java
  81. 30 30
      blade-ops/blade-admin/src/main/java/org/springblade/admin/config/SecurityConfiguration.java
  82. 53 53
      blade-ops/blade-admin/src/main/java/org/springblade/admin/dingtalk/DingTalkNotifier.java
  83. 55 55
      blade-ops/blade-admin/src/main/java/org/springblade/admin/dingtalk/DingTalkService.java
  84. 30 30
      blade-ops/blade-admin/src/main/java/org/springblade/admin/dingtalk/MonitorProperties.java
  85. 33 33
      blade-ops/blade-admin/src/main/java/org/springblade/admin/security/InternalAuthorizationManager.java
  86. 3 3
      blade-ops/blade-develop/src/main/java/org/springblade/develop/DevelopApplication.java
  87. 90 90
      blade-ops/blade-develop/src/main/java/org/springblade/develop/controller/CodeController.java
  88. 68 68
      blade-ops/blade-develop/src/main/java/org/springblade/develop/controller/DatasourceController.java
  89. 83 83
      blade-ops/blade-develop/src/main/java/org/springblade/develop/entity/Code.java
  90. 31 31
      blade-ops/blade-develop/src/main/java/org/springblade/develop/entity/Datasource.java
  91. 7 7
      blade-ops/blade-develop/src/main/java/org/springblade/develop/service/ICodeService.java
  92. 5 5
      blade-ops/blade-develop/src/main/java/org/springblade/develop/service/impl/CodeServiceImpl.java
  93. 57 57
      blade-ops/blade-develop/src/test/java/org/springblade/test/CodeGenerator.java
  94. 3 3
      blade-ops/blade-flow/src/main/java/org/springblade/flow/FlowApplication.java
  95. 89 89
      blade-ops/blade-flow/src/main/java/org/springblade/flow/business/controller/WorkController.java
  96. 53 52
      blade-ops/blade-flow/src/main/java/org/springblade/flow/business/feign/FlowClient.java
  97. 8 8
      blade-ops/blade-flow/src/main/java/org/springblade/flow/business/feign/NewFlowClientImpl.java
  98. 39 39
      blade-ops/blade-flow/src/main/java/org/springblade/flow/business/service/FlowBusinessService.java
  99. 296 296
      blade-ops/blade-flow/src/main/java/org/springblade/flow/business/service/impl/FlowBusinessServiceImpl.java
  100. 7 7
      blade-ops/blade-flow/src/main/java/org/springblade/flow/engine/config/FlowableConfiguration.java

+ 16 - 21
blade-auth/README.md

@@ -1,32 +1,27 @@
 ## 目前主要支持的oauth协议
-一、 授权码模式
-授权码模式(authorization_code)主要针对第三方应用,是最为复杂也最为安全的一种模式,操作步骤如下
-1. 访问地址:http://localhost:8100/oauth/authorize?client_id=blade&redirect_uri=http://example.com&code=233333&response_type=code
+
+一、 授权码模式 授权码模式(authorization_code)主要针对第三方应用,是最为复杂也最为安全的一种模式,操作步骤如下
+
+1.
+
+访问地址:http://localhost:8100/oauth/authorize?client_id=blade&redirect_uri=http://example.com&code=233333&response_type=code
+
 2. 获取跳转后的code值(http://example.com/?code=VhYNLR)之后,调用 http://localhost/blade-auth/oauth/token 传入对应的参数
 
-请求头:
-Authorization : Basic YmxhZGU6YmxhZGU= ("YmxhZGU6YmxhZGU="为clientId:clientSecret串转换为的base64编码)
+请求头: Authorization : Basic YmxhZGU6YmxhZGU= ("YmxhZGU6YmxhZGU="为clientId:clientSecret串转换为的base64编码)
+
+表单: grant_type:authorization_code scope:all code:VhYNLR redirect_uri: http://example.com
 
-表单:
-grant_type:authorization_code
-scope:all
-code:VhYNLR
-redirect_uri: http://example.com
+二、 密码模式 密码模式(password)主要针对自家应用,可信度较高,所以可以使用简便安全共存的模式,操作步骤如下
 
-二、 密码模式
-密码模式(password)主要针对自家应用,可信度较高,所以可以使用简便安全共存的模式,操作步骤如下
 1. 直接调用 http://localhost/blade-auth/oauth/token 传入对应的参数
 
-请求头:
-Authorization : Basic YmxhZGU6YmxhZGU= ("YmxhZGU6YmxhZGU="为clientId:clientSecret串转换为的base64编码)
+请求头: Authorization : Basic YmxhZGU6YmxhZGU= ("YmxhZGU6YmxhZGU="为clientId:clientSecret串转换为的base64编码)
 
-表单:
-grant_type:password
-scope:all
-username:admin
-password:123456
+表单: grant_type:password scope:all username:admin password:123456
 
 ## 获取到token后如何获取用户信息
-1. 拼接请求头
-Authorization :bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZXN0IjoidGVzdCIsInVzZXJfbmFtZSI6ImFkbWluIiwic2NvcGUiOlsiYWxsIl0sImV4cCI6MTU1MzE2MTA5NSwiYXV0aG9yaXRpZXMiOlsiUk9MRV9VU0VSIl0sImp0aSI6IjE0YmMyYjAyLTgxY2UtNDFiNC04ZTI3LTA5YWE0ZmU4ZWMwYyIsImNsaWVudF9pZCI6ImJsYWRlIn0.jTmioQDq-fSNNn7YCwl3wP0JE-etSWtzLDe545mDbP4
+
+1. 拼接请求头 Authorization :bearer
+   eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZXN0IjoidGVzdCIsInVzZXJfbmFtZSI6ImFkbWluIiwic2NvcGUiOlsiYWxsIl0sImV4cCI6MTU1MzE2MTA5NSwiYXV0aG9yaXRpZXMiOlsiUk9MRV9VU0VSIl0sImp0aSI6IjE0YmMyYjAyLTgxY2UtNDFiNC04ZTI3LTA5YWE0ZmU4ZWMwYyIsImNsaWVudF9pZCI6ImJsYWRlIn0.jTmioQDq-fSNNn7YCwl3wP0JE-etSWtzLDe545mDbP4
 2. 调用 http://localhost/blade-auth/oauth/user-info 既可获得对应用户信息

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

@@ -31,8 +31,8 @@ import org.springframework.cloud.client.SpringCloudApplication;
 @SpringCloudApplication
 public class AuthApplication {
 
-	public static void main(String[] args) {
-		BladeApplication.run(AppConstant.APPLICATION_AUTH_NAME, AuthApplication.class, args);
-	}
+    public static void main(String[] args) {
+        BladeApplication.run(AppConstant.APPLICATION_AUTH_NAME, AuthApplication.class, args);
+    }
 
 }

+ 60 - 60
blade-auth/src/main/java/org/springblade/auth/config/BladeAuthorizationServerConfiguration.java

@@ -54,64 +54,64 @@ import java.util.List;
 @EnableAuthorizationServer
 public class BladeAuthorizationServerConfiguration extends AuthorizationServerConfigurerAdapter {
 
-	private final DataSource dataSource;
-
-	private final AuthenticationManager authenticationManager;
-
-	private final UserDetailsService userDetailsService;
-
-	private final TokenStore tokenStore;
-
-	private final TokenEnhancer jwtTokenEnhancer;
-
-	private final JwtAccessTokenConverter jwtAccessTokenConverter;
-
-	private final BladeRedis bladeRedis;
-
-	private final IUserClient userClient;
-
-	private final SocialProperties socialProperties;
-
-	@Override
-	public void configure(AuthorizationServerEndpointsConfigurer endpoints) {
-		//获取自定义tokenGranter
-		TokenGranter tokenGranter = BladeTokenGranter.getTokenGranter(authenticationManager, endpoints, bladeRedis, userClient, socialProperties);
-
-		//配置端点
-		endpoints.tokenStore(tokenStore)
-			.authenticationManager(authenticationManager)
-			.userDetailsService(userDetailsService)
-			.tokenGranter(tokenGranter);
-
-		//扩展token返回结果
-		if (jwtAccessTokenConverter != null && jwtTokenEnhancer != null) {
-			TokenEnhancerChain tokenEnhancerChain = new TokenEnhancerChain();
-			List<TokenEnhancer> enhancerList = new ArrayList<>();
-			enhancerList.add(jwtTokenEnhancer);
-			enhancerList.add(jwtAccessTokenConverter);
-			tokenEnhancerChain.setTokenEnhancers(enhancerList);
-			//jwt增强
-			endpoints.tokenEnhancer(tokenEnhancerChain).accessTokenConverter(jwtAccessTokenConverter);
-		}
-	}
-
-	/**
-	 * 配置客户端信息
-	 */
-	@Override
-	@SneakyThrows
-	public void configure(ClientDetailsServiceConfigurer clients) {
-		BladeClientDetailsServiceImpl clientDetailsService = new BladeClientDetailsServiceImpl(dataSource);
-		clientDetailsService.setSelectClientDetailsSql(AuthConstant.DEFAULT_SELECT_STATEMENT);
-		clientDetailsService.setFindClientDetailsSql(AuthConstant.DEFAULT_FIND_STATEMENT);
-		clients.withClientDetails(clientDetailsService);
-	}
-
-	@Override
-	public void configure(AuthorizationServerSecurityConfigurer oauthServer) {
-		oauthServer
-			.allowFormAuthenticationForClients()
-			.tokenKeyAccess("permitAll()")
-			.checkTokenAccess("isAuthenticated()");
-	}
+    private final DataSource dataSource;
+
+    private final AuthenticationManager authenticationManager;
+
+    private final UserDetailsService userDetailsService;
+
+    private final TokenStore tokenStore;
+
+    private final TokenEnhancer jwtTokenEnhancer;
+
+    private final JwtAccessTokenConverter jwtAccessTokenConverter;
+
+    private final BladeRedis bladeRedis;
+
+    private final IUserClient userClient;
+
+    private final SocialProperties socialProperties;
+
+    @Override
+    public void configure(AuthorizationServerEndpointsConfigurer endpoints) {
+        //获取自定义tokenGranter
+        TokenGranter tokenGranter = BladeTokenGranter.getTokenGranter(authenticationManager, endpoints, bladeRedis, userClient, socialProperties);
+
+        //配置端点
+        endpoints.tokenStore(tokenStore)
+                .authenticationManager(authenticationManager)
+                .userDetailsService(userDetailsService)
+                .tokenGranter(tokenGranter);
+
+        //扩展token返回结果
+        if (jwtAccessTokenConverter != null && jwtTokenEnhancer != null) {
+            TokenEnhancerChain tokenEnhancerChain = new TokenEnhancerChain();
+            List<TokenEnhancer> enhancerList = new ArrayList<>();
+            enhancerList.add(jwtTokenEnhancer);
+            enhancerList.add(jwtAccessTokenConverter);
+            tokenEnhancerChain.setTokenEnhancers(enhancerList);
+            //jwt增强
+            endpoints.tokenEnhancer(tokenEnhancerChain).accessTokenConverter(jwtAccessTokenConverter);
+        }
+    }
+
+    /**
+     * 配置客户端信息
+     */
+    @Override
+    @SneakyThrows
+    public void configure(ClientDetailsServiceConfigurer clients) {
+        BladeClientDetailsServiceImpl clientDetailsService = new BladeClientDetailsServiceImpl(dataSource);
+        clientDetailsService.setSelectClientDetailsSql(AuthConstant.DEFAULT_SELECT_STATEMENT);
+        clientDetailsService.setFindClientDetailsSql(AuthConstant.DEFAULT_FIND_STATEMENT);
+        clients.withClientDetails(clientDetailsService);
+    }
+
+    @Override
+    public void configure(AuthorizationServerSecurityConfigurer oauthServer) {
+        oauthServer
+                .allowFormAuthenticationForClients()
+                .tokenKeyAccess("permitAll()")
+                .checkTokenAccess("isAuthenticated()");
+    }
 }

+ 22 - 22
blade-auth/src/main/java/org/springblade/auth/config/BladeResourceServerConfiguration.java

@@ -33,27 +33,27 @@ import org.springframework.security.oauth2.config.annotation.web.configuration.R
 @EnableResourceServer
 public class BladeResourceServerConfiguration extends ResourceServerConfigurerAdapter {
 
-	@Override
-	@SneakyThrows
-	public void configure(HttpSecurity http) {
-		http.headers().frameOptions().disable();
-		http.formLogin()
-			.and()
-			.authorizeRequests()
-			.antMatchers(
-				"/actuator/**",
-				"/oauth/captcha",
-				"/oauth/logout",
-				"/oauth/clear-cache",
-				"/oauth/render/**",
-				"/oauth/callback/**",
-				"/oauth/revoke/**",
-				"/oauth/refresh/**",
-				"/token/**",
-				"/mobile/**",
-				"/v2/api-docs").permitAll()
-			.anyRequest().authenticated().and()
-			.csrf().disable();
-	}
+    @Override
+    @SneakyThrows
+    public void configure(HttpSecurity http) {
+        http.headers().frameOptions().disable();
+        http.formLogin()
+                .and()
+                .authorizeRequests()
+                .antMatchers(
+                        "/actuator/**",
+                        "/oauth/captcha",
+                        "/oauth/logout",
+                        "/oauth/clear-cache",
+                        "/oauth/render/**",
+                        "/oauth/callback/**",
+                        "/oauth/revoke/**",
+                        "/oauth/refresh/**",
+                        "/token/**",
+                        "/mobile/**",
+                        "/v2/api-docs").permitAll()
+                .anyRequest().authenticated().and()
+                .csrf().disable();
+    }
 
 }

+ 24 - 24
blade-auth/src/main/java/org/springblade/auth/config/JwtTokenStoreConfiguration.java

@@ -36,31 +36,31 @@ import org.springframework.security.oauth2.provider.token.store.JwtTokenStore;
 @ConditionalOnProperty(prefix = "blade.security.oauth2", name = "storeType", havingValue = "jwt", matchIfMissing = true)
 public class JwtTokenStoreConfiguration {
 
-	/**
-	 * 使用jwtTokenStore存储token
-	 */
-	@Bean
-	public TokenStore jwtTokenStore(JwtProperties jwtProperties) {
-		return new JwtTokenStore(jwtAccessTokenConverter(jwtProperties));
-	}
+    /**
+     * 使用jwtTokenStore存储token
+     */
+    @Bean
+    public TokenStore jwtTokenStore(JwtProperties jwtProperties) {
+        return new JwtTokenStore(jwtAccessTokenConverter(jwtProperties));
+    }
 
-	/**
-	 * 用于生成jwt
-	 */
-	@Bean
-	public JwtAccessTokenConverter jwtAccessTokenConverter(JwtProperties jwtProperties) {
-		JwtAccessTokenConverter accessTokenConverter = new JwtAccessTokenConverter();
-		accessTokenConverter.setSigningKey(jwtProperties.getSignKey());
-		return accessTokenConverter;
-	}
+    /**
+     * 用于生成jwt
+     */
+    @Bean
+    public JwtAccessTokenConverter jwtAccessTokenConverter(JwtProperties jwtProperties) {
+        JwtAccessTokenConverter accessTokenConverter = new JwtAccessTokenConverter();
+        accessTokenConverter.setSigningKey(jwtProperties.getSignKey());
+        return accessTokenConverter;
+    }
 
-	/**
-	 * 用于扩展jwt
-	 */
-	@Bean
-	@ConditionalOnMissingBean(name = "jwtTokenEnhancer")
-	public TokenEnhancer jwtTokenEnhancer(JwtAccessTokenConverter jwtAccessTokenConverter, JwtProperties jwtProperties) {
-		return new BladeJwtTokenEnhancer(jwtAccessTokenConverter, jwtProperties);
-	}
+    /**
+     * 用于扩展jwt
+     */
+    @Bean
+    @ConditionalOnMissingBean(name = "jwtTokenEnhancer")
+    public TokenEnhancer jwtTokenEnhancer(JwtAccessTokenConverter jwtAccessTokenConverter, JwtProperties jwtProperties) {
+        return new BladeJwtTokenEnhancer(jwtAccessTokenConverter, jwtProperties);
+    }
 
 }

+ 15 - 15
blade-auth/src/main/java/org/springblade/auth/config/SecurityConfiguration.java

@@ -35,22 +35,22 @@ import org.springframework.security.crypto.password.PasswordEncoder;
 @AllArgsConstructor
 public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
 
-	@Bean
-	@Override
-	@SneakyThrows
-	public AuthenticationManager authenticationManagerBean() {
-		return super.authenticationManagerBean();
-	}
+    @Bean
+    @Override
+    @SneakyThrows
+    public AuthenticationManager authenticationManagerBean() {
+        return super.authenticationManagerBean();
+    }
 
-	@Bean
-	public PasswordEncoder passwordEncoder() {
-		return BladePasswordEncoderFactories.createDelegatingPasswordEncoder();
-	}
+    @Bean
+    public PasswordEncoder passwordEncoder() {
+        return BladePasswordEncoderFactories.createDelegatingPasswordEncoder();
+    }
 
-	@Override
-	@SneakyThrows
-	protected void configure(HttpSecurity http) {
-		http.httpBasic().and().csrf().disable().authorizeRequests().anyRequest().fullyAuthenticated();
-	}
+    @Override
+    @SneakyThrows
+    protected void configure(HttpSecurity http) {
+        http.httpBasic().and().csrf().disable().authorizeRequests().anyRequest().fullyAuthenticated();
+    }
 
 }

+ 22 - 22
blade-auth/src/main/java/org/springblade/auth/constant/AuthConstant.java

@@ -23,31 +23,31 @@ package org.springblade.auth.constant;
  */
 public interface AuthConstant {
 
-	/**
-	 * 密码加密规则
-	 */
-	String ENCRYPT = "{blade}";
+    /**
+     * 密码加密规则
+     */
+    String ENCRYPT = "{blade}";
 
-	/**
-	 * blade_client表字段
-	 */
-	String CLIENT_FIELDS = "client_id, CONCAT('{noop}',client_secret) as client_secret, resource_ids, scope, authorized_grant_types, " +
-		"web_server_redirect_uri, authorities, access_token_validity, " +
-		"refresh_token_validity, additional_information, autoapprove";
+    /**
+     * blade_client表字段
+     */
+    String CLIENT_FIELDS = "client_id, CONCAT('{noop}',client_secret) as client_secret, resource_ids, scope, authorized_grant_types, " +
+            "web_server_redirect_uri, authorities, access_token_validity, " +
+            "refresh_token_validity, additional_information, autoapprove";
 
-	/**
-	 * blade_client查询语句
-	 */
-	String BASE_STATEMENT = "select " + CLIENT_FIELDS + " from blade_client";
+    /**
+     * blade_client查询语句
+     */
+    String BASE_STATEMENT = "select " + CLIENT_FIELDS + " from blade_client";
 
-	/**
-	 * blade_client查询排序
-	 */
-	String DEFAULT_FIND_STATEMENT = BASE_STATEMENT + " order by client_id";
+    /**
+     * blade_client查询排序
+     */
+    String DEFAULT_FIND_STATEMENT = BASE_STATEMENT + " order by client_id";
 
-	/**
-	 * 查询client_id
-	 */
-	String DEFAULT_SELECT_STATEMENT = BASE_STATEMENT + " where client_id = ?";
+    /**
+     * 查询client_id
+     */
+    String DEFAULT_SELECT_STATEMENT = BASE_STATEMENT + " where client_id = ?";
 
 }

+ 34 - 34
blade-auth/src/main/java/org/springblade/auth/endpoint/BladeSocialEndpoint.java

@@ -45,44 +45,44 @@ import java.io.IOException;
 @ConditionalOnProperty(value = "social.enabled", havingValue = "true")
 public class BladeSocialEndpoint {
 
-	private final SocialProperties socialProperties;
+    private final SocialProperties socialProperties;
 
-	/**
-	 * 授权完毕跳转
-	 */
-	@RequestMapping("/oauth/render/{source}")
-	public void renderAuth(@PathVariable("source") String source, HttpServletResponse response) throws IOException {
-		AuthRequest authRequest = SocialUtil.getAuthRequest(source, socialProperties);
-		String authorizeUrl = authRequest.authorize(AuthStateUtils.createState());
-		response.sendRedirect(authorizeUrl);
-	}
+    /**
+     * 授权完毕跳转
+     */
+    @RequestMapping("/oauth/render/{source}")
+    public void renderAuth(@PathVariable("source") String source, HttpServletResponse response) throws IOException {
+        AuthRequest authRequest = SocialUtil.getAuthRequest(source, socialProperties);
+        String authorizeUrl = authRequest.authorize(AuthStateUtils.createState());
+        response.sendRedirect(authorizeUrl);
+    }
 
-	/**
-	 * 获取认证信息
-	 */
-	@RequestMapping("/oauth/callback/{source}")
-	public Object login(@PathVariable("source") String source, AuthCallback callback) {
-		AuthRequest authRequest = SocialUtil.getAuthRequest(source, socialProperties);
-		return authRequest.login(callback);
-	}
+    /**
+     * 获取认证信息
+     */
+    @RequestMapping("/oauth/callback/{source}")
+    public Object login(@PathVariable("source") String source, AuthCallback callback) {
+        AuthRequest authRequest = SocialUtil.getAuthRequest(source, socialProperties);
+        return authRequest.login(callback);
+    }
 
-	/**
-	 * 撤销授权
-	 */
-	@RequestMapping("/oauth/revoke/{source}/{token}")
-	public Object revokeAuth(@PathVariable("source") String source, @PathVariable("token") String token) {
-		AuthRequest authRequest = SocialUtil.getAuthRequest(source, socialProperties);
-		return authRequest.revoke(AuthToken.builder().accessToken(token).build());
-	}
+    /**
+     * 撤销授权
+     */
+    @RequestMapping("/oauth/revoke/{source}/{token}")
+    public Object revokeAuth(@PathVariable("source") String source, @PathVariable("token") String token) {
+        AuthRequest authRequest = SocialUtil.getAuthRequest(source, socialProperties);
+        return authRequest.revoke(AuthToken.builder().accessToken(token).build());
+    }
 
-	/**
-	 * 续期令牌
-	 */
-	@RequestMapping("/oauth/refresh/{source}")
-	public Object refreshAuth(@PathVariable("source") String source, String token) {
-		AuthRequest authRequest = SocialUtil.getAuthRequest(source, socialProperties);
-		return authRequest.refresh(AuthToken.builder().refreshToken(token).build());
-	}
+    /**
+     * 续期令牌
+     */
+    @RequestMapping("/oauth/refresh/{source}")
+    public Object refreshAuth(@PathVariable("source") String source, String token) {
+        AuthRequest authRequest = SocialUtil.getAuthRequest(source, socialProperties);
+        return authRequest.refresh(AuthToken.builder().refreshToken(token).build());
+    }
 
 
 }

+ 41 - 41
blade-auth/src/main/java/org/springblade/auth/endpoint/BladeTokenEndPoint.java

@@ -51,50 +51,50 @@ import static org.springblade.core.cache.constant.CacheConstant.*;
 @AllArgsConstructor
 public class BladeTokenEndPoint {
 
-	private final BladeRedis bladeRedis;
-	private final JwtProperties jwtProperties;
+    private final BladeRedis bladeRedis;
+    private final JwtProperties jwtProperties;
 
-	@GetMapping("/oauth/user-info")
-	public R<Authentication> currentUser(Authentication authentication) {
-		return R.data(authentication);
-	}
+    @GetMapping("/oauth/user-info")
+    public R<Authentication> currentUser(Authentication authentication) {
+        return R.data(authentication);
+    }
 
-	@GetMapping("/oauth/captcha")
-	public Kv captcha() {
-		SpecCaptcha specCaptcha = new SpecCaptcha(130, 48, 5);
-		String verCode = specCaptcha.text().toLowerCase();
-		String key = StringUtil.randomUUID();
-		// 存入redis并设置过期时间为30分钟
-		bladeRedis.setEx(CacheNames.CAPTCHA_KEY + key, verCode, Duration.ofMinutes(30));
-		// 将key和base64返回给前端
-		return Kv.create().set("key", key).set("image", specCaptcha.toBase64());
-	}
+    @GetMapping("/oauth/captcha")
+    public Kv captcha() {
+        SpecCaptcha specCaptcha = new SpecCaptcha(130, 48, 5);
+        String verCode = specCaptcha.text().toLowerCase();
+        String key = StringUtil.randomUUID();
+        // 存入redis并设置过期时间为30分钟
+        bladeRedis.setEx(CacheNames.CAPTCHA_KEY + key, verCode, Duration.ofMinutes(30));
+        // 将key和base64返回给前端
+        return Kv.create().set("key", key).set("image", specCaptcha.toBase64());
+    }
 
-	@GetMapping("/oauth/logout")
-	public Kv logout() {
-		BladeUser user = AuthUtil.getUser();
-		if (user != null && jwtProperties.getState()) {
-			String token = JwtUtil.getToken(WebUtil.getRequest().getHeader(TokenConstant.HEADER));
-			JwtUtil.removeAccessToken(user.getTenantId(), String.valueOf(user.getUserId()), token);
-		}
-		return Kv.create().set("success", "true").set("msg", "success");
-	}
+    @GetMapping("/oauth/logout")
+    public Kv logout() {
+        BladeUser user = AuthUtil.getUser();
+        if (user != null && jwtProperties.getState()) {
+            String token = JwtUtil.getToken(WebUtil.getRequest().getHeader(TokenConstant.HEADER));
+            JwtUtil.removeAccessToken(user.getTenantId(), String.valueOf(user.getUserId()), token);
+        }
+        return Kv.create().set("success", "true").set("msg", "success");
+    }
 
-	@GetMapping("/oauth/clear-cache")
-	public Kv clearCache() {
-		CacheUtil.clear(BIZ_CACHE);
-		CacheUtil.clear(USER_CACHE);
-		CacheUtil.clear(DICT_CACHE);
-		CacheUtil.clear(FLOW_CACHE);
-		CacheUtil.clear(SYS_CACHE);
-		CacheUtil.clear(PARAM_CACHE);
-		CacheUtil.clear(RESOURCE_CACHE);
-		CacheUtil.clear(MENU_CACHE);
-		CacheUtil.clear(DICT_CACHE, Boolean.FALSE);
-		CacheUtil.clear(MENU_CACHE, Boolean.FALSE);
-		CacheUtil.clear(SYS_CACHE, Boolean.FALSE);
-		CacheUtil.clear(PARAM_CACHE, Boolean.FALSE);
-		return Kv.create().set("success", "true").set("msg", "success");
-	}
+    @GetMapping("/oauth/clear-cache")
+    public Kv clearCache() {
+        CacheUtil.clear(BIZ_CACHE);
+        CacheUtil.clear(USER_CACHE);
+        CacheUtil.clear(DICT_CACHE);
+        CacheUtil.clear(FLOW_CACHE);
+        CacheUtil.clear(SYS_CACHE);
+        CacheUtil.clear(PARAM_CACHE);
+        CacheUtil.clear(RESOURCE_CACHE);
+        CacheUtil.clear(MENU_CACHE);
+        CacheUtil.clear(DICT_CACHE, Boolean.FALSE);
+        CacheUtil.clear(MENU_CACHE, Boolean.FALSE);
+        CacheUtil.clear(SYS_CACHE, Boolean.FALSE);
+        CacheUtil.clear(PARAM_CACHE, Boolean.FALSE);
+        return Kv.create().set("success", "true").set("msg", "success");
+    }
 
 }

+ 13 - 13
blade-auth/src/main/java/org/springblade/auth/granter/BladeTokenGranter.java

@@ -35,18 +35,18 @@ import java.util.List;
  */
 public class BladeTokenGranter {
 
-	/**
-	 * 自定义tokenGranter
-	 */
-	public static TokenGranter getTokenGranter(final AuthenticationManager authenticationManager, final AuthorizationServerEndpointsConfigurer endpoints, BladeRedis bladeRedis, IUserClient userClient, SocialProperties socialProperties) {
-		// 默认tokenGranter集合
-		List<TokenGranter> granters = new ArrayList<>(Collections.singletonList(endpoints.getTokenGranter()));
-		// 增加验证码模式
-		granters.add(new CaptchaTokenGranter(authenticationManager, endpoints.getTokenServices(), endpoints.getClientDetailsService(), endpoints.getOAuth2RequestFactory(), bladeRedis));
-		// 增加第三方登陆模式
-		granters.add(new SocialTokenGranter(endpoints.getTokenServices(), endpoints.getClientDetailsService(), endpoints.getOAuth2RequestFactory(), userClient, socialProperties));
-		// 组合tokenGranter集合
-		return new CompositeTokenGranter(granters);
-	}
+    /**
+     * 自定义tokenGranter
+     */
+    public static TokenGranter getTokenGranter(final AuthenticationManager authenticationManager, final AuthorizationServerEndpointsConfigurer endpoints, BladeRedis bladeRedis, IUserClient userClient, SocialProperties socialProperties) {
+        // 默认tokenGranter集合
+        List<TokenGranter> granters = new ArrayList<>(Collections.singletonList(endpoints.getTokenGranter()));
+        // 增加验证码模式
+        granters.add(new CaptchaTokenGranter(authenticationManager, endpoints.getTokenServices(), endpoints.getClientDetailsService(), endpoints.getOAuth2RequestFactory(), bladeRedis));
+        // 增加第三方登陆模式
+        granters.add(new SocialTokenGranter(endpoints.getTokenServices(), endpoints.getClientDetailsService(), endpoints.getOAuth2RequestFactory(), userClient, socialProperties));
+        // 组合tokenGranter集合
+        return new CompositeTokenGranter(granters);
+    }
 
 }

+ 45 - 46
blade-auth/src/main/java/org/springblade/auth/granter/CaptchaTokenGranter.java

@@ -24,59 +24,58 @@ import java.util.Map;
  */
 public class CaptchaTokenGranter extends AbstractTokenGranter {
 
-	private static final String GRANT_TYPE = "captcha";
+    private static final String GRANT_TYPE = "captcha";
 
-	private final AuthenticationManager authenticationManager;
+    private final AuthenticationManager authenticationManager;
 
-	private BladeRedis bladeRedis;
+    private BladeRedis bladeRedis;
 
-	public CaptchaTokenGranter(AuthenticationManager authenticationManager,
-							   AuthorizationServerTokenServices tokenServices, ClientDetailsService clientDetailsService, OAuth2RequestFactory requestFactory, BladeRedis bladeRedis) {
-		this(authenticationManager, tokenServices, clientDetailsService, requestFactory, GRANT_TYPE);
-		this.bladeRedis = bladeRedis;
-	}
+    public CaptchaTokenGranter(AuthenticationManager authenticationManager,
+                               AuthorizationServerTokenServices tokenServices, ClientDetailsService clientDetailsService, OAuth2RequestFactory requestFactory, BladeRedis bladeRedis) {
+        this(authenticationManager, tokenServices, clientDetailsService, requestFactory, GRANT_TYPE);
+        this.bladeRedis = bladeRedis;
+    }
 
-	protected CaptchaTokenGranter(AuthenticationManager authenticationManager, AuthorizationServerTokenServices tokenServices,
-												ClientDetailsService clientDetailsService, OAuth2RequestFactory requestFactory, String grantType) {
-		super(tokenServices, clientDetailsService, requestFactory, grantType);
-		this.authenticationManager = authenticationManager;
-	}
+    protected CaptchaTokenGranter(AuthenticationManager authenticationManager, AuthorizationServerTokenServices tokenServices,
+                                  ClientDetailsService clientDetailsService, OAuth2RequestFactory requestFactory, String grantType) {
+        super(tokenServices, clientDetailsService, requestFactory, grantType);
+        this.authenticationManager = authenticationManager;
+    }
 
-	@Override
-	protected OAuth2Authentication getOAuth2Authentication(ClientDetails client, TokenRequest tokenRequest) {
-		HttpServletRequest request = WebUtil.getRequest();
-		// 增加验证码判断
-		String key = request.getHeader(TokenUtil.CAPTCHA_HEADER_KEY);
-		String code = request.getHeader(TokenUtil.CAPTCHA_HEADER_CODE);
-		// 获取验证码
-		String redisCode = bladeRedis.get(CacheNames.CAPTCHA_KEY + key);
-		// 判断验证码
-		if (code == null || !StringUtil.equalsIgnoreCase(redisCode, code)) {
-			throw new UserDeniedAuthorizationException(TokenUtil.CAPTCHA_NOT_CORRECT);
-		}
+    @Override
+    protected OAuth2Authentication getOAuth2Authentication(ClientDetails client, TokenRequest tokenRequest) {
+        HttpServletRequest request = WebUtil.getRequest();
+        // 增加验证码判断
+        String key = request.getHeader(TokenUtil.CAPTCHA_HEADER_KEY);
+        String code = request.getHeader(TokenUtil.CAPTCHA_HEADER_CODE);
+        // 获取验证码
+        String redisCode = bladeRedis.get(CacheNames.CAPTCHA_KEY + key);
+        // 判断验证码
+        if (code == null || !StringUtil.equalsIgnoreCase(redisCode, code)) {
+            throw new UserDeniedAuthorizationException(TokenUtil.CAPTCHA_NOT_CORRECT);
+        }
 
-		Map<String, String> parameters = new LinkedHashMap<String, String>(tokenRequest.getRequestParameters());
-		String username = parameters.get("username");
-		String password = parameters.get("password");
-		// Protect from downstream leaks of password
-		parameters.remove("password");
+        Map<String, String> parameters = new LinkedHashMap<String, String>(tokenRequest.getRequestParameters());
+        String username = parameters.get("username");
+        String password = parameters.get("password");
+        // Protect from downstream leaks of password
+        parameters.remove("password");
 
-		Authentication userAuth = new UsernamePasswordAuthenticationToken(username, password);
-		((AbstractAuthenticationToken) userAuth).setDetails(parameters);
-		try {
-			userAuth = authenticationManager.authenticate(userAuth);
-		}
-		catch (AccountStatusException | BadCredentialsException ase) {
-			//covers expired, locked, disabled cases (mentioned in section 5.2, draft 31)
-			throw new InvalidGrantException(ase.getMessage());
-		}
-		// If the username/password are wrong the spec says we should send 400/invalid grant
+        Authentication userAuth = new UsernamePasswordAuthenticationToken(username, password);
+        ((AbstractAuthenticationToken) userAuth).setDetails(parameters);
+        try {
+            userAuth = authenticationManager.authenticate(userAuth);
+        } catch (AccountStatusException | BadCredentialsException ase) {
+            //covers expired, locked, disabled cases (mentioned in section 5.2, draft 31)
+            throw new InvalidGrantException(ase.getMessage());
+        }
+        // If the username/password are wrong the spec says we should send 400/invalid grant
 
-		if (userAuth == null || !userAuth.isAuthenticated()) {
-			throw new InvalidGrantException("Could not authenticate user: " + username);
-		}
+        if (userAuth == null || !userAuth.isAuthenticated()) {
+            throw new InvalidGrantException("Could not authenticate user: " + username);
+        }
 
-		OAuth2Request storedOAuth2Request = getRequestFactory().createOAuth2Request(client, tokenRequest);
-		return new OAuth2Authentication(storedOAuth2Request, userAuth);
-	}
+        OAuth2Request storedOAuth2Request = getRequestFactory().createOAuth2Request(client, tokenRequest);
+        return new OAuth2Authentication(storedOAuth2Request, userAuth);
+    }
 }

+ 63 - 63
blade-auth/src/main/java/org/springblade/auth/granter/SocialTokenGranter.java

@@ -54,77 +54,77 @@ import java.util.Objects;
  * @author Chill
  */
 public class SocialTokenGranter extends AbstractTokenGranter {
-	private static final String GRANT_TYPE = "social";
-	private static final Integer AUTH_SUCCESS_CODE = 2000;
+    private static final String GRANT_TYPE = "social";
+    private static final Integer AUTH_SUCCESS_CODE = 2000;
 
-	private final IUserClient userClient;
-	private final SocialProperties socialProperties;
+    private final IUserClient userClient;
+    private final SocialProperties socialProperties;
 
-	protected SocialTokenGranter(AuthorizationServerTokenServices tokenServices, ClientDetailsService clientDetailsService, OAuth2RequestFactory requestFactory, IUserClient userClient, SocialProperties socialProperties) {
-		super(tokenServices, clientDetailsService, requestFactory, GRANT_TYPE);
-		this.userClient = userClient;
-		this.socialProperties = socialProperties;
-	}
+    protected SocialTokenGranter(AuthorizationServerTokenServices tokenServices, ClientDetailsService clientDetailsService, OAuth2RequestFactory requestFactory, IUserClient userClient, SocialProperties socialProperties) {
+        super(tokenServices, clientDetailsService, requestFactory, GRANT_TYPE);
+        this.userClient = userClient;
+        this.socialProperties = socialProperties;
+    }
 
-	@Override
-	protected OAuth2Authentication getOAuth2Authentication(ClientDetails client, TokenRequest tokenRequest) {
-		// 请求头租户信息
-		HttpServletRequest request = WebUtil.getRequest();
-		String tenantId = Func.toStr(request.getHeader(TokenUtil.TENANT_HEADER_KEY), TokenUtil.DEFAULT_TENANT_ID);
+    @Override
+    protected OAuth2Authentication getOAuth2Authentication(ClientDetails client, TokenRequest tokenRequest) {
+        // 请求头租户信息
+        HttpServletRequest request = WebUtil.getRequest();
+        String tenantId = Func.toStr(request.getHeader(TokenUtil.TENANT_HEADER_KEY), TokenUtil.DEFAULT_TENANT_ID);
 
-		Map<String, String> parameters = new LinkedHashMap<>(tokenRequest.getRequestParameters());
-		// 开放平台来源
-		String sourceParameter = parameters.get("source");
-		// 匹配是否有别名定义
-		String source = socialProperties.getAlias().getOrDefault(sourceParameter, sourceParameter);
-		// 开放平台授权码
-		String code = parameters.get("code");
-		// 开放平台状态吗
-		String state = parameters.get("state");
+        Map<String, String> parameters = new LinkedHashMap<>(tokenRequest.getRequestParameters());
+        // 开放平台来源
+        String sourceParameter = parameters.get("source");
+        // 匹配是否有别名定义
+        String source = socialProperties.getAlias().getOrDefault(sourceParameter, sourceParameter);
+        // 开放平台授权码
+        String code = parameters.get("code");
+        // 开放平台状态吗
+        String state = parameters.get("state");
 
-		// 获取开放平台授权数据
-		AuthRequest authRequest = SocialUtil.getAuthRequest(source, socialProperties);
-		AuthCallback authCallback = new AuthCallback();
-		authCallback.setCode(code);
-		authCallback.setState(state);
-		AuthResponse authResponse = authRequest.login(authCallback);
-		AuthUser authUser;
-		if (authResponse.getCode() == AUTH_SUCCESS_CODE) {
-			authUser = (AuthUser) authResponse.getData();
-		} else {
-			throw new InvalidGrantException("social grant failure, auth response is not success");
-		}
+        // 获取开放平台授权数据
+        AuthRequest authRequest = SocialUtil.getAuthRequest(source, socialProperties);
+        AuthCallback authCallback = new AuthCallback();
+        authCallback.setCode(code);
+        authCallback.setState(state);
+        AuthResponse authResponse = authRequest.login(authCallback);
+        AuthUser authUser;
+        if (authResponse.getCode() == AUTH_SUCCESS_CODE) {
+            authUser = (AuthUser) authResponse.getData();
+        } else {
+            throw new InvalidGrantException("social grant failure, auth response is not success");
+        }
 
-		// 组装数据
-		UserOauth userOauth = Objects.requireNonNull(BeanUtil.copy(authUser, UserOauth.class));
-		userOauth.setSource(authUser.getSource());
-		userOauth.setTenantId(tenantId);
-		userOauth.setUuid(authUser.getUuid());
+        // 组装数据
+        UserOauth userOauth = Objects.requireNonNull(BeanUtil.copy(authUser, UserOauth.class));
+        userOauth.setSource(authUser.getSource());
+        userOauth.setTenantId(tenantId);
+        userOauth.setUuid(authUser.getUuid());
 
-		// 远程调用,获取认证信息
-		R<UserInfo> result = userClient.userAuthInfo(userOauth);
-		BladeUserDetails bladeUserDetails;
-		if (result.isSuccess()) {
-			User user = result.getData().getUser();
-			Kv detail = result.getData().getDetail();
-			if (user == null || user.getId() == null) {
-				throw new InvalidGrantException("social grant failure, user is null");
-			}
-			bladeUserDetails = new BladeUserDetails(user.getId(),user.getPhone(),
-				tenantId, result.getData().getOauthId(), user.getName(), user.getRealName(), user.getDeptId(), user.getPostId(), user.getRoleId(), Func.join(result.getData().getRoles()), Func.toStr(userOauth.getAvatar(), TokenUtil.DEFAULT_AVATAR),
-				userOauth.getUsername(), AuthConstant.ENCRYPT + user.getPassword(), detail, true, true, true, true,
-				AuthorityUtils.commaSeparatedStringToAuthorityList(Func.join(result.getData().getRoles())));
-		} else {
-			throw new InvalidGrantException("social grant failure, feign client return error");
-		}
+        // 远程调用,获取认证信息
+        R<UserInfo> result = userClient.userAuthInfo(userOauth);
+        BladeUserDetails bladeUserDetails;
+        if (result.isSuccess()) {
+            User user = result.getData().getUser();
+            Kv detail = result.getData().getDetail();
+            if (user == null || user.getId() == null) {
+                throw new InvalidGrantException("social grant failure, user is null");
+            }
+            bladeUserDetails = new BladeUserDetails(user.getId(), user.getPhone(),
+                    tenantId, result.getData().getOauthId(), user.getName(), user.getRealName(), user.getDeptId(), user.getPostId(), user.getRoleId(), Func.join(result.getData().getRoles()), Func.toStr(userOauth.getAvatar(), TokenUtil.DEFAULT_AVATAR),
+                    userOauth.getUsername(), AuthConstant.ENCRYPT + user.getPassword(), detail, true, true, true, true,
+                    AuthorityUtils.commaSeparatedStringToAuthorityList(Func.join(result.getData().getRoles())));
+        } else {
+            throw new InvalidGrantException("social grant failure, feign client return error");
+        }
 
-		// 组装认证数据,关闭密码校验
-		Authentication userAuth = new UsernamePasswordAuthenticationToken(bladeUserDetails, null, bladeUserDetails.getAuthorities());
-		((AbstractAuthenticationToken) userAuth).setDetails(parameters);
-		OAuth2Request storedOAuth2Request = getRequestFactory().createOAuth2Request(client, tokenRequest);
+        // 组装认证数据,关闭密码校验
+        Authentication userAuth = new UsernamePasswordAuthenticationToken(bladeUserDetails, null, bladeUserDetails.getAuthorities());
+        ((AbstractAuthenticationToken) userAuth).setDetails(parameters);
+        OAuth2Request storedOAuth2Request = getRequestFactory().createOAuth2Request(client, tokenRequest);
 
-		// 返回 OAuth2Authentication
-		return new OAuth2Authentication(storedOAuth2Request, userAuth);
-	}
+        // 返回 OAuth2Authentication
+        return new OAuth2Authentication(storedOAuth2Request, userAuth);
+    }
 
 }

+ 17 - 17
blade-auth/src/main/java/org/springblade/auth/service/BladeClientDetailsServiceImpl.java

@@ -30,22 +30,22 @@ import javax.sql.DataSource;
 @Component
 public class BladeClientDetailsServiceImpl extends JdbcClientDetailsService {
 
-	public BladeClientDetailsServiceImpl(DataSource dataSource) {
-		super(dataSource);
-	}
+    public BladeClientDetailsServiceImpl(DataSource dataSource) {
+        super(dataSource);
+    }
 
-	/**
-	 * 缓存客户端信息
-	 *
-	 * @param clientId 客户端id
-	 */
-	@Override
-	public ClientDetails loadClientByClientId(String clientId) {
-		try {
-			return super.loadClientByClientId(clientId);
-		} catch (Exception ex) {
-			ex.printStackTrace();
-			return null;
-		}
-	}
+    /**
+     * 缓存客户端信息
+     *
+     * @param clientId 客户端id
+     */
+    @Override
+    public ClientDetails loadClientByClientId(String clientId) {
+        try {
+            return super.loadClientByClientId(clientId);
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            return null;
+        }
+    }
 }

+ 68 - 68
blade-auth/src/main/java/org/springblade/auth/service/BladeUserDetails.java

@@ -31,75 +31,75 @@ import java.util.Collection;
 @Getter
 public class BladeUserDetails extends User {
 
-	/**
-	 * 用户id
-	 */
-	private final Long userId;
-	/**
-	 * 租户ID
-	 */
-	private final String tenantId;
-	/**
-	 * 第三方认证ID
-	 */
-	private final String oauthId;
-	/**
-	 * 昵称
-	 */
-	private final String name;
-	/**
-	 * 真名
-	 */
-	private final String realName;
-	/**
-	 * 账号
-	 */
-	private final String account;
-	/**
-	 * 部门id
-	 */
-	private final String deptId;
-	/**
-	 * 岗位id
-	 */
-	private final String postId;
+    /**
+     * 用户id
+     */
+    private final Long userId;
+    /**
+     * 租户ID
+     */
+    private final String tenantId;
+    /**
+     * 第三方认证ID
+     */
+    private final String oauthId;
+    /**
+     * 昵称
+     */
+    private final String name;
+    /**
+     * 真名
+     */
+    private final String realName;
+    /**
+     * 账号
+     */
+    private final String account;
+    /**
+     * 部门id
+     */
+    private final String deptId;
+    /**
+     * 岗位id
+     */
+    private final String postId;
 
-	/**
-	 * 岗位id
-	 */
-	private final String  phone;
-	/**
-	 * 角色id
-	 */
-	private final String roleId;
-	/**
-	 * 角色名
-	 */
-	private final String roleName;
-	/**
-	 * 头像
-	 */
-	private final String avatar;
-	/**
-	 * 用户详情
-	 */
-	private final Kv detail;
+    /**
+     * 岗位id
+     */
+    private final String phone;
+    /**
+     * 角色id
+     */
+    private final String roleId;
+    /**
+     * 角色名
+     */
+    private final String roleName;
+    /**
+     * 头像
+     */
+    private final String avatar;
+    /**
+     * 用户详情
+     */
+    private final Kv detail;
 
-	public BladeUserDetails(Long userId, String phone,String tenantId, String oauthId, String name, String realName, String deptId, String postId, String roleId, String roleName, String avatar, String username, String password, Kv detail, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) {
-		super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
-		this.userId = userId;
-		this.tenantId = tenantId;
-		this.oauthId = oauthId;
-		this.name = name;
-		this.realName = realName;
-		this.account = username;
-		this.deptId = deptId;
-		this.postId = postId;
-		this.roleId = roleId;
-		this.roleName = roleName;
-		this.avatar = avatar;
-		this.detail = detail;
-		this.phone = phone;
-	}
+    public BladeUserDetails(Long userId, String phone, String tenantId, String oauthId, String name, String realName, String deptId, String postId, String roleId, String roleName, String avatar, String username, String password, Kv detail, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) {
+        super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
+        this.userId = userId;
+        this.tenantId = tenantId;
+        this.oauthId = oauthId;
+        this.name = name;
+        this.realName = realName;
+        this.account = username;
+        this.deptId = deptId;
+        this.postId = postId;
+        this.roleId = roleId;
+        this.roleName = roleName;
+        this.avatar = avatar;
+        this.detail = detail;
+        this.phone = phone;
+    }
 
 }

+ 39 - 39
blade-auth/src/main/java/org/springblade/auth/support/BladeJwtTokenEnhancer.java

@@ -40,49 +40,49 @@ import java.util.Map;
 @AllArgsConstructor
 public class BladeJwtTokenEnhancer implements TokenEnhancer {
 
-	private final JwtAccessTokenConverter jwtAccessTokenConverter;
-	private final JwtProperties jwtProperties;
+    private final JwtAccessTokenConverter jwtAccessTokenConverter;
+    private final JwtProperties jwtProperties;
 
-	@Override
-	public OAuth2AccessToken enhance(OAuth2AccessToken accessToken, OAuth2Authentication authentication) {
-		BladeUserDetails principal = (BladeUserDetails) authentication.getUserAuthentication().getPrincipal();
+    @Override
+    public OAuth2AccessToken enhance(OAuth2AccessToken accessToken, OAuth2Authentication authentication) {
+        BladeUserDetails principal = (BladeUserDetails) authentication.getUserAuthentication().getPrincipal();
 
-		//token参数增强
-		Map<String, Object> info = new HashMap<>(16);
-		info.put(TokenUtil.CLIENT_ID, TokenUtil.getClientIdFromHeader());
-		info.put(TokenUtil.USER_ID, Func.toStr(principal.getUserId()));
-		info.put(TokenUtil.DEPT_ID, Func.toStr(principal.getDeptId()));
-		info.put(TokenUtil.POST_ID, Func.toStr(principal.getPostId()));
-		info.put(TokenUtil.ROLE_ID, Func.toStr(principal.getRoleId()));
-		info.put(TokenUtil.TENANT_ID, principal.getTenantId());
-		info.put(TokenUtil.OAUTH_ID, principal.getOauthId());
-		info.put(TokenUtil.ACCOUNT, principal.getAccount());
-		info.put(TokenUtil.USER_NAME, principal.getUsername());
-		info.put(TokenUtil.NICK_NAME, principal.getName());
-		info.put(TokenUtil.REAL_NAME, principal.getRealName());
-		info.put(TokenUtil.ROLE_NAME, principal.getRoleName());
-		info.put(TokenUtil.AVATAR, principal.getAvatar());
-		info.put(TokenUtil.DETAIL, principal.getDetail());
-		info.put(TokenUtil.LICENSE, TokenUtil.LICENSE_NAME);
-		info.put("phone", principal.getPhone());
+        //token参数增强
+        Map<String, Object> info = new HashMap<>(16);
+        info.put(TokenUtil.CLIENT_ID, TokenUtil.getClientIdFromHeader());
+        info.put(TokenUtil.USER_ID, Func.toStr(principal.getUserId()));
+        info.put(TokenUtil.DEPT_ID, Func.toStr(principal.getDeptId()));
+        info.put(TokenUtil.POST_ID, Func.toStr(principal.getPostId()));
+        info.put(TokenUtil.ROLE_ID, Func.toStr(principal.getRoleId()));
+        info.put(TokenUtil.TENANT_ID, principal.getTenantId());
+        info.put(TokenUtil.OAUTH_ID, principal.getOauthId());
+        info.put(TokenUtil.ACCOUNT, principal.getAccount());
+        info.put(TokenUtil.USER_NAME, principal.getUsername());
+        info.put(TokenUtil.NICK_NAME, principal.getName());
+        info.put(TokenUtil.REAL_NAME, principal.getRealName());
+        info.put(TokenUtil.ROLE_NAME, principal.getRoleName());
+        info.put(TokenUtil.AVATAR, principal.getAvatar());
+        info.put(TokenUtil.DETAIL, principal.getDetail());
+        info.put(TokenUtil.LICENSE, TokenUtil.LICENSE_NAME);
+        info.put("phone", principal.getPhone());
 
-		((DefaultOAuth2AccessToken) accessToken).setAdditionalInformation(info);
+        ((DefaultOAuth2AccessToken) accessToken).setAdditionalInformation(info);
 
-		//token状态设置
-		if (jwtProperties.getState()) {
-			OAuth2AccessToken oAuth2AccessToken = jwtAccessTokenConverter.enhance(accessToken, authentication);
-			String accessTokenValue = oAuth2AccessToken.getValue();
-			String tenantId = principal.getTenantId();
-			String userId = Func.toStr(principal.getUserId());
-			JwtUtil.addAccessToken(tenantId, userId, accessTokenValue, accessToken.getExpiresIn());
+        //token状态设置
+        if (jwtProperties.getState()) {
+            OAuth2AccessToken oAuth2AccessToken = jwtAccessTokenConverter.enhance(accessToken, authentication);
+            String accessTokenValue = oAuth2AccessToken.getValue();
+            String tenantId = principal.getTenantId();
+            String userId = Func.toStr(principal.getUserId());
+            JwtUtil.addAccessToken(tenantId, userId, accessTokenValue, accessToken.getExpiresIn());
 
-			if (jwtProperties.getSingle()) {
-				OAuth2RefreshToken oAuth2RefreshToken = oAuth2AccessToken.getRefreshToken();
-				String refreshTokenValue = oAuth2RefreshToken.getValue();
-				JwtUtil.addRefreshToken(tenantId, userId, refreshTokenValue, accessToken.getExpiresIn() * 168);
-			}
-		}
+            if (jwtProperties.getSingle()) {
+                OAuth2RefreshToken oAuth2RefreshToken = oAuth2AccessToken.getRefreshToken();
+                String refreshTokenValue = oAuth2RefreshToken.getValue();
+                JwtUtil.addRefreshToken(tenantId, userId, refreshTokenValue, accessToken.getExpiresIn() * 168);
+            }
+        }
 
-		return accessToken;
-	}
+        return accessToken;
+    }
 }

+ 21 - 21
blade-auth/src/main/java/org/springblade/auth/support/BladeNoOpPasswordEncoder.java

@@ -25,26 +25,26 @@ import org.springframework.security.crypto.password.PasswordEncoder;
  */
 public class BladeNoOpPasswordEncoder implements PasswordEncoder {
 
-	@Override
-	public String encode(CharSequence rawPassword) {
-		return rawPassword.toString();
-	}
-
-	@Override
-	public boolean matches(CharSequence rawPassword, String encodedPassword) {
-		return rawPassword.toString().equals(encodedPassword);
-	}
-
-	/**
-	 * Get the singleton {@link BladeNoOpPasswordEncoder}.
-	 */
-	public static PasswordEncoder getInstance() {
-		return INSTANCE;
-	}
-
-	private static final PasswordEncoder INSTANCE = new BladeNoOpPasswordEncoder();
-
-	private BladeNoOpPasswordEncoder() {
-	}
+    @Override
+    public String encode(CharSequence rawPassword) {
+        return rawPassword.toString();
+    }
+
+    @Override
+    public boolean matches(CharSequence rawPassword, String encodedPassword) {
+        return rawPassword.toString().equals(encodedPassword);
+    }
+
+    /**
+     * Get the singleton {@link BladeNoOpPasswordEncoder}.
+     */
+    public static PasswordEncoder getInstance() {
+        return INSTANCE;
+    }
+
+    private static final PasswordEncoder INSTANCE = new BladeNoOpPasswordEncoder();
+
+    private BladeNoOpPasswordEncoder() {
+    }
 
 }

+ 8 - 8
blade-auth/src/main/java/org/springblade/auth/support/BladePasswordEncoder.java

@@ -26,14 +26,14 @@ import org.springframework.security.crypto.password.PasswordEncoder;
  */
 public class BladePasswordEncoder implements PasswordEncoder {
 
-	@Override
-	public String encode(CharSequence rawPassword) {
-		return DigestUtil.hex((String) rawPassword);
-	}
+    @Override
+    public String encode(CharSequence rawPassword) {
+        return DigestUtil.hex((String) rawPassword);
+    }
 
-	@Override
-	public boolean matches(CharSequence rawPassword, String encodedPassword) {
-		return encodedPassword.equals(encode(rawPassword));
-	}
+    @Override
+    public boolean matches(CharSequence rawPassword, String encodedPassword) {
+        return encodedPassword.equals(encode(rawPassword));
+    }
 
 }

+ 28 - 28
blade-auth/src/main/java/org/springblade/auth/support/BladePasswordEncoderFactories.java

@@ -32,35 +32,35 @@ import java.util.Map;
  */
 public class BladePasswordEncoderFactories {
 
-	/**
-	 * Creates a {@link DelegatingPasswordEncoder} with default mappings. Additional
-	 * mappings may be added and the encoding will be updated to conform with best
-	 * practices. However, due to the nature of {@link DelegatingPasswordEncoder} the
-	 * updates should not impact users. The mappings current are:
-	 *
-	 * <ul>
-	 * <li>blade - {@link BladePasswordEncoder} (sha1(md5("password")))</li>
-	 * <li>bcrypt - {@link BCryptPasswordEncoder} (Also used for encoding)</li>
-	 * <li>noop - {@link BladeNoOpPasswordEncoder}</li>
-	 * <li>pbkdf2 - {@link Pbkdf2PasswordEncoder}</li>
-	 * <li>scrypt - {@link SCryptPasswordEncoder}</li>
-	 * </ul>
-	 *
-	 * @return the {@link PasswordEncoder} to use
-	 */
-	public static PasswordEncoder createDelegatingPasswordEncoder() {
-		String encodingId = "blade";
-		Map<String, PasswordEncoder> encoders = new HashMap<>(16);
-		encoders.put(encodingId, new BladePasswordEncoder());
-		encoders.put("bcrypt", new BCryptPasswordEncoder());
-		encoders.put("noop", BladeNoOpPasswordEncoder.getInstance());
-		encoders.put("pbkdf2", new Pbkdf2PasswordEncoder());
-		encoders.put("scrypt", new SCryptPasswordEncoder());
+    /**
+     * Creates a {@link DelegatingPasswordEncoder} with default mappings. Additional
+     * mappings may be added and the encoding will be updated to conform with best
+     * practices. However, due to the nature of {@link DelegatingPasswordEncoder} the
+     * updates should not impact users. The mappings current are:
+     *
+     * <ul>
+     * <li>blade - {@link BladePasswordEncoder} (sha1(md5("password")))</li>
+     * <li>bcrypt - {@link BCryptPasswordEncoder} (Also used for encoding)</li>
+     * <li>noop - {@link BladeNoOpPasswordEncoder}</li>
+     * <li>pbkdf2 - {@link Pbkdf2PasswordEncoder}</li>
+     * <li>scrypt - {@link SCryptPasswordEncoder}</li>
+     * </ul>
+     *
+     * @return the {@link PasswordEncoder} to use
+     */
+    public static PasswordEncoder createDelegatingPasswordEncoder() {
+        String encodingId = "blade";
+        Map<String, PasswordEncoder> encoders = new HashMap<>(16);
+        encoders.put(encodingId, new BladePasswordEncoder());
+        encoders.put("bcrypt", new BCryptPasswordEncoder());
+        encoders.put("noop", BladeNoOpPasswordEncoder.getInstance());
+        encoders.put("pbkdf2", new Pbkdf2PasswordEncoder());
+        encoders.put("scrypt", new SCryptPasswordEncoder());
 
-		return new DelegatingPasswordEncoder(encodingId, encoders);
-	}
+        return new DelegatingPasswordEncoder(encodingId, encoders);
+    }
 
-	private BladePasswordEncoderFactories() {
-	}
+    private BladePasswordEncoderFactories() {
+    }
 
 }

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

@@ -23,37 +23,37 @@ package org.springblade.common.cache;
  */
 public interface CacheNames {
 
-	/**
-	 * 返回拼接后的key
-	 *
-	 * @param cacheKey      缓存key
-	 * @param cacheKeyValue 缓存key值
-	 * @return tenantKey
-	 */
-	static String cacheKey(String cacheKey, String cacheKeyValue) {
-		return cacheKey.concat(cacheKeyValue);
-	}
+    /**
+     * 返回拼接后的key
+     *
+     * @param cacheKey      缓存key
+     * @param cacheKeyValue 缓存key值
+     * @return tenantKey
+     */
+    static String cacheKey(String cacheKey, String cacheKeyValue) {
+        return cacheKey.concat(cacheKeyValue);
+    }
 
-	/**
-	 * 返回租户格式的key
-	 *
-	 * @param tenantId      租户编号
-	 * @param cacheKey      缓存key
-	 * @param cacheKeyValue 缓存key值
-	 * @return tenantKey
-	 */
-	static String tenantKey(String tenantId, String cacheKey, String cacheKeyValue) {
-		return tenantId.concat(":").concat(cacheKey).concat(cacheKeyValue);
-	}
+    /**
+     * 返回租户格式的key
+     *
+     * @param tenantId      租户编号
+     * @param cacheKey      缓存key
+     * @param cacheKeyValue 缓存key值
+     * @return tenantKey
+     */
+    static String tenantKey(String tenantId, String cacheKey, String cacheKeyValue) {
+        return tenantId.concat(":").concat(cacheKey).concat(cacheKeyValue);
+    }
 
-	/**
-	 * 验证码key
-	 */
-	String CAPTCHA_KEY = "blade:auth::blade:captcha:";
+    /**
+     * 验证码key
+     */
+    String CAPTCHA_KEY = "blade:auth::blade:captcha:";
 
-	/**
-	 * 登录失败key
-	 */
-	String USER_FAIL_KEY = "blade:user::blade:fail:";
+    /**
+     * 登录失败key
+     */
+    String USER_FAIL_KEY = "blade:user::blade:fail:";
 
 }

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

@@ -23,65 +23,65 @@ package org.springblade.common.constant;
  */
 public interface CommonConstant {
 
-	/**
-	 * sword 系统名
-	 */
-	String SWORD_NAME = "sword";
+    /**
+     * sword 系统名
+     */
+    String SWORD_NAME = "sword";
 
-	/**
-	 * saber 系统名
-	 */
-	String SABER_NAME = "saber";
+    /**
+     * saber 系统名
+     */
+    String SABER_NAME = "saber";
 
-	/**
-	 * 顶级父节点id
-	 */
-	Long TOP_PARENT_ID = 0L;
+    /**
+     * 顶级父节点id
+     */
+    Long TOP_PARENT_ID = 0L;
 
-	/**
-	 * 顶级父节点名称
-	 */
-	String TOP_PARENT_NAME = "顶级";
+    /**
+     * 顶级父节点名称
+     */
+    String TOP_PARENT_NAME = "顶级";
 
-	/**
-	 * 未封存状态值
-	 */
-	Integer NOT_SEALED_ID = 0;
+    /**
+     * 未封存状态值
+     */
+    Integer NOT_SEALED_ID = 0;
 
-	/**
-	 * 默认密码
-	 */
-	String DEFAULT_PASSWORD = "123456";
+    /**
+     * 默认密码
+     */
+    String DEFAULT_PASSWORD = "123456";
 
-	/**
-	 * 默认密码参数值
-	 */
-	String DEFAULT_PARAM_PASSWORD = "account.initPassword";
+    /**
+     * 默认密码参数值
+     */
+    String DEFAULT_PARAM_PASSWORD = "account.initPassword";
 
-	String SYS_LOCAL_URL = "sys.local.url";
+    String SYS_LOCAL_URL = "sys.local.url";
 
-	String SYS_FILE_NET_URL = "sys.file.net.url";
+    String SYS_FILE_NET_URL = "sys.file.net.url";
 
-	String SYS_USER_TASK_BATCH = "sys.user.task.batch";
+    String SYS_USER_TASK_BATCH = "sys.user.task.batch";
 
-	String JL_THE_LOG = "JL.theLog";
+    String JL_THE_LOG = "JL.theLog";
 
-	String SG_THE_LOG = "SG.theLog";
+    String SG_THE_LOG = "SG.theLog";
 
-	/**
-	 * 默认排序字段
-	 */
-	String SORT_FIELD = "sort";
+    /**
+     * 默认排序字段
+     */
+    String SORT_FIELD = "sort";
 
-	/**
-	 * 数据权限类型
-	 */
-	Integer DATA_SCOPE_CATEGORY = 1;
+    /**
+     * 数据权限类型
+     */
+    Integer DATA_SCOPE_CATEGORY = 1;
 
-	/**
-	 * 接口权限类型
-	 */
-	Integer API_SCOPE_CATEGORY = 2;
+    /**
+     * 接口权限类型
+     */
+    Integer API_SCOPE_CATEGORY = 2;
 
 
 }

File diff suppressed because it is too large
+ 1 - 1
blade-common/src/main/java/org/springblade/common/constant/EVisaConstant.java


+ 206 - 206
blade-common/src/main/java/org/springblade/common/constant/LauncherConstant.java

@@ -28,211 +28,211 @@ import static org.springblade.core.launch.constant.AppConstant.APPLICATION_NAME_
 public interface LauncherConstant {
 
 
-	String APPLICATION_MANAGER_NAME = APPLICATION_NAME_PREFIX +  "manager";
-
-	String APPLICATION_ARCHIVE_NAME = APPLICATION_NAME_PREFIX +  "archive";
-
-
-	String APPLICATION_VISUAL_NAME = APPLICATION_NAME_PREFIX +  "visual";
-
-	/**
-	 * xxljob
-	 */
-	String APPLICATION_XXLJOB_NAME = APPLICATION_NAME_PREFIX + "xxljob";
-
-	/**
-	 * xxljob
-	 */
-	String APPLICATION_XXLJOB_ADMIN_NAME = APPLICATION_NAME_PREFIX + "xxljob-admin";
-
-	/**
-	 * nacos dev 地址 172.31.222.127   127.0.0.107
-	 */
-	String NACOS_DEV_ADDR = "127.0.0.1:8848";
-
-	/**
-	 * nacos prod 地址
-	 */
-	String NACOS_PROD_ADDR = "172.30.0.48:8848";
-
-	/**
-	 * nacos test 地址
-	 */
-	String NACOS_TEST_ADDR = "172.30.0.48:8848";
-
-	/**
-	 * sentinel dev 地址
-	 */
-	String SENTINEL_DEV_ADDR = "127.0.0.1:8858";
-
-	/**
-	 * sentinel prod 地址
-	 */
-	String SENTINEL_PROD_ADDR = "172.30.0.58:8858";
-
-	/**
-	 * sentinel test 地址
-	 */
-	String SENTINEL_TEST_ADDR = "172.30.0.58:8858";
-
-	/**
-	 * seata dev 地址
-	 */
-	String SEATA_DEV_ADDR = "127.0.0.1:8091";
-
-	/**
-	 * seata prod 地址
-	 */
-	String SEATA_PROD_ADDR = "172.30.0.68:8091";
-
-	/**
-	 * seata test 地址
-	 */
-	String SEATA_TEST_ADDR = "172.30.0.68:8091";
-
-	/**
-	 * zipkin dev 地址
-	 */
-	String ZIPKIN_DEV_ADDR = "http://127.0.0.1:9411";
-
-	/**
-	 * zipkin prod 地址
-	 */
-	String ZIPKIN_PROD_ADDR = "http://172.30.0.71:9411";
-
-	/**
-	 * zipkin test 地址
-	 */
-	String ZIPKIN_TEST_ADDR = "http://172.30.0.71:9411";
-
-	/**
-	 * elk dev 地址
-	 */
-	String ELK_DEV_ADDR = "127.0.0.1:9000";
-
-	/**
-	 * elk prod 地址
-	 */
-	String ELK_PROD_ADDR = "172.30.0.72:9000";
-
-	/**
-	 * elk test 地址
-	 */
-	String ELK_TEST_ADDR = "172.30.0.72:9000";
-
-	/**
-	 * seata file模式
-	 */
-	String FILE_MODE = "file";
-
-	/**
-	 * seata nacos模式
-	 */
-	String NACOS_MODE = "nacos";
-
-	/**
-	 * seata default模式
-	 */
-	String DEFAULT_MODE = "default";
-
-	/**
-	 * seata group后缀
-	 */
-	String GROUP_NAME = "-group";
-
-	/**
-	 * seata 服务组格式
-	 *
-	 * @param appName 服务名
-	 * @return group
-	 */
-	static String seataServiceGroup(String appName) {
-		return appName.concat(GROUP_NAME);
-	}
-
-	/**
-	 * 动态获取nacos地址
-	 *
-	 * @param profile 环境变量
-	 * @return addr
-	 */
-	static String nacosAddr(String profile) {
-		switch (profile) {
-			case (AppConstant.PROD_CODE):
-				return NACOS_PROD_ADDR;
-			case (AppConstant.TEST_CODE):
-				return NACOS_TEST_ADDR;
-			default:
-				return NACOS_DEV_ADDR;
-		}
-	}
-
-	/**
-	 * 动态获取sentinel地址
-	 *
-	 * @param profile 环境变量
-	 * @return addr
-	 */
-	static String sentinelAddr(String profile) {
-		switch (profile) {
-			case (AppConstant.PROD_CODE):
-				return SENTINEL_PROD_ADDR;
-			case (AppConstant.TEST_CODE):
-				return SENTINEL_TEST_ADDR;
-			default:
-				return SENTINEL_DEV_ADDR;
-		}
-	}
-
-	/**
-	 * 动态获取seata地址
-	 *
-	 * @param profile 环境变量
-	 * @return addr
-	 */
-	static String seataAddr(String profile) {
-		switch (profile) {
-			case (AppConstant.PROD_CODE):
-				return SEATA_PROD_ADDR;
-			case (AppConstant.TEST_CODE):
-				return SEATA_TEST_ADDR;
-			default:
-				return SEATA_DEV_ADDR;
-		}
-	}
-
-	/**
-	 * 动态获取zipkin地址
-	 *
-	 * @param profile 环境变量
-	 * @return addr
-	 */
-	static String zipkinAddr(String profile) {
-		switch (profile) {
-			case (AppConstant.PROD_CODE):
-				return ZIPKIN_PROD_ADDR;
-			case (AppConstant.TEST_CODE):
-				return ZIPKIN_TEST_ADDR;
-			default:
-				return ZIPKIN_DEV_ADDR;
-		}
-	}
-
-	/**
-	 * 动态获取elk地址
-	 *
-	 * @param profile 环境变量
-	 * @return addr
-	 */
-	static String elkAddr(String profile) {
-		switch (profile) {
-			case (AppConstant.PROD_CODE):
-				return ELK_PROD_ADDR;
-			case (AppConstant.TEST_CODE):
-				return ELK_TEST_ADDR;
-			default:
-				return ELK_DEV_ADDR;
-		}
-	}
+    String APPLICATION_MANAGER_NAME = APPLICATION_NAME_PREFIX + "manager";
+
+    String APPLICATION_ARCHIVE_NAME = APPLICATION_NAME_PREFIX + "archive";
+
+
+    String APPLICATION_VISUAL_NAME = APPLICATION_NAME_PREFIX + "visual";
+
+    /**
+     * xxljob
+     */
+    String APPLICATION_XXLJOB_NAME = APPLICATION_NAME_PREFIX + "xxljob";
+
+    /**
+     * xxljob
+     */
+    String APPLICATION_XXLJOB_ADMIN_NAME = APPLICATION_NAME_PREFIX + "xxljob-admin";
+
+    /**
+     * nacos dev 地址 172.31.222.127   127.0.0.107
+     */
+    String NACOS_DEV_ADDR = "192.168.0.109:8848";
+
+    /**
+     * nacos prod 地址
+     */
+    String NACOS_PROD_ADDR = "172.30.0.48:8848";
+
+    /**
+     * nacos test 地址
+     */
+    String NACOS_TEST_ADDR = "172.30.0.48:8848";
+
+    /**
+     * sentinel dev 地址
+     */
+    String SENTINEL_DEV_ADDR = "127.0.0.1:8858";
+
+    /**
+     * sentinel prod 地址
+     */
+    String SENTINEL_PROD_ADDR = "172.30.0.58:8858";
+
+    /**
+     * sentinel test 地址
+     */
+    String SENTINEL_TEST_ADDR = "172.30.0.58:8858";
+
+    /**
+     * seata dev 地址
+     */
+    String SEATA_DEV_ADDR = "127.0.0.1:8091";
+
+    /**
+     * seata prod 地址
+     */
+    String SEATA_PROD_ADDR = "172.30.0.68:8091";
+
+    /**
+     * seata test 地址
+     */
+    String SEATA_TEST_ADDR = "172.30.0.68:8091";
+
+    /**
+     * zipkin dev 地址
+     */
+    String ZIPKIN_DEV_ADDR = "http://127.0.0.1:9411";
+
+    /**
+     * zipkin prod 地址
+     */
+    String ZIPKIN_PROD_ADDR = "http://172.30.0.71:9411";
+
+    /**
+     * zipkin test 地址
+     */
+    String ZIPKIN_TEST_ADDR = "http://172.30.0.71:9411";
+
+    /**
+     * elk dev 地址
+     */
+    String ELK_DEV_ADDR = "127.0.0.1:9000";
+
+    /**
+     * elk prod 地址
+     */
+    String ELK_PROD_ADDR = "172.30.0.72:9000";
+
+    /**
+     * elk test 地址
+     */
+    String ELK_TEST_ADDR = "172.30.0.72:9000";
+
+    /**
+     * seata file模式
+     */
+    String FILE_MODE = "file";
+
+    /**
+     * seata nacos模式
+     */
+    String NACOS_MODE = "nacos";
+
+    /**
+     * seata default模式
+     */
+    String DEFAULT_MODE = "default";
+
+    /**
+     * seata group后缀
+     */
+    String GROUP_NAME = "-group";
+
+    /**
+     * seata 服务组格式
+     *
+     * @param appName 服务名
+     * @return group
+     */
+    static String seataServiceGroup(String appName) {
+        return appName.concat(GROUP_NAME);
+    }
+
+    /**
+     * 动态获取nacos地址
+     *
+     * @param profile 环境变量
+     * @return addr
+     */
+    static String nacosAddr(String profile) {
+        switch (profile) {
+            case (AppConstant.PROD_CODE):
+                return NACOS_PROD_ADDR;
+            case (AppConstant.TEST_CODE):
+                return NACOS_TEST_ADDR;
+            default:
+                return NACOS_DEV_ADDR;
+        }
+    }
+
+    /**
+     * 动态获取sentinel地址
+     *
+     * @param profile 环境变量
+     * @return addr
+     */
+    static String sentinelAddr(String profile) {
+        switch (profile) {
+            case (AppConstant.PROD_CODE):
+                return SENTINEL_PROD_ADDR;
+            case (AppConstant.TEST_CODE):
+                return SENTINEL_TEST_ADDR;
+            default:
+                return SENTINEL_DEV_ADDR;
+        }
+    }
+
+    /**
+     * 动态获取seata地址
+     *
+     * @param profile 环境变量
+     * @return addr
+     */
+    static String seataAddr(String profile) {
+        switch (profile) {
+            case (AppConstant.PROD_CODE):
+                return SEATA_PROD_ADDR;
+            case (AppConstant.TEST_CODE):
+                return SEATA_TEST_ADDR;
+            default:
+                return SEATA_DEV_ADDR;
+        }
+    }
+
+    /**
+     * 动态获取zipkin地址
+     *
+     * @param profile 环境变量
+     * @return addr
+     */
+    static String zipkinAddr(String profile) {
+        switch (profile) {
+            case (AppConstant.PROD_CODE):
+                return ZIPKIN_PROD_ADDR;
+            case (AppConstant.TEST_CODE):
+                return ZIPKIN_TEST_ADDR;
+            default:
+                return ZIPKIN_DEV_ADDR;
+        }
+    }
+
+    /**
+     * 动态获取elk地址
+     *
+     * @param profile 环境变量
+     * @return addr
+     */
+    static String elkAddr(String profile) {
+        switch (profile) {
+            case (AppConstant.PROD_CODE):
+                return ELK_PROD_ADDR;
+            case (AppConstant.TEST_CODE):
+                return ELK_TEST_ADDR;
+            default:
+                return ELK_DEV_ADDR;
+        }
+    }
 
 }

+ 1 - 1
blade-common/src/main/java/org/springblade/common/constant/RegexConstant.java

@@ -7,5 +7,5 @@ public interface RegexConstant {
     /**
      * 标准里程
      */
-   String KM_REG="[A-Z]*(\\d*)\\+([\\d|\\.]*)";
+    String KM_REG = "[A-Z]*(\\d*)\\+([\\d|\\.]*)";
 }

+ 30 - 30
blade-common/src/main/java/org/springblade/common/constant/TenantConstant.java

@@ -26,41 +26,41 @@ import java.util.List;
  */
 public interface TenantConstant {
 
-	/**
-	 * 租户默认密码KEY
-	 */
-	String PASSWORD_KEY = "tenant.default.password";
+    /**
+     * 租户默认密码KEY
+     */
+    String PASSWORD_KEY = "tenant.default.password";
 
-	/**
-	 * 租户默认账号额度KEY
-	 */
-	String ACCOUNT_NUMBER_KEY = "tenant.default.accountNumber";
+    /**
+     * 租户默认账号额度KEY
+     */
+    String ACCOUNT_NUMBER_KEY = "tenant.default.accountNumber";
 
-	/**
-	 * 租户默认菜单集合KEY
-	 */
-	String ACCOUNT_MENU_CODE_KEY = "tenant.default.menuCode";
+    /**
+     * 租户默认菜单集合KEY
+     */
+    String ACCOUNT_MENU_CODE_KEY = "tenant.default.menuCode";
 
-	/**
-	 * 租户默认密码
-	 */
-	String DEFAULT_PASSWORD = "123456";
+    /**
+     * 租户默认密码
+     */
+    String DEFAULT_PASSWORD = "123456";
 
-	/**
-	 * 租户授权码默认16位密钥
-	 */
-	String DES_KEY = "0000000000000000";
+    /**
+     * 租户授权码默认16位密钥
+     */
+    String DES_KEY = "0000000000000000";
 
-	/**
-	 * 租户默认账号额度
-	 */
-	Integer DEFAULT_ACCOUNT_NUMBER = -1;
+    /**
+     * 租户默认账号额度
+     */
+    Integer DEFAULT_ACCOUNT_NUMBER = -1;
 
-	/**
-	 * 租户默认菜单集合
-	 */
-	List<String> MENU_CODES = Arrays.asList(
-		"desk", "flow", "work", "monitor", "resource", "role", "user", "dept", "dictbiz", "topmenu"
-	);
+    /**
+     * 租户默认菜单集合
+     */
+    List<String> MENU_CODES = Arrays.asList(
+            "desk", "flow", "work", "monitor", "resource", "role", "user", "dept", "dictbiz", "topmenu"
+    );
 
 }

+ 23 - 23
blade-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java

@@ -32,30 +32,30 @@ import java.util.Properties;
 @AutoService(LauncherService.class)
 public class LauncherServiceImpl implements LauncherService {
 
-	@Override
-	public void launcher(SpringApplicationBuilder builder, String appName, String profile, boolean isLocalDev) {
-		Properties props = System.getProperties();
-		// 通用注册
-		PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.server-addr", LauncherConstant.nacosAddr(profile));
-		PropsUtil.setProperty(props, "spring.cloud.nacos.config.server-addr", LauncherConstant.nacosAddr(profile));
-		PropsUtil.setProperty(props, "spring.cloud.sentinel.transport.dashboard", LauncherConstant.sentinelAddr(profile));
-		PropsUtil.setProperty(props, "spring.zipkin.base-url", LauncherConstant.zipkinAddr(profile));
-		PropsUtil.setProperty(props, "spring.datasource.dynamic.enabled", "false");
+    @Override
+    public void launcher(SpringApplicationBuilder builder, String appName, String profile, boolean isLocalDev) {
+        Properties props = System.getProperties();
+        // 通用注册
+        PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.server-addr", LauncherConstant.nacosAddr(profile));
+        PropsUtil.setProperty(props, "spring.cloud.nacos.config.server-addr", LauncherConstant.nacosAddr(profile));
+        PropsUtil.setProperty(props, "spring.cloud.sentinel.transport.dashboard", LauncherConstant.sentinelAddr(profile));
+        PropsUtil.setProperty(props, "spring.zipkin.base-url", LauncherConstant.zipkinAddr(profile));
+        PropsUtil.setProperty(props, "spring.datasource.dynamic.enabled", "false");
 
-		// 开启elk日志
-		// PropsUtil.setProperty(props, "blade.log.elk.destination", LauncherConstant.elkAddr(profile));
+        // 开启elk日志
+        // PropsUtil.setProperty(props, "blade.log.elk.destination", LauncherConstant.elkAddr(profile));
 
-		// seata注册地址
-		// PropsUtil.setProperty(props, "seata.service.grouplist.default", LauncherConstant.seataAddr(profile));
-		// seata注册group格式
-		// PropsUtil.setProperty(props, "seata.tx-service-group", LauncherConstant.seataServiceGroup(appName));
-		// seata配置服务group
-		// PropsUtil.setProperty(props, "seata.service.vgroup-mapping.".concat(LauncherConstant.seataServiceGroup(appName)), LauncherConstant.DEFAULT_MODE);
-		// seata注册模式配置
-		// PropsUtil.setProperty(props, "seata.registry.type", LauncherConstant.NACOS_MODE);
-		// PropsUtil.setProperty(props, "seata.registry.nacos.server-addr", LauncherConstant.nacosAddr(profile));
-		// PropsUtil.setProperty(props, "seata.config.type", LauncherConstant.NACOS_MODE);
-		// PropsUtil.setProperty(props, "seata.config.nacos.server-addr", LauncherConstant.nacosAddr(profile));
-	}
+        // seata注册地址
+        // PropsUtil.setProperty(props, "seata.service.grouplist.default", LauncherConstant.seataAddr(profile));
+        // seata注册group格式
+        // PropsUtil.setProperty(props, "seata.tx-service-group", LauncherConstant.seataServiceGroup(appName));
+        // seata配置服务group
+        // PropsUtil.setProperty(props, "seata.service.vgroup-mapping.".concat(LauncherConstant.seataServiceGroup(appName)), LauncherConstant.DEFAULT_MODE);
+        // seata注册模式配置
+        // PropsUtil.setProperty(props, "seata.registry.type", LauncherConstant.NACOS_MODE);
+        // PropsUtil.setProperty(props, "seata.registry.nacos.server-addr", LauncherConstant.nacosAddr(profile));
+        // PropsUtil.setProperty(props, "seata.config.type", LauncherConstant.NACOS_MODE);
+        // PropsUtil.setProperty(props, "seata.config.nacos.server-addr", LauncherConstant.nacosAddr(profile));
+    }
 
 }

+ 6 - 5
blade-common/src/main/java/org/springblade/common/utils/BaiduApiUtil.java

@@ -21,12 +21,13 @@ public class BaiduApiUtil {
 
     /**
      * 根据区域代码获取当天天气
+     *
      * @param districtId 区域代码
      */
-    public static Map<String, String> getTodayWeather(String districtId){
+    public static Map<String, String> getTodayWeather(String districtId) {
         Map<String, String> map = new HashMap<>();
         String getUrl = "http://api.map.baidu.com/weather/v1/?data_type=all&district_id=" + districtId + "&ak=" + API_AK;
-        try{
+        try {
             URL url = new URL(getUrl);
             BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream(), StandardCharsets.UTF_8));
             String res;
@@ -39,13 +40,13 @@ public class BaiduApiUtil {
             JSONObject result = (JSONObject) jsonData.get("result");
             JSONObject now = (JSONObject) result.get("now");
             JSONArray forecasts = (JSONArray) result.get("forecasts");
-            JSONObject forecast = (JSONObject)forecasts.get(0);
+            JSONObject forecast = (JSONObject) forecasts.get(0);
             map.put("temp", now.get("temp").toString());
             map.put("weather", forecast.get("text_day").toString());
             map.put("high", forecast.get("high").toString());
             map.put("low", forecast.get("low").toString());
-            map.put("windLevel",now.get("wind_class").toString());
-        }catch (IOException e){
+            map.put("windLevel", now.get("wind_class").toString());
+        } catch (IOException e) {
             e.printStackTrace();
             return null;
         }

+ 21 - 20
blade-common/src/main/java/org/springblade/common/utils/BaseUtils.java

@@ -23,31 +23,32 @@ import java.util.regex.Pattern;
  */
 public class BaseUtils {
 
-    public static Pattern KM=Pattern.compile(RegexConstant.KM_REG);
-    public static double k2d(Object k){
+    public static Pattern KM = Pattern.compile(RegexConstant.KM_REG);
+
+    public static double k2d(Object k) {
         Matcher mt = KM.matcher(k.toString());
-        if(mt.find()){
-            return  Double.parseDouble(mt.group(1))*1000+Double.parseDouble(mt.group(2));
+        if (mt.find()) {
+            return Double.parseDouble(mt.group(1)) * 1000 + Double.parseDouble(mt.group(2));
         }
         return -1;
     }
 
 
     /**
+     * @return java.util.Map<java.lang.String, java.lang.String>
      * @Description 将key1(val1)key2(val2)key3(val3)...这种格式的参数转换为Map
      * @Param [str]
-     * @return java.util.Map<java.lang.String,java.lang.String>
      * @Author yangyj
      * @Date 2022.08.12 10:39
      **/
-    public  static  Map<String,String> string2Map(String str){
-        Map<String,String> result = new HashMap<>(15);
-        if(StringUtils.isNotEmpty(str)){
+    public static Map<String, String> string2Map(String str) {
+        Map<String, String> result = new HashMap<>(15);
+        if (StringUtils.isNotEmpty(str)) {
             String[] args = str.split("\\)");
-            for(String a:args){
-                if(StringUtils.isNotEmpty(a)){
-                    String[] kv=a.split("\\(");
-                    result.put(kv[0],kv[1]);
+            for (String a : args) {
+                if (StringUtils.isNotEmpty(a)) {
+                    String[] kv = a.split("\\(");
+                    result.put(kv[0], kv[1]);
                 }
             }
         }
@@ -55,16 +56,16 @@ public class BaseUtils {
     }
 
     /**
+     * @return java.lang.Boolean
      * @Description 基础数据类型批量非空判断
      * @Param [args]
-     * @return java.lang.Boolean
      * @Author yangyj
      * @Date 2022.08.26 11:14
      **/
-    public static Boolean isNotNull(Object... args){
-        if(args!=null){
-            for(Object obj:args){
-                if(obj==null||"".equals(obj)){
+    public static Boolean isNotNull(Object... args) {
+        if (args != null) {
+            for (Object obj : args) {
+                if (obj == null || "".equals(obj)) {
                     return false;
                 }
             }
@@ -74,10 +75,10 @@ public class BaseUtils {
     }
 
     public static boolean isNumber(Object value) {
-        if((value==null)||value.toString().trim().length()==0){
-            return  false;
+        if ((value == null) || value.toString().trim().length() == 0) {
+            return false;
         }
-        if(value instanceof  Number){
+        if (value instanceof Number) {
             return true;
         }
         String pattern = "^[+-]?\\d+(\\.\\d+)?$";

+ 35 - 30
blade-common/src/main/java/org/springblade/common/utils/CommonUtil.java

@@ -29,6 +29,7 @@ import java.util.stream.Collectors;
 import java.util.stream.Stream;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipOutputStream;
+
 import com.drew.metadata.MetadataException;
 
 /**
@@ -38,23 +39,23 @@ import com.drew.metadata.MetadataException;
  */
 public class CommonUtil {
 
-    public static Boolean checkBigDecimal(Object value){
-        try{
-            if(value != null && StringUtils.isNotEmpty(value.toString())){
+    public static Boolean checkBigDecimal(Object value) {
+        try {
+            if (value != null && StringUtils.isNotEmpty(value.toString())) {
                 new BigDecimal(value.toString());
                 return true;
             }
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
         }
         return false;
     }
 
-    public static void removeFile(List<String> removeList){
-        for(String fileUrl : removeList){
-            try{
+    public static void removeFile(List<String> removeList) {
+        for (String fileUrl : removeList) {
+            try {
                 FileUtil.del(new File(fileUrl));
-            }catch (Exception e){
+            } catch (Exception e) {
                 e.printStackTrace();
             }
         }
@@ -68,29 +69,29 @@ public class CommonUtil {
         }
     }
 
-    public static String join(Object ...args){
-        if(args!=null){
-            if(args.length>2){
+    public static String join(Object... args) {
+        if (args != null) {
+            if (args.length > 2) {
                 List<String> list = Arrays.stream(args).limit(args.length - 1).map(CommonUtil::handleNull).collect(Collectors.toList());
-                String split=handleNull(args[args.length-1]);
+                String split = handleNull(args[args.length - 1]);
                 return join(list, split);
-            }else{
+            } else {
                 return handleNull(args[0]);
             }
-        }else {
+        } else {
             return "";
         }
     }
 
-    public static String join(List<String>list, String split){
+    public static String join(List<String> list, String split) {
         StringBuilder sb = new StringBuilder();
-        if(list != null && list.size() > 0){
-            for(String str:list){
-                if(StringUtils.isNotEmpty(str)){
+        if (list != null && list.size() > 0) {
+            for (String str : list) {
+                if (StringUtils.isNotEmpty(str)) {
                     sb.append(str).append(split);
                 }
             }
-            if(sb.length()>0 && StringUtils.isNotEmpty(split)){
+            if (sb.length() > 0 && StringUtils.isNotEmpty(split)) {
                 sb.delete(sb.length() - split.length(), sb.length());
             }
         }
@@ -112,7 +113,7 @@ public class CommonUtil {
             HttpURLConnection conn = (HttpURLConnection) imageUrl.openConnection();
             conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
             return conn.getInputStream();
-        }catch (Exception e){
+        } catch (Exception e) {
             return null;
         }
     }
@@ -152,6 +153,7 @@ public class CommonUtil {
 
     /**
      * 随机生成短信验证码
+     *
      * @param length 生成长度
      */
     public static String getCharAndNumber(int length) {
@@ -172,18 +174,19 @@ public class CommonUtil {
 
     /**
      * 判断参数是否是数字
+     *
      * @param value 需要判断数据
      * @return 判断结果,数字则为true,反之false
      */
-    public static boolean checkIsBigDecimal(Object value){
-        try{
-            if(value != null && StringUtils.isNotEmpty(String.valueOf(value))){
+    public static boolean checkIsBigDecimal(Object value) {
+        try {
+            if (value != null && StringUtils.isNotEmpty(String.valueOf(value))) {
                 new BigDecimal(String.valueOf(value));
                 return true;
             } else {
                 return false;
             }
-        }catch (Exception e){
+        } catch (Exception e) {
             return false;
         }
     }
@@ -193,7 +196,7 @@ public class CommonUtil {
      */
     public static <T> List<List<T>> getBatchSize(List<T> allIds, int size) {
         List<List<T>> batchIds = new ArrayList<>();
-        if (allIds == null || allIds.size() == 0 ||  size <= 0) {
+        if (allIds == null || allIds.size() == 0 || size <= 0) {
             return batchIds;
         }
 
@@ -202,9 +205,9 @@ public class CommonUtil {
         for (T map : allIds) {
             tmp.add(map);
             i++;
-            if (i % size == 0 || i ==  allIds.size()) {
+            if (i % size == 0 || i == allIds.size()) {
                 batchIds.add(tmp);
-                tmp =  new ArrayList<>();
+                tmp = new ArrayList<>();
             }
         }
         return batchIds;
@@ -228,7 +231,8 @@ public class CommonUtil {
 
     /**
      * Description: Java8 Stream分割list集合
-     * @param list 集合数据
+     *
+     * @param list      集合数据
      * @param splitSize 几个分割一组
      * @return 集合分割后的集合
      */
@@ -270,6 +274,7 @@ public class CommonUtil {
 
     /**
      * 删除文件夹下所有文件
+     *
      * @param path
      * @return
      */
@@ -297,6 +302,7 @@ public class CommonUtil {
 
     /**
      * 压缩指定路径下的文件夹
+     *
      * @param filesPath
      * @throws Exception
      */
@@ -356,10 +362,9 @@ public class CommonUtil {
     }
 
 
-
-
     /**
      * 图片缩放、压缩、旋转处理
+     *
      * @param imageData
      * @return
      * @throws IOException

+ 15 - 14
blade-common/src/main/java/org/springblade/common/utils/FileUtils.java

@@ -14,10 +14,11 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Objects;
 
-public class FileUtils  {
+public class FileUtils {
 
     /**
      * 获取文件path
+     *
      * @param file
      * @return
      * @throws IOException
@@ -39,33 +40,33 @@ public class FileUtils  {
     }
 
     //获取文件大小
-    public static List<FileSize> getOssFileSize(List<String> fileList){
-        List<FileSize> reData =new ArrayList<>();
-        if(fileList!=null){
-            for(String fileUrl:fileList){
-                FileSize file =new FileSize();
+    public static List<FileSize> getOssFileSize(List<String> fileList) {
+        List<FileSize> reData = new ArrayList<>();
+        if (fileList != null) {
+            for (String fileUrl : fileList) {
+                FileSize file = new FileSize();
                 file.setFileUrl(fileUrl);
                 try {
-                    URLConnection  openConnection = new URL(fileUrl).openConnection();
+                    URLConnection openConnection = new URL(fileUrl).openConnection();
                     int contentLength = openConnection.getContentLength();
-                    Double fileLength = Double.parseDouble(contentLength+"");
-                    file.setFileSize(Math.ceil(fileLength/1024));
+                    Double fileLength = Double.parseDouble(contentLength + "");
+                    file.setFileSize(Math.ceil(fileLength / 1024));
                 } catch (IOException e) {
                     e.printStackTrace();
                 }
                 reData.add(file);
             }
         }
-        return  reData;
+        return reData;
     }
 
     //获取OSS文件总大小
-    public static Long getOssFileSizeCount(List<String> fileList){
+    public static Long getOssFileSizeCount(List<String> fileList) {
         Long count = 0L;
-        if(fileList!=null){
-            for(String fileUrl:fileList){
+        if (fileList != null) {
+            for (String fileUrl : fileList) {
                 try {
-                    URLConnection  openConnection = new URL(fileUrl).openConnection();
+                    URLConnection openConnection = new URL(fileUrl).openConnection();
                     count += openConnection.getContentLength();
 
                 } catch (IOException e) {

+ 2 - 2
blade-common/src/main/java/org/springblade/common/utils/ForestNodeManagerEx.java

@@ -10,7 +10,7 @@ import java.util.Map;
 
 public class ForestNodeManagerEx<T extends INodeEx<T>> {
 
-    private final ImmutableMap<Long, T> nodeMap ;
+    private final ImmutableMap<Long, T> nodeMap;
     private final Map<Long, Object> parentIdMap = Maps.newHashMap();
 
     public ForestNodeManagerEx(List<T> nodes) {
@@ -18,7 +18,7 @@ public class ForestNodeManagerEx<T extends INodeEx<T>> {
     }
 
     public INodeEx<T> getTreeNodeAt(Long id) {
-        return this.nodeMap.containsKey(id) ? (INodeEx)this.nodeMap.get(id) : null;
+        return this.nodeMap.containsKey(id) ? (INodeEx) this.nodeMap.get(id) : null;
     }
 
     public void addParentId(Long parentId) {

+ 62 - 66
blade-common/src/main/java/org/springblade/common/utils/ForestNodeMergerEx.java

@@ -14,13 +14,13 @@ import java.util.stream.Collectors;
 public class ForestNodeMergerEx {
     public static <T extends INodeEx<T>> List<T> merge(List<T> items) {
 
-        for (T item: items) {
+        for (T item : items) {
             item.clearChildren();
         }
 
         ForestNodeManagerEx<T> forestNodeManager = new ForestNodeManagerEx(items);
         items.forEach((forestNode) -> {
-            if (forestNode.getParentId()!= null && forestNode.getParentId() != 0L) {
+            if (forestNode.getParentId() != null && forestNode.getParentId() != 0L) {
                 INodeEx<T> node = forestNodeManager.getTreeNodeAt(forestNode.getParentId());
                 if (node != null) {
                     node.getChildren().add(forestNode);
@@ -36,13 +36,13 @@ public class ForestNodeMergerEx {
 
     public static <T extends INodeEx<T>> List<T> mergeOnlyRoot(List<T> items) {
 
-        for (T item: items) {
+        for (T item : items) {
             item.clearChildren();
         }
 
         ForestNodeManagerEx<T> forestNodeManager = new ForestNodeManagerEx(items);
         items.forEach((forestNode) -> {
-            if (forestNode.getParentId()!= null && forestNode.getParentId() != 0L) {
+            if (forestNode.getParentId() != null && forestNode.getParentId() != 0L) {
                 INodeEx<T> node = forestNodeManager.getTreeNodeAt(forestNode.getParentId());
                 if (node != null) {
                     node.getChildren().add(forestNode);
@@ -52,7 +52,8 @@ public class ForestNodeMergerEx {
             }
 
         });
-        List<T> roots = forestNodeManager.getRoot();;
+        List<T> roots = forestNodeManager.getRoot();
+        ;
         List<T> newRoots = new ArrayList();
         for (T root : roots) {
             if (root.getParentId() == 0L) {
@@ -62,7 +63,7 @@ public class ForestNodeMergerEx {
         return newRoots;
     }
 
-    public static <T extends INodeEx<T>> void getTreeList(T tree, List<T> nodes){
+    public static <T extends INodeEx<T>> void getTreeList(T tree, List<T> nodes) {
         if (tree == null) {
             return;
         }
@@ -70,14 +71,14 @@ public class ForestNodeMergerEx {
         nodes.add(tree);
 
         List<T> childrens = tree.getChildren();
-        if (childrens!= null) {
-            for (T child :childrens) {
-                getTreeList(child,nodes);
+        if (childrens != null) {
+            for (T child : childrens) {
+                getTreeList(child, nodes);
             }
         }
     }
 
-    public static <T extends INodeEx<T>> List<Long> getChildrenIds(T tree){
+    public static <T extends INodeEx<T>> List<Long> getChildrenIds(T tree) {
         List<Long> ids = new ArrayList<>();
 
         if (tree == null) {
@@ -85,9 +86,9 @@ public class ForestNodeMergerEx {
         }
 
         List<T> nodes = new ArrayList<>();
-        getTreeList(tree,nodes);
+        getTreeList(tree, nodes);
 
-        ids = nodes.stream().map(o->o.getId()).collect(Collectors.toList());
+        ids = nodes.stream().map(o -> o.getId()).collect(Collectors.toList());
         if (ids.size() > 0) {
             ids.remove(0);
         }
@@ -95,31 +96,31 @@ public class ForestNodeMergerEx {
     }
 
 
-    public static <T extends INodeEx<T>> T getSubTree(T tree,Long nodeId) {
+    public static <T extends INodeEx<T>> T getSubTree(T tree, Long nodeId) {
         List<T> srcList = new ArrayList<>();
 
-        getTreeList(tree,srcList);
+        getTreeList(tree, srcList);
 
         for (T src : srcList) {
             if (src.getId().equals(nodeId)) {
-                return  src;
+                return src;
             }
         }
         return null;
     }
 
-    public static <T extends INodeEx<T>> T getSubTreeByValue(T tree,Long srcNodeId,Long value) {
+    public static <T extends INodeEx<T>> T getSubTreeByValue(T tree, Long srcNodeId, Long value) {
         List<T> srcList = new ArrayList<>();
 
-        getTreeList(tree,srcList);
+        getTreeList(tree, srcList);
 
-        Map<Long,T> map = new LinkedHashMap<>();
+        Map<Long, T> map = new LinkedHashMap<>();
         for (T src : srcList) {
-            map.put(src.getId(),src);
+            map.put(src.getId(), src);
         }
 
         T srcNode = map.get(srcNodeId);
-        while (true ) {
+        while (true) {
             if (srcNode == null || srcNode.getValue() == value) {
                 break;
             }
@@ -129,38 +130,36 @@ public class ForestNodeMergerEx {
     }
 
 
-
-    public static <T extends INodeEx<T>,E extends INodeEx<E>>  void syncTreeList(T srcTree, E dstTree, List<E> outList){
+    public static <T extends INodeEx<T>, E extends INodeEx<E>> void syncTreeList(T srcTree, E dstTree, List<E> outList) {
         List<T> srcList = new ArrayList<>();
         List<T> srcAddList = new ArrayList<>();
         List<E> dstList = new ArrayList<>();
-        Map<Long,Long> srcDstMap = new LinkedHashMap<>();
+        Map<Long, Long> srcDstMap = new LinkedHashMap<>();
         //Map<Long,E> srcTMap = new LinkedHashMap<>();
 
 
-        getTreeList(srcTree,srcList);
-        getTreeList(dstTree,dstList);
+        getTreeList(srcTree, srcList);
+        getTreeList(dstTree, dstList);
 
         boolean bRootMatch = true;
 
-        if (dstTree.getFromId() == null ) {
+        if (dstTree.getFromId() == null) {
             bRootMatch = false;
-        }else if (!dstTree.getFromId().equals(srcTree.getId()) && dstTree.getParentId() != 0)  {
+        } else if (!dstTree.getFromId().equals(srcTree.getId()) && dstTree.getParentId() != 0) {
             bRootMatch = false;
         }
 
         //将dst fromID全部入MAP,看看哪个没有
-        for (E dst :dstList) {
-            if (dst.getFromId() != null ) {
-                srcDstMap.put(dst.getFromId(),dst.getId());
+        for (E dst : dstList) {
+            if (dst.getFromId() != null) {
+                srcDstMap.put(dst.getFromId(), dst.getId());
                 //srcTMap.put(dst.getFromId(),dst);
             }
         }
 
 
-
-        for (T src :srcList) {
-            if (srcDstMap.get(src.getId())!= null) {
+        for (T src : srcList) {
+            if (srcDstMap.get(src.getId()) != null) {
                 continue;
             }
             if (src.getId().equals(srcTree.getId()) && bRootMatch == false) {
@@ -170,21 +169,21 @@ public class ForestNodeMergerEx {
             srcAddList.add(src);
         }
 
-        for (T src :srcAddList) {
+        for (T src : srcAddList) {
             srcDstMap.put(src.getId(), SnowFlakeUtil.getId());
         }
 
 
-        for (T srcAdd :srcAddList) {
+        for (T srcAdd : srcAddList) {
 
             try {
                 E e = (E) create(dstTree.getClass());
 
-                BeanUtils.copyProperties(srcAdd,e);
-                e.setId(srcDstMap.get(srcAdd.getId()) );
+                BeanUtils.copyProperties(srcAdd, e);
+                e.setId(srcDstMap.get(srcAdd.getId()));
 
                 Long pid = srcDstMap.get(srcAdd.getParentId());
-                if (pid == null ) {
+                if (pid == null) {
                     pid = dstTree.getId();
                 }
                 e.setParentId(pid);
@@ -203,43 +202,42 @@ public class ForestNodeMergerEx {
         return a;
     }
 
-    public  static <T extends INodeEx<T>> void InitAncestors(T tree, String ancestors) {
+    public static <T extends INodeEx<T>> void InitAncestors(T tree, String ancestors) {
         String localAncestors = ancestors + "," + tree.getId();
         tree.setAncestors(ancestors);
 
         List<T> childrens = tree.getChildren();
-        if (childrens!= null) {
-            for (T child :childrens) {
-                InitAncestors(child,localAncestors);
+        if (childrens != null) {
+            for (T child : childrens) {
+                InitAncestors(child, localAncestors);
             }
         }
     }
 
-    public static <T extends INodeEx<T>> void InitTreeSort(T tree, String treeSort,int idx) {
+    public static <T extends INodeEx<T>> void InitTreeSort(T tree, String treeSort, int idx) {
 
         Integer localSort = 100;
-        if (tree.getSort() != null ) {
-            localSort =  tree.getSort() + 100;
-        }else {
-            localSort+= idx;
+        if (tree.getSort() != null) {
+            localSort = tree.getSort() + 100;
+        } else {
+            localSort += idx;
         }
 
-        String localTreeSort = treeSort + localSort ;
+        String localTreeSort = treeSort + localSort;
         tree.setTreeSort(localTreeSort);
 
         List<T> childrens = tree.getChildren();
         int index = 1;
-        if (childrens!= null) {
-            for (T child :childrens) {
-                InitTreeSort(child,localTreeSort,index);
+        if (childrens != null) {
+            for (T child : childrens) {
+                InitTreeSort(child, localTreeSort, index);
                 index++;
             }
         }
     }
 
 
-    public static void assignPropertyValue(Object obj, String propertyName, Object value)
-    {
+    public static void assignPropertyValue(Object obj, String propertyName, Object value) {
         try {
             // 获取对象的Class类型
             Class<?> clazz = obj.getClass();
@@ -271,37 +269,35 @@ public class ForestNodeMergerEx {
     }
 
 
-
-    public static <T extends INodeEx<T>> List<T> setPropertyfromId(List<T> NodeList, Map<String,String> propertyMap)
-    {
+    public static <T extends INodeEx<T>> List<T> setPropertyfromId(List<T> NodeList, Map<String, String> propertyMap) {
         List<T> changeList = new ArrayList<>();
-        Map<Long,Long> oldNewMap = new LinkedHashMap<>();
+        Map<Long, Long> oldNewMap = new LinkedHashMap<>();
 
-        for (T node: NodeList) {
+        for (T node : NodeList) {
             if (node.getFromId() != null) {
-                oldNewMap.put(node.getFromId(),node.getId());
+                oldNewMap.put(node.getFromId(), node.getId());
             }
         }
 
-        for (T node: NodeList) {
+        for (T node : NodeList) {
             if (node.getFromId() == null) {
                 continue;
             }
 
             boolean bSet = false;
 
-            for (String fieldName: propertyMap.keySet()) {
-                Object obj = getPropertyValue(node,fieldName);
-                if (obj != null ) {
+            for (String fieldName : propertyMap.keySet()) {
+                Object obj = getPropertyValue(node, fieldName);
+                if (obj != null) {
                     Long newId = oldNewMap.get(obj);
-                    if (newId != null ) {
-                        assignPropertyValue(node,fieldName,newId);
+                    if (newId != null) {
+                        assignPropertyValue(node, fieldName, newId);
                         bSet = true;
                     }
                 }
             }
 
-            if (bSet){
+            if (bSet) {
                 changeList.add(node);
             }
         }

+ 2 - 2
blade-common/src/main/java/org/springblade/common/utils/IDUtils.java

@@ -4,10 +4,10 @@ import java.util.Random;
 
 public class IDUtils {
 
-    public static Long generateId19(){
+    public static Long generateId19() {
         Random random = new Random();
         long randomLong = random.nextLong();
-        if(randomLong < 0){
+        if (randomLong < 0) {
             randomLong = randomLong * -1L;
         }
         return Long.parseLong(String.valueOf(randomLong).substring(0, 19));

+ 2 - 1
blade-common/src/main/java/org/springblade/common/utils/INodeEx.java

@@ -38,5 +38,6 @@ public interface INodeEx<T> extends Serializable {
         return false;
     }
 
-    default void clearChildren() {}
+    default void clearChildren() {
+    }
 }

+ 32 - 31
blade-common/src/main/java/org/springblade/common/utils/MathUtil.java

@@ -17,41 +17,42 @@ public class MathUtil {
     /**
      * 循环递归获取给定数组元素(无重复)的全排列
      *
-     * @param oriList 原始数组
-     * @param oriLen 原始数组size
+     * @param oriList         原始数组
+     * @param oriLen          原始数组size
      * @param arrayCombResult 数组排列结果集,可传null或空Set
-     * @param preList 记录排列参数,可传null或空List
+     * @param preList         记录排列参数,可传null或空List
      * @return 排列结果
      */
-    public static Set<String> getArrange(List oriList, int oriLen, Set<String> arrayCombResult, List preList){
-        if (oriList == null){
+    public static Set<String> getArrange(List oriList, int oriLen, Set<String> arrayCombResult, List preList) {
+        if (oriList == null) {
             return arrayCombResult;
         }
-        if (arrayCombResult == null){
+        if (arrayCombResult == null) {
             arrayCombResult = new HashSet<>();
         }
-        if (preList == null){
+        if (preList == null) {
             preList = new ArrayList();
         }
-        for (int i = 0; i < oriList.size(); i++){
-            while(preList.size() > 0 && oriList.size() + preList.size() > oriLen){
+        for (int i = 0; i < oriList.size(); i++) {
+            while (preList.size() > 0 && oriList.size() + preList.size() > oriLen) {
                 preList.remove(preList.size() - 1);
             }
             List arrList = new ArrayList(oriList);
             preList.add(arrList.get(i));
             arrList.remove(i);
-            if (arrList.isEmpty()){
+            if (arrList.isEmpty()) {
                 arrayCombResult.add(getStrFromList(preList));
-            }else {
+            } else {
                 getArrange(arrList, oriLen, arrayCombResult, preList);
             }
         }
         return arrayCombResult;
     }
+
     /**
      * 循环递归获取给定数组元素(无重复)的所有组合
      *
-     * @param oriList 原始数组
+     * @param oriList   原始数组
      * @param resultSet 元素组合结果,可传null或空set
      * @return 组合结果
      */
@@ -59,7 +60,7 @@ public class MathUtil {
         if (oriList == null) {
             return resultSet;
         }
-        if (resultSet == null){
+        if (resultSet == null) {
             resultSet = new HashSet<>();
         }
         for (int i = 0; i < oriList.size(); i++) {
@@ -72,20 +73,21 @@ public class MathUtil {
         }
         return resultSet;
     }
+
     /**
      * 将数组元素转化为逗号分隔的字符串
      *
      * @param oriList 原始数组
      * @return 字符串
      */
-    public static String getStrFromList(List oriList){
+    public static String getStrFromList(List oriList) {
         StringBuffer result = new StringBuffer();
-        if (oriList == null){
+        if (oriList == null) {
             return result.toString();
         } else {
-            for (int i = 0; i < oriList.size(); i++){
+            for (int i = 0; i < oriList.size(); i++) {
                 result.append(oriList.get(i));
-                if (i != (oriList.size() - 1)){
+                if (i != (oriList.size() - 1)) {
 
                 }
             }
@@ -94,16 +96,15 @@ public class MathUtil {
     }
 
 
-
     /**
      * @param args
      */
     private static int min(int one, int two, int three) {
         int min = one;
-        if(two < min) {
+        if (two < min) {
             min = two;
         }
-        if(three < min) {
+        if (three < min) {
             min = three;
         }
         return min;
@@ -118,31 +119,31 @@ public class MathUtil {
         char ch1; //str1的
         char ch2; //str2的
         int temp; //记录相同字符,在某个矩阵位置值的增量,不是0就是1
-        if(n == 0) {
+        if (n == 0) {
             return m;
         }
-        if(m == 0) {
+        if (m == 0) {
             return n;
         }
-        d = new int[n+1][m+1];
-        for(i=0; i<=n; i++) { //初始化第一列
+        d = new int[n + 1][m + 1];
+        for (i = 0; i <= n; i++) { //初始化第一列
             d[i][0] = i;
         }
-        for(j=0; j<=m; j++) { //初始化第一行
+        for (j = 0; j <= m; j++) { //初始化第一行
             d[0][j] = j;
         }
-        for(i=1; i<=n; i++) { //遍历str1
-            ch1 = str1.charAt(i-1);
+        for (i = 1; i <= n; i++) { //遍历str1
+            ch1 = str1.charAt(i - 1);
             //去匹配str2
-            for(j=1; j<=m; j++) {
-                ch2 = str2.charAt(j-1);
-                if(ch1 == ch2) {
+            for (j = 1; j <= m; j++) {
+                ch2 = str2.charAt(j - 1);
+                if (ch1 == ch2) {
                     temp = 0;
                 } else {
                     temp = 1;
                 }
                 //左边+1,上边+1, 左上角+temp取最小
-                d[i][j] = min(d[i-1][j]+1, d[i][j-1]+1, d[i-1][j-1]+temp);
+                d[i][j] = min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + temp);
             }
         }
         return d[n][m];

+ 4 - 3
blade-common/src/main/java/org/springblade/common/utils/SystemUtils.java

@@ -6,7 +6,7 @@ public class SystemUtils {
      * 判断操作系统是否是 Windows
      *
      * @return true:操作系统是 Windows
-     *         false:其它操作系统
+     * false:其它操作系统
      */
     public static boolean isWindows() {
         String osName = getOsName();
@@ -18,7 +18,7 @@ public class SystemUtils {
      * 判断操作系统是否是 MacOS
      *
      * @return true:操作系统是 MacOS
-     *         false:其它操作系统
+     * false:其它操作系统
      */
     public static boolean isMacOs() {
         String osName = getOsName();
@@ -30,7 +30,7 @@ public class SystemUtils {
      * 判断操作系统是否是 Linux
      *
      * @return true:操作系统是 Linux
-     *         false:其它操作系统
+     * false:其它操作系统
      */
     public static boolean isLinux() {
         String osName = getOsName();
@@ -40,6 +40,7 @@ public class SystemUtils {
 
     /**
      * 获取操作系统名称
+     *
      * @return os.name 属性值
      */
     public static String getOsName() {

+ 3 - 2
blade-common/src/main/java/org/springblade/common/vo/DataVO.java

@@ -9,11 +9,12 @@ public class DataVO {
 
     private Integer y;
 
-    public DataVO(Integer x, Integer y){
+    public DataVO(Integer x, Integer y) {
         this.x = x;
         this.y = y;
     }
 
-    public DataVO(){}
+    public DataVO() {
+    }
 
 }

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

@@ -32,8 +32,8 @@ import org.springframework.scheduling.annotation.EnableScheduling;
 @SpringCloudApplication
 public class GateWayApplication {
 
-	public static void main(String[] args) {
-		BladeApplication.run(AppConstant.APPLICATION_GATEWAY_NAME, GateWayApplication.class, args);
-	}
+    public static void main(String[] args) {
+        BladeApplication.run(AppConstant.APPLICATION_GATEWAY_NAME, GateWayApplication.class, args);
+    }
 
 }

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

@@ -37,9 +37,9 @@ import org.springframework.context.annotation.Configuration;
 @EnableConfigurationProperties({ServerProperties.class, ResourceProperties.class})
 public class ErrorHandlerConfiguration {
 
-	@Bean
-	public ErrorExceptionHandler globalExceptionHandler(ObjectMapper objectMapper) {
-		return new ErrorExceptionHandler(objectMapper);
-	}
+    @Bean
+    public ErrorExceptionHandler globalExceptionHandler(ObjectMapper objectMapper) {
+        return new ErrorExceptionHandler(objectMapper);
+    }
 
 }

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

@@ -44,38 +44,38 @@ import reactor.core.publisher.Mono;
 @EnableConfigurationProperties({AuthProperties.class})
 public class RouterFunctionConfiguration {
 
-	/**
-	 * 这里为支持的请求头,如果有自定义的header字段请自己添加
-	 */
-	private static final String ALLOWED_HEADERS = "X-Requested-With, Tenant-Id, Blade-Auth, Content-Type, Authorization, credential, X-XSRF-TOKEN, token, username, client, knfie4j-gateway-request, knife4j-gateway-code, request-origion";
-	private static final String ALLOWED_METHODS = "GET,POST,PUT,DELETE,OPTIONS,HEAD";
-	private static final String ALLOWED_ORIGIN = "*";
-	private static final String ALLOWED_EXPOSE = "*";
-	private static final String MAX_AGE = "18000L";
+    /**
+     * 这里为支持的请求头,如果有自定义的header字段请自己添加
+     */
+    private static final String ALLOWED_HEADERS = "X-Requested-With, Tenant-Id, Blade-Auth, Content-Type, Authorization, credential, X-XSRF-TOKEN, token, username, client, knfie4j-gateway-request, knife4j-gateway-code, request-origion";
+    private static final String ALLOWED_METHODS = "GET,POST,PUT,DELETE,OPTIONS,HEAD";
+    private static final String ALLOWED_ORIGIN = "*";
+    private static final String ALLOWED_EXPOSE = "*";
+    private static final String MAX_AGE = "18000L";
 
-	/**
-	 * 跨域配置
-	 */
-	@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 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);
+        };
+    }
 
 }

+ 55 - 55
blade-gateway/src/main/java/org/springblade/gateway/dynamic/DynamicRouteService.java

@@ -34,68 +34,68 @@ import java.util.List;
 @Service
 public class DynamicRouteService implements ApplicationEventPublisherAware {
 
-	private final RouteDefinitionWriter routeDefinitionWriter;
+    private final RouteDefinitionWriter routeDefinitionWriter;
 
-	private ApplicationEventPublisher publisher;
+    private ApplicationEventPublisher publisher;
 
-	public DynamicRouteService(RouteDefinitionWriter routeDefinitionWriter) {
-		this.routeDefinitionWriter = routeDefinitionWriter;
-	}
+    public DynamicRouteService(RouteDefinitionWriter routeDefinitionWriter) {
+        this.routeDefinitionWriter = routeDefinitionWriter;
+    }
 
-	@Override
-	public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
-		this.publisher = applicationEventPublisher;
-	}
+    @Override
+    public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
+        this.publisher = applicationEventPublisher;
+    }
 
-	/**
-	 * 增加路由
-	 */
-	public String save(RouteDefinition definition) {
-		try {
-			routeDefinitionWriter.save(Mono.just(definition)).subscribe();
-			this.publisher.publishEvent(new RefreshRoutesEvent(this));
-			return "save success";
-		} catch (Exception e) {
-			e.printStackTrace();
-			return "save failure";
-		}
-	}
+    /**
+     * 增加路由
+     */
+    public String save(RouteDefinition definition) {
+        try {
+            routeDefinitionWriter.save(Mono.just(definition)).subscribe();
+            this.publisher.publishEvent(new RefreshRoutesEvent(this));
+            return "save success";
+        } catch (Exception e) {
+            e.printStackTrace();
+            return "save failure";
+        }
+    }
 
-	/**
-	 * 更新路由
-	 */
-	public String update(RouteDefinition definition) {
-		try {
-			this.routeDefinitionWriter.delete(Mono.just(definition.getId()));
-			this.routeDefinitionWriter.save(Mono.just(definition)).subscribe();
-			this.publisher.publishEvent(new RefreshRoutesEvent(this));
-			return "update success";
-		} catch (Exception e) {
-			e.printStackTrace();
-			return "update failure";
-		}
-	}
+    /**
+     * 更新路由
+     */
+    public String update(RouteDefinition definition) {
+        try {
+            this.routeDefinitionWriter.delete(Mono.just(definition.getId()));
+            this.routeDefinitionWriter.save(Mono.just(definition)).subscribe();
+            this.publisher.publishEvent(new RefreshRoutesEvent(this));
+            return "update success";
+        } catch (Exception e) {
+            e.printStackTrace();
+            return "update failure";
+        }
+    }
 
-	/**
-	 * 更新路由
-	 */
-	public String updateList(List<RouteDefinition> routeDefinitions) {
-		routeDefinitions.forEach(this::update);
-		return "update done";
-	}
+    /**
+     * 更新路由
+     */
+    public String updateList(List<RouteDefinition> routeDefinitions) {
+        routeDefinitions.forEach(this::update);
+        return "update done";
+    }
 
-	/**
-	 * 删除路由
-	 */
-	public String delete(String id) {
-		try {
-			this.routeDefinitionWriter.delete(Mono.just(id));
-			return "delete success";
-		} catch (Exception e) {
-			e.printStackTrace();
-			return "delete failure";
-		}
-	}
+    /**
+     * 删除路由
+     */
+    public String delete(String id) {
+        try {
+            this.routeDefinitionWriter.delete(Mono.just(id));
+            return "delete success";
+        } catch (Exception e) {
+            e.printStackTrace();
+            return "delete failure";
+        }
+    }
 
 
 }

+ 41 - 41
blade-gateway/src/main/java/org/springblade/gateway/dynamic/DynamicRouteServiceListener.java

@@ -45,50 +45,50 @@ import java.util.concurrent.Executor;
 @Component
 public class DynamicRouteServiceListener {
 
-	private final DynamicRouteService dynamicRouteService;
-	private final NacosDiscoveryProperties nacosDiscoveryProperties;
-	private final NacosConfigProperties nacosConfigProperties;
-	private final BladeProperties bladeProperties;
+    private final DynamicRouteService dynamicRouteService;
+    private final NacosDiscoveryProperties nacosDiscoveryProperties;
+    private final NacosConfigProperties nacosConfigProperties;
+    private final BladeProperties bladeProperties;
 
-	public DynamicRouteServiceListener(DynamicRouteService dynamicRouteService, NacosDiscoveryProperties nacosDiscoveryProperties, NacosConfigProperties nacosConfigProperties, BladeProperties bladeProperties) {
-		this.dynamicRouteService = dynamicRouteService;
-		this.nacosDiscoveryProperties = nacosDiscoveryProperties;
-		this.nacosConfigProperties = nacosConfigProperties;
-		this.bladeProperties = bladeProperties;
-		dynamicRouteServiceListener();
-	}
+    public DynamicRouteServiceListener(DynamicRouteService dynamicRouteService, NacosDiscoveryProperties nacosDiscoveryProperties, NacosConfigProperties nacosConfigProperties, BladeProperties bladeProperties) {
+        this.dynamicRouteService = dynamicRouteService;
+        this.nacosDiscoveryProperties = nacosDiscoveryProperties;
+        this.nacosConfigProperties = nacosConfigProperties;
+        this.bladeProperties = bladeProperties;
+        dynamicRouteServiceListener();
+    }
 
-	/**
-	 * 监听Nacos下发的动态路由配置
-	 */
-	private void dynamicRouteServiceListener() {
-		try {
-			String dataId = NacosConstant.dataId(bladeProperties.getName(), bladeProperties.getEnv(), NacosConstant.NACOS_CONFIG_JSON_FORMAT);
-			String group = nacosConfigProperties.getGroup();
-			Properties properties = new Properties();
-			properties.setProperty(PropertyKeyConst.SERVER_ADDR, nacosDiscoveryProperties.getServerAddr());
-			properties.setProperty(PropertyKeyConst.NAMESPACE, nacosDiscoveryProperties.getNamespace());
-			ConfigService configService = NacosFactory.createConfigService(properties);
-			configService.addListener(dataId, group, new Listener() {
-				@Override
-				public void receiveConfigInfo(String configInfo) {
-					List<RouteDefinition> routeDefinitions = JSON.parseArray(configInfo, RouteDefinition.class);
-					dynamicRouteService.updateList(routeDefinitions);
-				}
+    /**
+     * 监听Nacos下发的动态路由配置
+     */
+    private void dynamicRouteServiceListener() {
+        try {
+            String dataId = NacosConstant.dataId(bladeProperties.getName(), bladeProperties.getEnv(), NacosConstant.NACOS_CONFIG_JSON_FORMAT);
+            String group = nacosConfigProperties.getGroup();
+            Properties properties = new Properties();
+            properties.setProperty(PropertyKeyConst.SERVER_ADDR, nacosDiscoveryProperties.getServerAddr());
+            properties.setProperty(PropertyKeyConst.NAMESPACE, nacosDiscoveryProperties.getNamespace());
+            ConfigService configService = NacosFactory.createConfigService(properties);
+            configService.addListener(dataId, group, new Listener() {
+                @Override
+                public void receiveConfigInfo(String configInfo) {
+                    List<RouteDefinition> routeDefinitions = JSON.parseArray(configInfo, RouteDefinition.class);
+                    dynamicRouteService.updateList(routeDefinitions);
+                }
 
-				@Override
-				public Executor getExecutor() {
-					return null;
-				}
-			});
-			String configInfo = configService.getConfig(dataId, group, 5000);
-			if (configInfo != null) {
-				List<RouteDefinition> routeDefinitions = JSON.parseArray(configInfo, RouteDefinition.class);
-				dynamicRouteService.updateList(routeDefinitions);
-			}
-		} catch (NacosException ignored) {
+                @Override
+                public Executor getExecutor() {
+                    return null;
+                }
+            });
+            String configInfo = configService.getConfig(dataId, group, 5000);
+            if (configInfo != null) {
+                List<RouteDefinition> routeDefinitions = JSON.parseArray(configInfo, RouteDefinition.class);
+                dynamicRouteService.updateList(routeDefinitions);
+            }
+        } catch (NacosException ignored) {
 
-		}
-	}
+        }
+    }
 
 }

+ 8 - 8
blade-gateway/src/main/java/org/springblade/gateway/dynamic/GatewayFilter.java

@@ -29,13 +29,13 @@ import java.util.Map;
 @Data
 public class GatewayFilter {
 
-	/**
-	 * 过滤器对应的Name
-	 */
-	private String name;
+    /**
+     * 过滤器对应的Name
+     */
+    private String name;
 
-	/**
-	 * 对应的路由规则
-	 */
-	private Map<String, String> args = new LinkedHashMap<>();
+    /**
+     * 对应的路由规则
+     */
+    private Map<String, String> args = new LinkedHashMap<>();
 }

+ 8 - 8
blade-gateway/src/main/java/org/springblade/gateway/dynamic/GatewayPredicate.java

@@ -29,13 +29,13 @@ import java.util.Map;
 @Data
 public class GatewayPredicate {
 
-	/**
-	 * 断言对应的Name
-	 */
-	private String name;
+    /**
+     * 断言对应的Name
+     */
+    private String name;
 
-	/**
-	 * 配置的断言规则
-	 */
-	private Map<String, String> args = new LinkedHashMap<>();
+    /**
+     * 配置的断言规则
+     */
+    private Map<String, String> args = new LinkedHashMap<>();
 }

+ 24 - 24
blade-gateway/src/main/java/org/springblade/gateway/dynamic/GatewayRoute.java

@@ -30,28 +30,28 @@ import java.util.List;
 @Data
 public class GatewayRoute {
 
-	/**
-	 * 路由的id
-	 */
-	private String id;
-
-	/**
-	 * 路由断言集合配置
-	 */
-	private List<GatewayPredicate> predicates = new ArrayList<>();
-
-	/**
-	 * 路由过滤器集合配置
-	 */
-	private List<GatewayFilter> filters = new ArrayList<>();
-
-	/**
-	 * 路由规则转发的目标uri
-	 */
-	private String uri;
-
-	/**
-	 * 路由执行的顺序
-	 */
-	private int order = 0;
+    /**
+     * 路由的id
+     */
+    private String id;
+
+    /**
+     * 路由断言集合配置
+     */
+    private List<GatewayPredicate> predicates = new ArrayList<>();
+
+    /**
+     * 路由过滤器集合配置
+     */
+    private List<GatewayFilter> filters = new ArrayList<>();
+
+    /**
+     * 路由规则转发的目标uri
+     */
+    private String uri;
+
+    /**
+     * 路由执行的顺序
+     */
+    private int order = 0;
 }

+ 56 - 56
blade-gateway/src/main/java/org/springblade/gateway/filter/AuthFilter.java

@@ -52,66 +52,66 @@ import java.nio.charset.StandardCharsets;
 @Component
 @AllArgsConstructor
 public class AuthFilter implements GlobalFilter, Ordered {
-	private final AuthProperties authProperties;
-	private final ObjectMapper objectMapper;
-	private final JwtProperties jwtProperties;
-	private final AntPathMatcher antPathMatcher = new AntPathMatcher();
+    private final AuthProperties authProperties;
+    private final ObjectMapper objectMapper;
+    private final JwtProperties jwtProperties;
+    private final AntPathMatcher antPathMatcher = new AntPathMatcher();
 
-	@Override
-	public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
-		//校验 Token 放行
-		String originalRequestUrl = RequestProvider.getOriginalRequestUrl(exchange);
-		String path = exchange.getRequest().getURI().getPath();
-		if (isSkip(path) || isSkip(originalRequestUrl)) {
-			return chain.filter(exchange);
-		}
-		//校验 Token 合法性
-		ServerHttpResponse resp = exchange.getResponse();
-		String headerToken = exchange.getRequest().getHeaders().getFirst(AuthProvider.AUTH_KEY);
-		String paramToken = exchange.getRequest().getQueryParams().getFirst(AuthProvider.AUTH_KEY);
-		if (StringUtils.isBlank(headerToken) && StringUtils.isBlank(paramToken)) {
-			return unAuth(resp, "缺失令牌,鉴权失败");
-		}
-		String auth = StringUtils.isBlank(headerToken) ? paramToken : headerToken;
-		String token = JwtUtil.getToken(auth);
-		Claims claims = JwtUtil.parseJWT(token);
-		if (token == null || claims == null) {
-			return unAuth(resp, "请求未授权");
-		}
-		//判断 Token 状态
-		if (jwtProperties.getState()) {
-			String tenantId = String.valueOf(claims.get(TokenConstant.TENANT_ID));
-			String userId = String.valueOf(claims.get(TokenConstant.USER_ID));
-			String accessToken = JwtUtil.getAccessToken(tenantId, userId, token);
-			if (!token.equalsIgnoreCase(accessToken)) {
-				return unAuth(resp, "令牌已失效");
-			}
-		}
-		return chain.filter(exchange);
-	}
+    @Override
+    public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
+        //校验 Token 放行
+        String originalRequestUrl = RequestProvider.getOriginalRequestUrl(exchange);
+        String path = exchange.getRequest().getURI().getPath();
+        if (isSkip(path) || isSkip(originalRequestUrl)) {
+            return chain.filter(exchange);
+        }
+        //校验 Token 合法性
+        ServerHttpResponse resp = exchange.getResponse();
+        String headerToken = exchange.getRequest().getHeaders().getFirst(AuthProvider.AUTH_KEY);
+        String paramToken = exchange.getRequest().getQueryParams().getFirst(AuthProvider.AUTH_KEY);
+        if (StringUtils.isBlank(headerToken) && StringUtils.isBlank(paramToken)) {
+            return unAuth(resp, "缺失令牌,鉴权失败");
+        }
+        String auth = StringUtils.isBlank(headerToken) ? paramToken : headerToken;
+        String token = JwtUtil.getToken(auth);
+        Claims claims = JwtUtil.parseJWT(token);
+        if (token == null || claims == null) {
+            return unAuth(resp, "请求未授权");
+        }
+        //判断 Token 状态
+        if (jwtProperties.getState()) {
+            String tenantId = String.valueOf(claims.get(TokenConstant.TENANT_ID));
+            String userId = String.valueOf(claims.get(TokenConstant.USER_ID));
+            String accessToken = JwtUtil.getAccessToken(tenantId, userId, token);
+            if (!token.equalsIgnoreCase(accessToken)) {
+                return unAuth(resp, "令牌已失效");
+            }
+        }
+        return chain.filter(exchange);
+    }
 
-	private boolean isSkip(String path) {
-		return AuthProvider.getDefaultSkipUrl().stream().anyMatch(pattern -> antPathMatcher.match(pattern, path))
-			|| authProperties.getSkipUrl().stream().anyMatch(pattern -> antPathMatcher.match(pattern, path));
-	}
+    private boolean isSkip(String path) {
+        return AuthProvider.getDefaultSkipUrl().stream().anyMatch(pattern -> antPathMatcher.match(pattern, path))
+                || authProperties.getSkipUrl().stream().anyMatch(pattern -> antPathMatcher.match(pattern, path));
+    }
 
-	private Mono<Void> unAuth(ServerHttpResponse resp, String msg) {
-		resp.setStatusCode(HttpStatus.UNAUTHORIZED);
-		resp.getHeaders().add("Content-Type", "application/json;charset=UTF-8");
-		String result = "";
-		try {
-			result = objectMapper.writeValueAsString(ResponseProvider.unAuth(msg));
-		} catch (JsonProcessingException e) {
-			log.error(e.getMessage(), e);
-		}
-		DataBuffer buffer = resp.bufferFactory().wrap(result.getBytes(StandardCharsets.UTF_8));
-		return resp.writeWith(Flux.just(buffer));
-	}
+    private Mono<Void> unAuth(ServerHttpResponse resp, String msg) {
+        resp.setStatusCode(HttpStatus.UNAUTHORIZED);
+        resp.getHeaders().add("Content-Type", "application/json;charset=UTF-8");
+        String result = "";
+        try {
+            result = objectMapper.writeValueAsString(ResponseProvider.unAuth(msg));
+        } catch (JsonProcessingException e) {
+            log.error(e.getMessage(), e);
+        }
+        DataBuffer buffer = resp.bufferFactory().wrap(result.getBytes(StandardCharsets.UTF_8));
+        return resp.writeWith(Flux.just(buffer));
+    }
 
 
-	@Override
-	public int getOrder() {
-		return -100;
-	}
+    @Override
+    public int getOrder() {
+        return -100;
+    }
 
 }

+ 49 - 49
blade-gateway/src/main/java/org/springblade/gateway/filter/GlobalRequestLogFilter.java

@@ -53,60 +53,60 @@ import java.util.List;
 @RequiredArgsConstructor
 @ConditionalOnProperty(value = "blade.log.request.enabled", havingValue = "true", matchIfMissing = true)
 public class GlobalRequestLogFilter implements GlobalFilter, Ordered {
-	private final WebEndpointProperties endpointProperties;
+    private final WebEndpointProperties endpointProperties;
 
-	@Override
-	public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
-		ServerHttpRequest request = exchange.getRequest();
-		// 打印请求路径
-		String path = request.getPath().pathWithinApplication().value();
+    @Override
+    public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
+        ServerHttpRequest request = exchange.getRequest();
+        // 打印请求路径
+        String path = request.getPath().pathWithinApplication().value();
 
-		// 忽略 endpoint 请求
-		String endpointBasePath = endpointProperties.getBasePath();
-		if (StringUtils.isNotBlank(endpointBasePath) && path.startsWith(endpointBasePath)) {
-			return chain.filter(exchange);
-		}
+        // 忽略 endpoint 请求
+        String endpointBasePath = endpointProperties.getBasePath();
+        if (StringUtils.isNotBlank(endpointBasePath) && path.startsWith(endpointBasePath)) {
+            return chain.filter(exchange);
+        }
 
-		String requestUrl = RequestProvider.getOriginalRequestUrl(exchange);
+        String requestUrl = RequestProvider.getOriginalRequestUrl(exchange);
 
-		// 构建成一条长 日志,避免并发下日志错乱
-		StringBuilder beforeReqLog = new StringBuilder(300);
-		// 日志参数
-		List<Object> beforeReqArgs = new ArrayList<>();
-		beforeReqLog.append("\n\n================ Gateway Request Start  ================\n");
-		// 打印路由
-		beforeReqLog.append("===> {}: {}\n");
-		// 参数
-		String requestMethod = request.getMethodValue();
-		beforeReqArgs.add(requestMethod);
-		beforeReqArgs.add(requestUrl);
+        // 构建成一条长 日志,避免并发下日志错乱
+        StringBuilder beforeReqLog = new StringBuilder(300);
+        // 日志参数
+        List<Object> beforeReqArgs = new ArrayList<>();
+        beforeReqLog.append("\n\n================ Gateway Request Start  ================\n");
+        // 打印路由
+        beforeReqLog.append("===> {}: {}\n");
+        // 参数
+        String requestMethod = request.getMethodValue();
+        beforeReqArgs.add(requestMethod);
+        beforeReqArgs.add(requestUrl);
 
-		// 打印请求头
-		HttpHeaders headers = request.getHeaders();
-		headers.forEach((headerName, headerValue) -> {
-			beforeReqLog.append("===Headers===  {}: {}\n");
-			beforeReqArgs.add(headerName);
-			if (AuthProvider.AUTH_KEY.toLowerCase().equals(headerName)) {
-				String value = headerValue.get(0);
-				String token = JwtUtil.getToken(value);
-				Claims claims = JwtUtil.parseJWT(token);
-				beforeReqArgs.add((claims == null) ? "" : claims.toString());
-				beforeReqLog.append("===Headers===  {}: {}\n");
-				beforeReqArgs.add(headerName.concat("-original"));
-				beforeReqArgs.add(StringUtils.join(headerValue.toArray()));
-			} else {
-				beforeReqArgs.add(StringUtils.join(headerValue.toArray()));
-			}
-		});
+        // 打印请求头
+        HttpHeaders headers = request.getHeaders();
+        headers.forEach((headerName, headerValue) -> {
+            beforeReqLog.append("===Headers===  {}: {}\n");
+            beforeReqArgs.add(headerName);
+            if (AuthProvider.AUTH_KEY.toLowerCase().equals(headerName)) {
+                String value = headerValue.get(0);
+                String token = JwtUtil.getToken(value);
+                Claims claims = JwtUtil.parseJWT(token);
+                beforeReqArgs.add((claims == null) ? "" : claims.toString());
+                beforeReqLog.append("===Headers===  {}: {}\n");
+                beforeReqArgs.add(headerName.concat("-original"));
+                beforeReqArgs.add(StringUtils.join(headerValue.toArray()));
+            } else {
+                beforeReqArgs.add(StringUtils.join(headerValue.toArray()));
+            }
+        });
 
-		beforeReqLog.append("================  Gateway Request End  =================\n");
-		// 打印执行时间
-		log.info(beforeReqLog.toString(), beforeReqArgs.toArray());
-		return chain.filter(exchange);
-	}
+        beforeReqLog.append("================  Gateway Request End  =================\n");
+        // 打印执行时间
+        log.info(beforeReqLog.toString(), beforeReqArgs.toArray());
+        return chain.filter(exchange);
+    }
 
-	@Override
-	public int getOrder() {
-		return Ordered.LOWEST_PRECEDENCE;
-	}
+    @Override
+    public int getOrder() {
+        return Ordered.LOWEST_PRECEDENCE;
+    }
 }

+ 45 - 45
blade-gateway/src/main/java/org/springblade/gateway/filter/GlobalResponseLogFilter.java

@@ -46,54 +46,54 @@ import java.util.List;
 @RequiredArgsConstructor
 @ConditionalOnProperty(value = "blade.log.request.enabled", havingValue = "true", matchIfMissing = true)
 public class GlobalResponseLogFilter implements GlobalFilter, Ordered {
-	private final WebEndpointProperties endpointProperties;
+    private final WebEndpointProperties endpointProperties;
 
-	@Override
-	public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
-		ServerHttpRequest request = exchange.getRequest();
-		// 打印请求路径
-		String path = request.getPath().pathWithinApplication().value();
-		// 忽略 endpoint 请求
-		String endpointBasePath = endpointProperties.getBasePath();
-		if (StringUtils.isNotBlank(endpointBasePath) && path.startsWith(endpointBasePath)) {
-			return chain.filter(exchange);
-		}
-		return chain.filter(exchange).then(
-			Mono.fromRunnable(() -> {
-				MultiValueMap<String, String> queryParams = request.getQueryParams();
-				String requestUrl = UriComponentsBuilder.fromPath(path).queryParams(queryParams).build().toUriString();
+    @Override
+    public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
+        ServerHttpRequest request = exchange.getRequest();
+        // 打印请求路径
+        String path = request.getPath().pathWithinApplication().value();
+        // 忽略 endpoint 请求
+        String endpointBasePath = endpointProperties.getBasePath();
+        if (StringUtils.isNotBlank(endpointBasePath) && path.startsWith(endpointBasePath)) {
+            return chain.filter(exchange);
+        }
+        return chain.filter(exchange).then(
+                Mono.fromRunnable(() -> {
+                    MultiValueMap<String, String> queryParams = request.getQueryParams();
+                    String requestUrl = UriComponentsBuilder.fromPath(path).queryParams(queryParams).build().toUriString();
 
-				// 构建成一条长 日志,避免并发下日志错乱
-				StringBuilder responseLog = new StringBuilder(300);
-				// 日志参数
-				List<Object> responseArgs = new ArrayList<>();
-				responseLog.append("\n\n================ Gateway Response Start  ================\n");
-				ServerHttpResponse response = exchange.getResponse();
-				// 打印路由 200 get: /api/xxx/xxx
-				responseLog.append("<=== {} {}: {}\n");
-				// 参数
-				String requestMethod = request.getMethodValue();
-				responseArgs.add(response.getStatusCode().value());
-				responseArgs.add(requestMethod);
-				responseArgs.add(requestUrl);
+                    // 构建成一条长 日志,避免并发下日志错乱
+                    StringBuilder responseLog = new StringBuilder(300);
+                    // 日志参数
+                    List<Object> responseArgs = new ArrayList<>();
+                    responseLog.append("\n\n================ Gateway Response Start  ================\n");
+                    ServerHttpResponse response = exchange.getResponse();
+                    // 打印路由 200 get: /api/xxx/xxx
+                    responseLog.append("<=== {} {}: {}\n");
+                    // 参数
+                    String requestMethod = request.getMethodValue();
+                    responseArgs.add(response.getStatusCode().value());
+                    responseArgs.add(requestMethod);
+                    responseArgs.add(requestUrl);
 
-				// 打印请求头
-				HttpHeaders headers = response.getHeaders();
-				headers.forEach((headerName, headerValue) -> {
-					responseLog.append("===Headers===  {}: {}\n");
-					responseArgs.add(headerName);
-					responseArgs.add(StringUtils.join(headerValue.toArray()));
-				});
+                    // 打印请求头
+                    HttpHeaders headers = response.getHeaders();
+                    headers.forEach((headerName, headerValue) -> {
+                        responseLog.append("===Headers===  {}: {}\n");
+                        responseArgs.add(headerName);
+                        responseArgs.add(StringUtils.join(headerValue.toArray()));
+                    });
 
-				responseLog.append("================  Gateway Response End  =================\n");
-				// 打印执行时间
-				log.info(responseLog.toString(), responseArgs.toArray());
-			})
-		);
-	}
+                    responseLog.append("================  Gateway Response End  =================\n");
+                    // 打印执行时间
+                    log.info(responseLog.toString(), responseArgs.toArray());
+                })
+        );
+    }
 
-	@Override
-	public int getOrder() {
-		return Ordered.HIGHEST_PRECEDENCE;
-	}
+    @Override
+    public int getOrder() {
+        return Ordered.HIGHEST_PRECEDENCE;
+    }
 }

+ 32 - 32
blade-gateway/src/main/java/org/springblade/gateway/filter/RequestFilter.java

@@ -27,37 +27,37 @@ import static org.springframework.cloud.gateway.support.ServerWebExchangeUtils.a
 @Component
 public class RequestFilter 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;
-	}
+    /**
+     * 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;
+    }
 
 }

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

@@ -41,56 +41,56 @@ import java.util.Map;
 @RequiredArgsConstructor
 public class ErrorExceptionHandler implements ErrorWebExceptionHandler {
 
-	private final ObjectMapper objectMapper;
+    private final ObjectMapper objectMapper;
 
-	@Override
-	public Mono<Void> handle(ServerWebExchange exchange, Throwable ex) {
-		ServerHttpRequest request = exchange.getRequest();
-		ServerHttpResponse response = exchange.getResponse();
+    @Override
+    public Mono<Void> handle(ServerWebExchange exchange, Throwable ex) {
+        ServerHttpRequest request = exchange.getRequest();
+        ServerHttpResponse response = exchange.getResponse();
 
-		if (response.isCommitted()) {
-			return Mono.error(ex);
-		}
+        if (response.isCommitted()) {
+            return Mono.error(ex);
+        }
 
-		response.getHeaders().setContentType(MediaType.APPLICATION_JSON);
-		if (ex instanceof ResponseStatusException) {
-			response.setStatusCode(((ResponseStatusException) ex).getStatus());
-		}
+        response.getHeaders().setContentType(MediaType.APPLICATION_JSON);
+        if (ex instanceof ResponseStatusException) {
+            response.setStatusCode(((ResponseStatusException) ex).getStatus());
+        }
 
-		return response.writeWith(Mono.fromSupplier(() -> {
-			DataBufferFactory bufferFactory = response.bufferFactory();
-			try {
-				int status = 500;
-				if (response.getStatusCode() != null) {
-					status = response.getStatusCode().value();
-				}
-				Map<String, Object> result = ResponseProvider.response(status, this.buildMessage(request, ex));
-				return bufferFactory.wrap(objectMapper.writeValueAsBytes(result));
-			} catch (JsonProcessingException e) {
-				return bufferFactory.wrap(new byte[0]);
-			}
-		}));
-	}
+        return response.writeWith(Mono.fromSupplier(() -> {
+            DataBufferFactory bufferFactory = response.bufferFactory();
+            try {
+                int status = 500;
+                if (response.getStatusCode() != null) {
+                    status = response.getStatusCode().value();
+                }
+                Map<String, Object> result = ResponseProvider.response(status, this.buildMessage(request, ex));
+                return bufferFactory.wrap(objectMapper.writeValueAsBytes(result));
+            } catch (JsonProcessingException e) {
+                return bufferFactory.wrap(new byte[0]);
+            }
+        }));
+    }
 
 
-	/**
-	 * 构建异常信息
-	 */
-	private String buildMessage(ServerHttpRequest request, Throwable ex) {
-		String uri = request.getURI().toString();
-		if (uri.endsWith("doc.html")) {
-			return "[Swagger聚合网关] 已迁移至 [blade-swagger] 服务,请开启 [blade-swagger] 服务并访问 [http://127.0.0.1:18000/doc.html]";
-		}
-		StringBuilder message = new StringBuilder("Failed to handle request [");
-		message.append(request.getMethodValue());
-		message.append(" ");
-		message.append(request.getURI());
-		message.append("]");
-		if (ex != null) {
-			message.append(": ");
-			message.append(ex.getMessage());
-		}
-		return message.toString();
-	}
+    /**
+     * 构建异常信息
+     */
+    private String buildMessage(ServerHttpRequest request, Throwable ex) {
+        String uri = request.getURI().toString();
+        if (uri.endsWith("doc.html")) {
+            return "[Swagger聚合网关] 已迁移至 [blade-swagger] 服务,请开启 [blade-swagger] 服务并访问 [http://127.0.0.1:18000/doc.html]";
+        }
+        StringBuilder message = new StringBuilder("Failed to handle request [");
+        message.append(request.getMethodValue());
+        message.append(" ");
+        message.append(request.getURI());
+        message.append("]");
+        if (ex != null) {
+            message.append(": ");
+            message.append(ex.getMessage());
+        }
+        return message.toString();
+    }
 
 }

+ 4 - 4
blade-gateway/src/main/java/org/springblade/gateway/props/AuthProperties.java

@@ -33,9 +33,9 @@ import java.util.List;
 @ConfigurationProperties("blade.secure")
 public class AuthProperties {
 
-	/**
-	 * 放行API集合
-	 */
-	private final List<String> skipUrl = new ArrayList<>();
+    /**
+     * 放行API集合
+     */
+    private final List<String> skipUrl = new ArrayList<>();
 
 }

+ 35 - 35
blade-gateway/src/main/java/org/springblade/gateway/provider/AuthProvider.java

@@ -28,42 +28,42 @@ import java.util.List;
  */
 public class AuthProvider {
 
-	public static final String AUTH_KEY = TokenConstant.HEADER;
-	private static final List<String> DEFAULT_SKIP_URL = new ArrayList<>();
+    public static final String AUTH_KEY = TokenConstant.HEADER;
+    private static final List<String> DEFAULT_SKIP_URL = new ArrayList<>();
 
-	static {
-		DEFAULT_SKIP_URL.add("/example");
-		DEFAULT_SKIP_URL.add("/oauth/token/**");
-		DEFAULT_SKIP_URL.add("/loginByToken");
-		DEFAULT_SKIP_URL.add("/exceltab/callbackSave");
-		DEFAULT_SKIP_URL.add("/oauth/captcha/**");
-		DEFAULT_SKIP_URL.add("/oauth/clear-cache/**");
-		DEFAULT_SKIP_URL.add("/oauth/user-info");
-		DEFAULT_SKIP_URL.add("/oauth/render/**");
-		DEFAULT_SKIP_URL.add("/oauth/callback/**");
-		DEFAULT_SKIP_URL.add("/oauth/revoke/**");
-		DEFAULT_SKIP_URL.add("/oauth/refresh/**");
-		DEFAULT_SKIP_URL.add("/token/**");
-		DEFAULT_SKIP_URL.add("/actuator/**");
-		DEFAULT_SKIP_URL.add("/v2/api-docs/**");
-		DEFAULT_SKIP_URL.add("/auth/**");
-		DEFAULT_SKIP_URL.add("/log/**");
-		DEFAULT_SKIP_URL.add("/menu/routes");
-		DEFAULT_SKIP_URL.add("/menu/auth-routes");
-		DEFAULT_SKIP_URL.add("/menu/top-menu");
-		DEFAULT_SKIP_URL.add("/tenant/info");
-		DEFAULT_SKIP_URL.add("/process/resource-view");
-		DEFAULT_SKIP_URL.add("/process/diagram-view");
-		DEFAULT_SKIP_URL.add("/manager/check-upload");
-		DEFAULT_SKIP_URL.add("/error/**");
-		DEFAULT_SKIP_URL.add("/assets/**");
-	}
+    static {
+        DEFAULT_SKIP_URL.add("/example");
+        DEFAULT_SKIP_URL.add("/oauth/token/**");
+        DEFAULT_SKIP_URL.add("/loginByToken");
+        DEFAULT_SKIP_URL.add("/exceltab/callbackSave");
+        DEFAULT_SKIP_URL.add("/oauth/captcha/**");
+        DEFAULT_SKIP_URL.add("/oauth/clear-cache/**");
+        DEFAULT_SKIP_URL.add("/oauth/user-info");
+        DEFAULT_SKIP_URL.add("/oauth/render/**");
+        DEFAULT_SKIP_URL.add("/oauth/callback/**");
+        DEFAULT_SKIP_URL.add("/oauth/revoke/**");
+        DEFAULT_SKIP_URL.add("/oauth/refresh/**");
+        DEFAULT_SKIP_URL.add("/token/**");
+        DEFAULT_SKIP_URL.add("/actuator/**");
+        DEFAULT_SKIP_URL.add("/v2/api-docs/**");
+        DEFAULT_SKIP_URL.add("/auth/**");
+        DEFAULT_SKIP_URL.add("/log/**");
+        DEFAULT_SKIP_URL.add("/menu/routes");
+        DEFAULT_SKIP_URL.add("/menu/auth-routes");
+        DEFAULT_SKIP_URL.add("/menu/top-menu");
+        DEFAULT_SKIP_URL.add("/tenant/info");
+        DEFAULT_SKIP_URL.add("/process/resource-view");
+        DEFAULT_SKIP_URL.add("/process/diagram-view");
+        DEFAULT_SKIP_URL.add("/manager/check-upload");
+        DEFAULT_SKIP_URL.add("/error/**");
+        DEFAULT_SKIP_URL.add("/assets/**");
+    }
 
-	/**
-	 * 默认无需鉴权的API
-	 */
-	public static List<String> getDefaultSkipUrl() {
-		return DEFAULT_SKIP_URL;
-	}
+    /**
+     * 默认无需鉴权的API
+     */
+    public static List<String> getDefaultSkipUrl() {
+        return DEFAULT_SKIP_URL;
+    }
 
 }

+ 13 - 13
blade-gateway/src/main/java/org/springblade/gateway/provider/RequestProvider.java

@@ -32,18 +32,18 @@ import java.util.LinkedHashSet;
  */
 public class RequestProvider {
 
-	/**
-	 * 获取原始url
-	 *
-	 * @param exchange
-	 * @return
-	 */
-	public static String getOriginalRequestUrl(ServerWebExchange exchange) {
-		ServerHttpRequest request = exchange.getRequest();
-		LinkedHashSet<URI> uris = exchange.getRequiredAttribute(ServerWebExchangeUtils.GATEWAY_ORIGINAL_REQUEST_URL_ATTR);
-		URI requestUri = uris.stream().findFirst().orElse(request.getURI());
-		MultiValueMap<String, String> queryParams = request.getQueryParams();
-		return UriComponentsBuilder.fromPath(requestUri.getRawPath()).queryParams(queryParams).build().toUriString();
-	}
+    /**
+     * 获取原始url
+     *
+     * @param exchange
+     * @return
+     */
+    public static String getOriginalRequestUrl(ServerWebExchange exchange) {
+        ServerHttpRequest request = exchange.getRequest();
+        LinkedHashSet<URI> uris = exchange.getRequiredAttribute(ServerWebExchangeUtils.GATEWAY_ORIGINAL_REQUEST_URL_ATTR);
+        URI requestUri = uris.stream().findFirst().orElse(request.getURI());
+        MultiValueMap<String, String> queryParams = request.getQueryParams();
+        return UriComponentsBuilder.fromPath(requestUri.getRawPath()).queryParams(queryParams).build().toUriString();
+    }
 
 }

+ 50 - 50
blade-gateway/src/main/java/org/springblade/gateway/provider/ResponseProvider.java

@@ -26,59 +26,59 @@ import java.util.Map;
  */
 public class ResponseProvider {
 
-	/**
-	 * 成功
-	 *
-	 * @param message 信息
-	 * @return
-	 */
-	public static Map<String, Object> success(String message) {
-		return response(200, message);
-	}
+    /**
+     * 成功
+     *
+     * @param message 信息
+     * @return
+     */
+    public static Map<String, Object> success(String message) {
+        return response(200, message);
+    }
 
-	/**
-	 * 失败
-	 *
-	 * @param message 信息
-	 * @return
-	 */
-	public static Map<String, Object> fail(String message) {
-		return response(400, message);
-	}
+    /**
+     * 失败
+     *
+     * @param message 信息
+     * @return
+     */
+    public static Map<String, Object> fail(String message) {
+        return response(400, message);
+    }
 
-	/**
-	 * 未授权
-	 *
-	 * @param message 信息
-	 * @return
-	 */
-	public static Map<String, Object> unAuth(String message) {
-		return response(401, message);
-	}
+    /**
+     * 未授权
+     *
+     * @param message 信息
+     * @return
+     */
+    public static Map<String, Object> unAuth(String message) {
+        return response(401, message);
+    }
 
-	/**
-	 * 服务器异常
-	 *
-	 * @param message 信息
-	 * @return
-	 */
-	public static Map<String, Object> error(String message) {
-		return response(500, message);
-	}
+    /**
+     * 服务器异常
+     *
+     * @param message 信息
+     * @return
+     */
+    public static Map<String, Object> error(String message) {
+        return response(500, message);
+    }
 
-	/**
-	 * 构建返回的JSON数据格式
-	 *
-	 * @param status  状态码
-	 * @param message 信息
-	 * @return
-	 */
-	public static Map<String, Object> response(int status, String message) {
-		Map<String, Object> map = new HashMap<>(16);
-		map.put("code", status);
-		map.put("msg", message);
-		map.put("data", null);
-		return map;
-	}
+    /**
+     * 构建返回的JSON数据格式
+     *
+     * @param status  状态码
+     * @param message 信息
+     * @return
+     */
+    public static Map<String, Object> response(int status, String message) {
+        Map<String, Object> map = new HashMap<>(16);
+        map.put("code", status);
+        map.put("msg", message);
+        map.put("data", null);
+        return map;
+    }
 
 }

+ 0 - 1
blade-ops-api/blade-flow-api/pom.xml

@@ -15,5 +15,4 @@
     <packaging>jar</packaging>
 
 
-
 </project>

+ 34 - 34
blade-ops-api/blade-flow-api/src/main/java/org/springblade/flow/core/constant/ProcessConstant.java

@@ -23,39 +23,39 @@ package org.springblade.flow.core.constant;
  */
 public interface ProcessConstant {
 
-	/**
-	 * 请假流程标识
-	 */
-	String LEAVE_KEY = "Leave";
-
-	/**
-	 * 审批流程
-	 */
-	String EXAMINATION_AND_APPROVAL = "Approval";
-
-	/**
-	 * 同意标识
-	 */
-	String PASS_KEY = "pass";
-
-	/**
-	 * 同意代号
-	 */
-	String PASS_ALIAS = "ok";
-
-	/**
-	 * 同意默认批复
-	 */
-	String PASS_COMMENT = "同意";
-
-	/**
-	 * 驳回默认批复
-	 */
-	String NOT_PASS_COMMENT = "驳回";
-
-	/**
-	 * 创建人变量名
-	 */
-	String TASK_VARIABLE_CREATE_USER = "createUser";
+    /**
+     * 请假流程标识
+     */
+    String LEAVE_KEY = "Leave";
+
+    /**
+     * 审批流程
+     */
+    String EXAMINATION_AND_APPROVAL = "Approval";
+
+    /**
+     * 同意标识
+     */
+    String PASS_KEY = "pass";
+
+    /**
+     * 同意代号
+     */
+    String PASS_ALIAS = "ok";
+
+    /**
+     * 同意默认批复
+     */
+    String PASS_COMMENT = "同意";
+
+    /**
+     * 驳回默认批复
+     */
+    String NOT_PASS_COMMENT = "驳回";
+
+    /**
+     * 创建人变量名
+     */
+    String TASK_VARIABLE_CREATE_USER = "createUser";
 
 }

+ 147 - 147
blade-ops-api/blade-flow-api/src/main/java/org/springblade/flow/core/entity/BladeFlow.java

@@ -30,154 +30,154 @@ import java.util.Map;
  */
 @Data
 public class BladeFlow implements Serializable {
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-	/**
-	 * 任务编号
-	 */
-	private String taskId;
-	/**
-	 * 任务处理人
-	 */
-	private String taskUser;
-	/**
-	 * 任务名称
-	 */
-	private String taskName;
-	/**
-	 * 任务定义Key
-	 */
-	private String taskDefinitionKey;
-	/**
-	 * 任务执行人编号
-	 */
-	private String assignee;
-	/**
-	 * 任务执行人名称
-	 */
-	private String assigneeName;
-	/**
-	 * 流程分类
-	 */
-	private String category;
-	/**
-	 * 流程分类名
-	 */
-	private String categoryName;
-	/**
-	 * 创建时间
-	 */
-	private Date createTime;
-	/**
-	 * 结束时间
-	 */
-	private Date endTime;
-	/**
-	 * 签收时间
-	 */
-	private Date claimTime;
-	/**
-	 * 历史任务结束时间
-	 */
-	private Date historyTaskEndTime;
-	/**
-	 * 执行ID
-	 */
-	private String executionId;
-	/**
-	 * 流程实例ID
-	 */
-	private String processInstanceId;
-	/**
-	 * 流程ID
-	 */
-	private String processDefinitionId;
-	/**
-	 * 流程标识
-	 */
-	private String processDefinitionKey;
-	/**
-	 * 流程名
-	 */
-	private String processDefinitionName;
-	/**
-	 * 流程版本
-	 */
-	private int processDefinitionVersion;
-	/**
-	 * 流程说明
-	 */
-	private String processDefinitionDesc;
-	/**
-	 * 流程简图名
-	 */
-	private String processDefinitionDiagramResName;
-	/**
-	 * 流程重命名
-	 */
-	private String processDefinitionResName;
-	/**
-	 * 历史任务流程实例ID 查看流程图会用到
-	 */
-	private String historyProcessInstanceId;
-	/**
-	 * 流程实例是否结束
-	 */
-	private String processIsFinished;
-	/**
-	 * 历史活动ID
-	 */
-	private String historyActivityId;
-	/**
-	 * 历史活动流程
-	 */
-	private String historyActivityName;
-	/**
-	 * 历史活动耗时
-	 */
-	private String historyActivityDurationTime;
-	/**
-	 * 业务绑定Table
-	 */
-	private String businessTable;
-	/**
-	 * 业务绑定ID
-	 */
-	private String businessId;
-	/**
-	 * 任务状态
-	 */
-	private String status;
-	/**
-	 * 任务意见
-	 */
-	private String comment;
-	/**
-	 * 是否通过
-	 */
-	private boolean isPass;
-	/**
-	 * 是否通过代号
-	 */
-	private String flag;
-	/**
-	 * 开始查询日期
-	 */
-	private Date beginDate;
-	/**
-	 * 结束查询日期
-	 */
-	private Date endDate;
-	/**
-	 * 流程参数
-	 */
-	private Map<String, Object> variables;
+    /**
+     * 任务编号
+     */
+    private String taskId;
+    /**
+     * 任务处理人
+     */
+    private String taskUser;
+    /**
+     * 任务名称
+     */
+    private String taskName;
+    /**
+     * 任务定义Key
+     */
+    private String taskDefinitionKey;
+    /**
+     * 任务执行人编号
+     */
+    private String assignee;
+    /**
+     * 任务执行人名称
+     */
+    private String assigneeName;
+    /**
+     * 流程分类
+     */
+    private String category;
+    /**
+     * 流程分类名
+     */
+    private String categoryName;
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    /**
+     * 结束时间
+     */
+    private Date endTime;
+    /**
+     * 签收时间
+     */
+    private Date claimTime;
+    /**
+     * 历史任务结束时间
+     */
+    private Date historyTaskEndTime;
+    /**
+     * 执行ID
+     */
+    private String executionId;
+    /**
+     * 流程实例ID
+     */
+    private String processInstanceId;
+    /**
+     * 流程ID
+     */
+    private String processDefinitionId;
+    /**
+     * 流程标识
+     */
+    private String processDefinitionKey;
+    /**
+     * 流程名
+     */
+    private String processDefinitionName;
+    /**
+     * 流程版本
+     */
+    private int processDefinitionVersion;
+    /**
+     * 流程说明
+     */
+    private String processDefinitionDesc;
+    /**
+     * 流程简图名
+     */
+    private String processDefinitionDiagramResName;
+    /**
+     * 流程重命名
+     */
+    private String processDefinitionResName;
+    /**
+     * 历史任务流程实例ID 查看流程图会用到
+     */
+    private String historyProcessInstanceId;
+    /**
+     * 流程实例是否结束
+     */
+    private String processIsFinished;
+    /**
+     * 历史活动ID
+     */
+    private String historyActivityId;
+    /**
+     * 历史活动流程
+     */
+    private String historyActivityName;
+    /**
+     * 历史活动耗时
+     */
+    private String historyActivityDurationTime;
+    /**
+     * 业务绑定Table
+     */
+    private String businessTable;
+    /**
+     * 业务绑定ID
+     */
+    private String businessId;
+    /**
+     * 任务状态
+     */
+    private String status;
+    /**
+     * 任务意见
+     */
+    private String comment;
+    /**
+     * 是否通过
+     */
+    private boolean isPass;
+    /**
+     * 是否通过代号
+     */
+    private String flag;
+    /**
+     * 开始查询日期
+     */
+    private Date beginDate;
+    /**
+     * 结束查询日期
+     */
+    private Date endDate;
+    /**
+     * 流程参数
+     */
+    private Map<String, Object> variables;
 
-	/**
-	 * 获取是否通过
-	 */
-	public boolean isPass() {
-		return ProcessConstant.PASS_ALIAS.equals(flag) || ProcessConstant.PASS_COMMENT.equals(comment);
-	}
+    /**
+     * 获取是否通过
+     */
+    public boolean isPass() {
+        return ProcessConstant.PASS_ALIAS.equals(flag) || ProcessConstant.PASS_COMMENT.equals(comment);
+    }
 
 }

+ 8 - 8
blade-ops-api/blade-flow-api/src/main/java/org/springblade/flow/core/entity/FlowEntity.java

@@ -30,14 +30,14 @@ import org.springblade.core.mp.base.BaseEntity;
 @EqualsAndHashCode(callSuper = true)
 public class FlowEntity extends BaseEntity {
 
-	@TableField(exist = false)
-	private BladeFlow flow;
+    @TableField(exist = false)
+    private BladeFlow flow;
 
-	public BladeFlow getFlow() {
-		if (flow == null) {
-			flow = new BladeFlow();
-		}
-		return flow;
-	}
+    public BladeFlow getFlow() {
+        if (flow == null) {
+            flow = new BladeFlow();
+        }
+        return flow;
+    }
 
 }

+ 11 - 11
blade-ops-api/blade-flow-api/src/main/java/org/springblade/flow/core/enums/FlowModeEnum.java

@@ -28,18 +28,18 @@ import lombok.Getter;
 @AllArgsConstructor
 public enum FlowModeEnum {
 
-	/**
-	 * 通用流程
-	 */
-	COMMON("common", 1),
+    /**
+     * 通用流程
+     */
+    COMMON("common", 1),
 
-	/**
-	 * 定制流程
-	 */
-	CUSTOM("custom", 2),
-	;
+    /**
+     * 定制流程
+     */
+    CUSTOM("custom", 2),
+    ;
 
-	final String name;
-	final int mode;
+    final String name;
+    final int mode;
 
 }

+ 57 - 56
blade-ops-api/blade-flow-api/src/main/java/org/springblade/flow/core/feign/IFlowClient.java

@@ -24,6 +24,7 @@ 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.RequestParam;
+
 import java.util.Map;
 
 /**
@@ -32,68 +33,68 @@ import java.util.Map;
  * @author Chill
  */
 @FeignClient(
-	value = AppConstant.APPLICATION_FLOW_NAME,
-	fallback = IFlowClientFallback.class
+        value = AppConstant.APPLICATION_FLOW_NAME,
+        fallback = IFlowClientFallback.class
 )
 public interface IFlowClient {
 
-	String API_PREFIX = "/client";
-	String START_PROCESS_INSTANCE_BY_ID = API_PREFIX + "/start-process-instance-by-id";
-	String START_PROCESS_INSTANCE_BY_KEY = API_PREFIX + "/start-process-instance-by-key";
-	String COMPLETE_TASK = API_PREFIX + "/complete-task";
-	String TASK_VARIABLE = API_PREFIX + "/task-variable";
-	String TASK_VARIABLES = API_PREFIX + "/task-variables";
+    String API_PREFIX = "/client";
+    String START_PROCESS_INSTANCE_BY_ID = API_PREFIX + "/start-process-instance-by-id";
+    String START_PROCESS_INSTANCE_BY_KEY = API_PREFIX + "/start-process-instance-by-key";
+    String COMPLETE_TASK = API_PREFIX + "/complete-task";
+    String TASK_VARIABLE = API_PREFIX + "/task-variable";
+    String TASK_VARIABLES = API_PREFIX + "/task-variables";
 
-	/**
-	 * 开启流程
-	 *
-	 * @param processDefinitionId 流程id
-	 * @param businessKey         业务key
-	 * @param variables           参数
-	 * @return BladeFlow
-	 */
-	@PostMapping(START_PROCESS_INSTANCE_BY_ID)
-	R<BladeFlow> startProcessInstanceById(@RequestParam("processDefinitionId") String processDefinitionId, @RequestParam("businessKey") String businessKey, @RequestBody Map<String, Object> variables);
+    /**
+     * 开启流程
+     *
+     * @param processDefinitionId 流程id
+     * @param businessKey         业务key
+     * @param variables           参数
+     * @return BladeFlow
+     */
+    @PostMapping(START_PROCESS_INSTANCE_BY_ID)
+    R<BladeFlow> startProcessInstanceById(@RequestParam("processDefinitionId") String processDefinitionId, @RequestParam("businessKey") String businessKey, @RequestBody Map<String, Object> variables);
 
-	/**
-	 * 开启流程
-	 *
-	 * @param processDefinitionKey 流程标识
-	 * @param businessKey          业务key
-	 * @param variables            参数
-	 * @return BladeFlow
-	 */
-	@PostMapping(START_PROCESS_INSTANCE_BY_KEY)
-	R<BladeFlow> startProcessInstanceByKey(@RequestParam("processDefinitionKey") String processDefinitionKey, @RequestParam("businessKey") String businessKey, @RequestBody Map<String, Object> variables);
+    /**
+     * 开启流程
+     *
+     * @param processDefinitionKey 流程标识
+     * @param businessKey          业务key
+     * @param variables            参数
+     * @return BladeFlow
+     */
+    @PostMapping(START_PROCESS_INSTANCE_BY_KEY)
+    R<BladeFlow> startProcessInstanceByKey(@RequestParam("processDefinitionKey") String processDefinitionKey, @RequestParam("businessKey") String businessKey, @RequestBody Map<String, Object> variables);
 
-	/**
-	 * 完成任务
-	 *
-	 * @param taskId            任务id
-	 * @param processInstanceId 流程实例id
-	 * @param comment           评论
-	 * @param variables         参数
-	 * @return R
-	 */
-	@PostMapping(COMPLETE_TASK)
-	R completeTask(@RequestParam("taskId") String taskId, @RequestParam("processInstanceId") String processInstanceId, @RequestParam("comment") String comment, @RequestBody Map<String, Object> variables);
+    /**
+     * 完成任务
+     *
+     * @param taskId            任务id
+     * @param processInstanceId 流程实例id
+     * @param comment           评论
+     * @param variables         参数
+     * @return R
+     */
+    @PostMapping(COMPLETE_TASK)
+    R completeTask(@RequestParam("taskId") String taskId, @RequestParam("processInstanceId") String processInstanceId, @RequestParam("comment") String comment, @RequestBody Map<String, Object> variables);
 
-	/**
-	 * 获取流程变量
-	 *
-	 * @param taskId       任务id
-	 * @param variableName 变量名
-	 * @return R
-	 */
-	@GetMapping(TASK_VARIABLE)
-	R<Object> taskVariable(@RequestParam("taskId") String taskId, @RequestParam("variableName") String variableName);
+    /**
+     * 获取流程变量
+     *
+     * @param taskId       任务id
+     * @param variableName 变量名
+     * @return R
+     */
+    @GetMapping(TASK_VARIABLE)
+    R<Object> taskVariable(@RequestParam("taskId") String taskId, @RequestParam("variableName") String variableName);
 
-	/**
-	 * 获取流程变量集合
-	 *
-	 * @param taskId 任务id
-	 * @return R
-	 */
-	@GetMapping(TASK_VARIABLES)
-	R<Map<String, Object>> taskVariables(@RequestParam("taskId") String taskId);
+    /**
+     * 获取流程变量集合
+     *
+     * @param taskId 任务id
+     * @return R
+     */
+    @GetMapping(TASK_VARIABLES)
+    R<Map<String, Object>> taskVariables(@RequestParam("taskId") String taskId);
 }

+ 24 - 24
blade-ops-api/blade-flow-api/src/main/java/org/springblade/flow/core/feign/IFlowClientFallback.java

@@ -34,29 +34,29 @@ import java.util.Map;
 @Component
 public class IFlowClientFallback implements IFlowClient {
 
-	@Override
-	public R<BladeFlow> startProcessInstanceById(String processDefinitionId, String businessKey, Map<String, Object> variables) {
-		return R.fail("远程调用失败");
-	}
-
-	@Override
-	public R<BladeFlow> startProcessInstanceByKey(String processDefinitionKey, String businessKey, Map<String, Object> variables) {
-		return R.fail("远程调用失败");
-	}
-
-	@Override
-	public R completeTask(String taskId, String processInstanceId, String comment, Map<String, Object> variables) {
-		return R.fail("远程调用失败");
-	}
-
-	@Override
-	public R<Object> taskVariable(String taskId, String variableName) {
-		return R.fail("远程调用失败");
-	}
-
-	@Override
-	public R<Map<String, Object>> taskVariables(String taskId) {
-		return R.fail("远程调用失败");
-	}
+    @Override
+    public R<BladeFlow> startProcessInstanceById(String processDefinitionId, String businessKey, Map<String, Object> variables) {
+        return R.fail("远程调用失败");
+    }
+
+    @Override
+    public R<BladeFlow> startProcessInstanceByKey(String processDefinitionKey, String businessKey, Map<String, Object> variables) {
+        return R.fail("远程调用失败");
+    }
+
+    @Override
+    public R completeTask(String taskId, String processInstanceId, String comment, Map<String, Object> variables) {
+        return R.fail("远程调用失败");
+    }
+
+    @Override
+    public R<Object> taskVariable(String taskId, String variableName) {
+        return R.fail("远程调用失败");
+    }
+
+    @Override
+    public R<Map<String, Object>> taskVariables(String taskId) {
+        return R.fail("远程调用失败");
+    }
 
 }

+ 3 - 3
blade-ops-api/blade-flow-api/src/main/java/org/springblade/flow/core/feign/NewFlowClient.java

@@ -30,13 +30,13 @@ public interface NewFlowClient {
      * 获取已发起
      */
     @PostMapping(SEND_LIST)
-    R<Object> selectSendPage(@RequestParam Integer current, @RequestParam Integer size,@RequestParam Integer ordType, @RequestParam String parallelProcessInstanceIds);
+    R<Object> selectSendPage(@RequestParam Integer current, @RequestParam Integer size, @RequestParam Integer ordType, @RequestParam String parallelProcessInstanceIds);
 
     /**
      * 获取待办
      */
     @PostMapping(DONE_LIST)
-    R<Object> selectDonePage(@RequestParam Integer current, @RequestParam Integer size,@RequestParam Integer ordType, @RequestParam String parallelProcessInstanceIds);
+    R<Object> selectDonePage(@RequestParam Integer current, @RequestParam Integer size, @RequestParam Integer ordType, @RequestParam String parallelProcessInstanceIds);
 
     /**
      * 根据业务ID获取流程ID
@@ -54,7 +54,7 @@ public interface NewFlowClient {
      * 流程待办列表
      */
     @GetMapping(TO_DO_LIST)
-    R<Object> selectTodoPage(@RequestParam Integer current, @RequestParam Integer size,@RequestParam Integer ordType, @RequestParam String parallelProcessInstanceIds);
+    R<Object> selectTodoPage(@RequestParam Integer current, @RequestParam Integer size, @RequestParam Integer ordType, @RequestParam String parallelProcessInstanceIds);
 
     /**
      * 查询可运行的模型

+ 30 - 30
blade-ops-api/blade-flow-api/src/main/java/org/springblade/flow/core/utils/FlowUtil.java

@@ -30,38 +30,38 @@ import java.util.Map;
  */
 public class FlowUtil {
 
-	/**
-	 * 定义流程key对应的表名
-	 */
-	private final static Map<String, String> BUSINESS_TABLE = new HashMap<>();
+    /**
+     * 定义流程key对应的表名
+     */
+    private final static Map<String, String> BUSINESS_TABLE = new HashMap<>();
 
-	static {
-		BUSINESS_TABLE.put(ProcessConstant.LEAVE_KEY, "blade_process_leave");
-		BUSINESS_TABLE.put(ProcessConstant.EXAMINATION_AND_APPROVAL, "u_task");
-	}
+    static {
+        BUSINESS_TABLE.put(ProcessConstant.LEAVE_KEY, "blade_process_leave");
+        BUSINESS_TABLE.put(ProcessConstant.EXAMINATION_AND_APPROVAL, "u_task");
+    }
 
-	/**
-	 * 通过流程key获取业务表名
-	 *
-	 * @param key 流程key
-	 */
-	public static String getBusinessTable(String key) {
-		String businessTable = BUSINESS_TABLE.get(key);
-		if (Func.isEmpty(businessTable)) {
-			throw new RuntimeException("流程启动失败,未找到相关业务表");
-		}
-		return businessTable;
-	}
+    /**
+     * 通过流程key获取业务表名
+     *
+     * @param key 流程key
+     */
+    public static String getBusinessTable(String key) {
+        String businessTable = BUSINESS_TABLE.get(key);
+        if (Func.isEmpty(businessTable)) {
+            throw new RuntimeException("流程启动失败,未找到相关业务表");
+        }
+        return businessTable;
+    }
 
-	/**
-	 * 获取业务标识
-	 *
-	 * @param businessTable 业务表
-	 * @param businessId    业务表主键
-	 * @return businessKey
-	 */
-	public static String getBusinessKey(String businessTable, String businessId) {
-		return StringUtil.format("{}:{}", businessTable, businessId);
-	}
+    /**
+     * 获取业务标识
+     *
+     * @param businessTable 业务表
+     * @param businessId    业务表主键
+     * @return businessKey
+     */
+    public static String getBusinessKey(String businessTable, String businessId) {
+        return StringUtil.format("{}:{}", businessTable, businessId);
+    }
 
 }

+ 34 - 34
blade-ops-api/blade-flow-api/src/main/java/org/springblade/flow/core/utils/TaskUtil.java

@@ -29,43 +29,43 @@ import static org.springblade.core.launch.constant.FlowConstant.TASK_USR_PREFIX;
  */
 public class TaskUtil {
 
-	/**
-	 * 获取任务用户格式
-	 *
-	 * @return taskUser
-	 */
-	public static String getTaskUser() {
-		return StringUtil.format("{}{}", TASK_USR_PREFIX, AuthUtil.getUserId());
-	}
+    /**
+     * 获取任务用户格式
+     *
+     * @return taskUser
+     */
+    public static String getTaskUser() {
+        return StringUtil.format("{}{}", TASK_USR_PREFIX, AuthUtil.getUserId());
+    }
 
-	/**
-	 * 获取任务用户格式
-	 *
-	 * @param userId 用户id
-	 * @return taskUser
-	 */
-	public static String getTaskUser(String userId) {
-		return StringUtil.format("{}{}", TASK_USR_PREFIX, userId);
-	}
+    /**
+     * 获取任务用户格式
+     *
+     * @param userId 用户id
+     * @return taskUser
+     */
+    public static String getTaskUser(String userId) {
+        return StringUtil.format("{}{}", TASK_USR_PREFIX, userId);
+    }
 
 
-	/**
-	 * 获取用户主键
-	 *
-	 * @param taskUser 任务用户
-	 * @return userId
-	 */
-	public static Long getUserId(String taskUser) {
-		return Func.toLong(StringUtil.removePrefix(taskUser, TASK_USR_PREFIX));
-	}
+    /**
+     * 获取用户主键
+     *
+     * @param taskUser 任务用户
+     * @return userId
+     */
+    public static Long getUserId(String taskUser) {
+        return Func.toLong(StringUtil.removePrefix(taskUser, TASK_USR_PREFIX));
+    }
 
-	/**
-	 * 获取用户组格式
-	 *
-	 * @return candidateGroup
-	 */
-	public static String getCandidateGroup() {
-		return AuthUtil.getUserRole();
-	}
+    /**
+     * 获取用户组格式
+     *
+     * @return candidateGroup
+     */
+    public static String getCandidateGroup() {
+        return AuthUtil.getUserRole();
+    }
 
 }

+ 12 - 12
blade-ops-api/blade-flow-api/src/main/java/org/springblade/flow/core/vo/FlowProcessVO.java

@@ -31,16 +31,16 @@ import java.util.Date;
 @NoArgsConstructor
 public class FlowProcessVO implements Serializable {
 
-	private String id;
-	private String tenantId;
-	private String name;
-	private String key;
-	private String category;
-	private String categoryName;
-	private Integer version;
-	private String deploymentId;
-	private String resourceName;
-	private String diagramResourceName;
-	private Integer suspensionState;
-	private Date deploymentTime;
+    private String id;
+    private String tenantId;
+    private String name;
+    private String key;
+    private String category;
+    private String categoryName;
+    private Integer version;
+    private String deploymentId;
+    private String resourceName;
+    private String diagramResourceName;
+    private Integer suspensionState;
+    private Date deploymentTime;
 }

+ 31 - 31
blade-ops-api/blade-resource-api/src/main/java/org/springblade/resource/entity/Attach.java

@@ -34,38 +34,38 @@ import org.springblade.core.tenant.mp.TenantEntity;
 @ApiModel(value = "Attach对象", description = "附件表")
 public class Attach extends TenantEntity {
 
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-	/**
-	 * 附件地址
-	 */
-	@ApiModelProperty(value = "附件地址")
-	private String link;
-	/**
-	 * 附件域名
-	 */
-	@ApiModelProperty(value = "附件域名")
-	private String domainUrl;
-	/**
-	 * 附件名称
-	 */
-	@ApiModelProperty(value = "附件名称")
-	private String name;
-	/**
-	 * 附件原名
-	 */
-	@ApiModelProperty(value = "附件原名")
-	private String originalName;
-	/**
-	 * 附件拓展名
-	 */
-	@ApiModelProperty(value = "附件拓展名")
-	private String extension;
-	/**
-	 * 附件大小
-	 */
-	@ApiModelProperty(value = "附件大小")
-	private Long attachSize;
+    /**
+     * 附件地址
+     */
+    @ApiModelProperty(value = "附件地址")
+    private String link;
+    /**
+     * 附件域名
+     */
+    @ApiModelProperty(value = "附件域名")
+    private String domainUrl;
+    /**
+     * 附件名称
+     */
+    @ApiModelProperty(value = "附件名称")
+    private String name;
+    /**
+     * 附件原名
+     */
+    @ApiModelProperty(value = "附件原名")
+    private String originalName;
+    /**
+     * 附件拓展名
+     */
+    @ApiModelProperty(value = "附件拓展名")
+    private String extension;
+    /**
+     * 附件大小
+     */
+    @ApiModelProperty(value = "附件大小")
+    private Long attachSize;
 
 
 }

+ 33 - 34
blade-ops-api/blade-resource-api/src/main/java/org/springblade/resource/entity/LargeFile.java

@@ -34,49 +34,48 @@ import org.springblade.core.tenant.mp.TenantEntity;
 @ApiModel(value = "LargeFile对象", description = "分片表")
 public class LargeFile extends TenantEntity {
 
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-	/**
-	 * 相对路径
-	 */
-	private String path;
+    /**
+     * 相对路径
+     */
+    private String path;
 
-	/**
-	 * 文件名
-	 */
-	private String name;
+    /**
+     * 文件名
+     */
+    private String name;
 
-	/**
-	 * 后缀
-	 */
-	private String suffix;
+    /**
+     * 后缀
+     */
+    private String suffix;
 
-	/**
-	 * 实际分片 大小|字节B
-	 */
-	private Integer size;
+    /**
+     * 实际分片 大小|字节B
+     */
+    private Integer size;
 
 
+    /**
+     * 已上传分片
+     */
+    private Integer shardIndex;
 
-	/**
-	 * 已上传分片
-	 */
-	private Integer shardIndex;
+    /**
+     * 理论 分片大小|B
+     */
+    private Integer shardSize;
 
-	/**
-	 * 理论 分片大小|B
-	 */
-	private Integer shardSize;
+    /**
+     * 分片总数
+     */
+    private Integer shardTotal;
 
-	/**
-	 * 分片总数
-	 */
-	private Integer shardTotal;
-
-	/**
-	 * 文件标识(md5算法)
-	 */
-	private String fileKey;
+    /**
+     * 文件标识(md5算法)
+     */
+    private String fileKey;
 
 
 }

+ 46 - 46
blade-ops-api/blade-resource-api/src/main/java/org/springblade/resource/entity/Oss.java

@@ -34,54 +34,54 @@ import org.springblade.core.tenant.mp.TenantEntity;
 @ApiModel(value = "Oss对象", description = "Oss对象")
 public class Oss extends TenantEntity {
 
-	private static final long serialVersionUID = 1L;
-	/**
-	 * 所属分类
-	 */
-	@ApiModelProperty(value = "所属分类")
-	private Integer category;
+    private static final long serialVersionUID = 1L;
+    /**
+     * 所属分类
+     */
+    @ApiModelProperty(value = "所属分类")
+    private Integer category;
 
-	/**
-	 * 资源编号
-	 */
-	@ApiModelProperty(value = "资源编号")
-	private String ossCode;
+    /**
+     * 资源编号
+     */
+    @ApiModelProperty(value = "资源编号")
+    private String ossCode;
 
-	/**
-	 * oss地址
-	 */
-	@ApiModelProperty(value = "资源地址")
-	private String endpoint;
-	/**
-	 * accessKey
-	 */
-	@ApiModelProperty(value = "accessKey")
-	private String accessKey;
-	/**
-	 * secretKey
-	 */
-	@ApiModelProperty(value = "secretKey")
-	private String secretKey;
-	/**
-	 * 空间名
-	 */
-	@ApiModelProperty(value = "空间名")
-	private String bucketName;
-	/**
-	 * 应用ID TencentCOS需要
-	 */
-	@ApiModelProperty(value = "应用ID")
-	private String appId;
-	/**
-	 * 地域简称 TencentCOS需要
-	 */
-	@ApiModelProperty(value = "地域简称")
-	private String region;
-	/**
-	 * 备注
-	 */
-	@ApiModelProperty(value = "备注")
-	private String remark;
+    /**
+     * oss地址
+     */
+    @ApiModelProperty(value = "资源地址")
+    private String endpoint;
+    /**
+     * accessKey
+     */
+    @ApiModelProperty(value = "accessKey")
+    private String accessKey;
+    /**
+     * secretKey
+     */
+    @ApiModelProperty(value = "secretKey")
+    private String secretKey;
+    /**
+     * 空间名
+     */
+    @ApiModelProperty(value = "空间名")
+    private String bucketName;
+    /**
+     * 应用ID TencentCOS需要
+     */
+    @ApiModelProperty(value = "应用ID")
+    private String appId;
+    /**
+     * 地域简称 TencentCOS需要
+     */
+    @ApiModelProperty(value = "地域简称")
+    private String region;
+    /**
+     * 备注
+     */
+    @ApiModelProperty(value = "备注")
+    private String remark;
 
 
 }

+ 41 - 41
blade-ops-api/blade-resource-api/src/main/java/org/springblade/resource/entity/Sms.java

@@ -34,49 +34,49 @@ import org.springblade.core.tenant.mp.TenantEntity;
 @ApiModel(value = "Sms对象", description = "短信配置表")
 public class Sms extends TenantEntity {
 
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-	/**
-	 * 资源编号
-	 */
-	@ApiModelProperty(value = "资源编号")
-	private String smsCode;
+    /**
+     * 资源编号
+     */
+    @ApiModelProperty(value = "资源编号")
+    private String smsCode;
 
-	/**
-	 * 模板ID
-	 */
-	@ApiModelProperty(value = "模板ID")
-	private String templateId;
-	/**
-	 * 分类
-	 */
-	@ApiModelProperty(value = "分类")
-	private Integer category;
-	/**
-	 * accessKey
-	 */
-	@ApiModelProperty(value = "accessKey")
-	private String accessKey;
-	/**
-	 * secretKey
-	 */
-	@ApiModelProperty(value = "secretKey")
-	private String secretKey;
-	/**
-	 * regionId
-	 */
-	@ApiModelProperty(value = "regionId")
-	private String regionId;
-	/**
-	 * 短信签名
-	 */
-	@ApiModelProperty(value = "短信签名")
-	private String signName;
-	/**
-	 * 备注
-	 */
-	@ApiModelProperty(value = "备注")
-	private String remark;
+    /**
+     * 模板ID
+     */
+    @ApiModelProperty(value = "模板ID")
+    private String templateId;
+    /**
+     * 分类
+     */
+    @ApiModelProperty(value = "分类")
+    private Integer category;
+    /**
+     * accessKey
+     */
+    @ApiModelProperty(value = "accessKey")
+    private String accessKey;
+    /**
+     * secretKey
+     */
+    @ApiModelProperty(value = "secretKey")
+    private String secretKey;
+    /**
+     * regionId
+     */
+    @ApiModelProperty(value = "regionId")
+    private String regionId;
+    /**
+     * 短信签名
+     */
+    @ApiModelProperty(value = "短信签名")
+    private String signName;
+    /**
+     * 备注
+     */
+    @ApiModelProperty(value = "备注")
+    private String remark;
 
 
 }

+ 28 - 28
blade-ops-api/blade-resource-api/src/main/java/org/springblade/resource/enums/SmsCodeEnum.java

@@ -30,33 +30,33 @@ import org.springblade.core.tool.utils.StringPool;
 @AllArgsConstructor
 public enum SmsCodeEnum {
 
-	/**
-	 * 默认编号
-	 */
-	DEFAULT(StringPool.EMPTY, 1),
-
-	/**
-	 * 验证码编号
-	 */
-	VALIDATE("validate", 2),
-
-	/**
-	 * 通知公告编号
-	 */
-	NOTICE("notice", 3),
-
-	/**
-	 * 下单通知编号
-	 */
-	ORDER("order", 4),
-
-	/**
-	 * 会议通知编号
-	 */
-	MEETING("meeting", 5),
-	;
-
-	final String name;
-	final int category;
+    /**
+     * 默认编号
+     */
+    DEFAULT(StringPool.EMPTY, 1),
+
+    /**
+     * 验证码编号
+     */
+    VALIDATE("validate", 2),
+
+    /**
+     * 通知公告编号
+     */
+    NOTICE("notice", 3),
+
+    /**
+     * 下单通知编号
+     */
+    ORDER("order", 4),
+
+    /**
+     * 会议通知编号
+     */
+    MEETING("meeting", 5),
+    ;
+
+    final String name;
+    final int category;
 
 }

+ 10 - 9
blade-ops-api/blade-resource-api/src/main/java/org/springblade/resource/feign/IOSSClient.java

@@ -31,19 +31,20 @@ import org.springframework.web.multipart.MultipartFile;
  * @author Chill
  */
 @FeignClient(
-	value = AppConstant.APPLICATION_RESOURCE_NAME
+        value = AppConstant.APPLICATION_RESOURCE_NAME
 )
 
 public interface IOSSClient {
-	String API_PREFIX = "/client";
-	String SEND_MESSAGE = API_PREFIX + "/addFileInfo";
+    String API_PREFIX = "/client";
+    String SEND_MESSAGE = API_PREFIX + "/addFileInfo";
 
 
-	/**
-	 * 通用短信发送
-	 * @return R
-	 */
-	@PostMapping(value = SEND_MESSAGE ,consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
-	R<BladeFile> addFileInfo(@RequestPart MultipartFile file);
+    /**
+     * 通用短信发送
+     *
+     * @return R
+     */
+    @PostMapping(value = SEND_MESSAGE, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
+    R<BladeFile> addFileInfo(@RequestPart MultipartFile file);
 
 }

+ 36 - 36
blade-ops-api/blade-resource-api/src/main/java/org/springblade/resource/feign/ISmsClient.java

@@ -29,46 +29,46 @@ import org.springframework.web.bind.annotation.RequestParam;
  * @author Chill
  */
 @FeignClient(
-	value = AppConstant.APPLICATION_RESOURCE_NAME,
-	fallback = ISmsClientFallback.class
+        value = AppConstant.APPLICATION_RESOURCE_NAME,
+        fallback = ISmsClientFallback.class
 )
 public interface ISmsClient {
-	String API_PREFIX = "/client";
-	String SEND_MESSAGE = API_PREFIX + "/send-message";
-	String SEND_VALIDATE = API_PREFIX + "/send-validate";
-	String VALIDATE_MESSAGE = API_PREFIX + "/validate-message";
+    String API_PREFIX = "/client";
+    String SEND_MESSAGE = API_PREFIX + "/send-message";
+    String SEND_VALIDATE = API_PREFIX + "/send-validate";
+    String VALIDATE_MESSAGE = API_PREFIX + "/validate-message";
 
-	/**
-	 * 通用短信发送
-	 *
-	 * @param code   资源编号
-	 * @param params 模板参数
-	 * @param phones 手机号集合
-	 * @return R
-	 */
-	@PostMapping(SEND_MESSAGE)
-	R<SmsResponse> sendMessage(@RequestParam("code") String code, @RequestParam("params") String params, @RequestParam("phones") String phones);
+    /**
+     * 通用短信发送
+     *
+     * @param code   资源编号
+     * @param params 模板参数
+     * @param phones 手机号集合
+     * @return R
+     */
+    @PostMapping(SEND_MESSAGE)
+    R<SmsResponse> sendMessage(@RequestParam("code") String code, @RequestParam("params") String params, @RequestParam("phones") String phones);
 
-	/**
-	 * 短信验证码发送
-	 *
-	 * @param code  资源编号
-	 * @param phone 手机号
-	 * @return R
-	 */
-	@PostMapping(SEND_VALIDATE)
-	R sendValidate(@RequestParam("code") String code, @RequestParam("phone") String phone);
+    /**
+     * 短信验证码发送
+     *
+     * @param code  资源编号
+     * @param phone 手机号
+     * @return R
+     */
+    @PostMapping(SEND_VALIDATE)
+    R sendValidate(@RequestParam("code") String code, @RequestParam("phone") String phone);
 
-	/**
-	 * 校验短信
-	 *
-	 * @param code  资源编号
-	 * @param id    校验id
-	 * @param value 校验值
-	 * @param phone 手机号
-	 * @return R
-	 */
-	@PostMapping(VALIDATE_MESSAGE)
-	R validateMessage(@RequestParam("code") String code, @RequestParam("id") String id, @RequestParam("value") String value, @RequestParam("phone") String phone);
+    /**
+     * 校验短信
+     *
+     * @param code  资源编号
+     * @param id    校验id
+     * @param value 校验值
+     * @param phone 手机号
+     * @return R
+     */
+    @PostMapping(VALIDATE_MESSAGE)
+    R validateMessage(@RequestParam("code") String code, @RequestParam("id") String id, @RequestParam("value") String value, @RequestParam("phone") String phone);
 
 }

+ 12 - 12
blade-ops-api/blade-resource-api/src/main/java/org/springblade/resource/feign/ISmsClientFallback.java

@@ -26,19 +26,19 @@ import org.springframework.stereotype.Component;
  */
 @Component
 public class ISmsClientFallback implements ISmsClient {
-	@Override
-	public R sendMessage(String code, String params, String phones) {
-		return R.fail("远程调用失败");
-	}
+    @Override
+    public R sendMessage(String code, String params, String phones) {
+        return R.fail("远程调用失败");
+    }
 
-	@Override
-	public R sendValidate(String code, String phone) {
-		return R.fail("远程调用失败");
-	}
+    @Override
+    public R sendValidate(String code, String phone) {
+        return R.fail("远程调用失败");
+    }
 
-	@Override
-	public R validateMessage(String code, String id, String value, String phone) {
-		return R.fail("远程调用失败");
-	}
+    @Override
+    public R validateMessage(String code, String id, String value, String phone) {
+        return R.fail("远程调用失败");
+    }
 
 }

+ 68 - 68
blade-ops-api/blade-resource-api/src/main/java/org/springblade/resource/utils/SmsUtil.java

@@ -35,79 +35,79 @@ import java.util.Map;
  */
 public class SmsUtil {
 
-	public static final String PARAM_KEY = "code";
-	public static final String SEND_SUCCESS = "短信发送成功";
-	public static final String SEND_FAIL = "短信发送失败";
-	public static final String VALIDATE_SUCCESS = "短信校验成功";
-	public static final String VALIDATE_FAIL = "短信校验失败";
+    public static final String PARAM_KEY = "code";
+    public static final String SEND_SUCCESS = "短信发送成功";
+    public static final String SEND_FAIL = "短信发送失败";
+    public static final String VALIDATE_SUCCESS = "短信校验成功";
+    public static final String VALIDATE_FAIL = "短信校验失败";
 
-	private static ISmsClient smsClient;
+    private static ISmsClient smsClient;
 
-	/**
-	 * 获取短信服务构建类
-	 *
-	 * @return SmsBuilder
-	 */
-	public static ISmsClient getSmsClient() {
-		if (smsClient == null) {
-			smsClient = SpringUtil.getBean(ISmsClient.class);
-		}
-		return smsClient;
-	}
+    /**
+     * 获取短信服务构建类
+     *
+     * @return SmsBuilder
+     */
+    public static ISmsClient getSmsClient() {
+        if (smsClient == null) {
+            smsClient = SpringUtil.getBean(ISmsClient.class);
+        }
+        return smsClient;
+    }
 
-	/**
-	 * 获取短信验证码参数
-	 *
-	 * @return 验证码参数
-	 */
-	public static Map<String, String> getValidateParams() {
-		Map<String, String> params = new HashMap<>(1);
-		params.put(PARAM_KEY, StringUtil.random(6, RandomType.INT));
-		return params;
-	}
+    /**
+     * 获取短信验证码参数
+     *
+     * @return 验证码参数
+     */
+    public static Map<String, String> getValidateParams() {
+        Map<String, String> params = new HashMap<>(1);
+        params.put(PARAM_KEY, StringUtil.random(6, RandomType.INT));
+        return params;
+    }
 
-	/**
-	 * 发送短信
-	 *
-	 * @param code   资源编号
-	 * @param params 模板参数
-	 * @param phones 手机号集合
-	 * @return 发送结果
-	 */
-	public static SmsResponse sendMessage(String code, Map<String, String> params, String phones) {
-		R<SmsResponse> result = getSmsClient().sendMessage(code, JsonUtil.toJson(params), phones);
-		return result.getData();
-	}
+    /**
+     * 发送短信
+     *
+     * @param code   资源编号
+     * @param params 模板参数
+     * @param phones 手机号集合
+     * @return 发送结果
+     */
+    public static SmsResponse sendMessage(String code, Map<String, String> params, String phones) {
+        R<SmsResponse> result = getSmsClient().sendMessage(code, JsonUtil.toJson(params), phones);
+        return result.getData();
+    }
 
-	/**
-	 * 发送验证码
-	 *
-	 * @param code  资源编号
-	 * @param phone 手机号
-	 * @return 发送结果
-	 */
-	public static SmsCode sendValidate(String code, String phone) {
-		SmsCode smsCode = new SmsCode();
-		R result = getSmsClient().sendValidate(code, phone);
-		if (result.isSuccess()) {
-			smsCode = JsonUtil.parse(JsonUtil.toJson(result.getData()), SmsCode.class);
-		} else {
-			smsCode.setSuccess(Boolean.FALSE);
-		}
-		return smsCode;
-	}
+    /**
+     * 发送验证码
+     *
+     * @param code  资源编号
+     * @param phone 手机号
+     * @return 发送结果
+     */
+    public static SmsCode sendValidate(String code, String phone) {
+        SmsCode smsCode = new SmsCode();
+        R result = getSmsClient().sendValidate(code, phone);
+        if (result.isSuccess()) {
+            smsCode = JsonUtil.parse(JsonUtil.toJson(result.getData()), SmsCode.class);
+        } else {
+            smsCode.setSuccess(Boolean.FALSE);
+        }
+        return smsCode;
+    }
 
-	/**
-	 * 校验短信
-	 *
-	 * @param code  资源编号
-	 * @param id    校验id
-	 * @param value 校验值
-	 * @return 发送结果
-	 */
-	public static boolean validateMessage(String code, String id, String value, String phone) {
-		R result = getSmsClient().validateMessage(code, id, value, phone);
-		return result.isSuccess();
-	}
+    /**
+     * 校验短信
+     *
+     * @param code  资源编号
+     * @param id    校验id
+     * @param value 校验值
+     * @return 发送结果
+     */
+    public static boolean validateMessage(String code, String id, String value, String phone) {
+        R result = getSmsClient().validateMessage(code, id, value, phone);
+        return result.isSuccess();
+    }
 
 }

+ 1 - 1
blade-ops-api/blade-resource-api/src/main/java/org/springblade/resource/vo/AttachVO.java

@@ -30,6 +30,6 @@ import org.springblade.resource.entity.Attach;
 @EqualsAndHashCode(callSuper = true)
 @ApiModel(value = "AttachVO对象", description = "附件表")
 public class AttachVO extends Attach {
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
 }

+ 9 - 9
blade-ops-api/blade-resource-api/src/main/java/org/springblade/resource/vo/OssVO.java

@@ -14,16 +14,16 @@ import org.springblade.resource.entity.Oss;
 @EqualsAndHashCode(callSuper = true)
 @ApiModel(value = "OssVO对象", description = "对象存储表")
 public class OssVO extends Oss {
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-	/**
-	 * 分类名
-	 */
-	private String categoryName;
+    /**
+     * 分类名
+     */
+    private String categoryName;
 
-	/**
-	 * 是否启用
-	 */
-	private String statusName;
+    /**
+     * 是否启用
+     */
+    private String statusName;
 
 }

+ 9 - 9
blade-ops-api/blade-resource-api/src/main/java/org/springblade/resource/vo/SmsVO.java

@@ -30,16 +30,16 @@ import org.springblade.resource.entity.Sms;
 @EqualsAndHashCode(callSuper = true)
 @ApiModel(value = "SmsVO对象", description = "短信配置表")
 public class SmsVO extends Sms {
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-	/**
-	 * 分类名
-	 */
-	private String categoryName;
+    /**
+     * 分类名
+     */
+    private String categoryName;
 
-	/**
-	 * 是否启用
-	 */
-	private String statusName;
+    /**
+     * 是否启用
+     */
+    private String statusName;
 
 }

+ 3 - 2
blade-ops-api/blade-resource-api/src/main/java/org/springblade/resource/vo/ToPdfVO.java

@@ -9,11 +9,12 @@ public class ToPdfVO {
 
     private Object file;
 
-    public ToPdfVO(String originalFilename, Object file){
+    public ToPdfVO(String originalFilename, Object file) {
         this.originalFilename = originalFilename;
         this.file = file;
     }
 
-    public ToPdfVO(){}
+    public ToPdfVO() {
+    }
 
 }

+ 2 - 1
blade-ops/blade-admin/README.md

@@ -1,8 +1,9 @@
 ## SDK下载
 
 #### Java SDK 下载
+
     下载SDK: https://open-doc.dingtalk.com/microapp/faquestions/vzbp02
-    
+
 ## 配置项
 
 #### bootstrap.yml

+ 3 - 3
blade-ops/blade-admin/src/main/java/org/springblade/admin/AdminApplication.java

@@ -30,8 +30,8 @@ import org.springframework.cloud.client.SpringCloudApplication;
 @SpringCloudApplication
 public class AdminApplication {
 
-	public static void main(String[] args) {
-		BladeApplication.run(AppConstant.APPLICATION_ADMIN_NAME, AdminApplication.class, args);
-	}
+    public static void main(String[] args) {
+        BladeApplication.run(AppConstant.APPLICATION_ADMIN_NAME, AdminApplication.class, args);
+    }
 
 }

+ 12 - 12
blade-ops/blade-admin/src/main/java/org/springblade/admin/config/DingTalkConfiguration.java

@@ -35,18 +35,18 @@ import org.springframework.web.reactive.function.client.WebClient;
 @ConditionalOnProperty(value = "monitor.ding-talk.enabled", havingValue = "true")
 public class DingTalkConfiguration {
 
-	@Bean
-	public DingTalkService dingTalkService(MonitorProperties properties,
-										   WebClient.Builder builder) {
-		return new DingTalkService(properties, builder.build());
-	}
+    @Bean
+    public DingTalkService dingTalkService(MonitorProperties properties,
+                                           WebClient.Builder builder) {
+        return new DingTalkService(properties, builder.build());
+    }
 
-	@Bean
-	public DingTalkNotifier dingTalkNotifier(MonitorProperties properties,
-											 DingTalkService dingTalkService,
-											 InstanceRepository repository,
-											 Environment environment) {
-		return new DingTalkNotifier(dingTalkService, properties, environment, repository);
-	}
+    @Bean
+    public DingTalkNotifier dingTalkNotifier(MonitorProperties properties,
+                                             DingTalkService dingTalkService,
+                                             InstanceRepository repository,
+                                             Environment environment) {
+        return new DingTalkNotifier(dingTalkService, properties, environment, repository);
+    }
 
 }

+ 30 - 30
blade-ops/blade-admin/src/main/java/org/springblade/admin/config/SecurityConfiguration.java

@@ -35,37 +35,37 @@ import java.net.URI;
 @EnableWebFluxSecurity
 @Configuration(proxyBeanMethods = false)
 public class SecurityConfiguration {
-	private final String contextPath;
+    private final String contextPath;
 
-	public SecurityConfiguration(AdminServerProperties adminServerProperties) {
-		this.contextPath = adminServerProperties.getContextPath();
-	}
+    public SecurityConfiguration(AdminServerProperties adminServerProperties) {
+        this.contextPath = adminServerProperties.getContextPath();
+    }
 
-	@Bean
-	public SecurityWebFilterChain securityWebFilterChain(ServerHttpSecurity http) {
-		// @formatter:off
-		RedirectServerAuthenticationSuccessHandler successHandler = new RedirectServerAuthenticationSuccessHandler();
-		successHandler.setLocation(URI.create(contextPath + "/"));
-		return http.headers().frameOptions().disable().and()
-			.authorizeExchange()
-			// 放开静态文件和登陆
-			.pathMatchers(
-				contextPath + "/assets/**"
-				, contextPath + "/login"
-				, contextPath + "/v1/agent/**"
-				, contextPath + "/v1/catalog/**"
-				, contextPath + "/v1/health/**"
-			).permitAll()
-			// 内网可访问 actuator
-			.pathMatchers(contextPath + "/actuator", contextPath + "/actuator/**").access(new InternalAuthorizationManager())
-			.anyExchange().authenticated().and()
-			.formLogin().loginPage(contextPath + "/login")
-			.authenticationSuccessHandler(successHandler).and()
-			.logout().logoutUrl(contextPath + "/logout").and()
-			.httpBasic().disable()
-			.csrf().disable()
-			.build();
-		// @formatter:on
-	}
+    @Bean
+    public SecurityWebFilterChain securityWebFilterChain(ServerHttpSecurity http) {
+        // @formatter:off
+        RedirectServerAuthenticationSuccessHandler successHandler = new RedirectServerAuthenticationSuccessHandler();
+        successHandler.setLocation(URI.create(contextPath + "/"));
+        return http.headers().frameOptions().disable().and()
+                .authorizeExchange()
+                // 放开静态文件和登陆
+                .pathMatchers(
+                        contextPath + "/assets/**"
+                        , contextPath + "/login"
+                        , contextPath + "/v1/agent/**"
+                        , contextPath + "/v1/catalog/**"
+                        , contextPath + "/v1/health/**"
+                ).permitAll()
+                // 内网可访问 actuator
+                .pathMatchers(contextPath + "/actuator", contextPath + "/actuator/**").access(new InternalAuthorizationManager())
+                .anyExchange().authenticated().and()
+                .formLogin().loginPage(contextPath + "/login")
+                .authenticationSuccessHandler(successHandler).and()
+                .logout().logoutUrl(contextPath + "/logout").and()
+                .httpBasic().disable()
+                .csrf().disable()
+                .build();
+        // @formatter:on
+    }
 
 }

+ 53 - 53
blade-ops/blade-admin/src/main/java/org/springblade/admin/dingtalk/DingTalkNotifier.java

@@ -43,63 +43,63 @@ import java.time.format.DateTimeFormatter;
  */
 @Slf4j
 public class DingTalkNotifier extends AbstractEventNotifier {
-	private final DingTalkService dingTalkService;
-	private final MonitorProperties properties;
-	private final Environment environment;
-	public static final DateTimeFormatter DATETIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+    private final DingTalkService dingTalkService;
+    private final MonitorProperties properties;
+    private final Environment environment;
+    public static final DateTimeFormatter DATETIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
 
-	public DingTalkNotifier(DingTalkService dingTalkService, MonitorProperties properties,
-							Environment environment, InstanceRepository repository) {
-		super(repository);
-		this.dingTalkService = dingTalkService;
-		this.properties = properties;
-		this.environment = environment;
-	}
+    public DingTalkNotifier(DingTalkService dingTalkService, MonitorProperties properties,
+                            Environment environment, InstanceRepository repository) {
+        super(repository);
+        this.dingTalkService = dingTalkService;
+        this.properties = properties;
+        this.environment = environment;
+    }
 
-	@NonNull
-	@Override
-	protected Mono<Void> doNotify(@NonNull InstanceEvent event, @NonNull Instance instance) {
-		if (event instanceof InstanceStatusChangedEvent) {
-			// 构造请求结构
-			return createAndPushMsg(event, instance);
-		}
-		return Mono.empty();
-	}
+    @NonNull
+    @Override
+    protected Mono<Void> doNotify(@NonNull InstanceEvent event, @NonNull Instance instance) {
+        if (event instanceof InstanceStatusChangedEvent) {
+            // 构造请求结构
+            return createAndPushMsg(event, instance);
+        }
+        return Mono.empty();
+    }
 
-	private Mono<Void> createAndPushMsg(InstanceEvent event, Instance instance) {
-		Registration registration = instance.getRegistration();
-		// 服务名
-		String appName = registration.getName();
-		// 服务地址
-		String serviceUrl = registration.getServiceUrl();
-		StatusInfo status = instance.getStatusInfo();
-		// 时间
-		LocalDateTime localDateTime = LocalDateTime.ofInstant(event.getTimestamp(), ZoneId.systemDefault());
-		MonitorProperties.DingTalk dingTalk = properties.getDingTalk();
-		String title = dingTalk.getService().getTitle();
+    private Mono<Void> createAndPushMsg(InstanceEvent event, Instance instance) {
+        Registration registration = instance.getRegistration();
+        // 服务名
+        String appName = registration.getName();
+        // 服务地址
+        String serviceUrl = registration.getServiceUrl();
+        StatusInfo status = instance.getStatusInfo();
+        // 时间
+        LocalDateTime localDateTime = LocalDateTime.ofInstant(event.getTimestamp(), ZoneId.systemDefault());
+        MonitorProperties.DingTalk dingTalk = properties.getDingTalk();
+        String title = dingTalk.getService().getTitle();
 
-		String message = "## **" + title + "**\n" +
-			"#### **【服务】** " + appName + "\n" +
-			"#### **【环境】** " + environment.getActiveProfiles()[0] + "\n" +
-			"#### **【地址】** " + serviceUrl + "\n" +
-			"#### **【状态】** " + statusCn(status) + "\n" +
-			"#### **【时间】** " + DATETIME_FORMATTER.format(localDateTime) + "\n" +
-			"#### **【详情】** " + dingTalk.getLink() + "\n";
+        String message = "## **" + title + "**\n" +
+                "#### **【服务】** " + appName + "\n" +
+                "#### **【环境】** " + environment.getActiveProfiles()[0] + "\n" +
+                "#### **【地址】** " + serviceUrl + "\n" +
+                "#### **【状态】** " + statusCn(status) + "\n" +
+                "#### **【时间】** " + DATETIME_FORMATTER.format(localDateTime) + "\n" +
+                "#### **【详情】** " + dingTalk.getLink() + "\n";
 
-		return dingTalkService.pushMsg(title, message);
-	}
+        return dingTalkService.pushMsg(title, message);
+    }
 
-	private String statusCn(StatusInfo status) {
-		if (status.isUp()) {
-			return "应用上线(IS UP)";
-		} else if (status.isDown()) {
-			return "应用宕机(IS DOWN)";
-		} else if (status.isOffline()) {
-			return "应用掉线(IS OFFLINE)";
-		} else if (status.isUnknown()) {
-			return "未知状态(UNKNOWN)";
-		} else {
-			return "异常状态";
-		}
-	}
+    private String statusCn(StatusInfo status) {
+        if (status.isUp()) {
+            return "应用上线(IS UP)";
+        } else if (status.isDown()) {
+            return "应用宕机(IS DOWN)";
+        } else if (status.isOffline()) {
+            return "应用掉线(IS OFFLINE)";
+        } else if (status.isUnknown()) {
+            return "未知状态(UNKNOWN)";
+        } else {
+            return "异常状态";
+        }
+    }
 }

+ 55 - 55
blade-ops/blade-admin/src/main/java/org/springblade/admin/dingtalk/DingTalkService.java

@@ -44,67 +44,67 @@ import java.util.Map;
 @Slf4j
 @RequiredArgsConstructor
 public class DingTalkService {
-	private static final String DING_TALK_ROBOT_URL = "https://oapi.dingtalk.com/robot/send?access_token=";
-	private final MonitorProperties properties;
-	private final WebClient webClient;
+    private static final String DING_TALK_ROBOT_URL = "https://oapi.dingtalk.com/robot/send?access_token=";
+    private final MonitorProperties properties;
+    private final WebClient webClient;
 
-	/**
-	 * 发送消息
-	 *
-	 * @param title title
-	 * @param text  消息
-	 */
-	public Mono<Void> pushMsg(String title, String text) {
-		log.info("钉钉消息:[创建消息体]title:{}, text:{}", title, text);
+    /**
+     * 发送消息
+     *
+     * @param title title
+     * @param text  消息
+     */
+    public Mono<Void> pushMsg(String title, String text) {
+        log.info("钉钉消息:[创建消息体]title:{}, text:{}", title, text);
 
-		HashMap<String, String> params = new HashMap<>(2);
-		params.put("title", title);
-		params.put("text", text);
+        HashMap<String, String> params = new HashMap<>(2);
+        params.put("title", title);
+        params.put("text", text);
 
-		Map<String, Object> body = new HashMap<>(2);
-		body.put("msgtype", "markdown");
-		body.put("markdown", params);
-		log.info("创建消息体 json:{}", body);
+        Map<String, Object> body = new HashMap<>(2);
+        body.put("msgtype", "markdown");
+        body.put("markdown", params);
+        log.info("创建消息体 json:{}", body);
 
-		MonitorProperties.DingTalk dingTalk = properties.getDingTalk();
-		String accessToken = dingTalk.getAccessToken();
-		if (StringUtils.isEmpty(accessToken)) {
-			log.error("DingTalk alert config accessToken ${monitor.ding-talk.access-token} is blank.");
-			return Mono.empty();
-		}
+        MonitorProperties.DingTalk dingTalk = properties.getDingTalk();
+        String accessToken = dingTalk.getAccessToken();
+        if (StringUtils.isEmpty(accessToken)) {
+            log.error("DingTalk alert config accessToken ${monitor.ding-talk.access-token} is blank.");
+            return Mono.empty();
+        }
 
-		String urlString = DING_TALK_ROBOT_URL + dingTalk.getAccessToken();
-		// 有私钥要签名
-		String secret = dingTalk.getSecret();
-		if (StringUtils.hasText(secret)) {
-			long timestamp = System.currentTimeMillis();
-			urlString += String.format("&timestamp=%s&sign=%s", timestamp, getSign(secret, timestamp));
-		}
-		return webClient.post()
-			.uri(URI.create(urlString))
-			.contentType(MediaType.APPLICATION_JSON)
-			.body(BodyInserters.fromValue(body))
-			.retrieve()
-			.bodyToMono(String.class)
-			.doOnSuccess((result) -> log.info("钉钉消息:[消息返回]result:{}", result))
-			.then();
-	}
+        String urlString = DING_TALK_ROBOT_URL + dingTalk.getAccessToken();
+        // 有私钥要签名
+        String secret = dingTalk.getSecret();
+        if (StringUtils.hasText(secret)) {
+            long timestamp = System.currentTimeMillis();
+            urlString += String.format("&timestamp=%s&sign=%s", timestamp, getSign(secret, timestamp));
+        }
+        return webClient.post()
+                .uri(URI.create(urlString))
+                .contentType(MediaType.APPLICATION_JSON)
+                .body(BodyInserters.fromValue(body))
+                .retrieve()
+                .bodyToMono(String.class)
+                .doOnSuccess((result) -> log.info("钉钉消息:[消息返回]result:{}", result))
+                .then();
+    }
 
-	private static String getSign(String secret, long timestamp) {
-		String stringToSign = timestamp + "\n" + secret;
-		byte[] hmacSha256Bytes = digestHmac(stringToSign, secret);
-		return UriUtils.encode(Base64Utils.encodeToString(hmacSha256Bytes), StandardCharsets.UTF_8);
-	}
+    private static String getSign(String secret, long timestamp) {
+        String stringToSign = timestamp + "\n" + secret;
+        byte[] hmacSha256Bytes = digestHmac(stringToSign, secret);
+        return UriUtils.encode(Base64Utils.encodeToString(hmacSha256Bytes), StandardCharsets.UTF_8);
+    }
 
-	public static byte[] digestHmac(String data, String key) {
-		SecretKey secretKey = new SecretKeySpec(key.getBytes(StandardCharsets.UTF_8), "HmacSHA256");
-		try {
-			Mac mac = Mac.getInstance(secretKey.getAlgorithm());
-			mac.init(secretKey);
-			return mac.doFinal(data.getBytes(StandardCharsets.UTF_8));
-		} catch (NoSuchAlgorithmException | InvalidKeyException e) {
-			throw new RuntimeException(e.getMessage());
-		}
-	}
+    public static byte[] digestHmac(String data, String key) {
+        SecretKey secretKey = new SecretKeySpec(key.getBytes(StandardCharsets.UTF_8), "HmacSHA256");
+        try {
+            Mac mac = Mac.getInstance(secretKey.getAlgorithm());
+            mac.init(secretKey);
+            return mac.doFinal(data.getBytes(StandardCharsets.UTF_8));
+        } catch (NoSuchAlgorithmException | InvalidKeyException e) {
+            throw new RuntimeException(e.getMessage());
+        }
+    }
 
 }

+ 30 - 30
blade-ops/blade-admin/src/main/java/org/springblade/admin/dingtalk/MonitorProperties.java

@@ -32,36 +32,36 @@ import org.springframework.cloud.context.config.annotation.RefreshScope;
 @RefreshScope
 @ConfigurationProperties("monitor")
 public class MonitorProperties {
-	private DingTalk dingTalk = new DingTalk();
+    private DingTalk dingTalk = new DingTalk();
 
-	@Getter
-	@Setter
-	public static class DingTalk {
-		/**
-		 * 启用钉钉告警,默认为 true
-		 */
-		private boolean enabled = false;
-		/**
-		 * 钉钉机器人 token
-		 */
-		private String accessToken;
-		/**
-		 * 签名:如果有 secret 则进行签名,兼容老接口
-		 */
-		private String secret;
-		/**
-		 * 地址配置
-		 */
-		private String link;
-		private Service service = new Service();
-	}
+    @Getter
+    @Setter
+    public static class DingTalk {
+        /**
+         * 启用钉钉告警,默认为 true
+         */
+        private boolean enabled = false;
+        /**
+         * 钉钉机器人 token
+         */
+        private String accessToken;
+        /**
+         * 签名:如果有 secret 则进行签名,兼容老接口
+         */
+        private String secret;
+        /**
+         * 地址配置
+         */
+        private String link;
+        private Service service = new Service();
+    }
 
-	@Getter
-	@Setter
-	public static class Service {
-		/**
-		 * 服务 状态 title
-		 */
-		private String title = "服务状态通知";
-	}
+    @Getter
+    @Setter
+    public static class Service {
+        /**
+         * 服务 状态 title
+         */
+        private String title = "服务状态通知";
+    }
 }

+ 33 - 33
blade-ops/blade-admin/src/main/java/org/springblade/admin/security/InternalAuthorizationManager.java

@@ -35,41 +35,41 @@ import java.util.Optional;
  * @author L.cm
  */
 public class InternalAuthorizationManager implements ReactiveAuthorizationManager<AuthorizationContext> {
-	private static final String HEADER_X_FORWARDED_FOR = "X-Forwarded-For";
+    private static final String HEADER_X_FORWARDED_FOR = "X-Forwarded-For";
 
-	@Override
-	public Mono<AuthorizationDecision> check(Mono<Authentication> authentication, AuthorizationContext context) {
-		return Mono.just(getAuthorizationDecision(context));
-	}
+    @Override
+    public Mono<AuthorizationDecision> check(Mono<Authentication> authentication, AuthorizationContext context) {
+        return Mono.just(getAuthorizationDecision(context));
+    }
 
-	private static AuthorizationDecision getAuthorizationDecision(AuthorizationContext context) {
-		return new AuthorizationDecision(isInternalNet(context));
-	}
+    private static AuthorizationDecision getAuthorizationDecision(AuthorizationContext context) {
+        return new AuthorizationDecision(isInternalNet(context));
+    }
 
-	/**
-	 * 判断是否内网 ip 请求
-	 *
-	 * @param context AuthorizationContext
-	 * @return 是否内网 ip
-	 */
-	private static boolean isInternalNet(AuthorizationContext context) {
-		ServerHttpRequest request = Optional.ofNullable(context)
-			.map(AuthorizationContext::getExchange)
-			.map(ServerWebExchange::getRequest)
-			.orElse(null);
-		if (request == null) {
-			return false;
-		}
-		HttpHeaders headers = request.getHeaders();
-		// 如果没有 X-Forwarded-For 代表为 admin 拉取
-		if (!headers.containsKey(HEADER_X_FORWARDED_FOR)) {
-			return true;
-		}
-		return Optional.of(request)
-			.map(ServerHttpRequest::getRemoteAddress)
-			.map(InetSocketAddress::getAddress)
-			.map(INetUtil::isInternalIp)
-			.orElse(false);
-	}
+    /**
+     * 判断是否内网 ip 请求
+     *
+     * @param context AuthorizationContext
+     * @return 是否内网 ip
+     */
+    private static boolean isInternalNet(AuthorizationContext context) {
+        ServerHttpRequest request = Optional.ofNullable(context)
+                .map(AuthorizationContext::getExchange)
+                .map(ServerWebExchange::getRequest)
+                .orElse(null);
+        if (request == null) {
+            return false;
+        }
+        HttpHeaders headers = request.getHeaders();
+        // 如果没有 X-Forwarded-For 代表为 admin 拉取
+        if (!headers.containsKey(HEADER_X_FORWARDED_FOR)) {
+            return true;
+        }
+        return Optional.of(request)
+                .map(ServerHttpRequest::getRemoteAddress)
+                .map(InetSocketAddress::getAddress)
+                .map(INetUtil::isInternalIp)
+                .orElse(false);
+    }
 
 }

+ 3 - 3
blade-ops/blade-develop/src/main/java/org/springblade/develop/DevelopApplication.java

@@ -30,9 +30,9 @@ import org.springframework.cloud.client.SpringCloudApplication;
 @SpringCloudApplication
 public class DevelopApplication {
 
-	public static void main(String[] args) {
-		BladeApplication.run(AppConstant.APPLICATION_DEVELOP_NAME, DevelopApplication.class, args);
-	}
+    public static void main(String[] args) {
+        BladeApplication.run(AppConstant.APPLICATION_DEVELOP_NAME, DevelopApplication.class, args);
+    }
 
 }
 

+ 90 - 90
blade-ops/blade-develop/src/main/java/org/springblade/develop/controller/CodeController.java

@@ -53,102 +53,102 @@ import java.util.Map;
 @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR)
 public class CodeController extends BladeController {
 
-	private final ICodeService codeService;
-	private final IDatasourceService datasourceService;
+    private final ICodeService codeService;
+    private final IDatasourceService datasourceService;
 
-	/**
-	 * 详情
-	 */
-	@GetMapping("/detail")
-	@ApiOperationSupport(order = 1)
-	@ApiOperation(value = "详情", notes = "传入code")
-	public R<Code> detail(Code code) {
-		Code detail = codeService.getOne(Condition.getQueryWrapper(code));
-		return R.data(detail);
-	}
+    /**
+     * 详情
+     */
+    @GetMapping("/detail")
+    @ApiOperationSupport(order = 1)
+    @ApiOperation(value = "详情", notes = "传入code")
+    public R<Code> detail(Code code) {
+        Code detail = codeService.getOne(Condition.getQueryWrapper(code));
+        return R.data(detail);
+    }
 
-	/**
-	 * 分页
-	 */
-	@GetMapping("/list")
-	@ApiImplicitParams({
-		@ApiImplicitParam(name = "codeName", value = "模块名", paramType = "query", dataType = "string"),
-		@ApiImplicitParam(name = "tableName", value = "表名", paramType = "query", dataType = "string"),
-		@ApiImplicitParam(name = "modelName", value = "实体名", paramType = "query", dataType = "string")
-	})
-	@ApiOperationSupport(order = 2)
-	@ApiOperation(value = "分页", notes = "传入code")
-	public R<IPage<Code>> list(@ApiIgnore @RequestParam Map<String, Object> code, Query query) {
-		IPage<Code> pages = codeService.page(Condition.getPage(query), Condition.getQueryWrapper(code, Code.class));
-		return R.data(pages);
-	}
+    /**
+     * 分页
+     */
+    @GetMapping("/list")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "codeName", value = "模块名", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "tableName", value = "表名", paramType = "query", dataType = "string"),
+            @ApiImplicitParam(name = "modelName", value = "实体名", paramType = "query", dataType = "string")
+    })
+    @ApiOperationSupport(order = 2)
+    @ApiOperation(value = "分页", notes = "传入code")
+    public R<IPage<Code>> list(@ApiIgnore @RequestParam Map<String, Object> code, Query query) {
+        IPage<Code> pages = codeService.page(Condition.getPage(query), Condition.getQueryWrapper(code, Code.class));
+        return R.data(pages);
+    }
 
-	/**
-	 * 新增或修改
-	 */
-	@PostMapping("/submit")
-	@ApiOperationSupport(order = 3)
-	@ApiOperation(value = "新增或修改", notes = "传入code")
-	public R submit(@Valid @RequestBody Code code) {
-		return R.status(codeService.submit(code));
-	}
+    /**
+     * 新增或修改
+     */
+    @PostMapping("/submit")
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "新增或修改", notes = "传入code")
+    public R submit(@Valid @RequestBody Code code) {
+        return R.status(codeService.submit(code));
+    }
 
 
-	/**
-	 * 删除
-	 */
-	@PostMapping("/remove")
-	@ApiOperationSupport(order = 4)
-	@ApiOperation(value = "删除", notes = "传入ids")
-	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
-		return R.status(codeService.removeByIds(Func.toLongList(ids)));
-	}
+    /**
+     * 删除
+     */
+    @PostMapping("/remove")
+    @ApiOperationSupport(order = 4)
+    @ApiOperation(value = "删除", notes = "传入ids")
+    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+        return R.status(codeService.removeByIds(Func.toLongList(ids)));
+    }
 
-	/**
-	 * 复制
-	 */
-	@PostMapping("/copy")
-	@ApiOperationSupport(order = 5)
-	@ApiOperation(value = "复制", notes = "传入id")
-	public R copy(@ApiParam(value = "主键", required = true) @RequestParam Long id) {
-		Code code = codeService.getById(id);
-		code.setId(null);
-		code.setCodeName(code.getCodeName() + "-copy");
-		return R.status(codeService.save(code));
-	}
+    /**
+     * 复制
+     */
+    @PostMapping("/copy")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "复制", notes = "传入id")
+    public R copy(@ApiParam(value = "主键", required = true) @RequestParam Long id) {
+        Code code = codeService.getById(id);
+        code.setId(null);
+        code.setCodeName(code.getCodeName() + "-copy");
+        return R.status(codeService.save(code));
+    }
 
-	/**
-	 * 代码生成
-	 */
-	@PostMapping("/gen-code")
-	@ApiOperationSupport(order = 6)
-	@ApiOperation(value = "代码生成", notes = "传入ids")
-	public R genCode(@ApiParam(value = "主键集合", required = true) @RequestParam String ids, @RequestParam(defaultValue = "sword") String system) {
-		Collection<Code> codes = codeService.listByIds(Func.toLongList(ids));
-		codes.forEach(code -> {
-			BladeCodeGenerator generator = new BladeCodeGenerator();
-			// 设置数据源
-			Datasource datasource = datasourceService.getById(code.getDatasourceId());
-			generator.setDriverName(datasource.getDriverClass());
-			generator.setUrl(datasource.getUrl());
-			generator.setUsername(datasource.getUsername());
-			generator.setPassword(datasource.getPassword());
-			// 设置基础配置
-			generator.setSystemName(system);
-			generator.setCodeName(code.getCodeName());
-			generator.setServiceName(code.getServiceName());
-			generator.setPackageName(code.getPackageName());
-			generator.setPackageDir(code.getApiPath());
-			generator.setPackageWebDir(code.getWebPath());
-			generator.setTablePrefix(Func.toStrArray(code.getTablePrefix()));
-			generator.setIncludeTables(Func.toStrArray(code.getTableName()));
-			// 设置是否继承基础业务字段
-			generator.setHasSuperEntity(code.getBaseMode() == 2);
-			// 设置是否开启包装器模式
-			generator.setHasWrapper(code.getWrapMode() == 2);
-			generator.run();
-		});
-		return R.success("代码生成成功");
-	}
+    /**
+     * 代码生成
+     */
+    @PostMapping("/gen-code")
+    @ApiOperationSupport(order = 6)
+    @ApiOperation(value = "代码生成", notes = "传入ids")
+    public R genCode(@ApiParam(value = "主键集合", required = true) @RequestParam String ids, @RequestParam(defaultValue = "sword") String system) {
+        Collection<Code> codes = codeService.listByIds(Func.toLongList(ids));
+        codes.forEach(code -> {
+            BladeCodeGenerator generator = new BladeCodeGenerator();
+            // 设置数据源
+            Datasource datasource = datasourceService.getById(code.getDatasourceId());
+            generator.setDriverName(datasource.getDriverClass());
+            generator.setUrl(datasource.getUrl());
+            generator.setUsername(datasource.getUsername());
+            generator.setPassword(datasource.getPassword());
+            // 设置基础配置
+            generator.setSystemName(system);
+            generator.setCodeName(code.getCodeName());
+            generator.setServiceName(code.getServiceName());
+            generator.setPackageName(code.getPackageName());
+            generator.setPackageDir(code.getApiPath());
+            generator.setPackageWebDir(code.getWebPath());
+            generator.setTablePrefix(Func.toStrArray(code.getTablePrefix()));
+            generator.setIncludeTables(Func.toStrArray(code.getTableName()));
+            // 设置是否继承基础业务字段
+            generator.setHasSuperEntity(code.getBaseMode() == 2);
+            // 设置是否开启包装器模式
+            generator.setHasWrapper(code.getWrapMode() == 2);
+            generator.run();
+        });
+        return R.success("代码生成成功");
+    }
 
 }

+ 68 - 68
blade-ops/blade-develop/src/main/java/org/springblade/develop/controller/DatasourceController.java

@@ -47,82 +47,82 @@ import java.util.List;
 @Api(value = "数据源配置表", tags = "数据源配置表接口")
 public class DatasourceController extends BladeController {
 
-	private final IDatasourceService datasourceService;
+    private final IDatasourceService datasourceService;
 
-	/**
-	 * 详情
-	 */
-	@GetMapping("/detail")
-	@ApiOperationSupport(order = 1)
-	@ApiOperation(value = "详情", notes = "传入datasource")
-	public R<Datasource> detail(Datasource datasource) {
-		Datasource detail = datasourceService.getOne(Condition.getQueryWrapper(datasource));
-		return R.data(detail);
-	}
+    /**
+     * 详情
+     */
+    @GetMapping("/detail")
+    @ApiOperationSupport(order = 1)
+    @ApiOperation(value = "详情", notes = "传入datasource")
+    public R<Datasource> detail(Datasource datasource) {
+        Datasource detail = datasourceService.getOne(Condition.getQueryWrapper(datasource));
+        return R.data(detail);
+    }
 
-	/**
-	 * 分页 数据源配置表
-	 */
-	@GetMapping("/list")
-	@ApiOperationSupport(order = 2)
-	@ApiOperation(value = "分页", notes = "传入datasource")
-	public R<IPage<Datasource>> list(Datasource datasource, Query query) {
-		IPage<Datasource> pages = datasourceService.page(Condition.getPage(query), Condition.getQueryWrapper(datasource));
-		return R.data(pages);
-	}
+    /**
+     * 分页 数据源配置表
+     */
+    @GetMapping("/list")
+    @ApiOperationSupport(order = 2)
+    @ApiOperation(value = "分页", notes = "传入datasource")
+    public R<IPage<Datasource>> list(Datasource datasource, Query query) {
+        IPage<Datasource> pages = datasourceService.page(Condition.getPage(query), Condition.getQueryWrapper(datasource));
+        return R.data(pages);
+    }
 
-	/**
-	 * 新增 数据源配置表
-	 */
-	@PostMapping("/save")
-	@ApiOperationSupport(order = 4)
-	@ApiOperation(value = "新增", notes = "传入datasource")
-	public R save(@Valid @RequestBody Datasource datasource) {
-		return R.status(datasourceService.save(datasource));
-	}
+    /**
+     * 新增 数据源配置表
+     */
+    @PostMapping("/save")
+    @ApiOperationSupport(order = 4)
+    @ApiOperation(value = "新增", notes = "传入datasource")
+    public R save(@Valid @RequestBody Datasource datasource) {
+        return R.status(datasourceService.save(datasource));
+    }
 
-	/**
-	 * 修改 数据源配置表
-	 */
-	@PostMapping("/update")
-	@ApiOperationSupport(order = 5)
-	@ApiOperation(value = "修改", notes = "传入datasource")
-	public R update(@Valid @RequestBody Datasource datasource) {
-		return R.status(datasourceService.updateById(datasource));
-	}
+    /**
+     * 修改 数据源配置表
+     */
+    @PostMapping("/update")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "修改", notes = "传入datasource")
+    public R update(@Valid @RequestBody Datasource datasource) {
+        return R.status(datasourceService.updateById(datasource));
+    }
 
-	/**
-	 * 新增或修改 数据源配置表
-	 */
-	@PostMapping("/submit")
-	@ApiOperationSupport(order = 6)
-	@ApiOperation(value = "新增或修改", notes = "传入datasource")
-	public R submit(@Valid @RequestBody Datasource datasource) {
-		datasource.setUrl(datasource.getUrl().replace("&amp;", "&"));
-		return R.status(datasourceService.saveOrUpdate(datasource));
-	}
+    /**
+     * 新增或修改 数据源配置表
+     */
+    @PostMapping("/submit")
+    @ApiOperationSupport(order = 6)
+    @ApiOperation(value = "新增或修改", notes = "传入datasource")
+    public R submit(@Valid @RequestBody Datasource datasource) {
+        datasource.setUrl(datasource.getUrl().replace("&amp;", "&"));
+        return R.status(datasourceService.saveOrUpdate(datasource));
+    }
 
 
-	/**
-	 * 删除 数据源配置表
-	 */
-	@PostMapping("/remove")
-	@ApiOperationSupport(order = 7)
-	@ApiOperation(value = "逻辑删除", notes = "传入ids")
-	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
-		return R.status(datasourceService.deleteLogic(Func.toLongList(ids)));
-	}
+    /**
+     * 删除 数据源配置表
+     */
+    @PostMapping("/remove")
+    @ApiOperationSupport(order = 7)
+    @ApiOperation(value = "逻辑删除", notes = "传入ids")
+    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+        return R.status(datasourceService.deleteLogic(Func.toLongList(ids)));
+    }
 
-	/**
-	 * 数据源列表
-	 */
-	@GetMapping("/select")
-	@ApiOperationSupport(order = 8)
-	@ApiOperation(value = "下拉数据源", notes = "查询列表")
-	public R<List<Datasource>> select() {
-		List<Datasource> list = datasourceService.list();
-		return R.data(list);
-	}
+    /**
+     * 数据源列表
+     */
+    @GetMapping("/select")
+    @ApiOperationSupport(order = 8)
+    @ApiOperation(value = "下拉数据源", notes = "查询列表")
+    public R<List<Datasource>> select() {
+        List<Datasource> list = datasourceService.list();
+        return R.data(list);
+    }
 
 
 }

+ 83 - 83
blade-ops/blade-develop/src/main/java/org/springblade/develop/entity/Code.java

@@ -38,89 +38,89 @@ import java.io.Serializable;
 @ApiModel(value = "Code对象", description = "Code对象")
 public class Code implements Serializable {
 
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * 主键
-	 */
-	@JsonSerialize(using = ToStringSerializer.class)
-	@ApiModelProperty(value = "主键")
-	@TableId(value = "id", type = IdType.ASSIGN_ID)
-	private Long id;
-
-	/**
-	 * 数据源主键
-	 */
-	@JsonSerialize(using = ToStringSerializer.class)
-	@ApiModelProperty(value = "数据源主键")
-	private Long datasourceId;
-
-	/**
-	 * 模块名称
-	 */
-	@ApiModelProperty(value = "服务名称")
-	private String serviceName;
-
-	/**
-	 * 模块名称
-	 */
-	@ApiModelProperty(value = "模块名称")
-	private String codeName;
-
-	/**
-	 * 表名
-	 */
-	@ApiModelProperty(value = "表名")
-	private String tableName;
-
-	/**
-	 * 实体名
-	 */
-	@ApiModelProperty(value = "表前缀")
-	private String tablePrefix;
-
-	/**
-	 * 主键名
-	 */
-	@ApiModelProperty(value = "主键名")
-	private String pkName;
-
-	/**
-	 * 基础业务模式
-	 */
-	@ApiModelProperty(value = "基础业务模式")
-	private Integer baseMode;
-
-	/**
-	 * 包装器模式
-	 */
-	@ApiModelProperty(value = "包装器模式")
-	private Integer wrapMode;
-
-	/**
-	 * 后端包名
-	 */
-	@ApiModelProperty(value = "后端包名")
-	private String packageName;
-
-	/**
-	 * 后端路径
-	 */
-	@ApiModelProperty(value = "后端路径")
-	private String apiPath;
-
-	/**
-	 * 前端路径
-	 */
-	@ApiModelProperty(value = "前端路径")
-	private String webPath;
-
-	/**
-	 * 是否已删除
-	 */
-	@TableLogic
-	@ApiModelProperty(value = "是否已删除")
-	private Integer isDeleted;
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @JsonSerialize(using = ToStringSerializer.class)
+    @ApiModelProperty(value = "主键")
+    @TableId(value = "id", type = IdType.ASSIGN_ID)
+    private Long id;
+
+    /**
+     * 数据源主键
+     */
+    @JsonSerialize(using = ToStringSerializer.class)
+    @ApiModelProperty(value = "数据源主键")
+    private Long datasourceId;
+
+    /**
+     * 模块名称
+     */
+    @ApiModelProperty(value = "服务名称")
+    private String serviceName;
+
+    /**
+     * 模块名称
+     */
+    @ApiModelProperty(value = "模块名称")
+    private String codeName;
+
+    /**
+     * 表名
+     */
+    @ApiModelProperty(value = "表名")
+    private String tableName;
+
+    /**
+     * 实体名
+     */
+    @ApiModelProperty(value = "表前缀")
+    private String tablePrefix;
+
+    /**
+     * 主键名
+     */
+    @ApiModelProperty(value = "主键名")
+    private String pkName;
+
+    /**
+     * 基础业务模式
+     */
+    @ApiModelProperty(value = "基础业务模式")
+    private Integer baseMode;
+
+    /**
+     * 包装器模式
+     */
+    @ApiModelProperty(value = "包装器模式")
+    private Integer wrapMode;
+
+    /**
+     * 后端包名
+     */
+    @ApiModelProperty(value = "后端包名")
+    private String packageName;
+
+    /**
+     * 后端路径
+     */
+    @ApiModelProperty(value = "后端路径")
+    private String apiPath;
+
+    /**
+     * 前端路径
+     */
+    @ApiModelProperty(value = "前端路径")
+    private String webPath;
+
+    /**
+     * 是否已删除
+     */
+    @TableLogic
+    @ApiModelProperty(value = "是否已删除")
+    private Integer isDeleted;
 
 
 }

+ 31 - 31
blade-ops/blade-develop/src/main/java/org/springblade/develop/entity/Datasource.java

@@ -34,38 +34,38 @@ import io.swagger.annotations.ApiModelProperty;
 @ApiModel(value = "Datasource对象", description = "数据源配置表")
 public class Datasource extends BaseEntity {
 
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-	/**
-	 * 名称
-	 */
-	@ApiModelProperty(value = "名称")
-	private String name;
-	/**
-	 * 驱动类
-	 */
-	@ApiModelProperty(value = "驱动类")
-	private String driverClass;
-	/**
-	 * 连接地址
-	 */
-	@ApiModelProperty(value = "连接地址")
-	private String url;
-	/**
-	 * 用户名
-	 */
-	@ApiModelProperty(value = "用户名")
-	private String username;
-	/**
-	 * 密码
-	 */
-	@ApiModelProperty(value = "密码")
-	private String password;
-	/**
-	 * 备注
-	 */
-	@ApiModelProperty(value = "备注")
-	private String remark;
+    /**
+     * 名称
+     */
+    @ApiModelProperty(value = "名称")
+    private String name;
+    /**
+     * 驱动类
+     */
+    @ApiModelProperty(value = "驱动类")
+    private String driverClass;
+    /**
+     * 连接地址
+     */
+    @ApiModelProperty(value = "连接地址")
+    private String url;
+    /**
+     * 用户名
+     */
+    @ApiModelProperty(value = "用户名")
+    private String username;
+    /**
+     * 密码
+     */
+    @ApiModelProperty(value = "密码")
+    private String password;
+    /**
+     * 备注
+     */
+    @ApiModelProperty(value = "备注")
+    private String remark;
 
 
 }

+ 7 - 7
blade-ops/blade-develop/src/main/java/org/springblade/develop/service/ICodeService.java

@@ -27,12 +27,12 @@ import org.springblade.develop.entity.Code;
  */
 public interface ICodeService extends IService<Code> {
 
-	/**
-	 * 提交
-	 *
-	 * @param code
-	 * @return
-	 */
-	boolean submit(Code code);
+    /**
+     * 提交
+     *
+     * @param code
+     * @return
+     */
+    boolean submit(Code code);
 
 }

+ 5 - 5
blade-ops/blade-develop/src/main/java/org/springblade/develop/service/impl/CodeServiceImpl.java

@@ -31,9 +31,9 @@ import org.springframework.stereotype.Service;
 @Service
 public class CodeServiceImpl extends ServiceImpl<CodeMapper, Code> implements ICodeService {
 
-	@Override
-	public boolean submit(Code code) {
-		code.setIsDeleted(BladeConstant.DB_NOT_DELETED);
-		return saveOrUpdate(code);
-	}
+    @Override
+    public boolean submit(Code code) {
+        code.setIsDeleted(BladeConstant.DB_NOT_DELETED);
+        return saveOrUpdate(code);
+    }
 }

+ 57 - 57
blade-ops/blade-develop/src/test/java/org/springblade/test/CodeGenerator.java

@@ -26,64 +26,64 @@ import org.springblade.develop.support.BladeCodeGenerator;
  */
 public class CodeGenerator {
 
-	/**
-	 * 代码生成的模块名
-	 */
-	public static String CODE_NAME = "资源管理";
-	/**
-	 * 代码所在服务名
-	 */
-	public static String SERVICE_NAME = "blade-develop";
-	/**
-	 * 代码生成的包名
-	 */
-	public static String PACKAGE_NAME = "org.springblade.develop";
-	/**
-	 * 前端代码生成所属系统
-	 */
-	public static String SYSTEM_NAME = "saber";
-	/**
-	 * 前端代码生成地址
-	 */
-	public static String PACKAGE_WEB_DIR = "/Users/chill/Workspaces/product/Saber";
-	/**
-	 * 需要去掉的表前缀
-	 */
-	public static String[] TABLE_PREFIX = {"blade_"};
-	/**
-	 * 需要生成的表名(两者只能取其一)
-	 */
-	public static String[] INCLUDE_TABLES = {"blade_datasource"};
-	/**
-	 * 需要排除的表名(两者只能取其一)
-	 */
-	public static String[] EXCLUDE_TABLES = {};
-	/**
-	 * 是否包含基础业务字段
-	 */
-	public static Boolean HAS_SUPER_ENTITY = Boolean.TRUE;
-	/**
-	 * 基础业务字段
-	 */
-	public static String[] SUPER_ENTITY_COLUMNS = {"id", "create_time", "create_user", "create_dept", "update_time", "update_user", "status", "is_deleted"};
+    /**
+     * 代码生成的模块名
+     */
+    public static String CODE_NAME = "资源管理";
+    /**
+     * 代码所在服务名
+     */
+    public static String SERVICE_NAME = "blade-develop";
+    /**
+     * 代码生成的包名
+     */
+    public static String PACKAGE_NAME = "org.springblade.develop";
+    /**
+     * 前端代码生成所属系统
+     */
+    public static String SYSTEM_NAME = "saber";
+    /**
+     * 前端代码生成地址
+     */
+    public static String PACKAGE_WEB_DIR = "/Users/chill/Workspaces/product/Saber";
+    /**
+     * 需要去掉的表前缀
+     */
+    public static String[] TABLE_PREFIX = {"blade_"};
+    /**
+     * 需要生成的表名(两者只能取其一)
+     */
+    public static String[] INCLUDE_TABLES = {"blade_datasource"};
+    /**
+     * 需要排除的表名(两者只能取其一)
+     */
+    public static String[] EXCLUDE_TABLES = {};
+    /**
+     * 是否包含基础业务字段
+     */
+    public static Boolean HAS_SUPER_ENTITY = Boolean.TRUE;
+    /**
+     * 基础业务字段
+     */
+    public static String[] SUPER_ENTITY_COLUMNS = {"id", "create_time", "create_user", "create_dept", "update_time", "update_user", "status", "is_deleted"};
 
 
-	/**
-	 * RUN THIS
-	 */
-	public static void main(String[] args) {
-		BladeCodeGenerator generator = new BladeCodeGenerator();
-		generator.setCodeName(CODE_NAME);
-		generator.setServiceName(SERVICE_NAME);
-		generator.setSystemName(SYSTEM_NAME);
-		generator.setPackageName(PACKAGE_NAME);
-		generator.setPackageWebDir(PACKAGE_WEB_DIR);
-		generator.setTablePrefix(TABLE_PREFIX);
-		generator.setIncludeTables(INCLUDE_TABLES);
-		generator.setExcludeTables(EXCLUDE_TABLES);
-		generator.setHasSuperEntity(HAS_SUPER_ENTITY);
-		generator.setSuperEntityColumns(SUPER_ENTITY_COLUMNS);
-		generator.run();
-	}
+    /**
+     * RUN THIS
+     */
+    public static void main(String[] args) {
+        BladeCodeGenerator generator = new BladeCodeGenerator();
+        generator.setCodeName(CODE_NAME);
+        generator.setServiceName(SERVICE_NAME);
+        generator.setSystemName(SYSTEM_NAME);
+        generator.setPackageName(PACKAGE_NAME);
+        generator.setPackageWebDir(PACKAGE_WEB_DIR);
+        generator.setTablePrefix(TABLE_PREFIX);
+        generator.setIncludeTables(INCLUDE_TABLES);
+        generator.setExcludeTables(EXCLUDE_TABLES);
+        generator.setHasSuperEntity(HAS_SUPER_ENTITY);
+        generator.setSuperEntityColumns(SUPER_ENTITY_COLUMNS);
+        generator.run();
+    }
 
 }

+ 3 - 3
blade-ops/blade-flow/src/main/java/org/springblade/flow/FlowApplication.java

@@ -31,9 +31,9 @@ import org.springframework.cloud.client.SpringCloudApplication;
 @SpringCloudApplication
 public class FlowApplication {
 
-	public static void main(String[] args) {
-		BladeApplication.run(AppConstant.APPLICATION_FLOW_NAME, FlowApplication.class, args);
-	}
+    public static void main(String[] args) {
+        BladeApplication.run(AppConstant.APPLICATION_FLOW_NAME, FlowApplication.class, args);
+    }
 
 }
 

+ 89 - 89
blade-ops/blade-flow/src/main/java/org/springblade/flow/business/controller/WorkController.java

@@ -46,102 +46,102 @@ import org.springframework.web.bind.annotation.*;
 @Api(value = "流程事务通用接口", tags = "流程事务通用接口")
 public class WorkController {
 
-	private final TaskService taskService;
-	private final FlowEngineService flowEngineService;
-	private final FlowBusinessService flowBusinessService;
+    private final TaskService taskService;
+    private final FlowEngineService flowEngineService;
+    private final FlowBusinessService flowBusinessService;
 
-	/**
-	 * 发起事务列表页
-	 */
-	@GetMapping("start-list")
-	@ApiOperationSupport(order = 1)
-	@ApiOperation(value = "发起事务列表页", notes = "传入流程类型")
-	public R<IPage<FlowProcess>> startList(@ApiParam("流程类型") String category, Query query, @RequestParam(required = false, defaultValue = "1") Integer mode) {
-		IPage<FlowProcess> pages = flowEngineService.selectProcessPage(Condition.getPage(query), category, mode);
-		return R.data(pages);
-	}
+    /**
+     * 发起事务列表页
+     */
+    @GetMapping("start-list")
+    @ApiOperationSupport(order = 1)
+    @ApiOperation(value = "发起事务列表页", notes = "传入流程类型")
+    public R<IPage<FlowProcess>> startList(@ApiParam("流程类型") String category, Query query, @RequestParam(required = false, defaultValue = "1") Integer mode) {
+        IPage<FlowProcess> pages = flowEngineService.selectProcessPage(Condition.getPage(query), category, mode);
+        return R.data(pages);
+    }
 
-	/**
-	 * 待签事务列表页
-	 */
-	@GetMapping("claim-list")
-	@ApiOperationSupport(order = 2)
-	@ApiOperation(value = "待签事务列表页", notes = "传入流程信息")
-	public R<IPage<BladeFlow>> claimList(@ApiParam("流程信息") BladeFlow bladeFlow, Query query) {
-		IPage<BladeFlow> pages = flowBusinessService.selectClaimPage(Condition.getPage(query), bladeFlow);
-		return R.data(pages);
-	}
+    /**
+     * 待签事务列表页
+     */
+    @GetMapping("claim-list")
+    @ApiOperationSupport(order = 2)
+    @ApiOperation(value = "待签事务列表页", notes = "传入流程信息")
+    public R<IPage<BladeFlow>> claimList(@ApiParam("流程信息") BladeFlow bladeFlow, Query query) {
+        IPage<BladeFlow> pages = flowBusinessService.selectClaimPage(Condition.getPage(query), bladeFlow);
+        return R.data(pages);
+    }
 
-	/**
-	 * 待办事务列表页
-	 */
-	@GetMapping("todo-list")
-	@ApiOperationSupport(order = 3)
-	@ApiOperation(value = "待办事务列表页", notes = "传入流程信息")
-	public R<IPage<BladeFlow>> todoList(@ApiParam("流程信息") BladeFlow bladeFlow, Query query) {
-		IPage<BladeFlow> pages = flowBusinessService.selectTodoPage(Condition.getPage(query),1, bladeFlow, null);
-		return R.data(pages);
-	}
+    /**
+     * 待办事务列表页
+     */
+    @GetMapping("todo-list")
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "待办事务列表页", notes = "传入流程信息")
+    public R<IPage<BladeFlow>> todoList(@ApiParam("流程信息") BladeFlow bladeFlow, Query query) {
+        IPage<BladeFlow> pages = flowBusinessService.selectTodoPage(Condition.getPage(query), 1, bladeFlow, null);
+        return R.data(pages);
+    }
 
-	/**
-	 * 已发事务列表页
-	 */
-	@GetMapping("send-list")
-	@ApiOperationSupport(order = 4)
-	@ApiOperation(value = "已发事务列表页", notes = "传入流程信息")
-	public R<IPage<BladeFlow>> sendList(@ApiParam("流程信息") BladeFlow bladeFlow, Query query) {
-		IPage<BladeFlow> pages = flowBusinessService.selectSendPage(Condition.getPage(query),1, bladeFlow, null);
-		return R.data(pages);
-	}
+    /**
+     * 已发事务列表页
+     */
+    @GetMapping("send-list")
+    @ApiOperationSupport(order = 4)
+    @ApiOperation(value = "已发事务列表页", notes = "传入流程信息")
+    public R<IPage<BladeFlow>> sendList(@ApiParam("流程信息") BladeFlow bladeFlow, Query query) {
+        IPage<BladeFlow> pages = flowBusinessService.selectSendPage(Condition.getPage(query), 1, bladeFlow, null);
+        return R.data(pages);
+    }
 
-	/**
-	 * 办结事务列表页
-	 */
-	@GetMapping("done-list")
-	@ApiOperationSupport(order = 5)
-	@ApiOperation(value = "办结事务列表页", notes = "传入流程信息")
-	public R<IPage<BladeFlow>> doneList(@ApiParam("流程信息") BladeFlow bladeFlow, Query query) {
-		IPage<BladeFlow> pages = flowBusinessService.selectDonePage(Condition.getPage(query),1, bladeFlow, null);
-		return R.data(pages);
-	}
+    /**
+     * 办结事务列表页
+     */
+    @GetMapping("done-list")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "办结事务列表页", notes = "传入流程信息")
+    public R<IPage<BladeFlow>> doneList(@ApiParam("流程信息") BladeFlow bladeFlow, Query query) {
+        IPage<BladeFlow> pages = flowBusinessService.selectDonePage(Condition.getPage(query), 1, bladeFlow, null);
+        return R.data(pages);
+    }
 
-	/**
-	 * 签收事务
-	 *
-	 * @param taskId 任务id
-	 */
-	@PostMapping("claim-task")
-	@ApiOperationSupport(order = 6)
-	@ApiOperation(value = "签收事务", notes = "传入流程信息")
-	public R claimTask(@ApiParam("任务id") String taskId) {
-		taskService.claim(taskId, TaskUtil.getTaskUser());
-		return R.success("签收事务成功");
-	}
+    /**
+     * 签收事务
+     *
+     * @param taskId 任务id
+     */
+    @PostMapping("claim-task")
+    @ApiOperationSupport(order = 6)
+    @ApiOperation(value = "签收事务", notes = "传入流程信息")
+    public R claimTask(@ApiParam("任务id") String taskId) {
+        taskService.claim(taskId, TaskUtil.getTaskUser());
+        return R.success("签收事务成功");
+    }
 
-	/**
-	 * 完成任务
-	 *
-	 * @param flow 请假信息
-	 */
-	@PostMapping("complete-task")
-	@ApiOperationSupport(order = 7)
-	@ApiOperation(value = "完成任务", notes = "传入流程信息")
-	public R completeTask(@ApiParam("任务信息") @RequestBody BladeFlow flow) {
-		return R.status(flowBusinessService.completeTask(flow));
-	}
+    /**
+     * 完成任务
+     *
+     * @param flow 请假信息
+     */
+    @PostMapping("complete-task")
+    @ApiOperationSupport(order = 7)
+    @ApiOperation(value = "完成任务", notes = "传入流程信息")
+    public R completeTask(@ApiParam("任务信息") @RequestBody BladeFlow flow) {
+        return R.status(flowBusinessService.completeTask(flow));
+    }
 
-	/**
-	 * 删除任务
-	 *
-	 * @param taskId 任务id
-	 * @param reason 删除原因
-	 */
-	@PostMapping("delete-task")
-	@ApiOperationSupport(order = 8)
-	@ApiOperation(value = "删除任务", notes = "传入流程信息")
-	public R deleteTask(@ApiParam("任务id") String taskId, @ApiParam("删除原因") String reason) {
-		taskService.deleteTask(taskId, reason);
-		return R.success("删除任务成功");
-	}
+    /**
+     * 删除任务
+     *
+     * @param taskId 任务id
+     * @param reason 删除原因
+     */
+    @PostMapping("delete-task")
+    @ApiOperationSupport(order = 8)
+    @ApiOperation(value = "删除任务", notes = "传入流程信息")
+    public R deleteTask(@ApiParam("任务id") String taskId, @ApiParam("删除原因") String reason) {
+        taskService.deleteTask(taskId, reason);
+        return R.success("删除任务成功");
+    }
 
 }

+ 53 - 52
blade-ops/blade-flow/src/main/java/org/springblade/flow/business/feign/FlowClient.java

@@ -17,6 +17,7 @@ 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.RestController;
+
 import java.util.Map;
 
 /**
@@ -29,64 +30,64 @@ import java.util.Map;
 @AllArgsConstructor
 public class FlowClient implements IFlowClient {
 
-	private final RuntimeService runtimeService;
+    private final RuntimeService runtimeService;
 
-	private final IdentityService identityService;
+    private final IdentityService identityService;
 
-	private final TaskService taskService;
+    private final TaskService taskService;
 
-	@Override
-	@PostMapping(START_PROCESS_INSTANCE_BY_ID)
-	public R<BladeFlow> startProcessInstanceById(String processDefinitionId, String businessKey, @RequestBody Map<String, Object> variables) {
-		// 设置流程启动用户
-		identityService.setAuthenticatedUserId(TaskUtil.getTaskUser());
-		// 开启流程
-		ProcessInstance processInstance = runtimeService.startProcessInstanceById(processDefinitionId, businessKey, variables);
-		// 组装流程通用类
-		BladeFlow flow = new BladeFlow();
-		flow.setProcessInstanceId(processInstance.getId());
-		return R.data(flow);
-	}
+    @Override
+    @PostMapping(START_PROCESS_INSTANCE_BY_ID)
+    public R<BladeFlow> startProcessInstanceById(String processDefinitionId, String businessKey, @RequestBody Map<String, Object> variables) {
+        // 设置流程启动用户
+        identityService.setAuthenticatedUserId(TaskUtil.getTaskUser());
+        // 开启流程
+        ProcessInstance processInstance = runtimeService.startProcessInstanceById(processDefinitionId, businessKey, variables);
+        // 组装流程通用类
+        BladeFlow flow = new BladeFlow();
+        flow.setProcessInstanceId(processInstance.getId());
+        return R.data(flow);
+    }
 
-	@Override
-	@PostMapping(START_PROCESS_INSTANCE_BY_KEY)
-	public R<BladeFlow> startProcessInstanceByKey(String processDefinitionKey, String businessKey, @RequestBody Map<String, Object> variables) {
-		// 设置流程启动用户
-		identityService.setAuthenticatedUserId(TaskUtil.getTaskUser());
-		// 开启流程
-		ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processDefinitionKey, businessKey, variables);
-		// 组装流程通用类
-		BladeFlow flow = new BladeFlow();
-		flow.setProcessInstanceId(processInstance.getId());
-		return R.data(flow);
-	}
+    @Override
+    @PostMapping(START_PROCESS_INSTANCE_BY_KEY)
+    public R<BladeFlow> startProcessInstanceByKey(String processDefinitionKey, String businessKey, @RequestBody Map<String, Object> variables) {
+        // 设置流程启动用户
+        identityService.setAuthenticatedUserId(TaskUtil.getTaskUser());
+        // 开启流程
+        ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processDefinitionKey, businessKey, variables);
+        // 组装流程通用类
+        BladeFlow flow = new BladeFlow();
+        flow.setProcessInstanceId(processInstance.getId());
+        return R.data(flow);
+    }
 
-	@Override
-	@PostMapping(COMPLETE_TASK)
-	public R completeTask(String taskId, String processInstanceId, String comment, @RequestBody Map<String, Object> variables) {
-		// 增加评论
-		if (StringUtil.isNoneBlank(processInstanceId, comment)) {
-			taskService.addComment(taskId, processInstanceId, comment);
-		}
-		// 非空判断
-		if (Func.isEmpty(variables)) {
-			variables = Kv.create();
-		}
-		// 完成任务
-		taskService.complete(taskId, variables);
-		return R.success("流程提交成功");
-	}
+    @Override
+    @PostMapping(COMPLETE_TASK)
+    public R completeTask(String taskId, String processInstanceId, String comment, @RequestBody Map<String, Object> variables) {
+        // 增加评论
+        if (StringUtil.isNoneBlank(processInstanceId, comment)) {
+            taskService.addComment(taskId, processInstanceId, comment);
+        }
+        // 非空判断
+        if (Func.isEmpty(variables)) {
+            variables = Kv.create();
+        }
+        // 完成任务
+        taskService.complete(taskId, variables);
+        return R.success("流程提交成功");
+    }
 
-	@Override
-	@GetMapping(TASK_VARIABLE)
-	public R<Object> taskVariable(String taskId, String variableName) {
-		return R.data(taskService.getVariable(taskId, variableName));
-	}
+    @Override
+    @GetMapping(TASK_VARIABLE)
+    public R<Object> taskVariable(String taskId, String variableName) {
+        return R.data(taskService.getVariable(taskId, variableName));
+    }
 
-	@Override
-	@GetMapping(TASK_VARIABLES)
-	public R<Map<String, Object>> taskVariables(String taskId) {
-		return R.data(taskService.getVariables(taskId));
-	}
+    @Override
+    @GetMapping(TASK_VARIABLES)
+    public R<Map<String, Object>> taskVariables(String taskId) {
+        return R.data(taskService.getVariables(taskId));
+    }
 
 }

+ 8 - 8
blade-ops/blade-flow/src/main/java/org/springblade/flow/business/feign/NewFlowClientImpl.java

@@ -37,21 +37,21 @@ public class NewFlowClientImpl implements NewFlowClient {
         Query query = new Query();
         query.setCurrent(current);
         query.setSize(size);
-        return R.data(this.flowBusinessService.selectSendPage(Condition.getPage(query),ordType, new BladeFlow(), parallelProcessInstanceIds));
+        return R.data(this.flowBusinessService.selectSendPage(Condition.getPage(query), ordType, new BladeFlow(), parallelProcessInstanceIds));
     }
 
     @Override
-    public R<Object> selectDonePage(Integer current, Integer size,Integer ordType, String parallelProcessInstanceIds) {
+    public R<Object> selectDonePage(Integer current, Integer size, Integer ordType, String parallelProcessInstanceIds) {
         Query query = new Query();
         query.setCurrent(current);
         query.setSize(size);
-        return R.data(this.flowBusinessService.selectDonePage(Condition.getPage(query),ordType, new BladeFlow(), parallelProcessInstanceIds));
+        return R.data(this.flowBusinessService.selectDonePage(Condition.getPage(query), ordType, new BladeFlow(), parallelProcessInstanceIds));
     }
 
     @Override
     public String queryTaskIdByProcessInstanceId(String processInstanceId) {
         TaskQuery taskQuery = this.taskService.createTaskQuery().processInstanceId(processInstanceId).includeProcessVariables();
-        if(taskQuery != null && taskQuery.list().size() > 0){
+        if (taskQuery != null && taskQuery.list().size() > 0) {
             //返回流程ID
             return taskQuery.list().get(0).getId();
         }
@@ -61,10 +61,10 @@ public class NewFlowClientImpl implements NewFlowClient {
     @Override
     public R<Boolean> completeApprovalTask(String taskId, String processInstanceId, String comment) {
         //添加审批意见
-        if(StringUtils.isNoneBlank(processInstanceId, comment)){
-            try{
+        if (StringUtils.isNoneBlank(processInstanceId, comment)) {
+            try {
                 this.taskService.addComment(taskId, processInstanceId, comment);
-            }catch (Exception e){
+            } catch (Exception e) {
                 e.printStackTrace();
             }
         }
@@ -75,7 +75,7 @@ public class NewFlowClientImpl implements NewFlowClient {
     }
 
     @Override
-    public R<Object> selectTodoPage(Integer current, Integer size,Integer ordType, String parallelProcessInstanceIds) {
+    public R<Object> selectTodoPage(Integer current, Integer size, Integer ordType, String parallelProcessInstanceIds) {
         Query query = new Query();
         query.setCurrent(current);
         query.setSize(size);

+ 39 - 39
blade-ops/blade-flow/src/main/java/org/springblade/flow/business/service/FlowBusinessService.java

@@ -28,47 +28,47 @@ import java.util.List;
  */
 public interface FlowBusinessService {
 
-	/**
-	 * 流程待签列表
-	 *
-	 * @param page      分页工具
-	 * @param bladeFlow 流程类
-	 * @return
-	 */
-	IPage<BladeFlow> selectClaimPage(IPage<BladeFlow> page, BladeFlow bladeFlow);
+    /**
+     * 流程待签列表
+     *
+     * @param page      分页工具
+     * @param bladeFlow 流程类
+     * @return
+     */
+    IPage<BladeFlow> selectClaimPage(IPage<BladeFlow> page, BladeFlow bladeFlow);
 
-	/**
-	 * 流程待办列表
-	 *
-	 * @param page      分页工具
-	 * @param bladeFlow 流程类
-	 * @return
-	 */
-	IPage<BladeFlow> selectTodoPage(IPage<BladeFlow> page,Integer ordType, BladeFlow bladeFlow, String parallelProcessInstanceIds);
+    /**
+     * 流程待办列表
+     *
+     * @param page      分页工具
+     * @param bladeFlow 流程类
+     * @return
+     */
+    IPage<BladeFlow> selectTodoPage(IPage<BladeFlow> page, Integer ordType, BladeFlow bladeFlow, String parallelProcessInstanceIds);
 
-	/**
-	 * 流程已发列表
-	 *
-	 * @param page      分页工具
-	 * @param bladeFlow 流程类
-	 * @return
-	 */
-	IPage<BladeFlow> selectSendPage(IPage<BladeFlow> page,Integer ordType, BladeFlow bladeFlow, String parallelProcessInstanceIds);
+    /**
+     * 流程已发列表
+     *
+     * @param page      分页工具
+     * @param bladeFlow 流程类
+     * @return
+     */
+    IPage<BladeFlow> selectSendPage(IPage<BladeFlow> page, Integer ordType, BladeFlow bladeFlow, String parallelProcessInstanceIds);
 
-	/**
-	 * 流程办结列表
-	 *
-	 * @param page      分页工具
-	 * @param bladeFlow 流程类
-	 * @return
-	 */
-	IPage<BladeFlow> selectDonePage(IPage<BladeFlow> page,Integer ordType, BladeFlow bladeFlow, String parallelProcessInstanceIds);
+    /**
+     * 流程办结列表
+     *
+     * @param page      分页工具
+     * @param bladeFlow 流程类
+     * @return
+     */
+    IPage<BladeFlow> selectDonePage(IPage<BladeFlow> page, Integer ordType, BladeFlow bladeFlow, String parallelProcessInstanceIds);
 
-	/**
-	 * 完成任务
-	 *
-	 * @param leave 请假信息
-	 * @return boolean
-	 */
-	boolean completeTask(BladeFlow leave);
+    /**
+     * 完成任务
+     *
+     * @param leave 请假信息
+     * @return boolean
+     */
+    boolean completeTask(BladeFlow leave);
 }

+ 296 - 296
blade-ops/blade-flow/src/main/java/org/springblade/flow/business/service/impl/FlowBusinessServiceImpl.java

@@ -52,325 +52,325 @@ import java.util.*;
 @AllArgsConstructor
 public class FlowBusinessServiceImpl implements FlowBusinessService {
 
-	private final TaskService taskService;
-	private final HistoryService historyService;
+    private final TaskService taskService;
+    private final HistoryService historyService;
 
-	@Override
-	public IPage<BladeFlow> selectClaimPage(IPage<BladeFlow> page, BladeFlow bladeFlow) {
-		String taskUser = TaskUtil.getTaskUser();
-		String taskGroup = TaskUtil.getCandidateGroup();
-		List<BladeFlow> flowList = new LinkedList<>();
+    @Override
+    public IPage<BladeFlow> selectClaimPage(IPage<BladeFlow> page, BladeFlow bladeFlow) {
+        String taskUser = TaskUtil.getTaskUser();
+        String taskGroup = TaskUtil.getCandidateGroup();
+        List<BladeFlow> flowList = new LinkedList<>();
 
-		// 个人等待签收的任务
-		TaskQuery claimUserQuery = taskService.createTaskQuery().taskCandidateUser(taskUser)
-			.includeProcessVariables().active().orderByTaskCreateTime().desc();
-		// 定制流程等待签收的任务
-		TaskQuery claimRoleWithTenantIdQuery = taskService.createTaskQuery().taskTenantId(AuthUtil.getTenantId()).taskCandidateGroupIn(Func.toStrList(taskGroup))
-			.includeProcessVariables().active().orderByTaskCreateTime().desc();
-		// 通用流程等待签收的任务
-		TaskQuery claimRoleWithoutTenantIdQuery = taskService.createTaskQuery().taskWithoutTenantId().taskCandidateGroupIn(Func.toStrList(taskGroup))
-			.includeProcessVariables().active().orderByTaskCreateTime().desc();
+        // 个人等待签收的任务
+        TaskQuery claimUserQuery = taskService.createTaskQuery().taskCandidateUser(taskUser)
+                .includeProcessVariables().active().orderByTaskCreateTime().desc();
+        // 定制流程等待签收的任务
+        TaskQuery claimRoleWithTenantIdQuery = taskService.createTaskQuery().taskTenantId(AuthUtil.getTenantId()).taskCandidateGroupIn(Func.toStrList(taskGroup))
+                .includeProcessVariables().active().orderByTaskCreateTime().desc();
+        // 通用流程等待签收的任务
+        TaskQuery claimRoleWithoutTenantIdQuery = taskService.createTaskQuery().taskWithoutTenantId().taskCandidateGroupIn(Func.toStrList(taskGroup))
+                .includeProcessVariables().active().orderByTaskCreateTime().desc();
 
-		// 构建列表数据
-		buildFlowTaskList(page,bladeFlow, flowList, claimUserQuery, FlowEngineConstant.STATUS_CLAIM);
-		buildFlowTaskList(page,bladeFlow, flowList, claimRoleWithTenantIdQuery, FlowEngineConstant.STATUS_CLAIM);
-		buildFlowTaskList(page,bladeFlow, flowList, claimRoleWithoutTenantIdQuery, FlowEngineConstant.STATUS_CLAIM);
+        // 构建列表数据
+        buildFlowTaskList(page, bladeFlow, flowList, claimUserQuery, FlowEngineConstant.STATUS_CLAIM);
+        buildFlowTaskList(page, bladeFlow, flowList, claimRoleWithTenantIdQuery, FlowEngineConstant.STATUS_CLAIM);
+        buildFlowTaskList(page, bladeFlow, flowList, claimRoleWithoutTenantIdQuery, FlowEngineConstant.STATUS_CLAIM);
 
-		// 计算总数
-		long count = claimUserQuery.count() + claimRoleWithTenantIdQuery.count() + claimRoleWithoutTenantIdQuery.count();
-		// 设置页数
-		page.setSize(count);
-		// 设置总数
-		page.setTotal(count);
-		// 设置数据
-		page.setRecords(flowList);
-		return page;
-	}
+        // 计算总数
+        long count = claimUserQuery.count() + claimRoleWithTenantIdQuery.count() + claimRoleWithoutTenantIdQuery.count();
+        // 设置页数
+        page.setSize(count);
+        // 设置总数
+        page.setTotal(count);
+        // 设置数据
+        page.setRecords(flowList);
+        return page;
+    }
 
-	@Override
-	public IPage<BladeFlow> selectTodoPage(IPage<BladeFlow> page,Integer ordType, BladeFlow bladeFlow, String parallelProcessInstanceIds) {
-		String taskUser = TaskUtil.getTaskUser();
-		List<BladeFlow> flowList = new LinkedList<>();
+    @Override
+    public IPage<BladeFlow> selectTodoPage(IPage<BladeFlow> page, Integer ordType, BladeFlow bladeFlow, String parallelProcessInstanceIds) {
+        String taskUser = TaskUtil.getTaskUser();
+        List<BladeFlow> flowList = new LinkedList<>();
 
-		// 已签收的任务
-		TaskQuery todoQuery;
-		if(StringUtils.isEmpty(parallelProcessInstanceIds)){
-			todoQuery = taskService.createTaskQuery().taskAssignee(taskUser).active()
-					.includeProcessVariables();
+        // 已签收的任务
+        TaskQuery todoQuery;
+        if (StringUtils.isEmpty(parallelProcessInstanceIds)) {
+            todoQuery = taskService.createTaskQuery().taskAssignee(taskUser).active()
+                    .includeProcessVariables();
 //					.orderByTaskCreateTime().desc();
-		} else {
-			todoQuery = taskService.createTaskQuery().taskAssignee(taskUser).active()
-					.includeProcessVariables().processInstanceIdIn(Arrays.asList(parallelProcessInstanceIds.split(",").clone()));
+        } else {
+            todoQuery = taskService.createTaskQuery().taskAssignee(taskUser).active()
+                    .includeProcessVariables().processInstanceIdIn(Arrays.asList(parallelProcessInstanceIds.split(",").clone()));
 //					.orderByTaskCreateTime().desc();
-		}
-		if(ordType == 1){
-			todoQuery.orderByTaskCreateTime().desc();
-		}else{
-			todoQuery.orderByTaskCreateTime().asc();
-		}
-		// 构建列表数据
-		buildFlowTaskList(page,bladeFlow, flowList, todoQuery, FlowEngineConstant.STATUS_TODO);
+        }
+        if (ordType == 1) {
+            todoQuery.orderByTaskCreateTime().desc();
+        } else {
+            todoQuery.orderByTaskCreateTime().asc();
+        }
+        // 构建列表数据
+        buildFlowTaskList(page, bladeFlow, flowList, todoQuery, FlowEngineConstant.STATUS_TODO);
 
-		// 计算总数
-		long count = todoQuery.count();
-		// 设置页数
-		page.setSize(count);
-		// 设置总数
-		page.setTotal(count);
-		// 设置数据
-		page.setRecords(flowList);
-		return page;
-	}
+        // 计算总数
+        long count = todoQuery.count();
+        // 设置页数
+        page.setSize(count);
+        // 设置总数
+        page.setTotal(count);
+        // 设置数据
+        page.setRecords(flowList);
+        return page;
+    }
 
-	@Override
-	public IPage<BladeFlow> selectSendPage(IPage<BladeFlow> page,Integer ordType, BladeFlow bladeFlow, String parallelProcessInstanceIds) {
-		String taskUser = TaskUtil.getTaskUser();
-		List<BladeFlow> flowList = new LinkedList<>();
+    @Override
+    public IPage<BladeFlow> selectSendPage(IPage<BladeFlow> page, Integer ordType, BladeFlow bladeFlow, String parallelProcessInstanceIds) {
+        String taskUser = TaskUtil.getTaskUser();
+        List<BladeFlow> flowList = new LinkedList<>();
 
-		HistoricProcessInstanceQuery historyQuery;
-		if(StringUtils.isEmpty(parallelProcessInstanceIds)){
-			historyQuery = historyService.createHistoricProcessInstanceQuery().startedBy(taskUser);
-		} else {
-			List<String> array = Arrays.asList(parallelProcessInstanceIds.split(","));
-			historyQuery = historyService.createHistoricProcessInstanceQuery().startedBy(taskUser).processInstanceIds(new HashSet<>(array));
-		}
-		if(ordType == 1){
-			historyQuery.orderByProcessInstanceStartTime().desc();
-		}else{
-			historyQuery.orderByProcessInstanceStartTime().asc();
-		}
-		if (bladeFlow.getCategory() != null) {
-			historyQuery.processDefinitionCategory(bladeFlow.getCategory());
-		}
-		if (bladeFlow.getProcessDefinitionName() != null) {
-			historyQuery.processDefinitionName(bladeFlow.getProcessDefinitionName());
-		}
-		if (bladeFlow.getBeginDate() != null) {
-			historyQuery.startedAfter(bladeFlow.getBeginDate());
-		}
-		if (bladeFlow.getEndDate() != null) {
-			historyQuery.startedBefore(bladeFlow.getEndDate());
-		}
+        HistoricProcessInstanceQuery historyQuery;
+        if (StringUtils.isEmpty(parallelProcessInstanceIds)) {
+            historyQuery = historyService.createHistoricProcessInstanceQuery().startedBy(taskUser);
+        } else {
+            List<String> array = Arrays.asList(parallelProcessInstanceIds.split(","));
+            historyQuery = historyService.createHistoricProcessInstanceQuery().startedBy(taskUser).processInstanceIds(new HashSet<>(array));
+        }
+        if (ordType == 1) {
+            historyQuery.orderByProcessInstanceStartTime().desc();
+        } else {
+            historyQuery.orderByProcessInstanceStartTime().asc();
+        }
+        if (bladeFlow.getCategory() != null) {
+            historyQuery.processDefinitionCategory(bladeFlow.getCategory());
+        }
+        if (bladeFlow.getProcessDefinitionName() != null) {
+            historyQuery.processDefinitionName(bladeFlow.getProcessDefinitionName());
+        }
+        if (bladeFlow.getBeginDate() != null) {
+            historyQuery.startedAfter(bladeFlow.getBeginDate());
+        }
+        if (bladeFlow.getEndDate() != null) {
+            historyQuery.startedBefore(bladeFlow.getEndDate());
+        }
 
-		// 查询列表
-		List<HistoricProcessInstance> historyList = historyQuery.listPage(Func.toInt((page.getCurrent() - 1) * page.getSize()), Func.toInt(page.getSize()));
+        // 查询列表
+        List<HistoricProcessInstance> historyList = historyQuery.listPage(Func.toInt((page.getCurrent() - 1) * page.getSize()), Func.toInt(page.getSize()));
 
-		historyList.forEach(historicProcessInstance -> {
-			BladeFlow flow = new BladeFlow();
-			// historicProcessInstance
-			flow.setCreateTime(historicProcessInstance.getStartTime());
-			flow.setEndTime(historicProcessInstance.getEndTime());
-			flow.setVariables(historicProcessInstance.getProcessVariables());
-			String[] businessKey = Func.toStrArray(StringPool.COLON, historicProcessInstance.getBusinessKey());
-			if (businessKey.length > 1) {
-				flow.setBusinessTable(businessKey[0]);
-				flow.setBusinessId(businessKey[1]);
-			}
-			flow.setHistoryActivityName(historicProcessInstance.getName());
-			flow.setProcessInstanceId(historicProcessInstance.getId());
-			flow.setHistoryProcessInstanceId(historicProcessInstance.getId());
-			// ProcessDefinition
-			FlowProcess processDefinition = FlowCache.getProcessDefinition(historicProcessInstance.getProcessDefinitionId());
-			flow.setProcessDefinitionId(processDefinition.getId());
-			flow.setProcessDefinitionName(processDefinition.getName());
-			flow.setProcessDefinitionVersion(processDefinition.getVersion());
-			flow.setProcessDefinitionKey(processDefinition.getKey());
-			flow.setCategory(processDefinition.getCategory());
-			flow.setCategoryName(FlowCache.getCategoryName(processDefinition.getCategory()));
-			flow.setProcessInstanceId(historicProcessInstance.getId());
-			// HistoricTaskInstance
-			List<HistoricTaskInstance> historyTasks = historyService.createHistoricTaskInstanceQuery().processInstanceId(historicProcessInstance.getId()).orderByHistoricTaskInstanceEndTime().desc().list();
-			if (Func.isNotEmpty(historyTasks)) {
-				HistoricTaskInstance historyTask = historyTasks.iterator().next();
-				flow.setTaskId(historyTask.getId());
-				flow.setTaskName(historyTask.getName());
-				flow.setTaskDefinitionKey(historyTask.getTaskDefinitionKey());
-			}
-			// Status
-			if (historicProcessInstance.getEndActivityId() != null) {
-				flow.setProcessIsFinished(FlowEngineConstant.STATUS_FINISHED);
-			} else {
-				flow.setProcessIsFinished(FlowEngineConstant.STATUS_UNFINISHED);
-			}
-			flow.setStatus(FlowEngineConstant.STATUS_FINISH);
-			flowList.add(flow);
-		});
+        historyList.forEach(historicProcessInstance -> {
+            BladeFlow flow = new BladeFlow();
+            // historicProcessInstance
+            flow.setCreateTime(historicProcessInstance.getStartTime());
+            flow.setEndTime(historicProcessInstance.getEndTime());
+            flow.setVariables(historicProcessInstance.getProcessVariables());
+            String[] businessKey = Func.toStrArray(StringPool.COLON, historicProcessInstance.getBusinessKey());
+            if (businessKey.length > 1) {
+                flow.setBusinessTable(businessKey[0]);
+                flow.setBusinessId(businessKey[1]);
+            }
+            flow.setHistoryActivityName(historicProcessInstance.getName());
+            flow.setProcessInstanceId(historicProcessInstance.getId());
+            flow.setHistoryProcessInstanceId(historicProcessInstance.getId());
+            // ProcessDefinition
+            FlowProcess processDefinition = FlowCache.getProcessDefinition(historicProcessInstance.getProcessDefinitionId());
+            flow.setProcessDefinitionId(processDefinition.getId());
+            flow.setProcessDefinitionName(processDefinition.getName());
+            flow.setProcessDefinitionVersion(processDefinition.getVersion());
+            flow.setProcessDefinitionKey(processDefinition.getKey());
+            flow.setCategory(processDefinition.getCategory());
+            flow.setCategoryName(FlowCache.getCategoryName(processDefinition.getCategory()));
+            flow.setProcessInstanceId(historicProcessInstance.getId());
+            // HistoricTaskInstance
+            List<HistoricTaskInstance> historyTasks = historyService.createHistoricTaskInstanceQuery().processInstanceId(historicProcessInstance.getId()).orderByHistoricTaskInstanceEndTime().desc().list();
+            if (Func.isNotEmpty(historyTasks)) {
+                HistoricTaskInstance historyTask = historyTasks.iterator().next();
+                flow.setTaskId(historyTask.getId());
+                flow.setTaskName(historyTask.getName());
+                flow.setTaskDefinitionKey(historyTask.getTaskDefinitionKey());
+            }
+            // Status
+            if (historicProcessInstance.getEndActivityId() != null) {
+                flow.setProcessIsFinished(FlowEngineConstant.STATUS_FINISHED);
+            } else {
+                flow.setProcessIsFinished(FlowEngineConstant.STATUS_UNFINISHED);
+            }
+            flow.setStatus(FlowEngineConstant.STATUS_FINISH);
+            flowList.add(flow);
+        });
 
-		// 计算总数
-		long count = historyQuery.count();
-		// 设置总数
-		page.setTotal(count);
-		page.setRecords(flowList);
-		return page;
-	}
+        // 计算总数
+        long count = historyQuery.count();
+        // 设置总数
+        page.setTotal(count);
+        page.setRecords(flowList);
+        return page;
+    }
 
-	@Override
-	public IPage<BladeFlow> selectDonePage(IPage<BladeFlow> page,Integer ordType, BladeFlow bladeFlow, String parallelProcessInstanceIds) {
-		String taskUser = TaskUtil.getTaskUser();
-		List<BladeFlow> flowList = new LinkedList<>();
+    @Override
+    public IPage<BladeFlow> selectDonePage(IPage<BladeFlow> page, Integer ordType, BladeFlow bladeFlow, String parallelProcessInstanceIds) {
+        String taskUser = TaskUtil.getTaskUser();
+        List<BladeFlow> flowList = new LinkedList<>();
 
-		HistoricTaskInstanceQuery doneQuery;
-		if(StringUtils.isEmpty(parallelProcessInstanceIds)){
-			doneQuery = historyService.createHistoricTaskInstanceQuery().taskAssignee(taskUser).finished()
-					.includeProcessVariables();
-		} else {
-			doneQuery = historyService.createHistoricTaskInstanceQuery().taskAssignee(taskUser).finished()
-					.includeProcessVariables().processInstanceIdIn(Arrays.asList(parallelProcessInstanceIds.split(",")));
-		}
-		if(ordType == 1){
-			doneQuery.orderByHistoricTaskInstanceEndTime().desc();
-		}else{
-			doneQuery.orderByHistoricTaskInstanceEndTime().asc();
-		}
-		if (bladeFlow.getCategory() != null) {
-			doneQuery.processCategoryIn(Func.toStrList(bladeFlow.getCategory()));
-		}
-		if (bladeFlow.getProcessDefinitionName() != null) {
-			doneQuery.processDefinitionName(bladeFlow.getProcessDefinitionName());
-		}
-		if (bladeFlow.getBeginDate() != null) {
-			doneQuery.taskCompletedAfter(bladeFlow.getBeginDate());
-		}
-		if (bladeFlow.getEndDate() != null) {
-			doneQuery.taskCompletedBefore(bladeFlow.getEndDate());
-		}
+        HistoricTaskInstanceQuery doneQuery;
+        if (StringUtils.isEmpty(parallelProcessInstanceIds)) {
+            doneQuery = historyService.createHistoricTaskInstanceQuery().taskAssignee(taskUser).finished()
+                    .includeProcessVariables();
+        } else {
+            doneQuery = historyService.createHistoricTaskInstanceQuery().taskAssignee(taskUser).finished()
+                    .includeProcessVariables().processInstanceIdIn(Arrays.asList(parallelProcessInstanceIds.split(",")));
+        }
+        if (ordType == 1) {
+            doneQuery.orderByHistoricTaskInstanceEndTime().desc();
+        } else {
+            doneQuery.orderByHistoricTaskInstanceEndTime().asc();
+        }
+        if (bladeFlow.getCategory() != null) {
+            doneQuery.processCategoryIn(Func.toStrList(bladeFlow.getCategory()));
+        }
+        if (bladeFlow.getProcessDefinitionName() != null) {
+            doneQuery.processDefinitionName(bladeFlow.getProcessDefinitionName());
+        }
+        if (bladeFlow.getBeginDate() != null) {
+            doneQuery.taskCompletedAfter(bladeFlow.getBeginDate());
+        }
+        if (bladeFlow.getEndDate() != null) {
+            doneQuery.taskCompletedBefore(bladeFlow.getEndDate());
+        }
 
-		// 查询列表
-		List<HistoricTaskInstance> doneList = doneQuery.listPage(Func.toInt((page.getCurrent() - 1) * page.getSize()), Func.toInt(page.getSize()));
-		doneList.forEach(historicTaskInstance -> {
-			BladeFlow flow = new BladeFlow();
-			flow.setTaskId(historicTaskInstance.getId());
-			flow.setTaskDefinitionKey(historicTaskInstance.getTaskDefinitionKey());
-			flow.setTaskName(historicTaskInstance.getName());
-			flow.setAssignee(historicTaskInstance.getAssignee());
-			flow.setCreateTime(historicTaskInstance.getCreateTime());
-			flow.setExecutionId(historicTaskInstance.getExecutionId());
-			flow.setHistoryTaskEndTime(historicTaskInstance.getEndTime());
-			flow.setVariables(historicTaskInstance.getProcessVariables());
+        // 查询列表
+        List<HistoricTaskInstance> doneList = doneQuery.listPage(Func.toInt((page.getCurrent() - 1) * page.getSize()), Func.toInt(page.getSize()));
+        doneList.forEach(historicTaskInstance -> {
+            BladeFlow flow = new BladeFlow();
+            flow.setTaskId(historicTaskInstance.getId());
+            flow.setTaskDefinitionKey(historicTaskInstance.getTaskDefinitionKey());
+            flow.setTaskName(historicTaskInstance.getName());
+            flow.setAssignee(historicTaskInstance.getAssignee());
+            flow.setCreateTime(historicTaskInstance.getCreateTime());
+            flow.setExecutionId(historicTaskInstance.getExecutionId());
+            flow.setHistoryTaskEndTime(historicTaskInstance.getEndTime());
+            flow.setVariables(historicTaskInstance.getProcessVariables());
 
-			FlowProcess processDefinition = FlowCache.getProcessDefinition(historicTaskInstance.getProcessDefinitionId());
-			flow.setProcessDefinitionId(processDefinition.getId());
-			flow.setProcessDefinitionName(processDefinition.getName());
-			flow.setProcessDefinitionKey(processDefinition.getKey());
-			flow.setProcessDefinitionVersion(processDefinition.getVersion());
-			flow.setCategory(processDefinition.getCategory());
-			flow.setCategoryName(FlowCache.getCategoryName(processDefinition.getCategory()));
+            FlowProcess processDefinition = FlowCache.getProcessDefinition(historicTaskInstance.getProcessDefinitionId());
+            flow.setProcessDefinitionId(processDefinition.getId());
+            flow.setProcessDefinitionName(processDefinition.getName());
+            flow.setProcessDefinitionKey(processDefinition.getKey());
+            flow.setProcessDefinitionVersion(processDefinition.getVersion());
+            flow.setCategory(processDefinition.getCategory());
+            flow.setCategoryName(FlowCache.getCategoryName(processDefinition.getCategory()));
 
-			flow.setProcessInstanceId(historicTaskInstance.getProcessInstanceId());
-			flow.setHistoryProcessInstanceId(historicTaskInstance.getProcessInstanceId());
-			HistoricProcessInstance historicProcessInstance = getHistoricProcessInstance((historicTaskInstance.getProcessInstanceId()));
-			if (Func.isNotEmpty(historicProcessInstance)) {
-				String[] businessKey = Func.toStrArray(StringPool.COLON, historicProcessInstance.getBusinessKey());
-				flow.setBusinessTable(businessKey[0]);
-				flow.setBusinessId(businessKey[1]);
-				if (historicProcessInstance.getEndActivityId() != null) {
-					flow.setProcessIsFinished(FlowEngineConstant.STATUS_FINISHED);
-				} else {
-					flow.setProcessIsFinished(FlowEngineConstant.STATUS_UNFINISHED);
-				}
-			}
-			flow.setStatus(FlowEngineConstant.STATUS_FINISH);
-			flowList.add(flow);
-		});
-		// 计算总数
-		long count = doneQuery.count();
-		// 设置总数
-		page.setTotal(count);
-		page.setRecords(flowList);
-		return page;
-	}
+            flow.setProcessInstanceId(historicTaskInstance.getProcessInstanceId());
+            flow.setHistoryProcessInstanceId(historicTaskInstance.getProcessInstanceId());
+            HistoricProcessInstance historicProcessInstance = getHistoricProcessInstance((historicTaskInstance.getProcessInstanceId()));
+            if (Func.isNotEmpty(historicProcessInstance)) {
+                String[] businessKey = Func.toStrArray(StringPool.COLON, historicProcessInstance.getBusinessKey());
+                flow.setBusinessTable(businessKey[0]);
+                flow.setBusinessId(businessKey[1]);
+                if (historicProcessInstance.getEndActivityId() != null) {
+                    flow.setProcessIsFinished(FlowEngineConstant.STATUS_FINISHED);
+                } else {
+                    flow.setProcessIsFinished(FlowEngineConstant.STATUS_UNFINISHED);
+                }
+            }
+            flow.setStatus(FlowEngineConstant.STATUS_FINISH);
+            flowList.add(flow);
+        });
+        // 计算总数
+        long count = doneQuery.count();
+        // 设置总数
+        page.setTotal(count);
+        page.setRecords(flowList);
+        return page;
+    }
 
-	@Override
-	public boolean completeTask(BladeFlow flow) {
-		String taskId = flow.getTaskId();
-		String processInstanceId = flow.getProcessInstanceId();
-		String comment = Func.toStr(flow.getComment(), ProcessConstant.PASS_COMMENT);
-		// 增加评论
-		if (StringUtil.isNoneBlank(processInstanceId, comment)) {
-			taskService.addComment(taskId, processInstanceId, comment);
-		}
-		// 创建变量
-		Map<String, Object> variables = flow.getVariables();
-		if (variables == null) {
-			variables = Kv.create();
-		}
-		variables.put(ProcessConstant.PASS_KEY, flow.isPass());
-		//完成任务时,如果传入taskUser这个key,就是指定下一处理人
-		variables.put("taskUser", flow.getTaskUser());
-		// 完成任务
-		taskService.complete(taskId, variables);
-		return true;
-	}
+    @Override
+    public boolean completeTask(BladeFlow flow) {
+        String taskId = flow.getTaskId();
+        String processInstanceId = flow.getProcessInstanceId();
+        String comment = Func.toStr(flow.getComment(), ProcessConstant.PASS_COMMENT);
+        // 增加评论
+        if (StringUtil.isNoneBlank(processInstanceId, comment)) {
+            taskService.addComment(taskId, processInstanceId, comment);
+        }
+        // 创建变量
+        Map<String, Object> variables = flow.getVariables();
+        if (variables == null) {
+            variables = Kv.create();
+        }
+        variables.put(ProcessConstant.PASS_KEY, flow.isPass());
+        //完成任务时,如果传入taskUser这个key,就是指定下一处理人
+        variables.put("taskUser", flow.getTaskUser());
+        // 完成任务
+        taskService.complete(taskId, variables);
+        return true;
+    }
 
-	/**
-	 * 构建流程
-	 *
-	 * @param bladeFlow 流程通用类
-	 * @param flowList  流程列表
-	 * @param taskQuery 任务查询类
-	 * @param status    状态
-	 */
-	private void buildFlowTaskList(IPage<BladeFlow> page,BladeFlow bladeFlow, List<BladeFlow> flowList, TaskQuery taskQuery, String status) {
-		if (bladeFlow.getCategory() != null) {
-			taskQuery.processCategoryIn(Func.toStrList(bladeFlow.getCategory()));
-		}
-		if (bladeFlow.getProcessDefinitionName() != null) {
-			taskQuery.processDefinitionName(bladeFlow.getProcessDefinitionName());
-		}
-		if (bladeFlow.getBeginDate() != null) {
-			taskQuery.taskCreatedAfter(bladeFlow.getBeginDate());
-		}
-		if (bladeFlow.getEndDate() != null) {
-			taskQuery.taskCreatedBefore(bladeFlow.getEndDate());
-		}
-		List<Task> list;
-		//代办任务列表分页失效,在这里加上分页取数
-		if(status.equals(FlowEngineConstant.STATUS_TODO)){
-			int l = (int) ((page.getCurrent()-1) * page.getSize());
-			int l1 = (int) page.getSize();
-			list = taskQuery.listPage(l,l1);
-		}else{
-			list = taskQuery.list();
-		}
-		list.forEach(task -> {
-			BladeFlow flow = new BladeFlow();
-			flow.setTaskId(task.getId());
-			flow.setTaskDefinitionKey(task.getTaskDefinitionKey());
-			flow.setTaskName(task.getName());
-			flow.setAssignee(task.getAssignee());
-			flow.setCreateTime(task.getCreateTime());
-			flow.setClaimTime(task.getClaimTime());
-			flow.setExecutionId(task.getExecutionId());
-			flow.setVariables(task.getProcessVariables());
+    /**
+     * 构建流程
+     *
+     * @param bladeFlow 流程通用类
+     * @param flowList  流程列表
+     * @param taskQuery 任务查询类
+     * @param status    状态
+     */
+    private void buildFlowTaskList(IPage<BladeFlow> page, BladeFlow bladeFlow, List<BladeFlow> flowList, TaskQuery taskQuery, String status) {
+        if (bladeFlow.getCategory() != null) {
+            taskQuery.processCategoryIn(Func.toStrList(bladeFlow.getCategory()));
+        }
+        if (bladeFlow.getProcessDefinitionName() != null) {
+            taskQuery.processDefinitionName(bladeFlow.getProcessDefinitionName());
+        }
+        if (bladeFlow.getBeginDate() != null) {
+            taskQuery.taskCreatedAfter(bladeFlow.getBeginDate());
+        }
+        if (bladeFlow.getEndDate() != null) {
+            taskQuery.taskCreatedBefore(bladeFlow.getEndDate());
+        }
+        List<Task> list;
+        //代办任务列表分页失效,在这里加上分页取数
+        if (status.equals(FlowEngineConstant.STATUS_TODO)) {
+            int l = (int) ((page.getCurrent() - 1) * page.getSize());
+            int l1 = (int) page.getSize();
+            list = taskQuery.listPage(l, l1);
+        } else {
+            list = taskQuery.list();
+        }
+        list.forEach(task -> {
+            BladeFlow flow = new BladeFlow();
+            flow.setTaskId(task.getId());
+            flow.setTaskDefinitionKey(task.getTaskDefinitionKey());
+            flow.setTaskName(task.getName());
+            flow.setAssignee(task.getAssignee());
+            flow.setCreateTime(task.getCreateTime());
+            flow.setClaimTime(task.getClaimTime());
+            flow.setExecutionId(task.getExecutionId());
+            flow.setVariables(task.getProcessVariables());
 
-			HistoricProcessInstance historicProcessInstance = getHistoricProcessInstance(task.getProcessInstanceId());
-			if (Func.isNotEmpty(historicProcessInstance)) {
-				String[] businessKey = Func.toStrArray(StringPool.COLON, historicProcessInstance.getBusinessKey());
-				flow.setBusinessTable(businessKey[0]);
-				flow.setBusinessId(businessKey[1]);
-			}
+            HistoricProcessInstance historicProcessInstance = getHistoricProcessInstance(task.getProcessInstanceId());
+            if (Func.isNotEmpty(historicProcessInstance)) {
+                String[] businessKey = Func.toStrArray(StringPool.COLON, historicProcessInstance.getBusinessKey());
+                flow.setBusinessTable(businessKey[0]);
+                flow.setBusinessId(businessKey[1]);
+            }
 
-			FlowProcess processDefinition = FlowCache.getProcessDefinition(task.getProcessDefinitionId());
-			flow.setCategory(processDefinition.getCategory());
-			flow.setCategoryName(FlowCache.getCategoryName(processDefinition.getCategory()));
-			flow.setProcessDefinitionId(processDefinition.getId());
-			flow.setProcessDefinitionName(processDefinition.getName());
-			flow.setProcessDefinitionKey(processDefinition.getKey());
-			flow.setProcessDefinitionVersion(processDefinition.getVersion());
-			flow.setProcessInstanceId(task.getProcessInstanceId());
-			flow.setStatus(status);
-			flowList.add(flow);
-		});
-	}
+            FlowProcess processDefinition = FlowCache.getProcessDefinition(task.getProcessDefinitionId());
+            flow.setCategory(processDefinition.getCategory());
+            flow.setCategoryName(FlowCache.getCategoryName(processDefinition.getCategory()));
+            flow.setProcessDefinitionId(processDefinition.getId());
+            flow.setProcessDefinitionName(processDefinition.getName());
+            flow.setProcessDefinitionKey(processDefinition.getKey());
+            flow.setProcessDefinitionVersion(processDefinition.getVersion());
+            flow.setProcessInstanceId(task.getProcessInstanceId());
+            flow.setStatus(status);
+            flowList.add(flow);
+        });
+    }
 
-	/**
-	 * 获取历史流程
-	 *
-	 * @param processInstanceId 流程实例id
-	 * @return HistoricProcessInstance
-	 */
-	private HistoricProcessInstance getHistoricProcessInstance(String processInstanceId) {
-		return historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
-	}
+    /**
+     * 获取历史流程
+     *
+     * @param processInstanceId 流程实例id
+     * @return HistoricProcessInstance
+     */
+    private HistoricProcessInstance getHistoricProcessInstance(String processInstanceId) {
+        return historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
+    }
 
 }

+ 7 - 7
blade-ops/blade-flow/src/main/java/org/springblade/flow/engine/config/FlowableConfiguration.java

@@ -32,13 +32,13 @@ import org.springframework.context.annotation.Configuration;
 @AllArgsConstructor
 @EnableConfigurationProperties(FlowableProperties.class)
 public class FlowableConfiguration implements EngineConfigurationConfigurer<SpringProcessEngineConfiguration> {
-	private final FlowableProperties flowableProperties;
+    private final FlowableProperties flowableProperties;
 
-	@Override
-	public void configure(SpringProcessEngineConfiguration engineConfiguration) {
-		engineConfiguration.setActivityFontName(flowableProperties.getActivityFontName());
-		engineConfiguration.setLabelFontName(flowableProperties.getLabelFontName());
-		engineConfiguration.setAnnotationFontName(flowableProperties.getAnnotationFontName());
-	}
+    @Override
+    public void configure(SpringProcessEngineConfiguration engineConfiguration) {
+        engineConfiguration.setActivityFontName(flowableProperties.getActivityFontName());
+        engineConfiguration.setLabelFontName(flowableProperties.getLabelFontName());
+        engineConfiguration.setAnnotationFontName(flowableProperties.getAnnotationFontName());
+    }
 
 }

Some files were not shown because too many files changed in this diff