浏览代码

重构enable字段,使用status替代

zhouhao 8 年之前
父节点
当前提交
528cc6114a
共有 51 个文件被更改,包括 175 次插入817 次删除
  1. 0 7
      hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/AuthenticationInitializeService.java
  2. 5 1
      hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/client/OAuth2Client.java
  3. 2 1
      hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/support/AbstractAuthorizationService.java
  4. 12 0
      hsweb-commons/hsweb-commons-entity/src/main/java/org/hswebframework/web/commons/entity/DataStatus.java
  5. 2 2
      hsweb-commons/hsweb-commons-service/hsweb-commons-service-simple/src/main/java/org/hswebframework/web/service/AbstractService.java
  6. 1 1
      hsweb-datasource/hsweb-datasource-jta/README.md
  7. 1 1
      hsweb-datasource/hsweb-datasource-jta/src/test/resources/application.yml
  8. 2 1
      hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-client/src/main/java/org/hswebframework/web/example/oauth2/OAuth2ClientApplication.java
  9. 2 1
      hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-server/src/main/java/org/hswebframework/web/example/oauth2/OAuth2ServerApplication.java
  10. 3 9
      hsweb-examples/hsweb-examples-simple/pom.xml
  11. 31 10
      hsweb-examples/hsweb-examples-simple/src/main/java/org/hswebframework/web/example/simple/SpringBootExample.java
  12. 1 0
      hsweb-examples/hsweb-examples-simple/src/main/java/org/hswebframework/web/example/simple/TestController.java
  13. 1 1
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-dao/hsweb-system-dictionary-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/dictionary/DictionaryItemMapper.xml
  14. 8 8
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-dao/hsweb-system-dictionary-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/dictionary/DictionaryMapper.xml
  15. 6 6
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-entity/src/main/java/org/hswebframework/web/entity/dictionary/DictionaryEntity.java
  16. 5 5
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-entity/src/main/java/org/hswebframework/web/entity/dictionary/DictionaryItemEntity.java
  17. 8 8
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-entity/src/main/java/org/hswebframework/web/entity/dictionary/SimpleDictionaryEntity.java
  18. 5 5
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-entity/src/main/java/org/hswebframework/web/entity/dictionary/SimpleDictionaryItemEntity.java
  19. 2 2
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-starter/src/main/resources/hsweb-starter.js
  20. 3 1
      hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-starter/src/test/java/org/hswebframework/web/starter/dictionary/DictionaryTests.java
  21. 0 49
      hsweb-system/hsweb-system-menu/hsweb-system-menu-controller/pom.xml
  22. 0 45
      hsweb-system/hsweb-system-menu/hsweb-system-menu-dao/hsweb-system-menu-dao-api/pom.xml
  23. 0 44
      hsweb-system/hsweb-system-menu/hsweb-system-menu-dao/hsweb-system-menu-dao-mybatis/pom.xml
  24. 0 36
      hsweb-system/hsweb-system-menu/hsweb-system-menu-dao/pom.xml
  25. 0 45
      hsweb-system/hsweb-system-menu/hsweb-system-menu-entity/pom.xml
  26. 0 47
      hsweb-system/hsweb-system-menu/hsweb-system-menu-service/hsweb-system-menu-service-api/pom.xml
  27. 0 52
      hsweb-system/hsweb-system-menu/hsweb-system-menu-service/hsweb-system-menu-service-simple/pom.xml
  28. 0 34
      hsweb-system/hsweb-system-menu/hsweb-system-menu-service/pom.xml
  29. 0 91
      hsweb-system/hsweb-system-menu/hsweb-system-menu-starter/pom.xml
  30. 0 90
      hsweb-system/hsweb-system-menu/hsweb-system-menu-starter/src/main/resources/hsweb-starter.js
  31. 0 70
      hsweb-system/hsweb-system-menu/hsweb-system-menu-starter/src/test/java/org/hswebframework/web/starter/menu/MenuTests.java
  32. 0 13
      hsweb-system/hsweb-system-menu/hsweb-system-menu-starter/src/test/resources/application.yml
  33. 0 40
      hsweb-system/hsweb-system-menu/pom.xml
  34. 1 1
      hsweb-system/hsweb-system-oauth2-client/hsweb-system-oauth2-client-dao/hsweb-system-oauth2-client-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/oauth2/client/OAuth2ServerConfigMapper.xml
  35. 4 4
      hsweb-system/hsweb-system-oauth2-client/hsweb-system-oauth2-client-entity/src/main/java/org/hswebframework/web/entity/oauth2/client/OAuth2ServerConfigEntity.java
  36. 13 13
      hsweb-system/hsweb-system-oauth2-client/hsweb-system-oauth2-client-entity/src/main/java/org/hswebframework/web/entity/oauth2/client/SimpleOAuth2ServerConfigEntity.java
  37. 2 1
      hsweb-system/hsweb-system-oauth2-client/hsweb-system-oauth2-client-service/hsweb-system-oauth2-client-service-simple/src/main/java/org/hswebframework/web/service/oauth2/client/simple/SimpleOAuth2RequestService.java
  38. 1 1
      hsweb-system/hsweb-system-oauth2-client/hsweb-system-oauth2-client-starter/src/main/resources/hsweb-starter.js
  39. 1 1
      hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-dao/hsweb-system-oauth2-server-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/oauth2/OAuth2ClientMapper.xml
  40. 1 1
      hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-entity/src/main/java/org/hswebframework/web/authorization/oauth2/server/entity/OAuth2ClientEntity.java
  41. 5 5
      hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-entity/src/main/java/org/hswebframework/web/authorization/oauth2/server/entity/SimpleOAuth2ClientEntity.java
  42. 1 1
      hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-starter/src/main/resources/hsweb-starter.js
  43. 1 1
      hsweb-system/hsweb-system-organizational/hsweb-system-organizational-dao/hsweb-system-organizational-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/organizational/DepartmentMapper.xml
  44. 1 1
      hsweb-system/hsweb-system-organizational/hsweb-system-organizational-dao/hsweb-system-organizational-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/organizational/OrganizationalMapper.xml
  45. 6 6
      hsweb-system/hsweb-system-organizational/hsweb-system-organizational-entity/src/main/java/org/hswebframework/web/entity/organizational/DepartmentEntity.java
  46. 4 10
      hsweb-system/hsweb-system-organizational/hsweb-system-organizational-entity/src/main/java/org/hswebframework/web/entity/organizational/OrganizationalEntity.java
  47. 13 18
      hsweb-system/hsweb-system-organizational/hsweb-system-organizational-entity/src/main/java/org/hswebframework/web/entity/organizational/SimpleDepartmentEntity.java
  48. 14 18
      hsweb-system/hsweb-system-organizational/hsweb-system-organizational-entity/src/main/java/org/hswebframework/web/entity/organizational/SimpleOrganizationalEntity.java
  49. 3 4
      hsweb-system/hsweb-system-organizational/hsweb-system-organizational-entity/src/main/java/org/hswebframework/web/entity/organizational/SimplePositionEntity.java
  50. 4 4
      hsweb-system/hsweb-system-organizational/hsweb-system-organizational-starter/src/main/resources/hsweb-starter.js
  51. 0 1
      hsweb-system/pom.xml

+ 0 - 7
hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/AuthenticationInitializeService.java

@@ -33,11 +33,4 @@ public interface AuthenticationInitializeService {
      */
     Authentication initUserAuthorization(String userId);
 
-    /**
-     * 将指定的用户初始化为超级管理员权限
-     *
-     * @param userId 用户ID
-     * @return 权限信息
-     */
-    Authentication initAdminAuthorization(String userId);
 }

+ 5 - 1
hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/src/main/java/org/hswebframework/web/authorization/oauth2/server/client/OAuth2Client.java

