Browse Source

规范部分代码格式

zhouhao 7 năm trước cách đây
mục cha
commit
f5fd09295a
100 tập tin đã thay đổi với 606 bổ sung190 xóa
  1. 6 2
      hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/Authentication.java
  2. 1 0
      hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/access/CustomDataAccessConfig.java
  3. 1 0
      hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/access/OwnCreatedDataAccessConfig.java
  4. 1 0
      hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/access/ScriptDataAccessConfig.java
  5. 3 1
      hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/listener/event/AbstractAuthorizationEvent.java
  6. 2 1
      hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/simple/SimpleCustomDataAccessConfigConfig.java
  7. 1 0
      hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/simple/SimpleScriptDataAccessConfig.java
  8. 10 5
      hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/simple/builder/SimpleDataAccessConfigBuilderFactory.java
  9. 12 5
      hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/token/DefaultUserTokenManager.java
  10. 2 1
      hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/aop/DefaultAopMethodAuthorizeDefinitionParser.java
  11. 11 4
      hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/define/DefaultBasicAuthorizeDefinition.java
  12. 11 4
      hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/handler/DefaultAuthorizingHandler.java
  13. 6 2
      hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/handler/access/DefaultDataAccessController.java
  14. 2 1
      hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/handler/access/FieldFilterDataAccessHandler.java
  15. 3 1
      hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/handler/access/ScriptDataAccessHandler.java
  16. 3 1
      hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/web/SessionIdUserTokenGenerator.java
  17. 3 1
      hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/web/UserTokenAuthenticationSupplier.java
  18. 1 1
      hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/support/AbstractAuthorizationService.java
  19. 2 1
      hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/support/implicit/DefaultImplicitGranter.java
  20. 2 1
      hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/support/password/DefaultPasswordGranter.java
  21. 3 1
      hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-core/src/main/java/org/hswebframework/web/oauth2/core/ErrorType.java
  22. 3 1
      hsweb-boost/hsweb-boost-aop/src/main/java/org/hswebframework/web/boost/aop/context/MethodInterceptorHolder.java
  23. 1 0
      hsweb-boost/hsweb-boost-validator/hsweb-boost-validator-api/src/main/java/org/hswebframework/web/boost/validator/ScriptDuplicateValidatorConfig.java
  24. 1 0
      hsweb-commons/hsweb-commons-controller/src/main/java/org/hswebframework/web/controller/CrudController.java
  25. 1 0
      hsweb-commons/hsweb-commons-controller/src/main/java/org/hswebframework/web/controller/GenericEntityController.java
  26. 3 1
      hsweb-commons/hsweb-commons-controller/src/main/java/org/hswebframework/web/controller/QueryController.java
  27. 1 0
      hsweb-commons/hsweb-commons-controller/src/main/java/org/hswebframework/web/controller/SimpleCrudController.java
  28. 1 0
      hsweb-commons/hsweb-commons-controller/src/main/java/org/hswebframework/web/controller/SimpleGenericEntityController.java
  29. 30 12
      hsweb-commons/hsweb-commons-controller/src/main/java/org/hswebframework/web/controller/message/ResponseMessage.java
  30. 4 2
      hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/MybatisProperties.java
  31. 42 16
      hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/builder/EasyOrmSqlBuilder.java
  32. 3 1
      hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/dynamic/DynamicSpringManagedTransaction.java
  33. 3 1
      hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/dynamic/DynamicSqlSessionFactory.java
  34. 6 2
      hsweb-commons/hsweb-commons-entity/src/main/java/org/hswebframework/web/commons/entity/GenericEntity.java
  35. 6 2
      hsweb-commons/hsweb-commons-entity/src/main/java/org/hswebframework/web/commons/entity/SimpleGenericEntity.java
  36. 2 0
      hsweb-commons/hsweb-commons-entity/src/main/java/org/hswebframework/web/commons/entity/SimpleTreeSortSupportEntity.java
  37. 4 1
      hsweb-commons/hsweb-commons-entity/src/main/java/org/hswebframework/web/commons/entity/SortSupportEntity.java
  38. 5 2
      hsweb-commons/hsweb-commons-entity/src/main/java/org/hswebframework/web/commons/entity/TreeSupportEntity.java
  39. 19 7
      hsweb-commons/hsweb-commons-entity/src/main/java/org/hswebframework/web/commons/entity/factory/MapperEntityFactory.java
  40. 6 2
      hsweb-commons/hsweb-commons-service/hsweb-commons-service-simple/src/main/java/org/hswebframework/web/service/AbstractService.java
  41. 12 4
      hsweb-commons/hsweb-commons-service/hsweb-commons-service-simple/src/main/java/org/hswebframework/web/service/AbstractTreeSortService.java
  42. 5 2
      hsweb-commons/hsweb-commons-service/hsweb-commons-service-simple/src/main/java/org/hswebframework/web/service/DefaultDSLQueryService.java
  43. 1 0
      hsweb-commons/hsweb-commons-service/hsweb-commons-service-simple/src/main/java/org/hswebframework/web/service/DefaultDeleteService.java
  44. 15 6
      hsweb-commons/hsweb-commons-service/hsweb-commons-service-simple/src/main/java/org/hswebframework/web/service/DefaultQueryByEntityService.java
  45. 9 3
      hsweb-commons/hsweb-commons-service/hsweb-commons-service-simple/src/main/java/org/hswebframework/web/service/GenericEntityService.java
  46. 9 3
      hsweb-commons/hsweb-commons-utils/src/main/java/org/hswebframework/web/AopUtils.java
  47. 5 2
      hsweb-commons/hsweb-commons-utils/src/main/java/org/hswebframework/web/ExpressionUtils.java
  48. 3 1
      hsweb-commons/hsweb-commons-utils/src/main/java/org/hswebframework/web/RegexUtils.java
  49. 3 1
      hsweb-concurrent/hsweb-concurrent-async-job/src/main/java/org/hswebframework/web/async/SpringTransactionSupportJob.java
  50. 2 1
      hsweb-concurrent/hsweb-concurrent-counter/hsweb-concurrent-counter-api/src/main/java/org/hswebframework/web/concurrent/counter/AbstractCounterManager.java
  51. 6 2
      hsweb-concurrent/hsweb-concurrent-lock/hsweb-concurrent-lock-api/src/main/java/org/hswebframework/web/concurrent/lock/AbstractLockManager.java
  52. 3 1
      hsweb-concurrent/hsweb-concurrent-lock/hsweb-concurrent-lock-redis/src/main/java/org/hswebframework/web/concurrent/lock/redis/RedissonLockManager.java
  53. 9 3
      hsweb-concurrent/hsweb-concurrent-lock/hsweb-concurrent-lock-starter/src/main/java/org/hswebframework/web/concurrent/lock/starter/AopLockAdvisor.java
  54. 2 1
      hsweb-concurrent/hsweb-concurrent-lock/hsweb-concurrent-lock-starter/src/main/java/org/hswebframework/web/concurrent/lock/starter/LockProcessor.java
  55. 3 1
      hsweb-core/src/main/java/org/hswebframework/web/validate/SimpleValidateResults.java
  56. 3 1
      hsweb-core/src/main/java/org/hswebframework/web/validate/ValidationException.java
  57. 6 2
      hsweb-datasource/hsweb-datasource-api/src/main/java/org/hswebframework/web/datasource/DataSourceHolder.java
  58. 7 3
      hsweb-datasource/hsweb-datasource-api/src/main/java/org/hswebframework/web/datasource/switcher/DefaultDataSourceSwitcher.java
  59. 5 2
      hsweb-datasource/hsweb-datasource-jta/src/main/java/org/hswebframework/web/datasource/jta/JtaDynamicDataSourceService.java
  60. 3 0
      hsweb-examples/hsweb-examples-cloud/hsweb-examples-cloud-gateway/src/main/resources/application.yml
  61. 3 1
      hsweb-examples/hsweb-examples-simple/src/main/java/org/hswebframework/web/example/simple/SpringBootExample.java
  62. 1 0
      hsweb-message/hsweb-message-api/src/main/java/org/hswebframework/web/message/support/MultipleUserMessageSubject.java
  63. 1 0
      hsweb-message/hsweb-message-api/src/main/java/org/hswebframework/web/message/support/UserMessageSubject.java
  64. 2 1
      hsweb-message/hsweb-message-memory/src/main/java/org/hswebframework/web/message/memory/MemoryPublish.java
  65. 2 1
      hsweb-message/hsweb-message-redis/src/main/java/org/hswebframework/web/message/redis/RedissionMessageSubscribe.java
  66. 14 6
      hsweb-message/hsweb-message-websocket/src/main/java/org/hswebframework/web/socket/handler/CommandWebSocketMessageDispatcher.java
  67. 5 2
      hsweb-message/hsweb-message-websocket/src/main/java/org/hswebframework/web/socket/handler/WebSocketUtils.java
  68. 3 1
      hsweb-message/hsweb-message-websocket/src/main/java/org/hswebframework/web/socket/processor/DefaultCommandProcessorContainer.java
  69. 3 1
      hsweb-starter/hsweb-spring-boot-starter/src/main/java/org/hswebframework/web/starter/SystemInitializeAutoConfiguration.java
  70. 21 7
      hsweb-starter/hsweb-spring-boot-starter/src/main/java/org/hswebframework/web/starter/SystemVersion.java
  71. 10 4
      hsweb-starter/hsweb-spring-boot-starter/src/main/java/org/hswebframework/web/starter/convert/FastJsonGenericHttpMessageConverter.java
  72. 7 3
      hsweb-starter/hsweb-spring-boot-starter/src/main/java/org/hswebframework/web/starter/convert/FastJsonHttpMessageConverter.java
  73. 8 3
      hsweb-starter/hsweb-spring-boot-starter/src/main/java/org/hswebframework/web/starter/entity/EntityProperties.java
  74. 6 2
      hsweb-starter/hsweb-spring-boot-starter/src/main/java/org/hswebframework/web/starter/init/SystemInitialize.java
  75. 6 2
      hsweb-starter/hsweb-spring-boot-starter/src/main/java/org/hswebframework/web/starter/init/simple/SimpleDependencyInstaller.java
  76. 14 5
      hsweb-starter/hsweb-spring-boot-starter/src/main/java/org/hswebframework/web/starter/init/simple/SimpleDependencyUpgrader.java
  77. 6 2
      hsweb-system/hsweb-system-authorization/hsweb-system-authorization-controller/src/main/java/org/hswebframework/web/controller/authorization/UserController.java
  78. 1 0
      hsweb-system/hsweb-system-authorization/hsweb-system-authorization-entity/src/main/java/org/hswebframework/web/entity/authorization/MenuEntity.java
  79. 1 0
      hsweb-system/hsweb-system-authorization/hsweb-system-authorization-entity/src/main/java/org/hswebframework/web/entity/authorization/PermissionEntity.java
  80. 11 0
      hsweb-system/hsweb-system-authorization/hsweb-system-authorization-entity/src/main/java/org/hswebframework/web/entity/authorization/SimpleAuthorizationSettingDetailEntity.java
  81. 8 0
      hsweb-system/hsweb-system-authorization/hsweb-system-authorization-entity/src/main/java/org/hswebframework/web/entity/authorization/SimpleAuthorizationSettingEntity.java
  82. 8 0
      hsweb-system/hsweb-system-authorization/hsweb-system-authorization-entity/src/main/java/org/hswebframework/web/entity/authorization/SimpleAuthorizationSettingMenuEntity.java
  83. 12 0
      hsweb-system/hsweb-system-authorization/hsweb-system-authorization-entity/src/main/java/org/hswebframework/web/entity/authorization/SimpleMenuEntity.java
  84. 7 0
      hsweb-system/hsweb-system-authorization/hsweb-system-authorization-entity/src/main/java/org/hswebframework/web/entity/authorization/SimpleMenuGroupBindEntity.java
  85. 10 1
      hsweb-system/hsweb-system-authorization/hsweb-system-authorization-entity/src/main/java/org/hswebframework/web/entity/authorization/SimpleMenuGroupEntity.java
  86. 10 1
      hsweb-system/hsweb-system-authorization/hsweb-system-authorization-entity/src/main/java/org/hswebframework/web/entity/authorization/SimplePermissionEntity.java
  87. 6 0
      hsweb-system/hsweb-system-authorization/hsweb-system-authorization-entity/src/main/java/org/hswebframework/web/entity/authorization/SimpleRoleEntity.java
  88. 6 0
      hsweb-system/hsweb-system-authorization/hsweb-system-authorization-entity/src/main/java/org/hswebframework/web/entity/authorization/SimpleUserEntity.java
  89. 5 2
      hsweb-system/hsweb-system-authorization/hsweb-system-authorization-entity/src/main/java/org/hswebframework/web/entity/authorization/bind/SimpleBindRoleUserEntity.java
  90. 3 1
      hsweb-system/hsweb-system-authorization/hsweb-system-authorization-model/src/main/java/org/hswebframework/web/model/authorization/FieldAccessModel.java
  91. 6 2
      hsweb-system/hsweb-system-authorization/hsweb-system-authorization-model/src/main/java/org/hswebframework/web/model/authorization/SimplePermissionRoleModel.java
  92. 3 0
      hsweb-system/hsweb-system-authorization/hsweb-system-authorization-model/src/main/java/org/hswebframework/web/model/authorization/SimpleUserModel.java
  93. 17 6
      hsweb-system/hsweb-system-authorization/hsweb-system-authorization-service/hsweb-system-authorization-service-simple/src/main/java/org/hswebframework/web/service/authorization/simple/SimpleAuthorizationSettingService.java
  94. 5 1
      hsweb-system/hsweb-system-authorization/hsweb-system-authorization-service/hsweb-system-authorization-service-simple/src/main/java/org/hswebframework/web/service/authorization/simple/SimpleMenuGroupService.java
  95. 2 1
      hsweb-system/hsweb-system-authorization/hsweb-system-authorization-service/hsweb-system-authorization-service-simple/src/main/java/org/hswebframework/web/service/authorization/simple/SimpleMenuService.java
  96. 15 5
      hsweb-system/hsweb-system-authorization/hsweb-system-authorization-service/hsweb-system-authorization-service-simple/src/main/java/org/hswebframework/web/service/authorization/simple/SimpleUserService.java
  97. 13 5
      hsweb-system/hsweb-system-config/hsweb-system-config-entity/src/main/java/org/hswebframework/web/entity/config/ConfigContent.java
  98. 5 1
      hsweb-system/hsweb-system-config/hsweb-system-config-entity/src/main/java/org/hswebframework/web/entity/config/SimpleConfigEntity.java
  99. 2 1
      hsweb-system/hsweb-system-database-manager/hsweb-system-database-manager-simple/src/main/java/org/hswebframework/web/datasource/manager/simple/DefaultLocalTransactionExecutor.java
  100. 0 0
      hsweb-system/hsweb-system-database-manager/hsweb-system-database-manager-simple/src/main/java/org/hswebframework/web/datasource/manager/simple/SimpleDatabaseManagerService.java