@@ -38,7 +38,11 @@ public interface OAuth2Client {
 
     Long getCreateTime();
 
-    Boolean isEnabled();
+    /**
+     * @return 状态
+     * @see org.hswebframework.web.commons.entity.DataStatus
+     */
+    Byte getStatus();
 
     /**
      * @return 客户端支持的认证类型

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

@@ -22,6 +22,7 @@ import org.hswebframework.web.authorization.oauth2.server.client.OAuth2Client;
 import org.hswebframework.web.authorization.oauth2.server.client.OAuth2ClientService;
 import org.hswebframework.web.authorization.oauth2.server.exception.GrantTokenException;
 import org.hswebframework.web.authorization.oauth2.server.token.AccessTokenService;
+import org.hswebframework.web.commons.entity.DataStatus;
 import org.hswebframework.web.oauth2.core.ErrorType;
 
 import static org.hswebframework.web.oauth2.core.ErrorType.*;
@@ -75,7 +76,7 @@ public abstract class AbstractAuthorizationService {
         if (client == null) {
             throw new GrantTokenException(CLIENT_NOT_EXIST);
         }
-        if (Boolean.TRUE != client.isEnabled()) {
+        if (DataStatus.STATUS_ENABLED != client.getStatus()) {
             throw new GrantTokenException(CLIENT_DISABLED);
         }
         return client;

+ 12 - 0
hsweb-commons/hsweb-commons-entity/src/main/java/org/hswebframework/web/commons/entity/DataStatus.java

@@ -0,0 +1,12 @@
+package org.hswebframework.web.commons.entity;
+
+/**
+ * TODO 完成注释
+ *
+ * @author zhouhao
+ */
+public interface DataStatus {
+    Byte STATUS_ENABLED  = 1;
+    Byte STATUS_DISABLED = 0;
+    Byte STATUS_LOCKED   = -1;
+}

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

@@ -95,13 +95,13 @@ public abstract class AbstractService<E extends Entity, PK> implements CreateEnt
         }
     }
 
-    protected void tryValidate(E bean) {
+    protected void tryValidate(Object data) {
         if (validator == null) {
             logger.warn("validator is null!");
             return;
         }
         SimpleValidateResults results = new SimpleValidateResults();
-        validator.validate(bean).forEach(violation -> results.addResult(violation.getPropertyPath().toString(), violation.getMessage()));
+        validator.validate(data).forEach(violation -> results.addResult(violation.getPropertyPath().toString(), violation.getMessage()));
         if (!results.isSuccess())
             throw new ValidationException(results);
     }

+ 1 - 1
hsweb-datasource/hsweb-datasource-jta/README.md

@@ -6,7 +6,7 @@
 ```yaml
 spring:
   jta:
-    enabled: true
+    status: true
     atomikos:
       datasource:
         xa-data-source-class-name: com.alibaba.druid.pool.xa.DruidXADataSource

+ 1 - 1
hsweb-datasource/hsweb-datasource-jta/src/test/resources/application.yml

@@ -1,7 +1,7 @@
 
 spring:
   jta:
-    enabled: true
+    status: true
     atomikos:
       datasource:
         xa-data-source-class-name: com.alibaba.druid.pool.xa.DruidXADataSource

+ 2 - 1
hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-client/src/main/java/org/hswebframework/web/example/oauth2/OAuth2ClientApplication.java

@@ -25,6 +25,7 @@ import org.hswebframework.web.authorization.AuthenticationManager;
 import org.hswebframework.web.authorization.oauth2.client.OAuth2RequestService;
 import org.hswebframework.web.authorization.oauth2.client.response.OAuth2Response;
 import org.hswebframework.web.authorization.shiro.oauth2sso.OAuth2SSOAuthorizingListener;
+import org.hswebframework.web.commons.entity.DataStatus;
 import org.hswebframework.web.commons.entity.factory.EntityFactory;
 import org.hswebframework.web.dao.datasource.DataSourceHolder;
 import org.hswebframework.web.dao.datasource.DatabaseType;
@@ -107,7 +108,7 @@ public class OAuth2ClientApplication implements CommandLineRunner {
         entity.setRedirectUri("http://localhost:8808/");
         //hsweb
         entity.setProvider("hsweb");
-        entity.setEnabled(true);
+        entity.setStatus(DataStatus.STATUS_ENABLED);
         //add
         serverConfigService.insert(entity);
 

+ 2 - 1
hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-server/src/main/java/org/hswebframework/web/example/oauth2/OAuth2ServerApplication.java

@@ -25,6 +25,7 @@ import org.hswebframework.web.authorization.Permission;
 import org.hswebframework.web.authorization.access.DataAccessConfig;
 import org.hswebframework.web.authorization.oauth2.server.entity.OAuth2ClientEntity;
 import org.hswebframework.web.authorization.simple.SimpleFieldFilterDataAccessConfig;
+import org.hswebframework.web.commons.entity.DataStatus;
 import org.hswebframework.web.commons.entity.factory.EntityFactory;
 import org.hswebframework.web.dao.datasource.DataSourceHolder;
 import org.hswebframework.web.dao.datasource.DatabaseType;
@@ -159,7 +160,7 @@ public class OAuth2ServerApplication implements CommandLineRunner {
         clientEntity.setRedirectUri("http://localhost:8808/oauth2/callback/hsweb");
         clientEntity.setCreateTime(System.currentTimeMillis());
         clientEntity.setSupportGrantTypes(new HashSet<>(Collections.singletonList("*")));
-        clientEntity.setEnabled(true);
+        clientEntity.setStatus(DataStatus.STATUS_ENABLED);
         oAuth2ClientDao.insert(clientEntity);
     }
 

+ 3 - 9
hsweb-examples/hsweb-examples-simple/pom.xml

@@ -99,22 +99,16 @@
             <version>${project.version}</version>
         </dependency>
         <!--使用shiro实现权限控制-->
-        <!--<dependency>-->
-            <!--<groupId>org.hswebframework.web</groupId>-->
-            <!--<artifactId>hsweb-authorization-shiro</artifactId>-->
-            <!--<version>${project.version}</version>-->
-        <!--</dependency>-->
-
-        <!--组织架构-->
         <dependency>
             <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-system-organizational-starter</artifactId>
+            <artifactId>hsweb-authorization-shiro</artifactId>
             <version>${project.version}</version>
         </dependency>
 
+        <!--组织架构-->
         <dependency>
             <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-system-menu-starter</artifactId>
+            <artifactId>hsweb-system-organizational-starter</artifactId>
             <version>${project.version}</version>
         </dependency>
 

+ 31 - 10
hsweb-examples/hsweb-examples-simple/src/main/java/org/hswebframework/web/example/simple/SpringBootExample.java

@@ -24,7 +24,7 @@ import org.hswebframework.web.authorization.Authentication;
 import org.hswebframework.web.authorization.Permission;
 import org.hswebframework.web.authorization.access.DataAccessConfig;
 import org.hswebframework.web.authorization.simple.SimpleFieldFilterDataAccessConfig;
-import org.hswebframework.web.authorization.simple.SimpleFiledScopeDataAccessConfig;
+import org.hswebframework.web.commons.entity.DataStatus;
 import org.hswebframework.web.commons.entity.factory.EntityFactory;
 import org.hswebframework.web.dao.datasource.DataSourceHolder;
 import org.hswebframework.web.dao.datasource.DatabaseType;
@@ -36,6 +36,7 @@ import org.hswebframework.web.loggin.aop.EnableAccessLogger;
 import org.hswebframework.web.logging.AccessLoggerListener;
 import org.hswebframework.web.organizational.authorization.access.DataAccessType;
 import org.hswebframework.web.organizational.authorization.simple.SimpleScopeDataAccessConfig;
+import org.hswebframework.web.service.authorization.AuthorizationSettingService;
 import org.hswebframework.web.service.authorization.PermissionService;
 import org.hswebframework.web.service.authorization.RoleService;
 import org.hswebframework.web.service.authorization.UserService;
@@ -46,7 +47,6 @@ import org.hswebframework.web.service.organizational.PositionService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.CommandLineRunner;
 import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.cache.annotation.EnableCaching;
@@ -75,6 +75,7 @@ import java.sql.Connection;
 import java.sql.SQLException;
 import java.util.Arrays;
 import java.util.Collections;
+import java.util.HashSet;
 import java.util.stream.Stream;
 
 /**
@@ -164,6 +165,8 @@ public class SpringBootExample implements CommandLineRunner {
     @Autowired
     PersonService         personService;
 
+    @Autowired
+    AuthorizationSettingService authorizationSettingService;
 
     public static void main(String[] args) {
         SpringApplication.run(SpringBootExample.class);
@@ -201,25 +204,45 @@ public class SpringBootExample implements CommandLineRunner {
         onlyDepartmentData.setConfig(JSON.toJSONString(new SimpleScopeDataAccessConfig(DataAccessType.SCOPE_TYPE_CHILDREN)));
         onlyDepartmentData.setDescribe("只能查看自己部门的数据");
 
+        //创建权限
         PermissionEntity permission = entityFactory.newInstance(PermissionEntity.class);
         permission.setName("测试");
         permission.setId("test");
-        permission.setStatus((byte) 1);
+        permission.setStatus(DataStatus.STATUS_ENABLED);
         permission.setActions(ActionEntity.create(Permission.ACTION_QUERY, Permission.ACTION_UPDATE));
 //        permission.setDataAccess(Arrays.asList(accessEntity, updateAccessEntity, denyUpdateFields, denyUpdateFields, onlyDepartmentData));
         permissionService.insert(permission);
 
+        //角色
         BindPermissionRoleEntity<PermissionRoleEntity> roleEntity = entityFactory.newInstance(BindPermissionRoleEntity.class);
         SimplePermissionRoleEntity permissionRoleEntity = new SimplePermissionRoleEntity();
         permissionRoleEntity.setRoleId("admin");
         permissionRoleEntity.setPermissionId("test");
-        permissionRoleEntity.setActions(Arrays.asList(Permission.ACTION_QUERY, Permission.ACTION_UPDATE));
-        permissionRoleEntity.setDataAccesses(Arrays.asList(accessEntity, updateAccessEntity, denyQueryFields, denyUpdateFields, onlyDepartmentData));
         roleEntity.setId("admin");
         roleEntity.setName("test");
         roleEntity.setPermissions(Arrays.asList(permissionRoleEntity));
         roleService.insert(roleEntity);
 
+        /*            权限设置        */
+        AuthorizationSettingEntity settingEntity = entityFactory.newInstance(AuthorizationSettingEntity.class);
+
+        settingEntity.setType("role"); //绑定到角色
+        settingEntity.setSettingFor(roleEntity.getId());
+
+        settingEntity.setDescribe("测试");
+        //权限配置详情
+        AuthorizationSettingDetailEntity detailEntity = entityFactory.newInstance(AuthorizationSettingDetailEntity.class);
+        detailEntity.setPermissionId(permission.getId());
+        detailEntity.setMerge(true);
+        detailEntity.setPriority(1L);
+        detailEntity.setActions(new HashSet<>(Arrays.asList(Permission.ACTION_QUERY, Permission.ACTION_UPDATE)));
+        detailEntity.setDataAccesses(Arrays.asList(accessEntity, updateAccessEntity, denyQueryFields, denyUpdateFields, onlyDepartmentData));
+
+        settingEntity.setDetails(Arrays.asList(detailEntity));
+
+        authorizationSettingService.insert(settingEntity);
+
+        //关联角色给用户
         BindRoleUserEntity userEntity = entityFactory.newInstance(BindRoleUserEntity.class);
         userEntity.setId("admin");
         userEntity.setName("admin");
@@ -234,21 +257,21 @@ public class SpringBootExample implements CommandLineRunner {
         OrganizationalEntity org = entityFactory.newInstance(OrganizationalEntity.class);
 
         org.setName("测试机构");
-        org.setEnabled(true);
+        org.setStatus(DataStatus.STATUS_ENABLED);
         org.setId("test");
         org.setParentId("-1");
 
         organizationalService.insert(org);
 
         DepartmentEntity department = entityFactory.newInstance(DepartmentEntity.class);
-        department.setEnabled(true);
+        department.setStatus(DataStatus.STATUS_ENABLED);
         department.setOrgId("test");
         department.setId("test");
         department.setName("部门");
         department.setParentId("-1");
 
         DepartmentEntity department2 = entityFactory.newInstance(DepartmentEntity.class);
-        department2.setEnabled(true);
+        department2.setStatus(DataStatus.STATUS_ENABLED);
         department2.setOrgId("test");
         department2.setId("test2");
         department2.setName("部门2");
@@ -275,7 +298,5 @@ public class SpringBootExample implements CommandLineRunner {
         personEntity.setPersonUser(personUserEntity);
 
         personService.insert(personEntity);
-
-
     }
 }

+ 1 - 0
hsweb-examples/hsweb-examples-simple/src/main/java/org/hswebframework/web/example/simple/TestController.java

@@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 
+
 /**
  * TODO 完成注释
  *

+ 1 - 1
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-dao/hsweb-system-dictionary-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/dictionary/DictionaryItemMapper.xml

@@ -26,7 +26,7 @@
         <result property="value" column="value" javaType="String" jdbcType="VARCHAR"/>
         <result property="text" column="text" javaType="String" jdbcType="VARCHAR"/>
         <result property="valueType" column="value_type" javaType="String" jdbcType="VARCHAR"/>
-        <result property="enabled" column="enabled" javaType="Long" jdbcType="DECIMAL"/>
+        <result property="status" column="status" javaType="Byte" jdbcType="DECIMAL"/>
         <result property="describe" column="describe" javaType="String" jdbcType="VARCHAR"/>
         <result property="parentId" column="parent_id" javaType="String" jdbcType="VARCHAR"/>
         <result property="path" column="path" javaType="String" jdbcType="VARCHAR"/>

+ 8 - 8
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-dao/hsweb-system-dictionary-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/dictionary/DictionaryMapper.xml

@@ -21,12 +21,12 @@
 <mapper namespace="org.hswebframework.web.dao.dictionary.DictionaryDao">
     <resultMap id="DictionaryResultMap" type="org.hswebframework.web.entity.dictionary.SimpleDictionaryEntity">
         <id property="id" column="u_id" javaType="string" jdbcType="VARCHAR"/>
-            <result property="name" column="name" javaType="String" jdbcType="VARCHAR"/>
-            <result property="classifiedId" column="classified_id" javaType="String" jdbcType="VARCHAR"/>
-            <result property="describe" column="describe" javaType="String" jdbcType="VARCHAR"/>
-            <result property="createTime" column="create_time" javaType="Long" jdbcType="DECIMAL"/>
-            <result property="creatorId" column="creator_id" javaType="String" jdbcType="VARCHAR"/>
-            <result property="enabled" column="enabled" javaType="Boolean" jdbcType="DECIMAL"/>
+        <result property="name" column="name" javaType="String" jdbcType="VARCHAR"/>
+        <result property="classifiedId" column="classified_id" javaType="String" jdbcType="VARCHAR"/>
+        <result property="describe" column="describe" javaType="String" jdbcType="VARCHAR"/>
+        <result property="createTime" column="create_time" javaType="Long" jdbcType="DECIMAL"/>
+        <result property="creatorId" column="creator_id" javaType="String" jdbcType="VARCHAR"/>
+        <result property="status" column="status" javaType="Byte" jdbcType="DECIMAL"/>
     </resultMap>
 
     <!--用于动态生成sql所需的配置-->
@@ -34,8 +34,8 @@
         <bind name="resultMapId" value="'DictionaryResultMap'"/>
         <bind name="tableName" value="'s_dictionary'"/>
     </sql>
-  
-    <insert id="insert" parameterType="org.hswebframework.web.entity.dictionary.SimpleDictionaryEntity" >
+
+    <insert id="insert" parameterType="org.hswebframework.web.entity.dictionary.SimpleDictionaryEntity">
         <include refid="config"/>
         <include refid="BasicMapper.buildInsertSql"/>
     </insert>

+ 6 - 6
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-entity/src/main/java/org/hswebframework/web/entity/dictionary/DictionaryEntity.java

@@ -51,9 +51,9 @@ public interface DictionaryEntity<ITEM extends DictionaryItemEntity> extends Gen
      */
     String creatorId    = "creatorId";
     /**
-     * 是否启用
+     * 状态
      */
-    String enabled      = "enabled";
+    String status       = "status";
 
     /**
      * @return 字典名称
@@ -86,14 +86,14 @@ public interface DictionaryEntity<ITEM extends DictionaryItemEntity> extends Gen
     void setDescribe(String describe);
 
     /**
-     * @return 是否启用
+     * @return 状态
      */
-    Boolean isEnabled();
+    Byte getStatus();
 
     /**
-     * 设置 是否启用
+     * 设置 状态
      */
-    void setEnabled(Boolean enabled);
+    void setStatus(Byte enabled);
 
     List<ITEM> getItems();
 

+ 5 - 5
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-entity/src/main/java/org/hswebframework/web/entity/dictionary/DictionaryItemEntity.java

@@ -53,7 +53,7 @@ public interface DictionaryItemEntity extends TreeSortSupportEntity<String> {
     /**
      * 是否启用
      */
-    String enabled        = "enabled";
+    String status        = "status";
     /**
      * 说明
      */
@@ -147,14 +147,14 @@ public interface DictionaryItemEntity extends TreeSortSupportEntity<String> {
     void setValueType(String valueType);
 
     /**
-     * @return 是否启用
+     * @return 状态
      */
-    Long getEnabled();
+    Byte getStatus();
 
     /**
-     * 设置 是否启用
+     * 设置 状态
      */
-    void setEnabled(Long enabled);
+    void setStatus(Byte status);
 
     /**
      * @return 说明

+ 8 - 8
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-entity/src/main/java/org/hswebframework/web/entity/dictionary/SimpleDictionaryEntity.java

@@ -36,8 +36,8 @@ public class SimpleDictionaryEntity extends SimpleGenericEntity<String> implemen
     private Long                             createTime;
     //创建人id
     private String                           creatorId;
-    //是否启用
-    private Boolean                          enabled;
+    //状态
+    private Byte                             status;
     //字段选项
     private List<SimpleDictionaryItemEntity> items;
 
@@ -112,17 +112,17 @@ public class SimpleDictionaryEntity extends SimpleGenericEntity<String> implemen
     }
 
     /**
-     * @return 是否启用
+     * @return 状态
      */
-    public Boolean isEnabled() {
-        return this.enabled;
+    public Byte getStatus() {
+        return this.status;
     }
 
     /**
-     * 设置 是否启用
+     * 设置 状态
      */
-    public void setEnabled(Boolean enabled) {
-        this.enabled = enabled;
+    public void setStatus(Byte status) {
+        this.status = status;
     }
 
     @Override

+ 5 - 5
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-entity/src/main/java/org/hswebframework/web/entity/dictionary/SimpleDictionaryItemEntity.java

@@ -37,7 +37,7 @@ public class SimpleDictionaryItemEntity extends SimpleTreeSortSupportEntity<Stri
     //字典值类型
     private String valueType;
     //是否启用
-    private Long   enabled;
+    private Byte   status;
     //说明
     private String describe;
     //快速搜索码
@@ -152,15 +152,15 @@ public class SimpleDictionaryItemEntity extends SimpleTreeSortSupportEntity<Stri
     /**
      * @return 是否启用
      */
-    public Long getEnabled() {
-        return this.enabled;
+    public Byte getStatus() {
+        return this.status;
     }
 
     /**
      * 设置 是否启用
      */
-    public void setEnabled(Long enabled) {
-        this.enabled = enabled;
+    public void setStatus(Byte enabled) {
+        this.status = enabled;
     }
 
     /**

+ 2 - 2
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-starter/src/main/resources/hsweb-starter.js

@@ -43,7 +43,7 @@ function install(context) {
         .addColumn().name("describe").alias("describe").comment("说明").jdbcType(java.sql.JDBCType.VARCHAR).length(256).commit()
         .addColumn().name("create_time").alias("createTime").comment("创建时间").jdbcType(java.sql.JDBCType.DECIMAL).length(32, 0).commit()
         .addColumn().name("creator_id").alias("creatorId").comment("创建人id").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit()
-        .addColumn().name("enabled").alias("enabled").comment("是否启用").jdbcType(java.sql.JDBCType.DECIMAL).length(4, 0).commit()
+        .addColumn().name("status").alias("status").comment("状态").jdbcType(java.sql.JDBCType.DECIMAL).length(4, 0).commit()
         .comment("数据字典").commit();
 
     database.createOrAlter("s_dict_item")
@@ -53,7 +53,7 @@ function install(context) {
         .addColumn().name("value").alias("value").comment("字典值").jdbcType(java.sql.JDBCType.VARCHAR).length(64).commit()
         .addColumn().name("text").alias("text").comment("字典文本").jdbcType(java.sql.JDBCType.VARCHAR).length(128).commit()
         .addColumn().name("value_type").alias("valueType").comment("字典值类型").jdbcType(java.sql.JDBCType.VARCHAR).length(64).commit()
-        .addColumn().name("is_enabled").alias("enabled").comment("是否启用").jdbcType(java.sql.JDBCType.DECIMAL).length(4, 0).commit()
+        .addColumn().name("is_status").alias("status").comment("状态").jdbcType(java.sql.JDBCType.DECIMAL).length(4, 0).commit()
         .addColumn().name("describe").alias("describe").comment("说明").jdbcType(java.sql.JDBCType.VARCHAR).length(128).commit()
         .addColumn().name("parent_id").alias("parentId").comment("父级选项").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit()
         .addColumn().name("path").alias("path").comment("树编码").jdbcType(java.sql.JDBCType.VARCHAR).length(3000).commit()

+ 3 - 1
hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-starter/src/test/java/org/hswebframework/web/starter/dictionary/DictionaryTests.java

@@ -20,6 +20,7 @@ package org.hswebframework.web.starter.dictionary;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import org.hswebframework.web.commons.entity.DataStatus;
 import org.hswebframework.web.entity.dictionary.DictionaryEntity;
 import org.hswebframework.web.entity.dictionary.DictionaryItemEntity;
 import org.hswebframework.web.entity.dictionary.SimpleDictionaryEntity;
@@ -32,6 +33,7 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.MediaType;
 
+import javax.xml.crypto.Data;
 import java.util.List;
 
 /**
@@ -54,7 +56,7 @@ public class DictionaryTests extends SimpleWebApplicationTests {
         entity.setId("test");
         entity.setDescribe("test");
         entity.setClassifiedId("test");
-        entity.setEnabled(true);
+        entity.setStatus(DataStatus.STATUS_ENABLED);
         String json = "[" +
                 "{'value':'1','text':'水果','children':" +
                 "[" +

+ 0 - 49
hsweb-system/hsweb-system-menu/hsweb-system-menu-controller/pom.xml

@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Copyright 2016 http://www.hswebframework.org
-  ~
-  ~ Licensed under the Apache License, Version 2.0 (the "License");
-  ~ you may not use this file except in compliance with the License.
-  ~ You may obtain a copy of the License at
-  ~
-  ~       http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~  See the License for the specific language governing permissions and
-  ~  limitations under the License.
-  ~
-  -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>hsweb-system-menu</artifactId>
-        <groupId>org.hswebframework.web</groupId>
-        <version>3.0-SNAPSHOT</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>hsweb-system-menu-controller</artifactId>
-
-    <dependencies>
-        <dependency>
-            <groupId>javax.servlet</groupId>
-            <artifactId>servlet-api</artifactId>
-            <version>2.5</version>
-            <optional>true</optional>
-        </dependency>
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-system-menu-service-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-commons-controller</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-    </dependencies>
-</project>

+ 0 - 45
hsweb-system/hsweb-system-menu/hsweb-system-menu-dao/hsweb-system-menu-dao-api/pom.xml

@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ 
-  ~   Copyright 2016 http://www.hswebframework.org
-  ~  
-  ~   Licensed under the Apache License, Version 2.0 (the "License");
-  ~   you may not use this file except in compliance with the License.
-  ~   You may obtain a copy of the License at
-  ~  
-  ~       http://www.apache.org/licenses/LICENSE-2.0
-  ~  
-  ~   Unless required by applicable law or agreed to in writing, software
-  ~   distributed under the License is distributed on an "AS IS" BASIS,
-  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~   See the License for the specific language governing permissions and
-  ~   limitations under the License.
-  ~  
-  -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>hsweb-system-menu-dao</artifactId>
-        <groupId>org.hswebframework.web</groupId>
-        <version>3.0-SNAPSHOT</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>hsweb-system-menu-dao-api</artifactId>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-system-menu-entity</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-commons-dao-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-    </dependencies>
-
-</project>

+ 0 - 44
hsweb-system/hsweb-system-menu/hsweb-system-menu-dao/hsweb-system-menu-dao-mybatis/pom.xml

@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ 
-  ~   Copyright 2016 http://www.hswebframework.org
-  ~  
-  ~   Licensed under the Apache License, Version 2.0 (the "License");
-  ~   you may not use this file except in compliance with the License.
-  ~   You may obtain a copy of the License at
-  ~  
-  ~       http://www.apache.org/licenses/LICENSE-2.0
-  ~  
-  ~   Unless required by applicable law or agreed to in writing, software
-  ~   distributed under the License is distributed on an "AS IS" BASIS,
-  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~   See the License for the specific language governing permissions and
-  ~   limitations under the License.
-  ~  
-  -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>hsweb-system-menu-dao</artifactId>
-        <groupId>org.hswebframework.web</groupId>
-        <version>3.0-SNAPSHOT</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>hsweb-system-menu-dao-mybatis</artifactId>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-system-menu-dao-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-commons-dao-mybatis</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-    </dependencies>
-</project>

+ 0 - 36
hsweb-system/hsweb-system-menu/hsweb-system-menu-dao/pom.xml

@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ 
-  ~   Copyright 2016 http://www.hswebframework.org
-  ~  
-  ~   Licensed under the Apache License, Version 2.0 (the "License");
-  ~   you may not use this file except in compliance with the License.
-  ~   You may obtain a copy of the License at
-  ~  
-  ~       http://www.apache.org/licenses/LICENSE-2.0
-  ~  
-  ~   Unless required by applicable law or agreed to in writing, software
-  ~   distributed under the License is distributed on an "AS IS" BASIS,
-  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~   See the License for the specific language governing permissions and
-  ~   limitations under the License.
-  ~  
-  -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>hsweb-system-menu</artifactId>
-        <groupId>org.hswebframework.web</groupId>
-        <version>3.0-SNAPSHOT</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>hsweb-system-menu-dao</artifactId>
-    <packaging>pom</packaging>
-    <modules>
-        <module>hsweb-system-menu-dao-api</module>
-        <module>hsweb-system-menu-dao-mybatis</module>
-    </modules>
-</project>

+ 0 - 45
hsweb-system/hsweb-system-menu/hsweb-system-menu-entity/pom.xml

@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ 
-  ~   Copyright 2016 http://www.hswebframework.org
-  ~  
-  ~   Licensed under the Apache License, Version 2.0 (the "License");
-  ~   you may not use this file except in compliance with the License.
-  ~   You may obtain a copy of the License at
-  ~  
-  ~       http://www.apache.org/licenses/LICENSE-2.0
-  ~  
-  ~   Unless required by applicable law or agreed to in writing, software
-  ~   distributed under the License is distributed on an "AS IS" BASIS,
-  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~   See the License for the specific language governing permissions and
-  ~   limitations under the License.
-  ~  
-  -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>hsweb-system-menu</artifactId>
-        <groupId>org.hswebframework.web</groupId>
-        <version>3.0-SNAPSHOT</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>hsweb-system-menu-entity</artifactId>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-commons-entity</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-system-authorization-entity</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-    </dependencies>
-
-</project>

+ 0 - 47
hsweb-system/hsweb-system-menu/hsweb-system-menu-service/hsweb-system-menu-service-api/pom.xml

@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Copyright 2016 http://www.hswebframework.org
-  ~
-  ~ Licensed under the Apache License, Version 2.0 (the "License");
-  ~ you may not use this file except in compliance with the License.
-  ~ You may obtain a copy of the License at
-  ~
-  ~       http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~  See the License for the specific language governing permissions and
-  ~  limitations under the License.
-  ~
-  -->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>hsweb-system-menu-service</artifactId>
-        <groupId>org.hswebframework.web</groupId>
-        <version>3.0-SNAPSHOT</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>hsweb-system-menu-service-api</artifactId>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-commons-service-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-system-authorization-entity</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-system-menu-entity</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-    </dependencies>
-</project>

+ 0 - 52
hsweb-system/hsweb-system-menu/hsweb-system-menu-service/hsweb-system-menu-service-simple/pom.xml

@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Copyright 2016 http://www.hswebframework.org
-  ~
-  ~ Licensed under the Apache License, Version 2.0 (the "License");
-  ~ you may not use this file except in compliance with the License.
-  ~ You may obtain a copy of the License at
-  ~
-  ~       http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~  See the License for the specific language governing permissions and
-  ~  limitations under the License.
-  ~
-  -->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>hsweb-system-menu-service</artifactId>
-        <groupId>org.hswebframework.web</groupId>
-        <version>3.0-SNAPSHOT</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>hsweb-system-menu-service-simple</artifactId>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-commons-service-simple</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-system-menu-service-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-system-authorization-service-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-system-menu-dao-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-    </dependencies>
-</project>

+ 0 - 34
hsweb-system/hsweb-system-menu/hsweb-system-menu-service/pom.xml

@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Copyright 2016 http://www.hswebframework.org
-  ~
-  ~ Licensed under the Apache License, Version 2.0 (the "License");
-  ~ you may not use this file except in compliance with the License.
-  ~ You may obtain a copy of the License at
-  ~
-  ~       http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~  See the License for the specific language governing permissions and
-  ~  limitations under the License.
-  ~
-  -->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>hsweb-system-menu</artifactId>
-        <groupId>org.hswebframework.web</groupId>
-        <version>3.0-SNAPSHOT</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>hsweb-system-menu-service</artifactId>
-    <packaging>pom</packaging>
-    <modules>
-        <module>hsweb-system-menu-service-api</module>
-        <module>hsweb-system-menu-service-simple</module>
-    </modules>
-</project>

+ 0 - 91
hsweb-system/hsweb-system-menu/hsweb-system-menu-starter/pom.xml

@@ -1,91 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Copyright 2016 http://www.hswebframework.org
-  ~
-  ~ Licensed under the Apache License, Version 2.0 (the "License");
-  ~ you may not use this file except in compliance with the License.
-  ~ You may obtain a copy of the License at
-  ~
-  ~       http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~  See the License for the specific language governing permissions and
-  ~  limitations under the License.
-  ~
-  -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>hsweb-system-menu</artifactId>
-        <groupId>org.hswebframework.web</groupId>
-        <version>3.0-SNAPSHOT</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>hsweb-system-menu-starter</artifactId>
-
-
-    <build>
-        <resources>
-            <resource>
-                <directory>src/main/resources</directory>
-                <filtering>true</filtering>
-            </resource>
-        </resources>
-    </build>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-system-menu-service-simple</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-system-menu-dao-mybatis</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-system-menu-controller</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>com.h2database</groupId>
-            <artifactId>h2</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>druid</artifactId>
-            <version>1.0.26</version>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-spring-boot-starter</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-tests</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>javax.servlet</groupId>
-            <artifactId>servlet-api</artifactId>
-            <version>2.5</version>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-</project>

+ 0 - 90
hsweb-system/hsweb-system-menu/hsweb-system-menu-starter/src/main/resources/hsweb-starter.js

@@ -1,90 +0,0 @@
-/*
- * Copyright 2016 http://www.hswebframework.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- */
-//组件信息
-var info = {
-    groupId: "${project.groupId}",
-    artifactId: "${project.artifactId}",
-    version: "${project.version}",
-    website: "https://github.com/hs-web/hsweb-framework/tree/master/hsweb-system/hsweb-system-menu",
-    author: "zh.sqy@qq.com",
-    comment: "菜单分组"
-};
-
-//版本更新信息
-var versions = [
-    // {
-    //     version: "3.0.0",
-    //     upgrade: function (context) {
-    //         java.lang.System.out.println("更新到3.0.2了");
-    //     }
-    // }
-];
-var JDBCType = java.sql.JDBCType;
-function install(context) {
-    var database = context.database;
-    database.createOrAlter("s_menu")
-        .addColumn().name("u_id").varchar(32).notNull().primaryKey().comment("uid").commit()
-        .addColumn().name("name").varchar(64).notNull().comment("名称").commit()
-        .addColumn().name("parent_id").varchar(32).comment("父级ID").commit()
-        .addColumn().name("permission_id").varchar(32).comment("权限ID").commit()
-        .addColumn().name("path").varchar(2048).notNull().comment("树编码").commit()
-        .addColumn().name("sort_index").number(32).notNull().comment("树编码").commit()
-        .addColumn().name("describe").varchar(128).comment("备注").commit()
-        .addColumn().name("url").varchar(2000).comment("URL").commit()
-        .addColumn().name("icon").varchar(512).comment("图标").commit()
-        .addColumn().name("enabled").varchar(32).comment("是否启用").commit()
-        .comment("系统菜单表").commit()
-
-    database.createOrAlter("s_menu_group")
-        .addColumn().name("u_id").alias("id").comment("ID").jdbcType(java.sql.JDBCType.VARCHAR).length(32).primaryKey().commit()
-        .addColumn().name("name").alias("name").comment("分组名称").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit()
-        .addColumn().name("describe").alias("describe").comment("分组描述").jdbcType(java.sql.JDBCType.VARCHAR).length(64).commit()
-        .addColumn().name("default_group").alias("defaultGroup").comment("是否默认").jdbcType(java.sql.JDBCType.DECIMAL).length(4, 0).commit()
-        .addColumn().name("path").alias("path").comment("树路径").jdbcType(java.sql.JDBCType.VARCHAR).length(4000).commit()
-        .addColumn().name("parent_id").alias("parentId").comment("父级id").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit()
-        .addColumn().name("level").alias("level").comment("树层级").jdbcType(java.sql.JDBCType.DECIMAL).length(32, 0).commit()
-        .addColumn().name("sort_index").alias("sortIndex").comment("排序序号").jdbcType(java.sql.JDBCType.DECIMAL).length(32, 0).commit()
-        .addColumn().name("enabled").alias("enabled").comment("是否启用").jdbcType(java.sql.JDBCType.DECIMAL).length(4, 0).commit()
-        .comment("菜单分组").commit();
-
-    database.createOrAlter("s_menu_group_bind")
-        .addColumn().name("u_id").alias("id").comment("ID").jdbcType(java.sql.JDBCType.VARCHAR).length(32).primaryKey().commit()
-        .addColumn().name("menu_id").alias("menuId").comment("菜单id").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit()
-        .addColumn().name("group_id").alias("groupId").comment("分组id").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit()
-        .addColumn().name("path").alias("path").comment("树结构编码").jdbcType(java.sql.JDBCType.VARCHAR).length(4000).commit()
-        .addColumn().name("parent_id").alias("parentId").comment("父级id").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit()
-        .addColumn().name("level").alias("level").comment("树层级").jdbcType(java.sql.JDBCType.DECIMAL).length(32, 0).commit()
-        .addColumn().name("sort_index").alias("sortIndex").comment("排序序号").jdbcType(java.sql.JDBCType.DECIMAL).length(32, 0).commit()
-        .addColumn().name("enabled").alias("enabled").comment("是否启用").jdbcType(java.sql.JDBCType.DECIMAL).length(4, 0).commit()
-        .addColumn().name("actions").alias("actions").comment("可选按钮").jdbcType(java.sql.JDBCType.VARCHAR).length(4000).commit()
-        .addColumn().name("data_accesses").alias("dataAccesses").comment("行级权限控制配置").jdbcType(java.sql.JDBCType.CLOB).commit()
-        .comment("菜单分组关联").commit();
-}
-
-//设置依赖
-dependency.setup(info)
-    .onInstall(install)
-    .onUpgrade(function (context) { //更新时执行
-        var upgrader = context.upgrader;
-        upgrader.filter(versions)
-            .upgrade(function (newVer) {
-                newVer.upgrade(context);
-            });
-    })
-    .onUninstall(function (context) { //卸载时执行
-
-    });

+ 0 - 70
hsweb-system/hsweb-system-menu/hsweb-system-menu-starter/src/test/java/org/hswebframework/web/starter/menu/MenuTests.java

@@ -1,70 +0,0 @@
-/*
- *  Copyright 2016 http://www.hswebframework.org
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- *
- */
-
-package org.hswebframework.web.starter.menu;
-
-import com.alibaba.fastjson.JSON;
-import org.hswebframework.web.entity.menu.MenuEntity;
-import org.hswebframework.web.service.menu.MenuService;
-import org.hswebframework.web.tests.SimpleWebApplicationTests;
-import org.junit.After;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.sql.SQLException;
-import java.util.Arrays;
-
-import static org.junit.Assert.assertNotNull;
-
-/**
- * TODO 完成注释
- *
- * @author zhouhao
- */
-
-public class MenuTests extends SimpleWebApplicationTests {
-
-    @Autowired
-    MenuService menuService;
-
-    @After
-    public void clear() throws SQLException {
-        sqlExecutor.delete("delete from s_menu");
-    }
-
-    public MenuEntity createMenu(String name) {
-        MenuEntity menuEntity = menuService.createEntity();
-        menuEntity.setName(name);
-        return menuEntity;
-    }
-
-    @Test
-    public void testCrud() throws Exception {
-        MenuEntity menuEntity = createMenu("测试1");
-        menuEntity.setSortIndex(1L);
-        MenuEntity child1 = createMenu("测试2");
-        MenuEntity child3 = createMenu("测试2");
-        menuEntity.setChildren(Arrays.asList(child1, child3));
-
-        String id = menuService.insert(menuEntity);
-
-        System.out.println(JSON.toJSONString(menuService.select()));
-        assertNotNull(id);
-
-    }
-}

+ 0 - 13
hsweb-system/hsweb-system-menu/hsweb-system-menu-starter/src/test/resources/application.yml

@@ -1,13 +0,0 @@
-spring:
-    aop:
-        auto: true
-    datasource:
-       url : jdbc:h2:mem:menu_test_mem
-       username : sa
-       password :
-       type: com.alibaba.druid.pool.DruidDataSource
-       driver-class-name : org.h2.Driver
-hsweb:
-    app:
-      name: 菜单分组测试
-      version: 3.0.0

+ 0 - 40
hsweb-system/hsweb-system-menu/pom.xml

@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Copyright 2016 http://www.hswebframework.org
-  ~
-  ~ Licensed under the Apache License, Version 2.0 (the "License");
-  ~ you may not use this file except in compliance with the License.
-  ~ You may obtain a copy of the License at
-  ~
-  ~       http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~  See the License for the specific language governing permissions and
-  ~  limitations under the License.
-  ~
-  -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>hsweb-system</artifactId>
-        <groupId>org.hswebframework.web</groupId>
-        <version>3.0-SNAPSHOT</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>hsweb-system-menu</artifactId>
-    <packaging>pom</packaging>
-    <modules>
-        <module>hsweb-system-menu-dao</module>
-        <module>hsweb-system-menu-service</module>
-        <module>hsweb-system-menu-controller</module>
-        <module>hsweb-system-menu-entity</module>
-        <module>hsweb-system-menu-starter</module>
-    </modules>
-
-
-</project>

+ 1 - 1
hsweb-system/hsweb-system-oauth2-client/hsweb-system-oauth2-client-dao/hsweb-system-oauth2-client-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/oauth2/client/OAuth2ServerConfigMapper.xml

@@ -31,7 +31,7 @@
         <result property="clientSecret" column="client_secret" javaType="String" jdbcType="VARCHAR"/>
         <result property="provider" column="provider" javaType="String" jdbcType="VARCHAR"/>
         <result property="properties" column="properties" javaType="java.util.Map" jdbcType="CLOB"/>
-        <result property="enabled" column="enabled" javaType="Boolean" jdbcType="DECIMAL"/>
+        <result property="status" column="status" javaType="Byte" jdbcType="DECIMAL"/>
     </resultMap>
 
     <!--用于动态生成sql所需的配置-->

+ 4 - 4
hsweb-system/hsweb-system-oauth2-client/hsweb-system-oauth2-client-entity/src/main/java/org/hswebframework/web/entity/oauth2/client/OAuth2ServerConfigEntity.java

@@ -56,9 +56,9 @@ public interface OAuth2ServerConfigEntity extends GenericEntity<String> {
      */
     String clientSecret   = "clientSecret";
     /**
-     * 是否启用
+     * 状态
      */
-    String enabled        = "enabled";
+    String status         = "status";
 
     String redirectUri = "redirectUri";
 
@@ -152,11 +152,11 @@ public interface OAuth2ServerConfigEntity extends GenericEntity<String> {
     /**
      * @return 是否启用
      */
-    Boolean isEnabled();
+    Byte getStatus();
 
     /**
      * 设置 是否启用
      */
-    void setEnabled(Boolean enabled);
+    void setStatus(Byte status);
 
 }

+ 13 - 13
hsweb-system/hsweb-system-oauth2-client/hsweb-system-oauth2-client-entity/src/main/java/org/hswebframework/web/entity/oauth2/client/SimpleOAuth2ServerConfigEntity.java

@@ -25,23 +25,23 @@ import org.hswebframework.web.commons.entity.SimpleGenericEntity;
  */
 public class SimpleOAuth2ServerConfigEntity extends SimpleGenericEntity<String> implements OAuth2ServerConfigEntity {
     //服务名称
-    private String  name;
+    private String name;
     //备注
-    private String  describe;
+    private String describe;
     //api根地址
-    private String  apiBaseUrl;
+    private String apiBaseUrl;
     //认证地址
-    private String  authUrl;
+    private String authUrl;
     //token获取地址
-    private String  accessTokenUrl;
+    private String accessTokenUrl;
     //客户端id
-    private String  clientId;
+    private String clientId;
     //客户端密钥
-    private String  clientSecret;
+    private String clientSecret;
     //是否启用
-    private Boolean enabled;
+    private Byte   status;
     //重定向地址
-    private String  redirectUri;
+    private String redirectUri;
 
     //服务提供商
     private String provider;
@@ -165,14 +165,14 @@ public class SimpleOAuth2ServerConfigEntity extends SimpleGenericEntity<String>
     /**
      * @return 是否启用
      */
-    public Boolean isEnabled() {
-        return this.enabled;
+    public Byte getStatus() {
+        return this.status;
     }
 
     /**
      * 设置 是否启用
      */
-    public void setEnabled(Boolean enabled) {
-        this.enabled = enabled;
+    public void setStatus(Byte status) {
+        this.status = status;
     }
 }

+ 2 - 1
hsweb-system/hsweb-system-oauth2-client/hsweb-system-oauth2-client-service/hsweb-system-oauth2-client-service-simple/src/main/java/org/hswebframework/web/service/oauth2/client/simple/SimpleOAuth2RequestService.java

@@ -26,6 +26,7 @@ import org.hswebframework.web.authorization.oauth2.client.OAuth2RequestService;
 import org.hswebframework.web.authorization.oauth2.client.OAuth2SessionBuilder;
 import org.hswebframework.web.authorization.oauth2.client.listener.OAuth2Event;
 import org.hswebframework.web.authorization.oauth2.client.listener.OAuth2Listener;
+import org.hswebframework.web.commons.entity.DataStatus;
 import org.hswebframework.web.entity.oauth2.client.OAuth2ServerConfigEntity;
 import org.hswebframework.web.service.oauth2.client.OAuth2ServerConfigService;
 import org.hswebframework.web.service.oauth2.client.OAuth2UserTokenService;
@@ -53,7 +54,7 @@ public class SimpleOAuth2RequestService implements OAuth2RequestService {
     @Override
     public OAuth2SessionBuilder create(String serverId) {
         OAuth2ServerConfigEntity configEntity = oAuth2ServerConfigService.selectByPk(serverId);
-        if (null == configEntity || !Boolean.TRUE.equals(configEntity.isEnabled())) throw new NotFoundException("server not found!");
+        if (null == configEntity || !DataStatus.STATUS_ENABLED.equals(configEntity.getStatus())) throw new NotFoundException("server not found!");
         return new SimpleOAuth2SessionBuilder(oAuth2UserTokenService, configEntity, oAuth2RequestBuilderFactory);
     }
 

+ 1 - 1
hsweb-system/hsweb-system-oauth2-client/hsweb-system-oauth2-client-starter/src/main/resources/hsweb-starter.js

@@ -48,7 +48,7 @@ function install(context) {
         .addColumn().name("client_secret").alias("clientSecret").comment("客户端密钥").jdbcType(java.sql.JDBCType.VARCHAR).length(128).commit()
         .addColumn().name("provider").alias("provider").comment("服务提供商").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit()
         .addColumn().name("properties").alias("properties").comment("其他配置").jdbcType(java.sql.JDBCType.CLOB).commit()
-        .addColumn().name("enabled").alias("enabled").comment("是否启用").jdbcType(java.sql.JDBCType.DECIMAL).length(4, 0).commit()
+        .addColumn().name("status").alias("status").comment("状态").jdbcType(java.sql.JDBCType.DECIMAL).length(4, 0).commit()
         .comment("OAuth2 服务配置").commit();
 
     database.createOrAlter("s_oauth2_user_token")

+ 1 - 1
hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-dao/hsweb-system-oauth2-server-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/oauth2/OAuth2ClientMapper.xml

@@ -34,7 +34,7 @@
         <result property="createTime" column="create_time" javaType="Long" jdbcType="NUMERIC"/>
         <result property="supportGrantType" column="support_grant_type" javaType="java.util.Set" jdbcType="VARCHAR"/>
         <result property="defaultGrantScope" column="default_grant_scope" javaType="java.util.Set" jdbcType="VARCHAR"/>
-        <result property="enabled" column="enabled" javaType="Boolean" jdbcType="NUMERIC"/>
+        <result property="status" column="status" javaType="Byte" jdbcType="NUMERIC"/>
     </resultMap>
 
     <!--用于动态生成sql所需的配置-->

+ 1 - 1
hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-entity/src/main/java/org/hswebframework/web/authorization/oauth2/server/entity/OAuth2ClientEntity.java

@@ -71,5 +71,5 @@ public interface OAuth2ClientEntity extends GenericEntity<String>, OAuth2Client,
 
     void setSupportGrantTypes(Set<String> supportGrantType);
 
-    void setEnabled(Boolean enabled);
+    void setStatus(Byte status);
 }

+ 5 - 5
hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-entity/src/main/java/org/hswebframework/web/authorization/oauth2/server/entity/SimpleOAuth2ClientEntity.java

@@ -46,7 +46,7 @@ public class SimpleOAuth2ClientEntity extends SimpleGenericEntity<String> implem
 
     private Set<String> defaultGrantScope;
 
-    private Boolean enabled;
+    private Byte status;
 
     public String getDescribe() {
         return describe;
@@ -141,11 +141,11 @@ public class SimpleOAuth2ClientEntity extends SimpleGenericEntity<String> implem
     }
 
     @Override
-    public Boolean isEnabled() {
-        return enabled;
+    public Byte getStatus() {
+        return status;
     }
 
-    public void setEnabled(Boolean enabled) {
-        this.enabled = enabled;
+    public void setStatus(Byte status) {
+        this.status = status;
     }
 }

+ 1 - 1
hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-starter/src/main/resources/hsweb-starter.js

@@ -50,7 +50,7 @@ function install(context) {
         .addColumn().name("support_grant_type").clob().notNull().comment("支持的授权列表").commit()
         .addColumn().name("default_expires_in").number(16).comment("默认认证过期时间").commit()
         .addColumn().name("default_grant_scope").clob().comment("默认认证范围").commit()
-        .addColumn().name("enabled").number(4).comment("是否启用").commit()
+        .addColumn().name("status").number(4).comment("状态").commit()
         .comment("OAuth2客户端").commit();
 
     database.createOrAlter("s_oauth2_access")

+ 1 - 1
hsweb-system/hsweb-system-organizational/hsweb-system-organizational-dao/hsweb-system-organizational-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/organizational/DepartmentMapper.xml

@@ -27,7 +27,7 @@
             <result property="parentId" column="parent_id" javaType="String" jdbcType="VARCHAR"/>
             <result property="path" column="path" javaType="String" jdbcType="VARCHAR"/>
             <result property="sortIndex" column="sort_index" javaType="Long" jdbcType="DECIMAL"/>
-            <result property="enabled" column="enabled" javaType="Boolean" jdbcType="DECIMAL"/>
+            <result property="status" column="status" javaType="Byte" jdbcType="DECIMAL"/>
             <result property="level" column="level" javaType="Integer" jdbcType="DECIMAL"/>
     </resultMap>
 

+ 1 - 1
hsweb-system/hsweb-system-organizational/hsweb-system-organizational-dao/hsweb-system-organizational-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/organizational/OrganizationalMapper.xml

@@ -28,7 +28,7 @@
             <result property="parentId" column="parent_id" javaType="String" jdbcType="VARCHAR"/>
             <result property="path" column="path" javaType="String" jdbcType="VARCHAR"/>
             <result property="sortIndex" column="sort_index" javaType="Long" jdbcType="DECIMAL"/>
-            <result property="enabled" column="enabled" javaType="Boolean" jdbcType="DECIMAL"/>
+            <result property="status" column="status" javaType="Byte" jdbcType="DECIMAL"/>
             <result property="level" column="level" javaType="Integer" jdbcType="DECIMAL"/>
     </resultMap>
 

+ 6 - 6
hsweb-system/hsweb-system-organizational/hsweb-system-organizational-entity/src/main/java/org/hswebframework/web/entity/organizational/DepartmentEntity.java

@@ -54,9 +54,9 @@ public interface DepartmentEntity extends TreeSortSupportEntity<String> {
      */
     String sortIndex = "sortIndex";
     /**
-     * 是否启用
+     * 状态
      */
-    String enabled   = "enabled";
+    String status    = "status";
     /**
      * 级别
      */
@@ -93,14 +93,14 @@ public interface DepartmentEntity extends TreeSortSupportEntity<String> {
     void setCode(String code);
 
     /**
-     * @return 是否启用
+     * @return 状态
      */
-    Boolean isEnabled();
+    Byte getStatus();
 
     /**
-     * 设置 是否启用
+     * 设置 状态
      */
-    void setEnabled(Boolean enabled);
+    void setStatus(Byte status);
 
     void setChildren(List<DepartmentEntity> children);
 }

+ 4 - 10
hsweb-system/hsweb-system-organizational/hsweb-system-organizational-entity/src/main/java/org/hswebframework/web/entity/organizational/OrganizationalEntity.java

@@ -58,9 +58,9 @@ public interface OrganizationalEntity extends TreeSortSupportEntity<String> {
      */
     String sortIndex     = "sortIndex";
     /**
-     * 是否启用
+     * 状态
      */
-    String enabled       = "enabled";
+    String status       = "status";
     /**
      * 级别
      */
@@ -108,15 +108,9 @@ public interface OrganizationalEntity extends TreeSortSupportEntity<String> {
 
     void setChildren(List<OrganizationalEntity> children);
 
-    /**
-     * @return 是否启用
-     */
-    Boolean isEnabled();
+    Byte getStatus();
 
-    /**
-     * 设置 是否启用
-     */
-    void setEnabled(Boolean enabled);
+    void setStatus(Byte status);
 
 
 }

+ 13 - 18
hsweb-system/hsweb-system-organizational/hsweb-system-organizational-entity/src/main/java/org/hswebframework/web/entity/organizational/SimpleDepartmentEntity.java

@@ -27,15 +27,15 @@ import java.util.List;
  */
 public class SimpleDepartmentEntity extends SimpleTreeSortSupportEntity<String> implements DepartmentEntity {
     //名称
-    private String  name;
+    private String name;
     //所在组织id
-    private String  orgId;
+    private String orgId;
     //部门编码
-    private String  code;
+    private String code;
     //是否启用
-    private Boolean enabled;
+    private Byte   status;
 
-    private List<SimpleDepartmentEntity> children;
+    private List<DepartmentEntity> children;
 
     /**
      * @return 名称
@@ -79,28 +79,23 @@ public class SimpleDepartmentEntity extends SimpleTreeSortSupportEntity<String>
         this.code = code;
     }
 
-    /**
-     * @return 是否启用
-     */
-    public Boolean isEnabled() {
-        return this.enabled;
+    @Override
+    public Byte getStatus() {
+        return status;
     }
 
-    /**
-     * 设置 是否启用
-     */
-    public void setEnabled(Boolean enabled) {
-        this.enabled = enabled;
+    @Override
+    public void setStatus(Byte status) {
+        this.status = status;
     }
 
     @Override
     @SuppressWarnings("unchecked")
-    public List<SimpleDepartmentEntity> getChildren() {
+    public List<DepartmentEntity> getChildren() {
         return children;
     }
 
-    @SuppressWarnings("unchecked")
     public void setChildren(List<DepartmentEntity> children) {
-        this.children = (List) children;
+        this.children = children;
     }
 }

+ 14 - 18
hsweb-system/hsweb-system-organizational/hsweb-system-organizational-entity/src/main/java/org/hswebframework/web/entity/organizational/SimpleOrganizationalEntity.java

@@ -27,17 +27,17 @@ import java.util.List;
  */
 public class SimpleOrganizationalEntity extends SimpleTreeSortSupportEntity<String> implements OrganizationalEntity {
     //名称
-    private String                           name;
+    private String                     name;
     //全称
-    private String                           fullName;
+    private String                     fullName;
     //机构编码
-    private String                           code;
+    private String                     code;
     //可选角色
-    private java.util.List<String>           optionalRoles;
+    private java.util.List<String>     optionalRoles;
     //是否启用
-    private Boolean                          enabled;
+    private Byte                       status;
     //子级组织
-    private List<SimpleOrganizationalEntity> children;
+    private List<OrganizationalEntity> children;
 
     /**
      * @return 名称
@@ -97,25 +97,21 @@ public class SimpleOrganizationalEntity extends SimpleTreeSortSupportEntity<Stri
 
     @Override
     @SuppressWarnings("unchecked")
-    public List<SimpleOrganizationalEntity> getChildren() {
+    public List<OrganizationalEntity> getChildren() {
         return children;
     }
 
     public void setChildren(List<OrganizationalEntity> children) {
-        this.children = (List) children;
+        this.children = children;
     }
 
-    /**
-     * @return 是否启用
-     */
-    public Boolean isEnabled() {
-        return this.enabled;
+    @Override
+    public Byte getStatus() {
+        return status;
     }
 
-    /**
-     * 设置 是否启用
-     */
-    public void setEnabled(Boolean enabled) {
-        this.enabled = enabled;
+    @Override
+    public void setStatus(Byte status) {
+        this.status = status;
     }
 }

+ 3 - 4
hsweb-system/hsweb-system-organizational/hsweb-system-organizational-entity/src/main/java/org/hswebframework/web/entity/organizational/SimplePositionEntity.java

@@ -35,17 +35,16 @@ public class SimplePositionEntity extends SimpleTreeSortSupportEntity<String> im
     //备注
     private String       remark;
 
-    private List<SimplePositionEntity> children;
+    private List<PositionEntity> children;
 
     @Override
     @SuppressWarnings("unchecked")
-    public List<SimplePositionEntity> getChildren() {
+    public List<PositionEntity> getChildren() {
         return children;
     }
 
-    @SuppressWarnings("unchecked")
     public void setChildren(List<PositionEntity> children) {
-        this.children = (List) children;
+        this.children = children;
     }
 
     /**

+ 4 - 4
hsweb-system/hsweb-system-organizational/hsweb-system-organizational-starter/src/main/resources/hsweb-starter.js

@@ -45,7 +45,7 @@ function install(context) {
         .addColumn().name("parent_id").alias("parentId").comment("上级机构id").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit()
         .addColumn().name("path").alias("path").comment("树定位码").jdbcType(java.sql.JDBCType.VARCHAR).length(1024).commit()
         .addColumn().name("sort_index").alias("sortIndex").comment("树结构编码").jdbcType(java.sql.JDBCType.DECIMAL).length(32, 0).commit()
-        .addColumn().name("enabled").alias("enabled").comment("是否启用").jdbcType(java.sql.JDBCType.DECIMAL).length(32, 0).commit()
+        .addColumn().name("status").alias("status").comment("状态").jdbcType(java.sql.JDBCType.DECIMAL).length(32, 0).commit()
         .addColumn().name("level").alias("level").comment("级别").jdbcType(java.sql.JDBCType.DECIMAL).length(32, 0).commit()
         .comment("组织").commit();
 
@@ -57,7 +57,7 @@ function install(context) {
         .addColumn().name("parent_id").alias("parentId").comment("父级id").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit()
         .addColumn().name("path").alias("path").comment("树结构编码").jdbcType(java.sql.JDBCType.VARCHAR).length(3000).commit()
         .addColumn().name("sort_index").alias("sortIndex").comment("排序序号").jdbcType(java.sql.JDBCType.DECIMAL).length(32, 0).commit()
-        .addColumn().name("enabled").alias("enabled").comment("是否启用").jdbcType(java.sql.JDBCType.DECIMAL).length(32, 0).commit()
+        .addColumn().name("status").alias("status").comment("状态").jdbcType(java.sql.JDBCType.DECIMAL).length(32, 0).commit()
         .addColumn().name("level").alias("level").comment("级别").jdbcType(java.sql.JDBCType.DECIMAL).length(32, 0).commit()
         .comment("部门").commit();
 
@@ -76,12 +76,12 @@ function install(context) {
     database.createOrAlter("s_person")
         .addColumn().name("u_id").alias("id").comment("ID").jdbcType(java.sql.JDBCType.VARCHAR).length(32).primaryKey().commit()
         .addColumn().name("name").alias("name").comment("姓名").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit()
-        .addColumn().name("sex").alias("sex").comment("性别").jdbcType(java.sql.JDBCType.DECIMAL).length(4,0).commit()
+        .addColumn().name("sex").alias("sex").comment("性别").jdbcType(java.sql.JDBCType.DECIMAL).length(4, 0).commit()
         .addColumn().name("email").alias("email").comment("电子邮箱").jdbcType(java.sql.JDBCType.VARCHAR).length(128).commit()
         .addColumn().name("phone").alias("phone").comment("联系电话").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit()
         .addColumn().name("photo").alias("photo").comment("照片").jdbcType(java.sql.JDBCType.VARCHAR).length(128).commit()
         .addColumn().name("user_id").alias("userId").comment("关联用户id").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit()
-        .addColumn().name("status").alias("status").comment("状态").jdbcType(java.sql.JDBCType.DECIMAL).length(32,0).commit()
+        .addColumn().name("status").alias("status").comment("状态").jdbcType(java.sql.JDBCType.DECIMAL).length(32, 0).commit()
         .addColumn().name("remark").alias("remark").comment("备注").jdbcType(java.sql.JDBCType.VARCHAR).length(256).commit()
         .comment("人员").commit();
 

+ 0 - 1
hsweb-system/pom.xml

@@ -29,7 +29,6 @@
         <module>hsweb-system-history</module>
         <module>hsweb-system-dictionary</module>
         <module>hsweb-system-document</module>
-        <module>hsweb-system-menu</module>
         <module>hsweb-system-crawler</module>
         <module>hsweb-system-oauth2-server</module>
         <module>hsweb-system-oauth2-client</module>