+ 6 - 2
hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/Authentication.java

@@ -76,7 +76,9 @@ public interface Authentication extends Serializable {
      * @return 角色信息
      */
     default Optional<Role> getRole(String id) {
-        if (null == id) return null;
+        if (null == id) {
+            return Optional.empty();
+        }
         return getRoles().stream()
                 .filter(role -> role.getId().equals(id))
                 .findAny();
@@ -89,7 +91,9 @@ public interface Authentication extends Serializable {
      * @return 权限信息
      */
     default Optional<Permission> getPermission(String id) {
-        if (null == id) return null;
+        if (null == id) {
+            return Optional.empty();
+        }
         return getPermissions().parallelStream()
                 .filter(permission -> permission.getId().equals(id))
                 .findAny();

+ 1 - 0
hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/access/CustomDataAccessConfig.java

@@ -13,6 +13,7 @@ public interface CustomDataAccessConfig extends DataAccessConfig {
      */
     DataAccessController getController();
 
+    @Override
     default String getType() {
         return DefaultType.CUSTOM;
     }

+ 1 - 0
hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/access/OwnCreatedDataAccessConfig.java

@@ -6,6 +6,7 @@ package org.hswebframework.web.authorization.access;
  * @author zhouhao
  */
 public interface OwnCreatedDataAccessConfig extends DataAccessConfig {
+    @Override
     default String getType() {
         return DefaultType.OWN_CREATED;
     }

+ 1 - 0
hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/access/ScriptDataAccessConfig.java

@@ -6,6 +6,7 @@ package org.hswebframework.web.authorization.access;
  * @author zhouhao
  */
 public interface ScriptDataAccessConfig extends DataAccessConfig {
+    @Override
     default String getType() {
         return DefaultType.SCRIPT;
     }

+ 3 - 1
hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/listener/event/AbstractAuthorizationEvent.java

@@ -43,7 +43,9 @@ public abstract class AbstractAuthorizationEvent implements AuthorizationEvent {
      * @param parameterGetter 参数获取函数,用户获取授权时传入的参数
      */
     public AbstractAuthorizationEvent(String username, String password, Function<String, Object> parameterGetter) {
-        if (username == null || password == null || parameterGetter == null) throw new NullPointerException();
+        if (username == null || password == null || parameterGetter == null) {
+            throw new NullPointerException();
+        }
         this.username = username;
         this.password = password;
         this.parameterGetter = parameterGetter;

+ 2 - 1
hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/simple/SimpleCustomDataAccessConfigConfig.java

@@ -24,12 +24,13 @@ public class SimpleCustomDataAccessConfigConfig extends AbstractDataAccessConfig
         if (instance == null) {
             synchronized (this) {
                 // TODO: 17-2-8  spring bean not support now!
-                if (instance == null)
+                if (instance == null) {
                     try {
                         instance = (DataAccessController) Class.forName(classOrBeanName).newInstance();
                     } catch (Exception e) {
                         throw new RuntimeException(e);
                     }
+                }
             }
         }
         return instance;

+ 1 - 0
hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/simple/SimpleScriptDataAccessConfig.java

@@ -29,6 +29,7 @@ public class SimpleScriptDataAccessConfig extends AbstractDataAccessConfig imple
         this.scriptLanguage = scriptLanguage;
     }
 
+    @Override
     public String getScript() {
         return script;
     }

+ 10 - 5
hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/simple/builder/SimpleDataAccessConfigBuilderFactory.java

@@ -71,20 +71,25 @@ public class SimpleDataAccessConfigBuilderFactory implements DataAccessConfigBui
 
     @PostConstruct
     public void init() {
-        if (defaultSupportConvert.contains(FIELD_SCOPE))
+        if (defaultSupportConvert.contains(FIELD_SCOPE)) {
             converts.add(createJsonConfig(FIELD_SCOPE, SimpleFiledScopeDataAccessConfig.class));
+        }
 
-        if (defaultSupportConvert.contains(DENY_FIELDS))
+        if (defaultSupportConvert.contains(DENY_FIELDS)) {
             converts.add(createJsonConfig(DENY_FIELDS, SimpleFieldFilterDataAccessConfig.class));
+        }
 
-        if (defaultSupportConvert.contains(OWN_CREATED))
+        if (defaultSupportConvert.contains(OWN_CREATED)) {
             converts.add(createConfig(OWN_CREATED, (action, config) -> new SimpleOwnCreatedDataAccessConfig(action)));
+        }
 
-        if (defaultSupportConvert.contains(SCRIPT))
+        if (defaultSupportConvert.contains(SCRIPT)) {
             converts.add(createJsonConfig(SCRIPT, SimpleScriptDataAccessConfig.class));
+        }
 
-        if (defaultSupportConvert.contains(CUSTOM))
+        if (defaultSupportConvert.contains(CUSTOM)) {
             converts.add(createConfig(CUSTOM, (action, config) -> new SimpleCustomDataAccessConfigConfig(config)));
+        }
     }
 
     @Override

+ 12 - 5
hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/token/DefaultUserTokenManager.java

@@ -74,7 +74,9 @@ public class DefaultUserTokenManager implements UserTokenManager {
     }
 
     private SimpleUserToken checkTimeout(SimpleUserToken detail) {
-        if (null == detail) return null;
+        if (null == detail) {
+            return null;
+        }
         if (detail.getMaxInactiveInterval() <= 0) {
             return detail;
         }
@@ -100,7 +102,9 @@ public class DefaultUserTokenManager implements UserTokenManager {
     @Override
     public boolean userIsLoggedIn(String userId) {
         for (UserToken userToken : getByUserId(userId)) {
-            if (userToken.isEffective()) return true;
+            if (userToken.isEffective()) {
+                return true;
+            }
         }
         return false;
     }
@@ -153,8 +157,9 @@ public class DefaultUserTokenManager implements UserTokenManager {
     @Override
     public void changeTokenState(String token, TokenState state) {
         SimpleUserToken userToken = getByToken(token);
-        if (null != userToken)
+        if (null != userToken) {
             userToken.setState(state);
+        }
     }
 
     @Override
@@ -165,8 +170,9 @@ public class DefaultUserTokenManager implements UserTokenManager {
     @Override
     public UserToken signIn(String token, String userId, long maxInactiveInterval) {
         SimpleUserToken detail = new SimpleUserToken(userId, token);
-        if (null != authorizationListenerDispatcher)
+        if (null != authorizationListenerDispatcher) {
             authorizationListenerDispatcher.doEvent(new UserSignInEvent(detail));
+        }
         if (allopatricLoginMode == AllopatricLoginMode.deny) {
             detail.setState(TokenState.deny);
         } else if (allopatricLoginMode == AllopatricLoginMode.offlineOther) {
@@ -187,8 +193,9 @@ public class DefaultUserTokenManager implements UserTokenManager {
     @Override
     public void touch(String token) {
         SimpleUserToken userToken = tokenUserStorage.get(token);
-        if (null != userToken)
+        if (null != userToken) {
             userToken.touch();
+        }
     }
 
 }

+ 2 - 1
hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/aop/DefaultAopMethodAuthorizeDefinitionParser.java

@@ -78,8 +78,9 @@ public class DefaultAopMethodAuthorizeDefinitionParser implements AopMethodAutho
 
         DefaultBasicAuthorizeDefinition authorizeDefinition = new DefaultBasicAuthorizeDefinition();
 
-        if (methodAuth == null || methodAuth.merge())
+        if (methodAuth == null || methodAuth.merge()) {
             authorizeDefinition.put(classAuth);
+        }
 
         authorizeDefinition.put(methodAuth);
 

+ 11 - 4
hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/define/DefaultBasicAuthorizeDefinition.java

@@ -83,6 +83,7 @@ public class DefaultBasicAuthorizeDefinition implements AuthorizeDefinition {
         return logical;
     }
 
+    @Override
     public boolean isEmpty() {
         return permissions.isEmpty() && roles.isEmpty() && user.isEmpty() && script == null && dataAccessDefinition == null;
     }
@@ -129,7 +130,9 @@ public class DefaultBasicAuthorizeDefinition implements AuthorizeDefinition {
     }
 
     public void put(Authorize authorize) {
-        if (null == authorize || authorize.ignore()) return;
+        if (null == authorize || authorize.ignore()) {
+            return;
+        }
         permissions.addAll(Arrays.asList(authorize.permission()));
         actions.addAll(Arrays.asList(authorize.action()));
         roles.addAll(Arrays.asList(authorize.role()));
@@ -141,13 +144,17 @@ public class DefaultBasicAuthorizeDefinition implements AuthorizeDefinition {
     }
 
     public void put(RequiresExpression expression) {
-        if (null == expression) return;
+        if (null == expression) {
+            return;
+        }
         script = new DefaultScript(expression.language(), expression.value());
     }
 
     public void put(RequiresDataAccess dataAccess) {
-        if (null == dataAccess) return;
-        if (!dataAccess.permission().equals("")) {
+        if (null == dataAccess) {
+            return;
+        }
+        if (!"".equals(dataAccess.permission())) {
             permissions.add(dataAccess.permission());
         }
         actions.addAll(Arrays.asList(dataAccess.action()));

+ 11 - 4
hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/handler/DefaultAuthorizingHandler.java

@@ -74,7 +74,9 @@ public class DefaultAuthorizingHandler implements AuthorizingHandler {
                 .filter(access -> context.getDefinition().getActions().contains(access.getAction()))
                 .collect(Collectors.toSet());
         //无规则,则代表不进行控制
-        if (accesses.isEmpty()) return;
+        if (accesses.isEmpty()) {
+            return;
+        }
         //单个规则验证函数
         Function<Predicate<DataAccessConfig>, Boolean> function = accesses.stream()::allMatch;
         //调用控制器进行验证
@@ -130,17 +132,22 @@ public class DefaultAuthorizingHandler implements AuthorizingHandler {
             List<Permission> permissions = authentication.getPermissions().stream()
                     .filter(permission -> {
                         // 未持有任何一个权限
-                        if (!permissionsDef.contains(permission.getId())) return false;
+                        if (!permissionsDef.contains(permission.getId())) {
+                            return false;
+                        }
                         //未配置action
-                        if (actionsDef.isEmpty())
+                        if (actionsDef.isEmpty()) {
                             return true;
+                        }
                         //判断action
                         List<String> actions = permission.getActions()
                                 .stream()
                                 .filter(actionsDef::contains)
                                 .collect(Collectors.toList());
 
-                        if (actions.isEmpty()) return false;
+                        if (actions.isEmpty()) {
+                            return false;
+                        }
 
                         //如果 控制逻辑是or,则只要过滤结果数量不为0.否则过滤结果数量必须和配置的数量相同
                         return logicalIsOr ? actions.size() > 0 : permission.getActions().containsAll(actions);

+ 6 - 2
hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/handler/access/DefaultDataAccessController.java

@@ -26,7 +26,9 @@ public final class DefaultDataAccessController implements DataAccessController {
     }
 
     public DefaultDataAccessController(DataAccessController parent) {
-        if (parent == this) throw new UnsupportedOperationException();
+        if (parent == this) {
+            throw new UnsupportedOperationException();
+        }
         this.parent = parent;
         addHandler(new CustomDataAccessHandler());
         addHandler(new OwnCreatedDataAccessHandler());
@@ -37,7 +39,9 @@ public final class DefaultDataAccessController implements DataAccessController {
 
     @Override
     public boolean doAccess(DataAccessConfig access, AuthorizingContext context) {
-        if (parent != null) parent.doAccess(access, context);
+        if (parent != null) {
+            parent.doAccess(access, context);
+        }
         return handlers.stream()
                 // TODO: 17-3-28 可以换成access对应的handler以提高效率
                 .filter(handler -> handler.isSupport(access))

+ 2 - 1
hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/handler/access/FieldFilterDataAccessHandler.java

@@ -37,8 +37,9 @@ public class FieldFilterDataAccessHandler implements DataAccessHandler {
             case Permission.ACTION_UPDATE:
                 return doUpdateAccess(filterDataAccessConfig, context);
             default:
-                if (logger.isDebugEnabled())
+                if (logger.isDebugEnabled()) {
                     logger.debug("field filter not support for {}", access.getAction());
+                }
                 return true;
         }
     }

+ 3 - 1
hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/handler/access/ScriptDataAccessHandler.java

@@ -25,7 +25,9 @@ public class ScriptDataAccessHandler implements DataAccessHandler {
     public boolean handle(DataAccessConfig access, AuthorizingContext context) {
         ScriptDataAccessConfig dataAccess = ((ScriptDataAccessConfig) access);
         DynamicScriptEngine engine = DynamicScriptEngineFactory.getEngine(dataAccess.getScriptLanguage());
-        if (engine == null) throw new UnsupportedOperationException(dataAccess.getScriptLanguage() + " {not_support}");
+        if (engine == null) {
+            throw new UnsupportedOperationException(dataAccess.getScriptLanguage() + " {not_support}");
+        }
         String scriptId = DigestUtils.md5Hex(dataAccess.getScript());
         try {
             if (!engine.compiled(scriptId)) {

+ 3 - 1
hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/web/SessionIdUserTokenGenerator.java

@@ -21,7 +21,9 @@ public class SessionIdUserTokenGenerator implements UserTokenGenerator ,Serializ
     @Override
     public GeneratedToken generate(Authentication authentication) {
         HttpServletRequest request= WebUtil.getHttpServletRequest();
-        if(null==request)throw new UnsupportedOperationException();
+        if(null==request) {
+            throw new UnsupportedOperationException();
+        }
 
 
         int timeout =request.getSession().getMaxInactiveInterval()*1000;

+ 3 - 1
hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/web/UserTokenAuthenticationSupplier.java

@@ -21,7 +21,9 @@ public class UserTokenAuthenticationSupplier implements AuthenticationSupplier {
 
     @Override
     public Authentication get(String userId) {
-        if (userId == null) return null;
+        if (userId == null) {
+            return null;
+        }
         return authenticationManager.getByUserId(userId);
     }
 

+ 1 - 1
hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/support/AbstractAuthorizationService.java

@@ -76,7 +76,7 @@ public abstract class AbstractAuthorizationService {
         if (client == null) {
             throw new GrantTokenException(CLIENT_NOT_EXIST);
         }
-        if (DataStatus.STATUS_ENABLED != client.getStatus()) {
+        if (!DataStatus.STATUS_ENABLED.equals(client.getStatus())) {
             throw new GrantTokenException(CLIENT_DISABLED);
         }
         return client;

+ 2 - 1
hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/support/implicit/DefaultImplicitGranter.java

@@ -49,8 +49,9 @@ public class DefaultImplicitGranter extends AbstractAuthorizationService impleme
 
         OAuth2Client client = getClient(clientId);
         assertGrantTypeSupport(client, GrantType.implicit);
-        if (scope == null || scope.isEmpty())
+        if (scope == null || scope.isEmpty()) {
             scope = client.getDefaultGrantScope();
+        }
         if (!client.getDefaultGrantScope().containsAll(scope)) {
             throw new GrantTokenException(SCOPE_OUT_OF_RANGE);
         }

+ 2 - 1
hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/support/password/DefaultPasswordGranter.java

@@ -57,8 +57,9 @@ public class DefaultPasswordGranter extends AbstractAuthorizationService impleme
 
         OAuth2Client client = getClientByOwnerId(userId);
         assertGrantTypeSupport(client, GrantType.implicit);
-        if (scope == null || scope.isEmpty())
+        if (scope == null || scope.isEmpty()) {
             scope = client.getDefaultGrantScope();
+        }
         if (!client.getDefaultGrantScope().containsAll(scope)) {
             throw new GrantTokenException(SCOPE_OUT_OF_RANGE);
         }

+ 3 - 1
hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-core/src/main/java/org/hswebframework/web/oauth2/core/ErrorType.java

@@ -76,7 +76,9 @@ public enum ErrorType {
     }
 
     public String message() {
-        if (message == null) return this.name();
+        if (message == null) {
+            return this.name();
+        }
         return message;
     }
 

+ 3 - 1
hsweb-boost/hsweb-boost-aop/src/main/java/org/hswebframework/web/boost/aop/context/MethodInterceptorHolder.java

@@ -133,7 +133,9 @@ public class MethodInterceptorHolder {
 
             @Override
             public <T> Optional<T> getParameter(String name) {
-                if (args == null) return Optional.empty();
+                if (args == null) {
+                    return Optional.empty();
+                }
                 return Optional.of((T) args.get(name));
             }
 

+ 1 - 0
hsweb-boost/hsweb-boost-validator/hsweb-boost-validator-api/src/main/java/org/hswebframework/web/boost/validator/ScriptDuplicateValidatorConfig.java

@@ -24,6 +24,7 @@ package org.hswebframework.web.boost.validator;
  * @author zhouhao
  */
 public interface ScriptDuplicateValidatorConfig extends DuplicateValidatorConfig {
+    @Override
     default String getType() {
         return DefaultType.SCRIPT;
     }

+ 1 - 0
hsweb-commons/hsweb-commons-controller/src/main/java/org/hswebframework/web/controller/CrudController.java

@@ -39,6 +39,7 @@ public interface CrudController<E, PK, Q extends Entity, M>
         , CreateController<E, PK, M>
         , DeleteController<PK> {
 
+    @Override
     @SuppressWarnings("unchecked")
     CrudService<E, PK> getService();
 

+ 1 - 0
hsweb-commons/hsweb-commons-controller/src/main/java/org/hswebframework/web/controller/GenericEntityController.java

@@ -33,6 +33,7 @@ import org.hswebframework.web.service.CrudService;
 public interface GenericEntityController<E extends GenericEntity<PK>, PK, Q extends Entity, M>
         extends CrudController<E, PK, Q, M> {
 
+    @Override
     CrudService<E, PK> getService();
 
 }

+ 3 - 1
hsweb-commons/hsweb-commons-controller/src/main/java/org/hswebframework/web/controller/QueryController.java

@@ -91,7 +91,9 @@ public interface QueryController<E, PK, Q extends Entity> {
     }
 
     static <T> T assertNotNull(T obj) {
-        if (null == obj) throw new NotFoundException("{data_not_exist}");
+        if (null == obj) {
+            throw new NotFoundException("{data_not_exist}");
+        }
         return obj;
     }
 

+ 1 - 0
hsweb-commons/hsweb-commons-controller/src/main/java/org/hswebframework/web/controller/SimpleCrudController.java

@@ -39,6 +39,7 @@ public interface SimpleCrudController<E, PK, Q extends Entity>
         , CreateController<E, PK, E>
         , DeleteController<PK> {
 
+    @Override
     @SuppressWarnings("unchecked")
     CrudService<E, PK> getService();
 

+ 1 - 0
hsweb-commons/hsweb-commons-controller/src/main/java/org/hswebframework/web/controller/SimpleGenericEntityController.java

@@ -33,6 +33,7 @@ import org.hswebframework.web.service.CrudService;
 public interface SimpleGenericEntityController<E extends GenericEntity<PK>, PK, Q extends Entity>
         extends SimpleCrudController<E, PK, Q> {
 
+    @Override
     CrudService<E, PK> getService();
 
 

+ 30 - 12
hsweb-commons/hsweb-commons-controller/src/main/java/org/hswebframework/web/controller/message/ResponseMessage.java

@@ -113,9 +113,12 @@ public class ResponseMessage<T> implements Serializable {
     }
 
     public ResponseMessage<T> include(Class<?> type, Collection<String> fields) {
-        if (includes == null)
+        if (includes == null) {
             includes = new HashMap<>();
-        if (fields == null || fields.isEmpty()) return this;
+        }
+        if (fields == null || fields.isEmpty()) {
+            return this;
+        }
         fields.forEach(field -> {
             if (field.contains(".")) {
                 String tmp[] = field.split("[.]", 2);
@@ -134,9 +137,12 @@ public class ResponseMessage<T> implements Serializable {
     }
 
     public ResponseMessage<T> exclude(Class type, Collection<String> fields) {
-        if (excludes == null)
+        if (excludes == null) {
             excludes = new HashMap<>();
-        if (fields == null || fields.isEmpty()) return this;
+        }
+        if (fields == null || fields.isEmpty()) {
+            return this;
+        }
         fields.forEach(field -> {
             if (field.contains(".")) {
                 String tmp[] = field.split("[.]", 2);
@@ -155,23 +161,35 @@ public class ResponseMessage<T> implements Serializable {
     }
 
     public ResponseMessage<T> exclude(Collection<String> fields) {
-        if (excludes == null)
+        if (excludes == null) {
             excludes = new HashMap<>();
-        if (fields == null || fields.isEmpty()) return this;
+        }
+        if (fields == null || fields.isEmpty()) {
+            return this;
+        }
         Class type;
-        if (getResult() != null) type = getResult().getClass();
-        else return this;
+        if (getResult() != null) {
+            type = getResult().getClass();
+        } else {
+            return this;
+        }
         exclude(type, fields);
         return this;
     }
 
     public ResponseMessage<T> include(Collection<String> fields) {
-        if (includes == null)
+        if (includes == null) {
             includes = new HashMap<>();
-        if (fields == null || fields.isEmpty()) return this;
+        }
+        if (fields == null || fields.isEmpty()) {
+            return this;
+        }
         Class type;
-        if (getResult() != null) type = getResult().getClass();
-        else return this;
+        if (getResult() != null) {
+            type = getResult().getClass();
+        } else {
+            return this;
+        }
         include(type, fields);
         return this;
     }

+ 4 - 2
hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/MybatisProperties.java

@@ -80,14 +80,16 @@ public class MybatisProperties extends org.mybatis.spring.boot.autoconfigure.Myb
         this.dynamicDatasource = dynamicDatasource;
     }
 
+    @Override
     public Resource[] resolveMapperLocations() {
         Map<String, Resource> resources = new HashMap<>();
         Set<String> locations;
 
-        if (this.getMapperLocations() == null)
+        if (this.getMapperLocations() == null) {
             locations = new HashSet<>();
-        else
+        } else {
             locations = Arrays.stream(getMapperLocations()).collect(Collectors.toSet());
+        }
 
         locations.add(defaultMapperLocation);
 

+ 42 - 16
hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/builder/EasyOrmSqlBuilder.java

@@ -93,7 +93,9 @@ public class EasyOrmSqlBuilder {
 
     public static String getJavaType(Class type) {
         String javaType = simpleName.get(type);
-        if (javaType == null) javaType = type.getName();
+        if (javaType == null) {
+            javaType = type.getName();
+        }
         return javaType;
     }
 
@@ -146,8 +148,9 @@ public class EasyOrmSqlBuilder {
                 RDBColumnMetaData column = new RDBColumnMetaData();
                 column.setJdbcType(JDBCType.valueOf(resultMapping.getJdbcType().name()));
                 column.setName(resultMapping.getColumn());
-                if (!StringUtils.isNullOrEmpty(resultMapping.getProperty()))
+                if (!StringUtils.isNullOrEmpty(resultMapping.getProperty())) {
                     column.setAlias(resultMapping.getProperty());
+                }
                 column.setJavaType(resultMapping.getJavaType());
                 column.setProperty("resultMapping", resultMapping);
                 if (column.getJdbcType() == JDBCType.DATE) {
@@ -175,11 +178,17 @@ public class EasyOrmSqlBuilder {
         SqlAppender appender = new SqlAppender();
         columns.forEach(column -> {
             RDBColumnMetaData columnMetaData = column.getRDBColumnMetaData();
-            if (columnMetaData == null) return;
-            if (columnMetaData.getName().contains(".")) return;
+            if (columnMetaData == null) {
+                return;
+            }
+            if (columnMetaData.getName().contains(".")) {
+                return;
+            }
             try {
                 Object tmp = propertyUtils.getProperty(param.getData(), columnMetaData.getAlias());
-                if (tmp == null) return;
+                if (tmp == null) {
+                    return;
+                }
             } catch (Exception e) {
                 return;
             }
@@ -189,8 +198,11 @@ public class EasyOrmSqlBuilder {
                     ",jdbcType=", columnMetaData.getJdbcType(),
                     "}");
         });
-        if (!appender.isEmpty()) appender.removeFirst();
-        else throw new UnsupportedOperationException("{no_columns_will_be_update}");
+        if (!appender.isEmpty()) {
+            appender.removeFirst();
+        } else {
+            throw new UnsupportedOperationException("{no_columns_will_be_update}");
+        }
         return appender.toString();
     }
 
@@ -206,10 +218,11 @@ public class EasyOrmSqlBuilder {
     public String buildInsertSql(String resultMapId, String tableName, Object param) {
         Pager.reset();
         InsertParam insertParam;
-        if (param instanceof InsertParam)
+        if (param instanceof InsertParam) {
             insertParam = ((InsertParam) param);
-        else
+        } else {
             insertParam = new InsertParam<>(param);
+        }
         RDBTableMetaData tableMetaData = createMeta(tableName, resultMapId);
         SqlRender<InsertParam> render = tableMetaData.getDatabaseMetaData().getRenderer(SqlRender.TYPE.INSERT);
         String sql = render.render(tableMetaData, insertParam).getSql();
@@ -240,9 +253,13 @@ public class EasyOrmSqlBuilder {
         SqlAppender appender = new SqlAppender();
         columns.forEach(column -> {
             RDBColumnMetaData columnMetaData = column.getRDBColumnMetaData();
-            if (columnMetaData == null) return;
+            if (columnMetaData == null) {
+                return;
+            }
             String cname = columnMetaData.getName();
-            if (!cname.contains(".")) cname = tableName.concat(".").concat(cname);
+            if (!cname.contains(".")) {
+                cname = tableName.concat(".").concat(cname);
+            }
             appender.add(",", encodeColumn(dialect, cname)
                     , " AS "
                     , dialect.getQuoteStart()
@@ -250,7 +267,9 @@ public class EasyOrmSqlBuilder {
                     , dialect.getQuoteEnd());
         });
         param.getIncludes().remove("*");
-        if (appender.isEmpty()) return "*";
+        if (appender.isEmpty()) {
+            return "*";
+        }
         appender.removeFirst();
         return appender.toString();
     }
@@ -264,14 +283,21 @@ public class EasyOrmSqlBuilder {
         param.getSorts()
                 .forEach(sort -> {
                     RDBColumnMetaData column = tableMetaData.getColumn(sort.getName());
-                    if (column == null)
+                    if (column == null) {
                         column = tableMetaData.findColumn(sort.getName());
-                    if (column == null) return;
+                    }
+                    if (column == null) {
+                        return;
+                    }
                     String cname = column.getName();
-                    if (!cname.contains(".")) cname = tableName.concat(".").concat(cname);
+                    if (!cname.contains(".")) {
+                        cname = tableName.concat(".").concat(cname);
+                    }
                     appender.add(encodeColumn(tableMetaData.getDatabaseMetaData().getDialect(), cname), " ", sort.getOrder(), ",");
                 });
-        if (appender.isEmpty()) return "";
+        if (appender.isEmpty()) {
+            return "";
+        }
         appender.removeLast();
         return appender.toString();
     }

+ 3 - 1
hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/dynamic/DynamicSpringManagedTransaction.java

@@ -131,7 +131,9 @@ public class DynamicSpringManagedTransaction implements Transaction {
             }
         }
         connectionMap.clear();
-        if (null != tmp) throw tmp;
+        if (null != tmp) {
+            throw tmp;
+        }
     }
 
     @Override

+ 3 - 1
hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/dynamic/DynamicSqlSessionFactory.java

@@ -94,7 +94,9 @@ public class DynamicSqlSessionFactory implements SqlSessionFactory {
             final Environment environment = getConfiguration().getEnvironment();
             final TransactionFactory transactionFactory = getTransactionFactoryFromEnvironment(environment);
             DataSource ds = DataSourceHolder.currentDataSource().getNative();
-            if (ds == null) ds = environment.getDataSource();
+            if (ds == null) {
+                ds = environment.getDataSource();
+            }
             tx = transactionFactory.newTransaction(ds, level, autoCommit);
             final Executor executor = getConfiguration().newExecutor(tx, execType);
             return new DefaultSqlSession(getConfiguration(), executor, autoCommit);

+ 6 - 2
hsweb-commons/hsweb-commons-entity/src/main/java/org/hswebframework/web/commons/entity/GenericEntity.java

@@ -43,7 +43,9 @@ public interface GenericEntity<PK> extends CloneableEntity {
     @SuppressWarnings("unchecked")
     default <T> T getProperty(String propertyName, T defaultValue) {
         Map<String, Object> map = getProperties();
-        if (map == null) return null;
+        if (map == null) {
+            return null;
+        }
         return (T) map.getOrDefault(propertyName, defaultValue);
     }
 
@@ -63,7 +65,9 @@ public interface GenericEntity<PK> extends CloneableEntity {
     default Map<String, Object> cloneProperties() {
         Map<String, Object> target = new LinkedHashMap<>();
         Map<String, Object> old = getProperties();
-        if (old == null || old.isEmpty()) return target;
+        if (old == null || old.isEmpty()) {
+            return target;
+        }
         old.forEach((k, v) -> {
             if (v instanceof CloneableEntity) {
                 target.put(k, ((CloneableEntity) v).clone());

+ 6 - 2
hsweb-commons/hsweb-commons-entity/src/main/java/org/hswebframework/web/commons/entity/SimpleGenericEntity.java

@@ -54,7 +54,9 @@ public abstract class SimpleGenericEntity<PK> implements GenericEntity<PK> {
     @Override
     @SuppressWarnings("unchecked")
     public <T> T getProperty(String propertyName, T defaultValue) {
-        if (null == properties) return defaultValue;
+        if (null == properties) {
+            return defaultValue;
+        }
         return (T) properties.getOrDefault(propertyName, defaultValue);
     }
 
@@ -65,7 +67,9 @@ public abstract class SimpleGenericEntity<PK> implements GenericEntity<PK> {
 
     @Override
     public void setProperty(String propertyName, Object value) {
-        if (null == properties) properties = new LinkedHashMap<>();
+        if (null == properties) {
+            properties = new LinkedHashMap<>();
+        }
         properties.put(propertyName, value);
     }
 

+ 2 - 0
hsweb-commons/hsweb-commons-entity/src/main/java/org/hswebframework/web/commons/entity/SimpleTreeSortSupportEntity.java

@@ -42,10 +42,12 @@ public abstract class SimpleTreeSortSupportEntity<PK> extends SimpleGenericEntit
 
     private Integer level;
 
+    @Override
     public String getPath() {
         return path;
     }
 
+    @Override
     public void setPath(String path) {
         this.path = path;
     }

+ 4 - 1
hsweb-commons/hsweb-commons-entity/src/main/java/org/hswebframework/web/commons/entity/SortSupportEntity.java

@@ -26,8 +26,11 @@ public interface SortSupportEntity extends Comparable<SortSupportEntity>, Entity
 
     void setSortIndex(Long sortIndex);
 
+    @Override
     default int compareTo(SortSupportEntity support) {
-        if (support == null) return -1;
+        if (support == null) {
+            return -1;
+        }
         
         return Long.compare(getSortIndex() == null ? 0 : getSortIndex(), support.getSortIndex() == null ? 0 : support.getSortIndex());
     }

+ 5 - 2
hsweb-commons/hsweb-commons-entity/src/main/java/org/hswebframework/web/commons/entity/TreeSupportEntity.java

@@ -57,7 +57,9 @@ public interface TreeSupportEntity<PK> extends GenericEntity<PK> {
      * @return 父节点path
      */
     static String getParentPath(String path) {
-        if (path == null || path.length() < 4) return null;
+        if (path == null || path.length() < 4) {
+            return null;
+        }
         return path.substring(0, path.length() - 5);
     }
 
@@ -85,8 +87,9 @@ public interface TreeSupportEntity<PK> extends GenericEntity<PK> {
         List<T> children = parent.getChildren();
         if (parent.getPath() == null) {
             parent.setPath(RandomUtil.randomChar(4));
-            if (parent.getPath() != null)
+            if (parent.getPath() != null) {
                 parent.setLevel(parent.getPath().split("-").length);
+            }
             if (parent instanceof SortSupportEntity) {
                 Long index = ((SortSupportEntity) parent).getSortIndex();
                 if (null == index) {

+ 19 - 7
hsweb-commons/hsweb-commons-entity/src/main/java/org/hswebframework/web/commons/entity/factory/MapperEntityFactory.java

@@ -103,7 +103,9 @@ public class MapperEntityFactory implements EntityFactory {
         Objects.requireNonNull(target);
         try {
             PropertyCopier<S, T> copier = copierCache.<S, T>get(getCopierCacheKey(source.getClass(), target.getClass()));
-            if (null != copier) return copier.copyProperties(source, target);
+            if (null != copier) {
+                return copier.copyProperties(source, target);
+            }
 
             return (T) defaultPropertyCopier.copyProperties(source, target);
 //
@@ -141,8 +143,9 @@ public class MapperEntityFactory implements EntityFactory {
             realType = beanClass;
         }
         if (mapper == null && realType != null) {
-            if (logger.isDebugEnabled())
+            if (logger.isDebugEnabled()) {
                 logger.debug("use instance {} for {}", realType, beanClass);
+            }
             mapper = new Mapper<>(realType, new DefaultInstanceGetter(realType));
         }
         if (mapper != null) {
@@ -158,12 +161,20 @@ public class MapperEntityFactory implements EntityFactory {
 
     @Override
     public <T> T newInstance(Class<T> beanClass, Class<? extends T> defaultClass) {
-        if (beanClass == null) return null;
+        if (beanClass == null) {
+            return null;
+        }
         Mapper<T> mapper = realTypeMapper.get(beanClass);
-        if (mapper != null) return mapper.getInstanceGetter().get();
+        if (mapper != null) {
+            return mapper.getInstanceGetter().get();
+        }
         mapper = initCache(beanClass);
-        if (mapper != null) return mapper.getInstanceGetter().get();
-        if (defaultClass != null) return newInstance(defaultClass);
+        if (mapper != null) {
+            return mapper.getInstanceGetter().get();
+        }
+        if (defaultClass != null) {
+            return newInstance(defaultClass);
+        }
 
         throw new NotFoundException("can't create instance for " + beanClass);
     }
@@ -176,8 +187,9 @@ public class MapperEntityFactory implements EntityFactory {
             return mapper.getTarget();
         }
         mapper = initCache(beanClass);
-        if (mapper != null)
+        if (mapper != null) {
             return mapper.getTarget();
+        }
 
         return Modifier.isAbstract(beanClass.getModifiers())
                 || Modifier.isInterface(beanClass.getModifiers())

+ 6 - 2
hsweb-commons/hsweb-commons-service/hsweb-commons-service-simple/src/main/java/org/hswebframework/web/service/AbstractService.java

@@ -56,6 +56,7 @@ public abstract class AbstractService<E extends Entity, PK> implements CreateEnt
         return null != entityFactory;
     }
 
+    @Override
     public Class<E> getEntityInstanceType() {
         return entityFactory.getInstanceType(getEntityType());
     }
@@ -118,8 +119,9 @@ public abstract class AbstractService<E extends Entity, PK> implements CreateEnt
         SimpleValidateResults results = new SimpleValidateResults();
         validatorSetFunction.get()
                 .forEach(violation -> results.addResult(violation.getPropertyPath().toString(), violation.getMessage()));
-        if (!results.isSuccess())
+        if (!results.isSuccess()) {
             throw new ValidationException(results);
+        }
     }
 
     public static void assertNotNull(Object data) {
@@ -127,7 +129,9 @@ public abstract class AbstractService<E extends Entity, PK> implements CreateEnt
     }
 
     public static void assertNotNull(Object data, String message) {
-        if (null == data) throw new NotFoundException(message);
+        if (null == data) {
+            throw new NotFoundException(message);
+        }
     }
 
 

+ 12 - 4
hsweb-commons/hsweb-commons-service/hsweb-commons-service-simple/src/main/java/org/hswebframework/web/service/AbstractTreeSortService.java

@@ -64,8 +64,12 @@ public abstract class AbstractTreeSortService<E extends TreeSortSupportEntity<PK
     }
 
     protected void applyPath(E entity) {
-        if (!StringUtils.isEmpty(entity.getParentId())) return;
-        if (!StringUtils.isEmpty(entity.getPath())) return;
+        if (!StringUtils.isEmpty(entity.getParentId())) {
+            return;
+        }
+        if (!StringUtils.isEmpty(entity.getPath())) {
+            return;
+        }
 
         TreeSortSupportEntity<PK> parent = selectByPk(entity.getParentId());
         if (null == parent) {
@@ -78,7 +82,9 @@ public abstract class AbstractTreeSortService<E extends TreeSortSupportEntity<PK
 
     @Override
     public PK insert(E entity) {
-        if (entity.getId() == null) entity.setId(getIDGenerator().generate());
+        if (entity.getId() == null) {
+            entity.setId(getIDGenerator().generate());
+        }
         applyPath(entity);
         List<E> childrenList = new ArrayList<>();
         TreeSupportEntity.expandTree2List(entity, childrenList, getIDGenerator());
@@ -94,6 +100,7 @@ public abstract class AbstractTreeSortService<E extends TreeSortSupportEntity<PK
                 .collect(Collectors.toList());
     }
 
+    @Override
     public int updateBatch(Collection<E> data) {
         assertNotNull(data);
         return data.stream().map(this::updateByPk).reduce(Math::addExact).orElse(0);
@@ -114,8 +121,9 @@ public abstract class AbstractTreeSortService<E extends TreeSortSupportEntity<PK
         PK id = entity.getId();
         applyPath(entity);
         if (null == id || this.selectByPk(id) == null) {
-            if (null == id)
+            if (null == id) {
                 entity.setId(getIDGenerator().generate());
+            }
             return super.insert(entity);
         }
         super.updateByPk(entity);

+ 5 - 2
hsweb-commons/hsweb-commons-service/hsweb-commons-service-simple/src/main/java/org/hswebframework/web/service/DefaultDSLQueryService.java

@@ -79,8 +79,11 @@ public interface DefaultDSLQueryService<E, PK>
         query.setSingleExecutor((param) -> {
             param.doPaging(0, 1);
             List<PO> list = dao.query(param);
-            if (null == list || list.size() == 0) return null;
-            else return list.get(0);
+            if (null == list || list.size() == 0) {
+                return null;
+            } else {
+                return list.get(0);
+            }
         });
         query.noPaging();
         return query;

+ 1 - 0
hsweb-commons/hsweb-commons-service/hsweb-commons-service-simple/src/main/java/org/hswebframework/web/service/DefaultDeleteService.java

@@ -28,5 +28,6 @@ public interface DefaultDeleteService<PK> extends DeleteService<PK> {
      * @param pk 主键
      * @return 影响记录数
      */
+    @Override
     int deleteByPk(PK pk);
 }

+ 15 - 6
hsweb-commons/hsweb-commons-service/hsweb-commons-service-simple/src/main/java/org/hswebframework/web/service/DefaultQueryByEntityService.java

@@ -57,8 +57,9 @@ public interface DefaultQueryByEntityService<E>
             pagerResult.setData(Collections.emptyList());
         } else {
             //根据实际记录数量重新指定分页参数
-            if (param instanceof QueryParamEntity)
+            if (param instanceof QueryParamEntity) {
                 ((QueryParamEntity) param).rePaging(total);
+            }
             pagerResult.setData(getDao().query(param));
         }
         return pagerResult;
@@ -74,7 +75,9 @@ public interface DefaultQueryByEntityService<E>
     @Override
     @Transactional(readOnly = true)
     default List<E> select(Entity param) {
-        if (param == null) param = QueryParamEntity.empty();
+        if (param == null) {
+            param = QueryParamEntity.empty();
+        }
         return getDao().query(param);
     }
 
@@ -88,7 +91,9 @@ public interface DefaultQueryByEntityService<E>
     @Override
     @Transactional(readOnly = true)
     default int count(Entity param) {
-        if (param == null) param = QueryParamEntity.empty();
+        if (param == null) {
+            param = QueryParamEntity.empty();
+        }
         return getDao().count(param);
     }
 
@@ -101,11 +106,15 @@ public interface DefaultQueryByEntityService<E>
     @Override
     @Transactional(readOnly = true)
     default E selectSingle(Entity param) {
-        if (param instanceof QueryParamEntity)
+        if (param instanceof QueryParamEntity) {
             ((QueryParamEntity) param).doPaging(0, 1);
+        }
         List<E> list = this.select(param);
-        if (list.size() == 0) return null;
-        else return list.get(0);
+        if (list.size() == 0) {
+            return null;
+        } else {
+            return list.get(0);
+        }
     }
 
 }

+ 9 - 3
hsweb-commons/hsweb-commons-service/hsweb-commons-service-simple/src/main/java/org/hswebframework/web/service/GenericEntityService.java

@@ -108,7 +108,9 @@ public abstract class GenericEntityService<E extends GenericEntity<PK>, PK>
             }
             tryValidateProperty(selectByPk(entity.getId()) == null, "id", entity.getId() + "已存在");
         }
-        if (entity.getId() == null) entity.setId(getIDGenerator().generate());
+        if (entity.getId() == null) {
+            entity.setId(getIDGenerator().generate());
+        }
         tryValidate(entity, CreateGroup.class);
         getDao().insert(entity);
         return entity.getId();
@@ -117,13 +119,17 @@ public abstract class GenericEntityService<E extends GenericEntity<PK>, PK>
     @Override
     @Transactional(readOnly = true)
     public E selectByPk(PK pk) {
-        if (null == pk) return null;
+        if (null == pk) {
+            return null;
+        }
         return createQuery().where(GenericEntity.id, pk).single();
     }
 
     @Override
     public List<E> selectByPk(List<PK> id) {
-        if (id == null || id.isEmpty()) return new ArrayList<>();
+        if (id == null || id.isEmpty()) {
+            return new ArrayList<>();
+        }
         return createQuery().where().in(GenericEntity.id, id).listNoPaging();
     }
 }

+ 9 - 3
hsweb-commons/hsweb-commons-utils/src/main/java/org/hswebframework/web/AopUtils.java

@@ -32,7 +32,9 @@ public class AopUtils {
     public static <T extends Annotation> T findMethodAnnotation(Class targetClass, Method method, Class<T> annClass) {
         Method m = method;
         T a = AnnotationUtils.findAnnotation(m, annClass);
-        if (a != null) return a;
+        if (a != null) {
+            return a;
+        }
         m = ClassUtils.getMostSpecificMethod(m, targetClass);
         a = AnnotationUtils.findAnnotation(m, annClass);
         return a;
@@ -44,7 +46,9 @@ public class AopUtils {
 
     public static <T extends Annotation> T findAnnotation(Class targetClass, Method method, Class<T> annClass) {
         T a = findMethodAnnotation(targetClass, method, annClass);
-        if (a != null) return a;
+        if (a != null) {
+            return a;
+        }
         return findAnnotation(targetClass, annClass);
     }
 
@@ -61,7 +65,9 @@ public class AopUtils {
         String[] names = signature.getParameterNames();
         Class[] args = signature.getParameterTypes();
         for (int i = 0, len = args.length; i < len; i++) {
-            if (i != 0) methodName.append(",");
+            if (i != 0) {
+                methodName.append(",");
+            }
             methodName.append(args[i].getSimpleName()).append(" ").append(names[i]);
         }
         return methodName.append(")").toString();

+ 5 - 2
hsweb-commons/hsweb-commons-utils/src/main/java/org/hswebframework/web/ExpressionUtils.java

@@ -75,7 +75,9 @@ public class ExpressionUtils {
     public static String analytical(String expression, Map<String, Object> vars, String language) throws Exception {
         Matcher matcher = PATTERN.matcher(expression);
         DynamicScriptEngine engine = DynamicScriptEngineFactory.getEngine(language);
-        if (engine == null) return expression;
+        if (engine == null) {
+            return expression;
+        }
         vars = new HashMap<>(vars);
         vars.putAll(getDefaultVar());
         while (matcher.find()) {
@@ -85,8 +87,9 @@ public class ExpressionUtils {
                 engine.compile(e_id, real_expression);
             }
             ExecuteResult result = engine.execute(e_id, vars);
-            if (!result.isSuccess())
+            if (!result.isSuccess()) {
                 throw new RuntimeException(result.getMessage(), result.getException());
+            }
             String obj = String.valueOf(result.get());
             // expression = matcher.replaceFirst(obj);
             expression = expression.replace("${" + real_expression + "}", obj);

+ 3 - 1
hsweb-commons/hsweb-commons-utils/src/main/java/org/hswebframework/web/RegexUtils.java

@@ -14,7 +14,9 @@ public class RegexUtils {
     static Set<Character> SPECIAL_WORDS = new HashSet<>(Arrays.asList('\\', '$', '(', ')', '*', '+', '.', '[', ']', '?', '^', '{', '}', '|'));
 
     public static String escape(String regex) {
-        if (regex == null || regex.isEmpty()) return regex;
+        if (regex == null || regex.isEmpty()) {
+            return regex;
+        }
         char[] chars = regex.toCharArray();
         StringBuilder builder = new StringBuilder();
         for (int i = 0; i < chars.length; i++) {

+ 3 - 1
hsweb-concurrent/hsweb-concurrent-async-job/src/main/java/org/hswebframework/web/async/SpringTransactionSupportJob.java

@@ -46,7 +46,9 @@ public class SpringTransactionSupportJob<V> implements TransactionSupportJob<V>
     @Override
     public V call() throws Exception {
         transactionStatus = transactionTemplate.getTransactionManager().getTransaction(transactionTemplate);
-        if (rollback) transactionStatus.setRollbackOnly();
+        if (rollback) {
+            transactionStatus.setRollbackOnly();
+        }
         return target.call();
     }
 }

+ 2 - 1
hsweb-concurrent/hsweb-concurrent-counter/hsweb-concurrent-counter-api/src/main/java/org/hswebframework/web/concurrent/counter/AbstractCounterManager.java

@@ -13,8 +13,9 @@ public abstract class AbstractCounterManager implements CounterManager {
     @Override
     public Counter getCounter(String name) {
         Counter counter = counterStore.get(name);
-        if (counter != null)
+        if (counter != null) {
             return counter;
+        }
         synchronized (counterStore) {
             return counterStore.computeIfAbsent(name, this::createCount);
         }

+ 6 - 2
hsweb-concurrent/hsweb-concurrent-lock/hsweb-concurrent-lock-api/src/main/java/org/hswebframework/web/concurrent/lock/AbstractLockManager.java

@@ -17,7 +17,9 @@ public abstract class AbstractLockManager implements LockManager {
     @Override
     public Lock getLock(String lockName) {
         Lock lock = lockStore.get(lockName);
-        if (lock != null) return lock;
+        if (lock != null) {
+            return lock;
+        }
         synchronized (lockStore) {
             return lockStore.computeIfAbsent(lockName, this::createLock);
         }
@@ -26,7 +28,9 @@ public abstract class AbstractLockManager implements LockManager {
     @Override
     public ReadWriteLock getReadWriteLock(String lockName) {
         ReadWriteLock lock = readWriteLockStore.get(lockName);
-        if (lock != null) return lock;
+        if (lock != null) {
+            return lock;
+        }
         synchronized (readWriteLockStore) {
             return readWriteLockStore.computeIfAbsent(lockName, this::createReadWriteLock);
         }

+ 3 - 1
hsweb-concurrent/hsweb-concurrent-lock/hsweb-concurrent-lock-redis/src/main/java/org/hswebframework/web/concurrent/lock/redis/RedissonLockManager.java

@@ -13,7 +13,9 @@ public class RedissonLockManager extends AbstractLockManager {
     private RedissonClient redisson;
 
     public RedissonLockManager(RedissonClient redisson) {
-        if (null == redisson) throw new NullPointerException();
+        if (null == redisson) {
+            throw new NullPointerException();
+        }
         this.redisson = redisson;
     }
 

+ 9 - 3
hsweb-concurrent/hsweb-concurrent-lock/hsweb-concurrent-lock-starter/src/main/java/org/hswebframework/web/concurrent/lock/starter/AopLockAdvisor.java

@@ -89,11 +89,17 @@ public class AopLockAdvisor extends StaticMethodMatcherPointcutAdvisor {
     @Override
     public boolean matches(Method method, Class<?> aClass) {
         Lock lock = AopUtils.findMethodAnnotation(aClass, method, Lock.class);
-        if (null != lock) return true;
+        if (null != lock) {
+            return true;
+        }
         ReadLock readLock = AopUtils.findMethodAnnotation(aClass, method, ReadLock.class);
-        if (null != readLock) return true;
+        if (null != readLock) {
+            return true;
+        }
         WriteLock writeLock = AopUtils.findMethodAnnotation(aClass, method, WriteLock.class);
-        if (null != writeLock) return true;
+        if (null != writeLock) {
+            return true;
+        }
         return false;
     }
 }

+ 2 - 1
hsweb-concurrent/hsweb-concurrent-lock/hsweb-concurrent-lock-starter/src/main/java/org/hswebframework/web/concurrent/lock/starter/LockProcessor.java

@@ -112,8 +112,9 @@ public class LockProcessor<A extends Annotation, L> {
     public void doUnlock() {
         for (L lock : successLock) {
             Throwable error = unlockAccepter.apply(lock);
-            if (null != error)
+            if (null != error) {
                 logger.error("unlock {} error", interceptorHolder.getMethod(), error);
+            }
         }
     }
 

+ 3 - 1
hsweb-core/src/main/java/org/hswebframework/web/validate/SimpleValidateResults.java

@@ -75,7 +75,9 @@ public class SimpleValidateResults implements ValidateResults {
 
     @Override
     public String toString() {
-        if (isSuccess()) return "success";
+        if (isSuccess()) {
+            return "success";
+        }
         return results.toString();
     }
 }

+ 3 - 1
hsweb-core/src/main/java/org/hswebframework/web/validate/ValidationException.java

@@ -41,7 +41,9 @@ public class ValidationException extends BusinessException {
     }
 
     public List<ValidateResults.Result> getResults() {
-        if (results == null) return null;
+        if (results == null) {
+            return null;
+        }
         return results.getResults();
     }
 }

+ 6 - 2
hsweb-datasource/hsweb-datasource-api/src/main/java/org/hswebframework/web/datasource/DataSourceHolder.java

@@ -61,7 +61,9 @@ public final class DataSourceHolder {
      */
     public static DynamicDataSource currentDataSource() {
         String id = dataSourceSwitcher.currentDataSourceId();
-        if (id == null) return defaultDataSource();
+        if (id == null) {
+            return defaultDataSource();
+        }
         checkDynamicDataSourceReady();
         return dynamicDataSourceService.getDataSource(id);
     }
@@ -92,7 +94,9 @@ public final class DataSourceHolder {
      * @return 当前使用的数据源是否存在
      */
     public static boolean currentExisting() {
-        if (currentIsDefault()) return true;
+        if (currentIsDefault()) {
+            return true;
+        }
         try {
             return currentDataSource() != null;
         } catch (DataSourceNotFoundException e) {

+ 7 - 3
hsweb-datasource/hsweb-datasource-api/src/main/java/org/hswebframework/web/datasource/switcher/DefaultDataSourceSwitcher.java

@@ -35,9 +35,11 @@ public class DefaultDataSourceSwitcher implements DataSourceSwitcher {
         getUsedHistoryQueue().removeLast();
         if (logger.isDebugEnabled()) {
             String current = currentDataSourceId();
-            if (null != current)
+            if (null != current) {
                 logger.debug("try use last data source : {}", currentDataSourceId());
-            else logger.debug("try use default data source");
+            } else {
+                logger.debug("try use default data source");
+            }
         }
     }
 
@@ -60,7 +62,9 @@ public class DefaultDataSourceSwitcher implements DataSourceSwitcher {
 
     @Override
     public String currentDataSourceId() {
-        if (getUsedHistoryQueue().size() == 0) return null;
+        if (getUsedHistoryQueue().size() == 0) {
+            return null;
+        }
 
         String activeId = getUsedHistoryQueue().getLast();
         if (DEFAULT_DATASOURCE_ID.equals(activeId)) {

+ 5 - 2
hsweb-datasource/hsweb-datasource-jta/src/main/java/org/hswebframework/web/datasource/jta/JtaDynamicDataSourceService.java

@@ -51,7 +51,9 @@ public class JtaDynamicDataSourceService extends AbstractDynamicDataSourceServic
     @Override
     protected int getHash(String id) {
         AtomikosDataSourceConfig config = jtaDataSourceRepository.getConfig(id);
-        if (null == config) return 0;
+        if (null == config) {
+            return 0;
+        }
         return config.hashCode();
     }
 
@@ -106,8 +108,9 @@ public class JtaDynamicDataSourceService extends AbstractDynamicDataSourceServic
                         // 初始化超时,认定为失败
                         logger.error("init timeout ({}ms)", config.getInitTimeout());
                         cache.closeDataSource();
-                        if (downLatch.getCount() > 0)
+                        if (downLatch.getCount() > 0) {
                             downLatch.countDown();
+                        }
                     }
                 }
             });

+ 3 - 0
hsweb-examples/hsweb-examples-cloud/hsweb-examples-cloud-gateway/src/main/resources/application.yml

@@ -6,6 +6,9 @@ eureka:
   client:
     fetch-registry: true
     register-with-eureka: true
+  server:
+    enable-self-preservation: false
+    eviction-interval-timer-in-ms: 1000
 zuul:
   prefix: /api
   routes:

+ 3 - 1
hsweb-examples/hsweb-examples-simple/src/main/java/org/hswebframework/web/example/simple/SpringBootExample.java

@@ -103,8 +103,9 @@ public class SpringBootExample
         };
         return loggerInfo -> {
             Map<String, Object> loggerMap = loggerInfo.toSimpleMap(obj -> {
-                if (Stream.of(excludes).anyMatch(aClass -> aClass.isInstance(obj)))
+                if (Stream.of(excludes).anyMatch(aClass -> aClass.isInstance(obj))) {
                     return obj.getClass().getName();
+                }
                 return JSON.toJSONString(obj);
             });
 //            loggerMap.put("userToken", UserTokenHolder.currentToken());
@@ -167,6 +168,7 @@ public class SpringBootExample
 
     // main
     //    @Override
+    @Override
     public void run(String... strings) throws Exception {
         //只能查询自己创建的数据
         DataAccessEntity accessEntity = new DataAccessEntity();

+ 1 - 0
hsweb-message/hsweb-message-api/src/main/java/org/hswebframework/web/message/support/MultipleUserMessageSubject.java

@@ -29,6 +29,7 @@ import java.util.stream.Collectors;
 public interface MultipleUserMessageSubject extends MultipleQueueMessageSubject {
     Set<String> getUserIdList();
 
+    @Override
     default Set<String> getQueueName() {
         return getUserIdList().stream()
                 .map(id -> "queue_for_user:" + id)

+ 1 - 0
hsweb-message/hsweb-message-api/src/main/java/org/hswebframework/web/message/support/UserMessageSubject.java

@@ -26,6 +26,7 @@ package org.hswebframework.web.message.support;
 public interface UserMessageSubject extends QueueMessageSubject {
     String getUserId();
 
+    @Override
     default String getQueueName() {
         return "queue_for_user:" + getUserId();
     }

+ 2 - 1
hsweb-message/hsweb-message-memory/src/main/java/org/hswebframework/web/message/memory/MemoryPublish.java

@@ -44,8 +44,9 @@ public class MemoryPublish implements MessagePublish {
         queueConsumer.lock.readLock().lock();
         try {
             int size = queueConsumer.consumers.size();
-            if (size > 0)
+            if (size > 0) {
                 queueConsumer.consumers.get(random.nextInt(size)).accept(message);
+            }
         } finally {
             queueConsumer.lock.readLock().unlock();
         }

+ 2 - 1
hsweb-message/hsweb-message-redis/src/main/java/org/hswebframework/web/message/redis/RedissionMessageSubscribe.java

@@ -76,8 +76,9 @@ public class RedissionMessageSubscribe<M extends Message> implements MessageSubs
                         countDownLatch.await();
                         consumers.forEach(cons -> {
                             M message = queue.poll();
-                            if (null != message)
+                            if (null != message) {
                                 cons.accept(message);
+                            }
                         });
                     } catch (InterruptedException e) {
                         running = false;

+ 14 - 6
hsweb-message/hsweb-message-websocket/src/main/java/org/hswebframework/web/socket/handler/CommandWebSocketMessageDispatcher.java

@@ -48,7 +48,9 @@ public class CommandWebSocketMessageDispatcher extends TextWebSocketHandler {
     @Override
     protected void handleTextMessage(WebSocketSession session, TextMessage message) throws Exception {
         String payload = message.getPayload();
-        if (StringUtils.isEmpty(payload)) return;
+        if (StringUtils.isEmpty(payload)) {
+            return;
+        }
         try {
             WebSocketCommandRequest request = JSON.parseObject(payload, WebSocketCommandRequest.class);
             CommandRequest command = buildCommand(request, session);
@@ -67,7 +69,9 @@ public class CommandWebSocketMessageDispatcher extends TextWebSocketHandler {
     }
 
     private Authentication getAuthenticationFromSession(WebSocketSession socketSession) {
-        if (null == userTokenManager) return null;
+        if (null == userTokenManager) {
+            return null;
+        }
         return WebSocketUtils.getAuthentication(userTokenManager, socketSession);
     }
 
@@ -92,13 +96,17 @@ public class CommandWebSocketMessageDispatcher extends TextWebSocketHandler {
 
     @Override
     public void afterConnectionEstablished(WebSocketSession session) throws Exception {
-        if (webSocketSessionListeners != null) webSocketSessionListeners.forEach(webSocketSessionListener ->
-                webSocketSessionListener.onSessionConnect(session));
+        if (webSocketSessionListeners != null) {
+            webSocketSessionListeners.forEach(webSocketSessionListener ->
+                    webSocketSessionListener.onSessionConnect(session));
+        }
     }
 
     @Override
     public void afterConnectionClosed(WebSocketSession session, CloseStatus status) throws Exception {
-        if (webSocketSessionListeners != null) webSocketSessionListeners.forEach(webSocketSessionListener ->
-                webSocketSessionListener.onSessionClose(session));
+        if (webSocketSessionListeners != null) {
+            webSocketSessionListeners.forEach(webSocketSessionListener ->
+                    webSocketSessionListener.onSessionClose(session));
+        }
     }
 }

+ 5 - 2
hsweb-message/hsweb-message-websocket/src/main/java/org/hswebframework/web/socket/handler/WebSocketUtils.java

@@ -20,7 +20,9 @@ public class WebSocketUtils {
                 .current()
                 .orElseGet(() -> ((Authentication) session.getAttributes().get(Authentication.class.getName())));
 
-        if (authentication != null) return authentication;
+        if (authentication != null) {
+            return authentication;
+        }
         HttpHeaders headers = session.getHandshakeHeaders();
         List<String> cookies = headers.get("Cookie");
         if (cookies == null || cookies.isEmpty()) {
@@ -30,9 +32,10 @@ public class WebSocketUtils {
         Map<String, Set<String>> sessionId = new HashMap<>();
         for (String aCookie : cookie) {
             String[] tmp = aCookie.split("[=]");
-            if (tmp.length == 2)
+            if (tmp.length == 2) {
                 sessionId.computeIfAbsent(tmp[0].trim(), k -> new HashSet<>())
                         .add(tmp[1].trim());
+            }
         }
 
         // TODO: 2017/7/12  修改权限获取方式

+ 3 - 1
hsweb-message/hsweb-message-websocket/src/main/java/org/hswebframework/web/socket/processor/DefaultCommandProcessorContainer.java

@@ -21,7 +21,9 @@ public class DefaultCommandProcessorContainer implements CommandProcessorContain
     @Override
     public CommandProcessor uninstall(String name) {
         CommandProcessor processor = processorStore.remove(name);
-        if (null != processor) processor.destroy();
+        if (null != processor) {
+            processor.destroy();
+        }
         return processor;
     }
 

+ 3 - 1
hsweb-starter/hsweb-spring-boot-starter/src/main/java/org/hswebframework/web/starter/SystemInitializeAutoConfiguration.java

@@ -110,7 +110,9 @@ public class SystemInitializeAutoConfiguration implements CommandLineRunner, Bea
             connection = DataSourceHolder.currentDataSource().getNative().getConnection();
             jdbcUserName = connection.getMetaData().getUserName();
         } finally {
-            if (null != connection) connection.close();
+            if (null != connection) {
+                connection.close();
+            }
         }
         RDBDatabaseMetaData metaData;
         switch (type) {

+ 21 - 7
hsweb-starter/hsweb-spring-boot-starter/src/main/java/org/hswebframework/web/starter/SystemVersion.java

@@ -67,7 +67,9 @@ public class SystemVersion extends Version {
     }
 
     public Dependency getDependency(String groupId, String artifactId) {
-        if (depCache == null) initDepCache();
+        if (depCache == null) {
+            initDepCache();
+        }
         return depCache.get(getDepKey(groupId, artifactId));
     }
 
@@ -230,7 +232,9 @@ class Version implements Comparable<Version> {
     }
 
     public String getWebsite() {
-        if (website == null) website = "";
+        if (website == null) {
+            website = "";
+        }
         return website;
     }
 
@@ -272,13 +276,23 @@ class Version implements Comparable<Version> {
 
     @Override
     public int compareTo(Version o) {
-        if (null == o) return -1;
-        if (o.getMajorVersion() > this.getMajorVersion()) return -1;
+        if (null == o) {
+            return -1;
+        }
+        if (o.getMajorVersion() > this.getMajorVersion()) {
+            return -1;
+        }
         if (o.getMajorVersion() == this.getMajorVersion()) {
-            if (o.getMinorVersion() > this.getMinorVersion()) return -1;
+            if (o.getMinorVersion() > this.getMinorVersion()) {
+                return -1;
+            }
             if (o.getMinorVersion() == this.getMinorVersion()) {
-                if (o.getRevisionVersion() > this.getRevisionVersion()) return -1;
-                if (o.getRevisionVersion() == this.getRevisionVersion()) return 0;
+                if (o.getRevisionVersion() > this.getRevisionVersion()) {
+                    return -1;
+                }
+                if (o.getRevisionVersion() == this.getRevisionVersion()) {
+                    return 0;
+                }
                 return 1;
             } else {
                 return 1;

+ 10 - 4
hsweb-starter/hsweb-spring-boot-starter/src/main/java/org/hswebframework/web/starter/convert/FastJsonGenericHttpMessageConverter.java

@@ -96,7 +96,9 @@ public class FastJsonGenericHttpMessageConverter extends AbstractGenericHttpMess
 
 
     public Object readByBytes(Type type, byte[] bytes) {
-        if (type == String.class) return new String(bytes, charset);
+        if (type == String.class) {
+            return new String(bytes, charset);
+        }
         if (type instanceof Class) {
             Class clazz = ((Class) type);
             if (null != converters) {
@@ -131,7 +133,9 @@ public class FastJsonGenericHttpMessageConverter extends AbstractGenericHttpMess
     }
 
     public String converter(Object obj) {
-        if (obj instanceof String) return (String) obj;
+        if (obj instanceof String) {
+            return (String) obj;
+        }
         String text;
         String callback = ThreadLocalUtils.getAndRemove("jsonp-callback");
         if (obj instanceof ResponseMessage) {
@@ -159,18 +163,20 @@ public class FastJsonGenericHttpMessageConverter extends AbstractGenericHttpMess
 
     protected static SerializeFilter[] parseFilter(ResponseMessage<?> responseMessage) {
         List<SerializeFilter> filters = new ArrayList<>();
-        if (responseMessage.getIncludes() != null)
+        if (responseMessage.getIncludes() != null) {
             for (Map.Entry<Class<?>, Set<String>> classSetEntry : responseMessage.getIncludes().entrySet()) {
                 SimplePropertyPreFilter filter = new SimplePropertyPreFilter(classSetEntry.getKey());
                 filter.getIncludes().addAll(classSetEntry.getValue());
                 filters.add(filter);
             }
-        if (responseMessage.getExcludes() != null)
+        }
+        if (responseMessage.getExcludes() != null) {
             for (Map.Entry<Class<?>, Set<String>> classSetEntry : responseMessage.getExcludes().entrySet()) {
                 SimplePropertyPreFilter filter = new SimplePropertyPreFilter(classSetEntry.getKey());
                 filter.getExcludes().addAll(classSetEntry.getValue());
                 filters.add(filter);
             }
+        }
         PropertyFilter responseMessageFilter = (object, name, value) ->
                 !(object instanceof ResponseMessage) || value != null;
         filters.add(responseMessageFilter);

+ 7 - 3
hsweb-starter/hsweb-spring-boot-starter/src/main/java/org/hswebframework/web/starter/convert/FastJsonHttpMessageConverter.java

@@ -112,7 +112,9 @@ public class FastJsonHttpMessageConverter extends AbstractHttpMessageConverter<O
     }
 
     public String converter(Object obj) {
-        if (obj instanceof String) return (String) obj;
+        if (obj instanceof String) {
+            return (String) obj;
+        }
         String text;
         String callback = ThreadLocalUtils.getAndRemove("jsonp-callback");
         if (obj instanceof ResponseMessage) {
@@ -141,18 +143,20 @@ public class FastJsonHttpMessageConverter extends AbstractHttpMessageConverter<O
 
     protected static SerializeFilter[] parseFilter(ResponseMessage<?> responseMessage) {
         List<SerializeFilter> filters = new ArrayList<>();
-        if (responseMessage.getIncludes() != null)
+        if (responseMessage.getIncludes() != null) {
             for (Map.Entry<Class<?>, Set<String>> classSetEntry : responseMessage.getIncludes().entrySet()) {
                 SimplePropertyPreFilter filter = new SimplePropertyPreFilter(classSetEntry.getKey());
                 filter.getIncludes().addAll(classSetEntry.getValue());
                 filters.add(filter);
             }
-        if (responseMessage.getExcludes() != null)
+        }
+        if (responseMessage.getExcludes() != null) {
             for (Map.Entry<Class<?>, Set<String>> classSetEntry : responseMessage.getExcludes().entrySet()) {
                 SimplePropertyPreFilter filter = new SimplePropertyPreFilter(classSetEntry.getKey());
                 filter.getExcludes().addAll(classSetEntry.getValue());
                 filters.add(filter);
             }
+        }
         PropertyFilter responseMessageFilter = (object, name, value) ->
                 !(object instanceof ResponseMessage) || value != null;
         filters.add(responseMessageFilter);

+ 8 - 3
hsweb-starter/hsweb-spring-boot-starter/src/main/java/org/hswebframework/web/starter/entity/EntityProperties.java

@@ -54,7 +54,9 @@ public class EntityProperties {
     }
 
     public Map<Class<Entity>, MapperEntityFactory.Mapper> createMappers() {
-        if (mappings == null || mappings.isEmpty()) return Collections.emptyMap();
+        if (mappings == null || mappings.isEmpty()) {
+            return Collections.emptyMap();
+        }
         return mappings.stream()
                 .map(Mapping::create)
                 .reduce(MapUtils::merge)
@@ -67,7 +69,9 @@ public class EntityProperties {
         Map<String, String> mapping;
 
         Map<Class<Entity>, MapperEntityFactory.Mapper> create() {
-            if (mapping == null || mapping.isEmpty()) return Collections.emptyMap();
+            if (mapping == null || mapping.isEmpty()) {
+                return Collections.emptyMap();
+            }
             return mapping.entrySet().stream()
                     .collect(Collectors.toMap(
                             entry -> getSourceClass(entry.getKey()),
@@ -75,8 +79,9 @@ public class EntityProperties {
         }
 
         protected Class<Entity> getClass(String basePackage, String name) {
-            if (!StringUtils.isNullOrEmpty(basePackage))
+            if (!StringUtils.isNullOrEmpty(basePackage)) {
                 name = basePackage.concat(".").concat(name);
+            }
             return classForName(name);
         }
 

+ 6 - 2
hsweb-starter/hsweb-spring-boot-starter/src/main/java/org/hswebframework/web/starter/init/SystemInitialize.java

@@ -106,12 +106,16 @@ public class SystemInitialize {
     }
 
     private SystemVersion.Dependency getInstalledDependency(String groupId, String artifactId) {
-        if (installed == null) return null;
+        if (installed == null) {
+            return null;
+        }
         return installed.getDependency(groupId, artifactId);
     }
 
     private SimpleDependencyInstaller getReadyToInstallDependency(String groupId, String artifactId) {
-        if (readyToInstall == null) return null;
+        if (readyToInstall == null) {
+            return null;
+        }
         return readyToInstall.stream()
                 .filter(installer -> installer.getDependency().isSameDependency(groupId, artifactId))
                 .findFirst().orElse(null);

+ 6 - 2
hsweb-starter/hsweb-spring-boot-starter/src/main/java/org/hswebframework/web/starter/init/simple/SimpleDependencyInstaller.java

@@ -49,14 +49,18 @@ public class SimpleDependencyInstaller implements DependencyInstaller {
     }
 
     public void doUnInstall(Map<String, Object> context) {
-        if (unInstaller != null) installer.execute(context);
+        if (unInstaller != null) {
+            installer.execute(context);
+        }
     }
 
     public void doUpgrade(Map<String, Object> context, SystemVersion.Dependency installed) {
         SimpleDependencyUpgrader simpleDependencyUpgrader =
                 new SimpleDependencyUpgrader(installed, dependency, context);
         context.put("upgrader", simpleDependencyUpgrader);
-        if (unInstaller != null) upgrader.execute(context);
+        if (unInstaller != null) {
+            upgrader.execute(context);
+        }
     }
 
     @Override

+ 14 - 5
hsweb-starter/hsweb-spring-boot-starter/src/main/java/org/hswebframework/web/starter/init/simple/SimpleDependencyUpgrader.java

@@ -40,11 +40,17 @@ public class SimpleDependencyUpgrader implements DependencyUpgrader {
         shouldUpdateVersionList = versions.stream()
                 .filter(map -> {
                     String ver = (String) map.get("version");
-                    if (null == ver) return false;
+                    if (null == ver) {
+                        return false;
+                    }
                     //首次安装
-                    if (firstInstall) return true;
+                    if (firstInstall) {
+                        return true;
+                    }
                     //相同版本
-                    if (installed.compareTo(dependency) == 0) return false;
+                    if (installed.compareTo(dependency) == 0) {
+                        return false;
+                    }
 
                     return installed.compareTo(new SystemVersion(ver)) < 0;
                 })
@@ -56,9 +62,12 @@ public class SimpleDependencyUpgrader implements DependencyUpgrader {
     @Override
     public void upgrade(UpgradeCallBack callBack) {
         shouldUpdateVersionList.forEach(context -> {
-            if (this.context != null) context.putAll(context);
-            if (logger.isInfoEnabled())
+            if (this.context != null) {
+                context.putAll(context);
+            }
+            if (logger.isInfoEnabled()) {
                 logger.info("upgrade [{}/{}] to version:{} {}", dependency.getGroupId(), dependency.getArtifactId(), context.get("version"), dependency.getWebsite());
+            }
             callBack.execute(context);
         });
     }

+ 6 - 2
hsweb-system/hsweb-system-authorization/hsweb-system-authorization-controller/src/main/java/org/hswebframework/web/controller/authorization/UserController.java

@@ -81,7 +81,9 @@ public class UserController implements
     @Authorize(action = Permission.ACTION_QUERY)
     @AccessLogger("获取所有已登录用户的信息")
     public ResponseMessage<List<UserToken>> userTokens() {
-        if (userTokenManager == null) throw new UnsupportedOperationException("userTokenManager is null");
+        if (userTokenManager == null) {
+            throw new UnsupportedOperationException("userTokenManager is null");
+        }
 
         return ok(userTokenManager.allLoggedUser());
     }
@@ -90,7 +92,9 @@ public class UserController implements
     @Authorize(action = "change-state")
     @AccessLogger("修改token的状态")
     public ResponseMessage<List<UserToken>> makeOffline(@PathVariable String token, @PathVariable TokenState state) {
-        if (userTokenManager == null) throw new UnsupportedOperationException("userTokenManager is null");
+        if (userTokenManager == null) {
+            throw new UnsupportedOperationException("userTokenManager is null");
+        }
         userTokenManager.changeTokenState(token, state);
         return ok();
     }

+ 1 - 0
hsweb-system/hsweb-system-authorization/hsweb-system-authorization-entity/src/main/java/org/hswebframework/web/entity/authorization/MenuEntity.java

@@ -54,5 +54,6 @@ public interface MenuEntity
 
     void setChildren(List<MenuEntity> children);
 
+    @Override
     MenuEntity clone();
 }

+ 1 - 0
hsweb-system/hsweb-system-authorization/hsweb-system-authorization-entity/src/main/java/org/hswebframework/web/entity/authorization/PermissionEntity.java

@@ -30,6 +30,7 @@ import java.util.List;
  */
 public interface PermissionEntity extends GenericEntity<String> {
 
+    @Override
     @Pattern(regexp = "[a-zA-Z0-9_\\-]+")
     String getId();
 

+ 11 - 0
hsweb-system/hsweb-system-authorization/hsweb-system-authorization-entity/src/main/java/org/hswebframework/web/entity/authorization/SimpleAuthorizationSettingDetailEntity.java

@@ -45,6 +45,7 @@ public class SimpleAuthorizationSettingDetailEntity extends SimpleGenericEntity<
     /**
      * @return 权限id
      */
+    @Override
     public String getPermissionId() {
         return this.permissionId;
     }
@@ -52,6 +53,7 @@ public class SimpleAuthorizationSettingDetailEntity extends SimpleGenericEntity<
     /**
      * 设置 权限id
      */
+    @Override
     public void setPermissionId(String permissionId) {
         this.permissionId = permissionId;
     }
@@ -59,6 +61,7 @@ public class SimpleAuthorizationSettingDetailEntity extends SimpleGenericEntity<
     /**
      * @return 设置id
      */
+    @Override
     public String getSettingId() {
         return this.settingId;
     }
@@ -66,6 +69,7 @@ public class SimpleAuthorizationSettingDetailEntity extends SimpleGenericEntity<
     /**
      * 设置 设置id
      */
+    @Override
     public void setSettingId(String settingId) {
         this.settingId = settingId;
     }
@@ -73,6 +77,7 @@ public class SimpleAuthorizationSettingDetailEntity extends SimpleGenericEntity<
     /**
      * @return 可操作类型
      */
+    @Override
     public Set<String> getActions() {
         return this.actions;
     }
@@ -80,6 +85,7 @@ public class SimpleAuthorizationSettingDetailEntity extends SimpleGenericEntity<
     /**
      * 设置 可操作类型
      */
+    @Override
     public void setActions(Set<String> actions) {
         this.actions = actions;
     }
@@ -87,6 +93,7 @@ public class SimpleAuthorizationSettingDetailEntity extends SimpleGenericEntity<
     /**
      * @return 数据权限控制
      */
+    @Override
     public List<DataAccessEntity> getDataAccesses() {
         return this.dataAccesses;
     }
@@ -94,6 +101,7 @@ public class SimpleAuthorizationSettingDetailEntity extends SimpleGenericEntity<
     /**
      * 设置 数据权限控制
      */
+    @Override
     public void setDataAccesses(List<DataAccessEntity> dataAccesses) {
         this.dataAccesses = dataAccesses;
     }
@@ -101,6 +109,7 @@ public class SimpleAuthorizationSettingDetailEntity extends SimpleGenericEntity<
     /**
      * @return 状态
      */
+    @Override
     public Byte getStatus() {
         return this.status;
     }
@@ -108,6 +117,7 @@ public class SimpleAuthorizationSettingDetailEntity extends SimpleGenericEntity<
     /**
      * 设置 状态
      */
+    @Override
     public void setStatus(Byte status) {
         this.status = status;
     }
@@ -122,6 +132,7 @@ public class SimpleAuthorizationSettingDetailEntity extends SimpleGenericEntity<
         this.priority = priority;
     }
 
+    @Override
     public Boolean isMerge() {
         return merge;
     }

+ 8 - 0
hsweb-system/hsweb-system-authorization/hsweb-system-authorization-entity/src/main/java/org/hswebframework/web/entity/authorization/SimpleAuthorizationSettingEntity.java

@@ -62,6 +62,7 @@ public class SimpleAuthorizationSettingEntity extends SimpleGenericEntity<String
     /**
      * @return 类型
      */
+    @Override
     public String getType() {
         return this.type;
     }
@@ -69,6 +70,7 @@ public class SimpleAuthorizationSettingEntity extends SimpleGenericEntity<String
     /**
      * 设置 类型
      */
+    @Override
     public void setType(String type) {
         this.type = type;
     }
@@ -76,6 +78,7 @@ public class SimpleAuthorizationSettingEntity extends SimpleGenericEntity<String
     /**
      * @return 设置给谁
      */
+    @Override
     public String getSettingFor() {
         return this.settingFor;
     }
@@ -83,6 +86,7 @@ public class SimpleAuthorizationSettingEntity extends SimpleGenericEntity<String
     /**
      * 设置 设置给谁
      */
+    @Override
     public void setSettingFor(String settingFor) {
         this.settingFor = settingFor;
     }
@@ -90,6 +94,7 @@ public class SimpleAuthorizationSettingEntity extends SimpleGenericEntity<String
     /**
      * @return 状态
      */
+    @Override
     public Byte getStatus() {
         return this.status;
     }
@@ -97,6 +102,7 @@ public class SimpleAuthorizationSettingEntity extends SimpleGenericEntity<String
     /**
      * 设置 状态
      */
+    @Override
     public void setStatus(Byte status) {
         this.status = status;
     }
@@ -104,6 +110,7 @@ public class SimpleAuthorizationSettingEntity extends SimpleGenericEntity<String
     /**
      * @return 备注
      */
+    @Override
     public String getDescribe() {
         return this.describe;
     }
@@ -111,6 +118,7 @@ public class SimpleAuthorizationSettingEntity extends SimpleGenericEntity<String
     /**
      * 设置 备注
      */
+    @Override
     public void setDescribe(String describe) {
         this.describe = describe;
     }

+ 8 - 0
hsweb-system/hsweb-system-authorization/hsweb-system-authorization-entity/src/main/java/org/hswebframework/web/entity/authorization/SimpleAuthorizationSettingMenuEntity.java

@@ -40,6 +40,7 @@ public class SimpleAuthorizationSettingMenuEntity extends SimpleTreeSortSupportE
     /**
      * @return 菜单id
      */
+    @Override
     public String getMenuId() {
         return this.menuId;
     }
@@ -47,6 +48,7 @@ public class SimpleAuthorizationSettingMenuEntity extends SimpleTreeSortSupportE
     /**
      * 设置 菜单id
      */
+    @Override
     public void setMenuId(String menuId) {
         this.menuId = menuId;
     }
@@ -54,6 +56,7 @@ public class SimpleAuthorizationSettingMenuEntity extends SimpleTreeSortSupportE
     /**
      * @return 设置id
      */
+    @Override
     public String getSettingId() {
         return this.settingId;
     }
@@ -61,6 +64,7 @@ public class SimpleAuthorizationSettingMenuEntity extends SimpleTreeSortSupportE
     /**
      * 设置 设置id
      */
+    @Override
     public void setSettingId(String settingId) {
         this.settingId = settingId;
     }
@@ -69,6 +73,7 @@ public class SimpleAuthorizationSettingMenuEntity extends SimpleTreeSortSupportE
     /**
      * @return 状态
      */
+    @Override
     public Byte getStatus() {
         return this.status;
     }
@@ -76,6 +81,7 @@ public class SimpleAuthorizationSettingMenuEntity extends SimpleTreeSortSupportE
     /**
      * 设置 状态
      */
+    @Override
     public void setStatus(Byte status) {
         this.status = status;
     }
@@ -83,6 +89,7 @@ public class SimpleAuthorizationSettingMenuEntity extends SimpleTreeSortSupportE
     /**
      * @return 其他配置内容
      */
+    @Override
     public String getConfig() {
         return this.config;
     }
@@ -90,6 +97,7 @@ public class SimpleAuthorizationSettingMenuEntity extends SimpleTreeSortSupportE
     /**
      * 设置 其他配置内容
      */
+    @Override
     public void setConfig(String config) {
         this.config = config;
     }

+ 12 - 0
hsweb-system/hsweb-system-authorization/hsweb-system-authorization-entity/src/main/java/org/hswebframework/web/entity/authorization/SimpleMenuEntity.java

@@ -65,50 +65,62 @@ public class SimpleMenuEntity extends SimpleTreeSortSupportEntity<String>
         this.children = children;
     }
 
+    @Override
     public String getName() {
         return name;
     }
 
+    @Override
     public void setName(String name) {
         this.name = name;
     }
 
+    @Override
     public String getDescribe() {
         return describe;
     }
 
+    @Override
     public void setDescribe(String describe) {
         this.describe = describe;
     }
 
+    @Override
     public String getPermissionId() {
         return permissionId;
     }
 
+    @Override
     public void setPermissionId(String permissionId) {
         this.permissionId = permissionId;
     }
 
+    @Override
     public String getUrl() {
         return url;
     }
 
+    @Override
     public void setUrl(String url) {
         this.url = url;
     }
 
+    @Override
     public String getIcon() {
         return icon;
     }
 
+    @Override
     public void setIcon(String icon) {
         this.icon = icon;
     }
 
+    @Override
     public Byte getStatus() {
         return status;
     }
 
+    @Override
     public void setStatus(Byte status) {
         this.status = status;
     }

+ 7 - 0
hsweb-system/hsweb-system-authorization/hsweb-system-authorization-entity/src/main/java/org/hswebframework/web/entity/authorization/SimpleMenuGroupBindEntity.java

@@ -36,10 +36,12 @@ public class SimpleMenuGroupBindEntity extends SimpleTreeSortSupportEntity<Strin
     //子节点
     private List<MenuGroupBindEntity> children;
 
+    @Override
     public Byte getStatus() {
         return status;
     }
 
+    @Override
     public void setStatus(Byte status) {
         this.status = status;
     }
@@ -47,6 +49,7 @@ public class SimpleMenuGroupBindEntity extends SimpleTreeSortSupportEntity<Strin
     /**
      * @return 菜单id
      */
+    @Override
     public String getMenuId() {
         return this.menuId;
     }
@@ -54,6 +57,7 @@ public class SimpleMenuGroupBindEntity extends SimpleTreeSortSupportEntity<Strin
     /**
      * 设置 菜单id
      */
+    @Override
     public void setMenuId(String menuId) {
         this.menuId = menuId;
     }
@@ -61,6 +65,7 @@ public class SimpleMenuGroupBindEntity extends SimpleTreeSortSupportEntity<Strin
     /**
      * @return 分组id
      */
+    @Override
     public String getGroupId() {
         return this.groupId;
     }
@@ -68,11 +73,13 @@ public class SimpleMenuGroupBindEntity extends SimpleTreeSortSupportEntity<Strin
     /**
      * 设置 分组id
      */
+    @Override
     public void setGroupId(String groupId) {
         this.groupId = groupId;
     }
 
 
+    @Override
     public List<MenuGroupBindEntity> getChildren() {
         return children;
     }

+ 10 - 1
hsweb-system/hsweb-system-authorization/hsweb-system-authorization-entity/src/main/java/org/hswebframework/web/entity/authorization/SimpleMenuGroupEntity.java

@@ -44,6 +44,7 @@ public class SimpleMenuGroupEntity extends SimpleTreeSortSupportEntity<String> i
     /**
      * @return 分组名称
      */
+    @Override
     public String getName() {
         return this.name;
     }
@@ -51,6 +52,7 @@ public class SimpleMenuGroupEntity extends SimpleTreeSortSupportEntity<String> i
     /**
      * 设置 分组名称
      */
+    @Override
     public void setName(String name) {
         this.name = name;
     }
@@ -58,6 +60,7 @@ public class SimpleMenuGroupEntity extends SimpleTreeSortSupportEntity<String> i
     /**
      * @return 分组描述
      */
+    @Override
     public String getDescribe() {
         return this.describe;
     }
@@ -65,6 +68,7 @@ public class SimpleMenuGroupEntity extends SimpleTreeSortSupportEntity<String> i
     /**
      * 设置 分组描述
      */
+    @Override
     public void setDescribe(String describe) {
         this.describe = describe;
     }
@@ -72,6 +76,7 @@ public class SimpleMenuGroupEntity extends SimpleTreeSortSupportEntity<String> i
     /**
      * @return 是否默认
      */
+    @Override
     public Boolean isDefaultGroup() {
         return this.defaultGroup;
     }
@@ -79,6 +84,7 @@ public class SimpleMenuGroupEntity extends SimpleTreeSortSupportEntity<String> i
     /**
      * 设置 是否默认
      */
+    @Override
     public void setDefaultGroup(Boolean defaultGroup) {
         this.defaultGroup = defaultGroup;
     }
@@ -94,8 +100,9 @@ public class SimpleMenuGroupEntity extends SimpleTreeSortSupportEntity<String> i
 
     @Override
     public List<MenuGroupBindEntity> getBindInfo() {
-        if (bindInfo == null)
+        if (bindInfo == null) {
             return Collections.emptyList();
+        }
         return new LinkedList<>(bindInfo);
     }
 
@@ -104,10 +111,12 @@ public class SimpleMenuGroupEntity extends SimpleTreeSortSupportEntity<String> i
         this.bindInfo = new LinkedList(bindInfo);
     }
 
+    @Override
     public Byte getStatus() {
         return status;
     }
 
+    @Override
     public void setStatus(Byte status) {
         this.status = status;
     }

+ 10 - 1
hsweb-system/hsweb-system-authorization/hsweb-system-authorization-entity/src/main/java/org/hswebframework/web/entity/authorization/SimplePermissionEntity.java

@@ -30,26 +30,32 @@ public class SimplePermissionEntity extends SimpleGenericEntity<String> implemen
 
     private List<OptionalField> optionalFields;
 
+    @Override
     public String getName() {
         return this.name;
     }
 
+    @Override
     public void setName(String name) {
         this.name = name;
     }
 
+    @Override
     public String getDescribe() {
         return describe;
     }
 
+    @Override
     public void setDescribe(String describe) {
         this.describe = describe;
     }
 
+    @Override
     public Byte getStatus() {
         return status;
     }
 
+    @Override
     public void setStatus(Byte status) {
         this.status = status;
     }
@@ -77,8 +83,9 @@ public class SimplePermissionEntity extends SimpleGenericEntity<String> implemen
     @Override
     public SimplePermissionEntity clone() {
         SimplePermissionEntity target = (SimplePermissionEntity) super.clone();
-        if (actions != null)
+        if (actions != null) {
             target.setActions(getActions().stream().map(ActionEntity::clone).collect(Collectors.toList()));
+        }
         if (optionalFields != null) {
             target.setOptionalFields(getOptionalFields().stream().map(OptionalField::clone).collect(Collectors.toList()));
         }
@@ -98,10 +105,12 @@ public class SimplePermissionEntity extends SimpleGenericEntity<String> implemen
         this.type = type;
     }
 
+    @Override
     public List<String> getSupportDataAccessTypes() {
         return supportDataAccessTypes;
     }
 
+    @Override
     public void setSupportDataAccessTypes(List<String> supportDataAccessTypes) {
         this.supportDataAccessTypes = supportDataAccessTypes;
     }

+ 6 - 0
hsweb-system/hsweb-system-authorization/hsweb-system-authorization-entity/src/main/java/org/hswebframework/web/entity/authorization/SimpleRoleEntity.java

@@ -14,26 +14,32 @@ public class SimpleRoleEntity extends SimpleGenericEntity<String> implements Rol
 
     private Byte status;
 
+    @Override
     public String getName() {
         return name;
     }
 
+    @Override
     public void setName(String name) {
         this.name = name;
     }
 
+    @Override
     public String getDescribe() {
         return describe;
     }
 
+    @Override
     public void setDescribe(String describe) {
         this.describe = describe;
     }
 
+    @Override
     public Byte getStatus() {
         return status;
     }
 
+    @Override
     public void setStatus(Byte status) {
         this.status = status;
     }

+ 6 - 0
hsweb-system/hsweb-system-authorization/hsweb-system-authorization-entity/src/main/java/org/hswebframework/web/entity/authorization/SimpleUserEntity.java

@@ -27,6 +27,7 @@ public class SimpleUserEntity extends SimpleGenericEntity<String> implements Use
         return name;
     }
 
+    @Override
     public void setName(String name) {
         this.name = name;
     }
@@ -36,6 +37,7 @@ public class SimpleUserEntity extends SimpleGenericEntity<String> implements Use
         return username;
     }
 
+    @Override
     public void setUsername(String username) {
         this.username = username;
     }
@@ -45,6 +47,7 @@ public class SimpleUserEntity extends SimpleGenericEntity<String> implements Use
         return password;
     }
 
+    @Override
     public void setPassword(String password) {
         this.password = password;
     }
@@ -54,6 +57,7 @@ public class SimpleUserEntity extends SimpleGenericEntity<String> implements Use
         return salt;
     }
 
+    @Override
     public void setSalt(String salt) {
         this.salt = salt;
     }
@@ -78,10 +82,12 @@ public class SimpleUserEntity extends SimpleGenericEntity<String> implements Use
         this.creatorId = creatorId;
     }
 
+    @Override
     public Byte getStatus() {
         return status;
     }
 
+    @Override
     public void setStatus(Byte status) {
         this.status = status;
     }

+ 5 - 2
hsweb-system/hsweb-system-authorization/hsweb-system-authorization-entity/src/main/java/org/hswebframework/web/entity/authorization/bind/SimpleBindRoleUserEntity.java

@@ -20,6 +20,7 @@ public class SimpleBindRoleUserEntity extends SimpleUserEntity implements BindRo
         return roles;
     }
 
+    @Override
     public void setRoles(List<String> roles) {
         this.roles = roles;
     }
@@ -27,10 +28,12 @@ public class SimpleBindRoleUserEntity extends SimpleUserEntity implements BindRo
     @Override
     public SimpleBindRoleUserEntity clone() {
         SimpleBindRoleUserEntity target = ((SimpleBindRoleUserEntity) super.clone());
-        if (roles != null)
+        if (roles != null) {
             target.setRoles(new ArrayList<>(getRoles()));
-        if (getProperties() != null)
+        }
+        if (getProperties() != null) {
             target.setProperties(new HashMap<>(getProperties()));
+        }
         return target;
     }
 }

+ 3 - 1
hsweb-system/hsweb-system-authorization/hsweb-system-authorization-model/src/main/java/org/hswebframework/web/model/authorization/FieldAccessModel.java

@@ -58,7 +58,9 @@ public class FieldAccessModel implements Model {
 //            example = "[{\"action\":\"query\"}]",
             required = true, dataType = "ActionModel")
     public List<ActionModel> getActions() {
-        if (actions == null) actions = Collections.emptyList();
+        if (actions == null) {
+            actions = Collections.emptyList();
+        }
         return actions;
     }
 

+ 6 - 2
hsweb-system/hsweb-system-authorization/hsweb-system-authorization-model/src/main/java/org/hswebframework/web/model/authorization/SimplePermissionRoleModel.java

@@ -47,7 +47,9 @@ public class SimplePermissionRoleModel implements PermissionRoleModel {
 
     @Override
     public List<String> getActions() {
-        if (this.actions == null) return Collections.emptyList();
+        if (this.actions == null) {
+            return Collections.emptyList();
+        }
         return actions;
     }
 
@@ -58,7 +60,9 @@ public class SimplePermissionRoleModel implements PermissionRoleModel {
 
     @Override
     public List<DataAccessModel> getDataAccesses() {
-        if (this.dataAccesses == null) return Collections.emptyList();
+        if (this.dataAccesses == null) {
+            return Collections.emptyList();
+        }
         return this.dataAccesses;
     }
 

+ 3 - 0
hsweb-system/hsweb-system-authorization/hsweb-system-authorization-model/src/main/java/org/hswebframework/web/model/authorization/SimpleUserModel.java

@@ -40,6 +40,7 @@ public class SimpleUserModel implements UserModel {
         return name;
     }
 
+    @Override
     public void setName(String name) {
         this.name = name;
     }
@@ -49,6 +50,7 @@ public class SimpleUserModel implements UserModel {
         return username;
     }
 
+    @Override
     public void setUsername(String username) {
         this.username = username;
     }
@@ -58,6 +60,7 @@ public class SimpleUserModel implements UserModel {
         return password;
     }
 
+    @Override
     public void setPassword(String password) {
         this.password = password;
     }

+ 17 - 6
hsweb-system/hsweb-system-authorization/hsweb-system-authorization-service/hsweb-system-authorization-service-simple/src/main/java/org/hswebframework/web/service/authorization/simple/SimpleAuthorizationSettingService.java

@@ -183,8 +183,9 @@ public class SimpleAuthorizationSettingService extends GenericEntityService<Auth
                         .collect(Collectors.groupingBy(SettingInfo::getType));
         Stream<Map.Entry<String, List<SettingInfo>>> settingInfoStream = settingInfo.entrySet().stream();
         //大于1 使用并行处理
-        if (settingInfo.size() > 1)
+        if (settingInfo.size() > 1) {
             settingInfoStream.parallel();
+        }
         return settingInfoStream
                 .map(entry ->
                         createQuery()
@@ -200,9 +201,13 @@ public class SimpleAuthorizationSettingService extends GenericEntityService<Auth
     @Override
     @Cacheable(key = "'user-menu-list:'+#userId")
     public List<UserMenuEntity> getUserMenuAsList(String userId) {
-        if (null == userId) return null;
+        if (null == userId) {
+            return null;
+        }
         UserEntity userEntity = userService.selectByPk(userId);
-        if (userEntity == null) return null;
+        if (userEntity == null) {
+            return null;
+        }
         List<AuthorizationSettingEntity> entities = getUserSetting(userId);
         //用户持有的权限设置id集合
         List<String> settingIdList = entities.stream()
@@ -216,7 +221,9 @@ public class SimpleAuthorizationSettingService extends GenericEntityService<Auth
                 .map(AuthorizationSettingMenuEntity::getMenuId)
                 .distinct()
                 .collect(Collectors.toList());
-        if (menuIdList.isEmpty()) return new ArrayList<>();
+        if (menuIdList.isEmpty()) {
+            return new ArrayList<>();
+        }
         //获取全部菜单,并创建缓存备用
         Map<String, MenuEntity> menuCache = menuService
                 .selectByPk(menuIdList)
@@ -262,9 +269,13 @@ public class SimpleAuthorizationSettingService extends GenericEntityService<Auth
 
     @Override
     public Authentication initUserAuthorization(String userId) {
-        if (null == userId) return null;
+        if (null == userId) {
+            return null;
+        }
         UserEntity userEntity = userService.selectByPk(userId);
-        if (userEntity == null) return null;
+        if (userEntity == null) {
+            return null;
+        }
         SimpleAuthentication authentication = new SimpleAuthentication();
         // 用户信息
         authentication.setUser(new SimpleUser(userId, userEntity.getUsername(), userEntity.getName()));

+ 5 - 1
hsweb-system/hsweb-system-authorization/hsweb-system-authorization-service/hsweb-system-authorization-service-simple/src/main/java/org/hswebframework/web/service/authorization/simple/SimpleMenuGroupService.java

@@ -69,16 +69,20 @@ public class SimpleMenuGroupService
         return menuGroupDao;
     }
 
+    @Override
     @Cacheable(key = "'group-id-list:'+#groupId==null?0:#groupId.hashCode()")
     public List<MenuEntity> getMenuByGroupId(List<String> groupId) {
         List<MenuGroupBindEntity> bindEntities = menuGroupBindService.selectByPk(groupId);
-        if (bindEntities == null || bindEntities.isEmpty()) return new LinkedList<>();
+        if (bindEntities == null || bindEntities.isEmpty()) {
+            return new LinkedList<>();
+        }
         return menuService.selectByPk(bindEntities.stream()
                 .map(MenuGroupBindEntity::getMenuId)
                 .distinct()
                 .collect(Collectors.toList()));
     }
 
+    @Override
     @CacheEvict(allEntries = true)
     public String insert(MenuGroupEntity entity) {
         entity.setStatus((byte) 1);

+ 2 - 1
hsweb-system/hsweb-system-authorization/hsweb-system-authorization-service/hsweb-system-authorization-service-simple/src/main/java/org/hswebframework/web/service/authorization/simple/SimpleMenuService.java

@@ -85,8 +85,9 @@ public class SimpleMenuService
     @Override
     @CacheEvict(allEntries = true)
     public String insert(MenuEntity entity) {
-        if (entity.getStatus() == null)
+        if (entity.getStatus() == null) {
             entity.setStatus((byte) 1);
+        }
         return super.insert(entity);
     }
 

+ 15 - 5
hsweb-system/hsweb-system-authorization/hsweb-system-authorization-service/hsweb-system-authorization-service-simple/src/main/java/org/hswebframework/web/service/authorization/simple/SimpleUserService.java

@@ -75,14 +75,18 @@ public class SimpleUserService extends AbstractService<UserEntity, String>
     @Override
     @Transactional(readOnly = true)
     public UserEntity selectByUsername(String username) {
-        if (null == username) return null;
+        if (null == username) {
+            return null;
+        }
         return createQuery().where("username", username).single();
     }
 
     @Override
     @Transactional(readOnly = true)
     public UserEntity selectByPk(String id) {
-        if (null == id) return null;
+        if (null == id) {
+            return null;
+        }
         UserEntity userEntity = createQuery().where(UserEntity.id, id).single();
         if (null != userEntity) {
             List<String> roleId = userRoleDao.selectByUserId(id).stream().map(UserRoleEntity::getRoleId).collect(Collectors.toList());
@@ -95,7 +99,9 @@ public class SimpleUserService extends AbstractService<UserEntity, String>
 
     @Override
     public List<UserEntity> selectByPk(List<String> id) {
-        if (CollectionUtils.isEmpty(id)) return new ArrayList<>();
+        if (CollectionUtils.isEmpty(id)) {
+            return new ArrayList<>();
+        }
         return createQuery().where().in(UserEntity.id, id).listNoPaging();
     }
 
@@ -213,7 +219,9 @@ public class SimpleUserService extends AbstractService<UserEntity, String>
     public List<RoleEntity> getUserRole(String userId) {
         Objects.requireNonNull(userId);
         List<UserRoleEntity> roleEntities = userRoleDao.selectByUserId(userId);
-        if (roleEntities.isEmpty()) return new ArrayList<>();
+        if (roleEntities.isEmpty()) {
+            return new ArrayList<>();
+        }
         List<String> roleIdList = roleEntities.stream().map(UserRoleEntity::getRoleId).collect(Collectors.toList());
         return DefaultDSLQueryService
                 .createQuery(roleDao).where()
@@ -230,7 +238,9 @@ public class SimpleUserService extends AbstractService<UserEntity, String>
     @Override
     public Set<SettingInfo> get(String userId) {
         UserEntity userEntity = selectByPk(userId);
-        if (null == userEntity) return new HashSet<>();
+        if (null == userEntity) {
+            return new HashSet<>();
+        }
         List<UserRoleEntity> roleEntities = userRoleDao.selectByUserId(userId);
         //使用角色配置
         Set<SettingInfo> settingInfo = roleEntities.stream()

+ 13 - 5
hsweb-system/hsweb-system-config/hsweb-system-config-entity/src/main/java/org/hswebframework/web/entity/config/ConfigContent.java

@@ -46,24 +46,32 @@ public class ConfigContent implements CloneableEntity {
 
     public Number getNumber(Number defaultValue) {
         Object val = getValue();
-        if (null == val) return defaultValue;
-        if (val instanceof Number) return ((Number) val);
-        if (val instanceof String)
+        if (null == val) {
+            return defaultValue;
+        }
+        if (val instanceof Number) {
+            return ((Number) val);
+        }
+        if (val instanceof String) {
             return new BigDecimal(((String) val));
+        }
         return defaultValue;
     }
 
     public Object getValue(Object defaultValue) {
         Object val = getValue();
-        if (val == null) return defaultValue;
+        if (val == null) {
+            return defaultValue;
+        }
         return val;
     }
 
     @Override
     public ConfigContent clone() {
         Object val = value;
-        if (val instanceof CloneableEntity)
+        if (val instanceof CloneableEntity) {
             val = ((CloneableEntity) val).clone();
+        }
         return new ConfigContent(key, val, comment);
     }
 }

+ 5 - 1
hsweb-system/hsweb-system-config/hsweb-system-config-entity/src/main/java/org/hswebframework/web/entity/config/SimpleConfigEntity.java

@@ -80,7 +80,9 @@ public class SimpleConfigEntity extends SimpleGenericEntity<String> implements C
 
     @Override
     public ConfigEntity addContent(String key, Object value, String comment) {
-        if (content == null) content = new ArrayList<>();
+        if (content == null) {
+            content = new ArrayList<>();
+        }
         content.add(new ConfigContent(key, value, comment));
         return this;
     }
@@ -111,6 +113,7 @@ public class SimpleConfigEntity extends SimpleGenericEntity<String> implements C
         return createTime;
     }
 
+    @Override
     public void setCreateTime(Long createTime) {
         this.createTime = createTime;
     }
@@ -120,6 +123,7 @@ public class SimpleConfigEntity extends SimpleGenericEntity<String> implements C
         return updateTime;
     }
 
+    @Override
     public void setUpdateTime(Long updateTime) {
         this.updateTime = updateTime;
     }

+ 2 - 1
hsweb-system/hsweb-system-database-manager/hsweb-system-database-manager-simple/src/main/java/org/hswebframework/web/datasource/manager/simple/DefaultLocalTransactionExecutor.java

@@ -225,8 +225,9 @@ public class DefaultLocalTransactionExecutor implements TransactionExecutor {
         executionQueue.add(execution);
         try {
             //当前没有在执行sql,说明现在正在等待新的sql进入,唤醒之
-            if (!running)
+            if (!running) {
                 waitToReady.await();
+            }
             //等待sql执行完毕
             countDownLatch.await();
             //判断是否有异常

+ 0 - 0
hsweb-system/hsweb-system-database-manager/hsweb-system-database-manager-simple/src/main/java/org/hswebframework/web/datasource/manager/simple/SimpleDatabaseManagerService.java


Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác