Browse Source

3.0.0 RELEASE

zhouhao 6 năm trước cách đây
mục cha
commit
d0e6749057
100 tập tin đã thay đổi với 61 bổ sung2719 xóa
  1. 1 1
      hsweb-authorization/hsweb-authorization-api/pom.xml
  2. 1 1
      hsweb-authorization/hsweb-authorization-basic/pom.xml
  3. 1 1
      hsweb-authorization/hsweb-authorization-jwt/pom.xml
  4. 1 1
      hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/pom.xml
  5. 1 1
      hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-client/pom.xml
  6. 1 1
      hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-core/pom.xml
  7. 1 1
      hsweb-authorization/hsweb-authorization-oauth2/pom.xml
  8. 1 1
      hsweb-authorization/pom.xml
  9. 1 1
      hsweb-boost/hsweb-boost-aop/pom.xml
  10. 1 1
      hsweb-boost/hsweb-boost-excel/pom.xml
  11. 1 1
      hsweb-boost/hsweb-boost-ftp/pom.xml
  12. 1 1
      hsweb-boost/pom.xml
  13. 1 1
      hsweb-commons/hsweb-commons-bean/pom.xml
  14. 1 1
      hsweb-commons/hsweb-commons-controller/pom.xml
  15. 1 1
      hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-api/pom.xml
  16. 1 1
      hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/pom.xml
  17. 1 1
      hsweb-commons/hsweb-commons-dao/pom.xml
  18. 1 1
      hsweb-commons/hsweb-commons-entity/pom.xml
  19. 1 1
      hsweb-commons/hsweb-commons-model/pom.xml
  20. 1 1
      hsweb-commons/hsweb-commons-service/hsweb-commons-service-api/pom.xml
  21. 1 1
      hsweb-commons/hsweb-commons-service/hsweb-commons-service-oauth2/pom.xml
  22. 1 1
      hsweb-commons/hsweb-commons-service/hsweb-commons-service-simple/pom.xml
  23. 1 1
      hsweb-commons/hsweb-commons-service/pom.xml
  24. 1 1
      hsweb-commons/hsweb-commons-utils/pom.xml
  25. 1 1
      hsweb-commons/pom.xml
  26. 1 1
      hsweb-concurrent/hsweb-concurrent-async-job/pom.xml
  27. 1 1
      hsweb-concurrent/hsweb-concurrent-cache/pom.xml
  28. 1 1
      hsweb-concurrent/hsweb-concurrent-counter/hsweb-concurrent-counter-api/pom.xml
  29. 1 1
      hsweb-concurrent/hsweb-concurrent-counter/hsweb-concurrent-counter-redis/pom.xml
  30. 1 1
      hsweb-concurrent/hsweb-concurrent-counter/pom.xml
  31. 1 1
      hsweb-concurrent/hsweb-concurrent-lock/hsweb-concurrent-lock-api/pom.xml
  32. 1 1
      hsweb-concurrent/hsweb-concurrent-lock/hsweb-concurrent-lock-redis/pom.xml
  33. 1 1
      hsweb-concurrent/hsweb-concurrent-lock/hsweb-concurrent-lock-starter/pom.xml
  34. 1 1
      hsweb-concurrent/hsweb-concurrent-lock/pom.xml
  35. 1 1
      hsweb-concurrent/pom.xml
  36. 1 1
      hsweb-core/pom.xml
  37. 1 1
      hsweb-datasource/hsweb-datasource-api/pom.xml
  38. 1 1
      hsweb-datasource/hsweb-datasource-jta/pom.xml
  39. 1 1
      hsweb-datasource/hsweb-datasource-web/pom.xml
  40. 1 1
      hsweb-datasource/pom.xml
  41. 0 3
      hsweb-examples/README.md
  42. 0 235
      hsweb-examples/hsweb-examples-custom-entity/README.md
  43. 0 89
      hsweb-examples/hsweb-examples-custom-entity/pom.xml
  44. 0 18
      hsweb-examples/hsweb-examples-custom-entity/src/main/java/org/hswebframework/web/example/custom/Application.java
  45. 0 31
      hsweb-examples/hsweb-examples-custom-entity/src/main/java/org/hswebframework/web/example/custom/config/CustomEntityMappingCustomer.java
  46. 0 27
      hsweb-examples/hsweb-examples-custom-entity/src/main/java/org/hswebframework/web/example/custom/config/CustomMybatisMapperCustomer.java
  47. 0 40
      hsweb-examples/hsweb-examples-custom-entity/src/main/java/org/hswebframework/web/example/custom/entity/CustomOrganizationalEntity.java
  48. 0 22
      hsweb-examples/hsweb-examples-custom-entity/src/main/java/org/hswebframework/web/example/custom/entity/CustomUserEntity.java
  49. 0 1
      hsweb-examples/hsweb-examples-custom-entity/src/main/resources/META-INF/services/org.hswebframework.web.entity.organizational.OrganizationalEntity
  50. 0 27
      hsweb-examples/hsweb-examples-custom-entity/src/main/resources/application.yml
  51. 0 74
      hsweb-examples/hsweb-examples-custom-entity/src/main/resources/custom/mappers/OrganizationalMapper.xml
  52. 0 71
      hsweb-examples/hsweb-examples-custom-entity/src/main/resources/custom/mappers/UserMapper.xml
  53. 0 65
      hsweb-examples/hsweb-examples-custom-entity/src/main/resources/hsweb-starter.js
  54. 0 5
      hsweb-examples/hsweb-examples-oauth2/README.md
  55. 0 7
      hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-client/README.md
  56. 0 122
      hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-client/pom.xml
  57. 0 51
      hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-client/src/main/java/org/hswebframework/web/example/oauth2/IndexController.java
  58. 0 32
      hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-client/src/main/java/org/hswebframework/web/example/oauth2/MemoryAuthenticationManager.java
  59. 0 124
      hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-client/src/main/java/org/hswebframework/web/example/oauth2/OAuth2ClientApplication.java
  60. 0 82
      hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-client/src/main/java/org/hswebframework/web/example/oauth2/OAuth2SSOAuthorizingListener.java
  61. 0 68
      hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-client/src/main/java/org/hswebframework/web/example/oauth2/github/GithubResponseConvert.java
  62. 0 38
      hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-client/src/main/java/org/hswebframework/web/example/oauth2/github/GithubResponseJudge.java
  63. 0 73
      hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-client/src/main/java/org/hswebframework/web/example/oauth2/github/GithubSSOAuthorizingListener.java
  64. 0 19
      hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-client/src/main/resources/application.yml
  65. 0 54
      hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-client/src/main/resources/static/login.html
  66. 0 4
      hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-server/README.md
  67. 0 116
      hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-server/pom.xml
  68. 0 171
      hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-server/src/main/java/org/hswebframework/web/example/oauth2/OAuth2ServerApplication.java
  69. 0 16
      hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-server/src/main/resources/application.yml
  70. 0 139
      hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-server/src/main/resources/static/oauth2/login.html
  71. 0 49
      hsweb-examples/hsweb-examples-oauth2/pom.xml
  72. 0 19
      hsweb-examples/hsweb-examples-simple/README.md
  73. 0 191
      hsweb-examples/hsweb-examples-simple/pom.xml
  74. 0 314
      hsweb-examples/hsweb-examples-simple/src/main/java/org/hswebframework/web/example/simple/SpringBootExample.java
  75. 0 139
      hsweb-examples/hsweb-examples-simple/src/main/java/org/hswebframework/web/example/simple/TestController.java
  76. 0 27
      hsweb-examples/hsweb-examples-simple/src/main/java/org/hswebframework/web/example/simple/TestEntity.java
  77. 0 45
      hsweb-examples/hsweb-examples-simple/src/main/resources/application.yml
  78. 0 50
      hsweb-examples/pom.xml
  79. 1 1
      hsweb-logging/hsweb-access-logging-aop/pom.xml
  80. 1 1
      hsweb-logging/hsweb-access-logging-api/pom.xml
  81. 1 1
      hsweb-logging/pom.xml
  82. 1 1
      hsweb-message/hsweb-message-api/pom.xml
  83. 1 1
      hsweb-message/hsweb-message-jms/pom.xml
  84. 1 1
      hsweb-message/hsweb-message-redis/pom.xml
  85. 1 1
      hsweb-message/hsweb-message-websocket/pom.xml
  86. 1 1
      hsweb-message/pom.xml
  87. 1 1
      hsweb-starter/hsweb-spring-boot-starter/pom.xml
  88. 1 1
      hsweb-starter/pom.xml
  89. 1 1
      hsweb-system/hsweb-system-authorization/hsweb-system-authorization-api/pom.xml
  90. 1 1
      hsweb-system/hsweb-system-authorization/hsweb-system-authorization-local/pom.xml
  91. 1 1
      hsweb-system/hsweb-system-authorization/hsweb-system-authorization-starter/pom.xml
  92. 1 1
      hsweb-system/hsweb-system-authorization/hsweb-system-authorization-web/pom.xml
  93. 1 1
      hsweb-system/hsweb-system-authorization/pom.xml
  94. 1 1
      hsweb-system/hsweb-system-config/hsweb-system-config-api/pom.xml
  95. 1 1
      hsweb-system/hsweb-system-config/hsweb-system-config-local/pom.xml
  96. 1 1
      hsweb-system/hsweb-system-config/hsweb-system-config-starter/pom.xml
  97. 1 1
      hsweb-system/hsweb-system-config/hsweb-system-config-web/pom.xml
  98. 1 1
      hsweb-system/hsweb-system-config/pom.xml
  99. 1 1
      hsweb-system/hsweb-system-dashboard/hsweb-system-dashboard-api/pom.xml
  100. 0 0
      hsweb-system/hsweb-system-dashboard/hsweb-system-dashboard-local/pom.xml

+ 1 - 1
hsweb-authorization/hsweb-authorization-api/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-authorization</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-authorization/hsweb-authorization-basic/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-authorization</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-authorization/hsweb-authorization-jwt/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-authorization</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/pom.xml

@@ -23,7 +23,7 @@
     <parent>
         <artifactId>hsweb-authorization-oauth2</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-client/pom.xml

@@ -23,7 +23,7 @@
     <parent>
         <artifactId>hsweb-authorization-oauth2</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-core/pom.xml

@@ -23,7 +23,7 @@
     <parent>
         <artifactId>hsweb-authorization-oauth2</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
         <!--<relativePath>../../pom.xml</relativePath>-->
     </parent>
     <modelVersion>4.0.0</modelVersion>

+ 1 - 1
hsweb-authorization/hsweb-authorization-oauth2/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-authorization</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-authorization/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-framework</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-boost/hsweb-boost-aop/pom.xml

@@ -23,7 +23,7 @@
     <parent>
         <artifactId>hsweb-boost</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-boost/hsweb-boost-excel/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-boost</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-boost/hsweb-boost-ftp/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-boost</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-boost/pom.xml

@@ -23,7 +23,7 @@
     <parent>
         <artifactId>hsweb-framework</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-commons/hsweb-commons-bean/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-commons</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

+ 1 - 1
hsweb-commons/hsweb-commons-controller/pom.xml

@@ -23,7 +23,7 @@
     <parent>
         <artifactId>hsweb-commons</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

+ 1 - 1
hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-api/pom.xml

@@ -23,7 +23,7 @@
     <parent>
         <artifactId>hsweb-commons-dao</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

+ 1 - 1
hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/pom.xml

@@ -23,7 +23,7 @@
     <parent>
         <artifactId>hsweb-commons-dao</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

+ 1 - 1
hsweb-commons/hsweb-commons-dao/pom.xml

@@ -23,7 +23,7 @@
     <parent>
         <artifactId>hsweb-commons</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

+ 1 - 1
hsweb-commons/hsweb-commons-entity/pom.xml

@@ -23,7 +23,7 @@
     <parent>
         <artifactId>hsweb-commons</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-commons/hsweb-commons-model/pom.xml

@@ -23,7 +23,7 @@
     <parent>
         <artifactId>hsweb-commons</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-commons/hsweb-commons-service/hsweb-commons-service-api/pom.xml

@@ -23,7 +23,7 @@
     <parent>
         <artifactId>hsweb-commons-service</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

+ 1 - 1
hsweb-commons/hsweb-commons-service/hsweb-commons-service-oauth2/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-commons-service</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
 
         <relativePath>../pom.xml</relativePath>
     </parent>

+ 1 - 1
hsweb-commons/hsweb-commons-service/hsweb-commons-service-simple/pom.xml

@@ -23,7 +23,7 @@
     <parent>
         <artifactId>hsweb-commons-service</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
         <relativePath>../pom.xml</relativePath>
 
     </parent>

+ 1 - 1
hsweb-commons/hsweb-commons-service/pom.xml

@@ -23,7 +23,7 @@
     <parent>
         <artifactId>hsweb-commons</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
 
         <relativePath>../pom.xml</relativePath>
     </parent>

+ 1 - 1
hsweb-commons/hsweb-commons-utils/pom.xml

@@ -23,7 +23,7 @@
     <parent>
         <artifactId>hsweb-commons</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

+ 1 - 1
hsweb-commons/pom.xml

@@ -23,7 +23,7 @@
     <parent>
         <artifactId>hsweb-framework</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

+ 1 - 1
hsweb-concurrent/hsweb-concurrent-async-job/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-concurrent</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-concurrent/hsweb-concurrent-cache/pom.xml

@@ -22,7 +22,7 @@
     <parent>
         <artifactId>hsweb-concurrent</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-concurrent/hsweb-concurrent-counter/hsweb-concurrent-counter-api/pom.xml

@@ -22,7 +22,7 @@
     <parent>
         <artifactId>hsweb-concurrent-counter</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-concurrent/hsweb-concurrent-counter/hsweb-concurrent-counter-redis/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-concurrent-counter</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-concurrent/hsweb-concurrent-counter/pom.xml

@@ -22,7 +22,7 @@
     <parent>
         <artifactId>hsweb-concurrent</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-concurrent/hsweb-concurrent-lock/hsweb-concurrent-lock-api/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-concurrent-lock</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-concurrent/hsweb-concurrent-lock/hsweb-concurrent-lock-redis/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-concurrent-lock</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-concurrent/hsweb-concurrent-lock/hsweb-concurrent-lock-starter/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-concurrent-lock</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-concurrent/hsweb-concurrent-lock/pom.xml

@@ -22,7 +22,7 @@
     <parent>
         <artifactId>hsweb-concurrent</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-concurrent/pom.xml

@@ -22,7 +22,7 @@
     <parent>
         <artifactId>hsweb-framework</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-core/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-framework</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

+ 1 - 1
hsweb-datasource/hsweb-datasource-api/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-datasource</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
 
         <relativePath>../pom.xml</relativePath>
     </parent>

+ 1 - 1
hsweb-datasource/hsweb-datasource-jta/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-datasource</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
         <relativePath>../pom.xml</relativePath>
 
     </parent>

+ 1 - 1
hsweb-datasource/hsweb-datasource-web/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-datasource</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
 
         <relativePath>../pom.xml</relativePath>
     </parent>

+ 1 - 1
hsweb-datasource/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-framework</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
 
         <relativePath>../pom.xml</relativePath>
     </parent>

+ 0 - 3
hsweb-examples/README.md

@@ -1,3 +0,0 @@
-#系统演示模块
-
-1. [hsweb-examples-simple](hsweb-examples-simple)基本演示

+ 0 - 235
hsweb-examples/hsweb-examples-custom-entity/README.md

@@ -1,235 +0,0 @@
-# 拓展实体演示
-想拓展系统自带功能的实体?如添加字段.
-
-测试: 运行`org.hswebframework.web.example.custom.Application`
-
-提交数据:
-```bash
-curl -l -H "Content-type: application/json" \
--X POST -d '{"name":"旧的属性","nameEn":"拓展的属性"}' \
-http://localhost:8081/organizational
-```
-成功返回:
-```json
-{"result":"fd13ec65130d5ed66491a1e0453a3172","status":200,"timestamp":1497678000068}
-```
-
-获取数据:
-```bash
-curl http://localhost:8081/organizational/fd13ec65130d5ed66491a1e0453a3172
-```
-可以看到数据已经有新的字段
-# 实体类
-1. 编写实体类,继承需要拓展的实体,如:
-```java
-package org.hswebframework.web.example.custom.entity;
-
-import org.hswebframework.web.entity.organizational.SimpleOrganizationalEntity;
-
-public class CustomOrganizationalEntity extends SimpleOrganizationalEntity {
-    
-    /**********拓展字段**********/
-    private String leader;
-
-    private String nameEn;
-
-    private String otherProperty;
-
-    public String getLeader() {
-        return leader;
-    }
-
-    public void setLeader(String leader) {
-        this.leader = leader;
-    }
-
-    public String getNameEn() {
-        return nameEn;
-    }
-
-    public void setNameEn(String nameEn) {
-        this.nameEn = nameEn;
-    }
-
-    public String getOtherProperty() {
-        return otherProperty;
-    }
-
-    public void setOtherProperty(String otherProperty) {
-        this.otherProperty = otherProperty;
-    }
-}
-```
-
-2. 提供给hsweb
-将新的实体类提供给hsweb有3种方式,第一种:jdk的serviceLoader;第二种:application.yml配置;
-第三种:java类方式配置,选择其中一种即可.
-
-serviceLoader方式:
-
-创建文件:`META-INF/services/org.hswebframework.web.entity.organizational.OrganizationalEntity`
-内容:
-```text
-org.hswebframework.web.example.custom.entity.CustomOrganizationalEntity
-```
-
-application.yml
-```yaml
-hsweb: 
-   entity:
-     mappings:
-         -  source-base-package: org.hswebframework.web.entity.organizational
-            target-base-package: org.hswebframework.web.example.custom.entity
-            mapping:
-                OrganizationalEntity: CustomOrganizationalEntity
-```
-
-java类
-```java
-    package org.hswebframework.web.example.custom.config;
-    
-    import org.hswebframework.web.commons.entity.factory.MapperEntityFactory;
-    import org.hswebframework.web.entity.organizational.OrganizationalEntity;
-    import org.hswebframework.web.example.custom.entity.CustomOrganizationalEntity;
-    import org.hswebframework.web.starter.entity.EntityMappingCustomer;
-    import org.springframework.stereotype.Component;
-    
-    /**
-     * 自定义实体关系
-     *
-     * @author zhouhao
-     * @since 3.0
-     */
-    @Component
-    public class CustomEntityMappingCustomer implements EntityMappingCustomer {
-        @Override
-        public void customize(MapperEntityFactory entityFactory) {
-            //OrganizationalEntity使用CustomOrganizationalEntity实现
-            entityFactory.addMapping(OrganizationalEntity.class,
-                    MapperEntityFactory.defaultMapper(CustomOrganizationalEntity.class));
-        }
-    }
-
-```
-
-3. 编写新的mybatis mapper配置
-
-```xml
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper
-        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-        "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="org.hswebframework.web.dao.organizational.OrganizationalDao">
-     <!--修改type为新的实体类型-->
-    <resultMap id="OrganizationalResultMap" type="org.hswebframework.web.example.custom.entity.CustomOrganizationalEntity">
-        <id property="id" column="u_id" javaType="string" jdbcType="VARCHAR"/>
-        <result property="name" column="name" javaType="String" jdbcType="VARCHAR"/>
-        <result property="fullName" column="full_name" javaType="String" jdbcType="VARCHAR"/>
-        <result property="code" column="code" javaType="String" jdbcType="VARCHAR"/>
-        <result property="optionalRoles" column="optional_roles" javaType="java.util.List" jdbcType="CLOB"/>
-        <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="status" column="status" javaType="Byte" jdbcType="DECIMAL"/>
-        <result property="level" column="level" javaType="Integer" jdbcType="DECIMAL"/>
-        <!--拓展的属性-->
-        <result property="nameEn" column="name_en" javaType="String" jdbcType="VARCHAR"/>
-        <result property="leader" column="leader" javaType="String" jdbcType="VARCHAR"/>
-        <result property="otherProperty" column="other_property" javaType="String" jdbcType="VARCHAR"/>
-
-    </resultMap>
-
-    <!--用于动态生成sql所需的配置-->
-    <sql id="config">
-        <bind name="resultMapId" value="'OrganizationalResultMap'"/>
-        <bind name="tableName" value="'s_organization'"/>
-    </sql>
-    <!--修改parameterType为新的实体类型-->
-    <insert id="insert" parameterType="org.hswebframework.web.example.custom.entity.CustomOrganizationalEntity">
-        <include refid="config"/>
-        <include refid="BasicMapper.buildInsertSql"/>
-    </insert>
-
-    <delete id="deleteByPk" parameterType="String">
-        delete from s_organization where u_id =#{id}
-    </delete>
-
-    <delete id="delete" parameterType="org.hswebframework.web.commons.entity.Entity">
-        <include refid="config"/>
-        <include refid="BasicMapper.buildDeleteSql"/>
-    </delete>
-
-    <update id="update" parameterType="org.hswebframework.web.commons.entity.Entity">
-        <include refid="config"/>
-        <include refid="BasicMapper.buildUpdateSql"/>
-    </update>
-
-    <select id="query" parameterType="org.hswebframework.web.commons.entity.Entity" resultMap="OrganizationalResultMap">
-        <include refid="config"/>
-        <include refid="BasicMapper.buildSelectSql"/>
-    </select>
-
-    <select id="count" parameterType="org.hswebframework.web.commons.entity.Entity" resultType="int">
-        <include refid="config"/>
-        <include refid="BasicMapper.buildTotalSql"/>
-    </select>
-</mapper>
-```
-
-4. 覆盖mybatis mapper xml配置
-覆盖方式有2种: application.yml或者java类配置.选择其一即可.
-
-application.yml
-
-```yaml
-mybatis:
-  mapper-location-excludes: classpath*:org/hswebframework/**/OrganizationalMapper.xml
-  mapper-locations: classpath*:custom/mappers/OrganizationalMapper.xml
-```
-
-java class
-```java
-package org.hswebframework.web.example.custom.config;
-
-import org.hswebframework.web.dao.mybatis.MybatisMapperCustomer;
-import org.springframework.stereotype.Component;
-
-@Component
-public class CustomMybatisMapperCustomer implements MybatisMapperCustomer {
-    @Override
-    public String[] getExcludes() {
-        return new String[]{
-                "classpath*:org/hswebframework/**/OrganizationalMapper.xml"
-        };
-    }
-
-    @Override
-    public String[] getIncludes() {
-        return new String[]{
-                "classpath*:custom/mappers/OrganizationalMapper.xml"
-        };
-    }
-}
-```
-
-5. 使用jpa注解方式拓展字段
-
-依赖jpa-api:
-```xml
-<dependency>
-    <groupId>org.hibernate.javax.persistence</groupId>
-    <artifactId>hibernate-jpa-2.0-api</artifactId>
-    <version>1.0.1.Final</version>
-</dependency>
-```
-
-在拓展的实体类中使用jpa注解:
-```java
-    @Data
-    @Table //此处设置表名是无效的,仅作为一个解析标识
-    public class CustomUserEntity extends SimpleBindRoleUserEntity {
-        @Column(name = "nick_name")
-        private String nickName;
-    }
-```
-注意: 暂时只支持简单的属性。不支持表关联

+ 0 - 89
hsweb-examples/hsweb-examples-custom-entity/pom.xml

@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>hsweb-examples</artifactId>
-        <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>hsweb-examples-custom-entity</artifactId>
-
-    <build>
-        <resources>
-            <resource>
-                <directory>src/main/resources</directory>
-                <filtering>true</filtering>
-            </resource>
-        </resources>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-deploy-plugin</artifactId>
-                <version>2.8.2</version>
-                <configuration>
-                    <skip>true</skip>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-    <dependencies>
-        <dependency>
-            <groupId>org.codehaus.groovy</groupId>
-            <artifactId>groovy-all</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.h2database</groupId>
-            <artifactId>h2</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>druid</artifactId>
-            <version>1.0.26</version>
-        </dependency>
-        <dependency>
-            <groupId>ch.qos.logback</groupId>
-            <artifactId>logback-classic</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-jdbc</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-logging</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-spring-boot-starter</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <!--组织架构-->
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-system-organizational-starter</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-system-authorization-starter</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.hibernate.javax.persistence</groupId>
-            <artifactId>hibernate-jpa-2.0-api</artifactId>
-            <version>1.0.1.Final</version>
-        </dependency>
-    </dependencies>
-</project>

+ 0 - 18
hsweb-examples/hsweb-examples-custom-entity/src/main/java/org/hswebframework/web/example/custom/Application.java

@@ -1,18 +0,0 @@
-package org.hswebframework.web.example.custom;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-
-/**
- * @author zhouhao
- */
-@SpringBootApplication
-@Configuration
-@EnableAspectJAutoProxy
-public class Application {
-    public static void main(String[] args) {
-        SpringApplication.run(Application.class);
-    }
-}

+ 0 - 31
hsweb-examples/hsweb-examples-custom-entity/src/main/java/org/hswebframework/web/example/custom/config/CustomEntityMappingCustomer.java

@@ -1,31 +0,0 @@
-package org.hswebframework.web.example.custom.config;
-
-import org.hswebframework.web.commons.entity.factory.MapperEntityFactory;
-import org.hswebframework.web.entity.authorization.UserEntity;
-import org.hswebframework.web.entity.authorization.bind.BindRoleUserEntity;
-import org.hswebframework.web.entity.organizational.OrganizationalEntity;
-import org.hswebframework.web.example.custom.entity.CustomOrganizationalEntity;
-import org.hswebframework.web.example.custom.entity.CustomUserEntity;
-import org.hswebframework.web.starter.entity.EntityMappingCustomer;
-import org.springframework.stereotype.Component;
-
-/**
- * 自定义实体关系
- *
- * @author zhouhao
- * @since 3.0
- */
-@Component
-public class CustomEntityMappingCustomer implements EntityMappingCustomer {
-    @Override
-    public void customize(MapperEntityFactory entityFactory) {
-        entityFactory.addMapping(OrganizationalEntity.class,
-                MapperEntityFactory.defaultMapper(CustomOrganizationalEntity.class));
-
-        entityFactory.addMapping(UserEntity.class,
-                MapperEntityFactory.defaultMapper(CustomUserEntity.class));
-
-        entityFactory.addMapping(BindRoleUserEntity.class,
-                MapperEntityFactory.defaultMapper(CustomUserEntity.class));
-    }
-}

+ 0 - 27
hsweb-examples/hsweb-examples-custom-entity/src/main/java/org/hswebframework/web/example/custom/config/CustomMybatisMapperCustomer.java

@@ -1,27 +0,0 @@
-package org.hswebframework.web.example.custom.config;
-
-import org.hswebframework.web.dao.mybatis.MybatisMapperCustomer;
-import org.springframework.stereotype.Component;
-
-
-/**
- * 自定义mybatis xml
- *
- * @author zhouhao
- */
-@Component
-public class CustomMybatisMapperCustomer implements MybatisMapperCustomer {
-    @Override
-    public String[] getExcludes() {
-        return new String[]{
-                "classpath*:org/hswebframework/**/OrganizationalMapper.xml"
-        };
-    }
-
-    @Override
-    public String[] getIncludes() {
-        return new String[]{
-                "classpath*:custom/mappers/OrganizationalMapper.xml"
-        };
-    }
-}

+ 0 - 40
hsweb-examples/hsweb-examples-custom-entity/src/main/java/org/hswebframework/web/example/custom/entity/CustomOrganizationalEntity.java

@@ -1,40 +0,0 @@
-package org.hswebframework.web.example.custom.entity;
-
-import org.hswebframework.web.entity.organizational.SimpleOrganizationalEntity;
-
-/**
- * 自定义实体
- *
- * @author zhouhao
- */
-public class CustomOrganizationalEntity extends SimpleOrganizationalEntity {
-    private String leader;
-
-    private String nameEn;
-
-    private String otherProperty;
-
-    public String getLeader() {
-        return leader;
-    }
-
-    public void setLeader(String leader) {
-        this.leader = leader;
-    }
-
-    public String getNameEn() {
-        return nameEn;
-    }
-
-    public void setNameEn(String nameEn) {
-        this.nameEn = nameEn;
-    }
-
-    public String getOtherProperty() {
-        return otherProperty;
-    }
-
-    public void setOtherProperty(String otherProperty) {
-        this.otherProperty = otherProperty;
-    }
-}

+ 0 - 22
hsweb-examples/hsweb-examples-custom-entity/src/main/java/org/hswebframework/web/example/custom/entity/CustomUserEntity.java

@@ -1,22 +0,0 @@
-package org.hswebframework.web.example.custom.entity;
-
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import org.hswebframework.web.entity.authorization.bind.SimpleBindRoleUserEntity;
-
-import javax.persistence.Column;
-import javax.persistence.Table;
-
-/**
- * 使用jpa注解的方式来拓展字段信息
- *
- * @author zhouhao
- * @since 3.0
- */
-@EqualsAndHashCode(callSuper = true)
-@Data
-@Table
-public class CustomUserEntity extends SimpleBindRoleUserEntity {
-    @Column(name = "nick_name")
-    private String nickName;
-}

+ 0 - 1
hsweb-examples/hsweb-examples-custom-entity/src/main/resources/META-INF/services/org.hswebframework.web.entity.organizational.OrganizationalEntity

@@ -1 +0,0 @@
-org.hswebframework.web.example.custom.entity.CustomOrganizationalEntity

+ 0 - 27
hsweb-examples/hsweb-examples-custom-entity/src/main/resources/application.yml

@@ -1,27 +0,0 @@
-logging:
-    level:
-      org.hswebframework.web: debug
-spring:
-    aop:
-        auto: true
-        proxy-target-class: true
-    datasource:
-       url : jdbc:h2:mem:example
-       username : sa
-       password :
-       type: com.alibaba.druid.pool.DruidDataSource
-       driver-class-name : org.h2.Driver
-    cache:
-       type: simple
-hsweb:
-    app:
-      name: hsweb示例
-      version: 3.0.0
-#    entity:
-#      mappings:
-#         -  source-base-package: org.hswebframework.web.entity.organizational
-#            target-base-package: org.hswebframework.web.example.custom.entity
-#            mapping:
-#                OrganizationalEntity: CustomOrganizationalEntity
-server:
-  port: 8081

+ 0 - 74
hsweb-examples/hsweb-examples-custom-entity/src/main/resources/custom/mappers/OrganizationalMapper.xml

@@ -1,74 +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.
-  ~
-  -->
-<!DOCTYPE mapper
-        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-        "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="org.hswebframework.web.dao.organizational.OrganizationalDao">
-    <resultMap id="OrganizationalResultMap" type="org.hswebframework.web.example.custom.entity.CustomOrganizationalEntity">
-        <id property="id" column="u_id" javaType="string" jdbcType="VARCHAR"/>
-        <result property="name" column="name" javaType="String" jdbcType="VARCHAR"/>
-        <result property="fullName" column="full_name" javaType="String" jdbcType="VARCHAR"/>
-        <result property="code" column="code" javaType="String" jdbcType="VARCHAR"/>
-        <result property="optionalRoles" column="optional_roles" javaType="java.util.List" jdbcType="CLOB"/>
-        <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="status" column="status" javaType="Byte" jdbcType="DECIMAL"/>
-        <result property="level" column="level" javaType="Integer" jdbcType="DECIMAL"/>
-        <!--拓展的属性-->
-        <result property="nameEn" column="name_en" javaType="String" jdbcType="VARCHAR"/>
-        <result property="leader" column="leader" javaType="String" jdbcType="VARCHAR"/>
-        <result property="otherProperty" column="other_property" javaType="String" jdbcType="VARCHAR"/>
-
-    </resultMap>
-
-    <!--用于动态生成sql所需的配置-->
-    <sql id="config">
-        <bind name="resultMapId" value="'OrganizationalResultMap'"/>
-        <bind name="tableName" value="'s_organization'"/>
-    </sql>
-
-    <insert id="insert" parameterType="org.hswebframework.web.example.custom.entity.CustomOrganizationalEntity">
-        <include refid="config"/>
-        <include refid="BasicMapper.buildInsertSql"/>
-    </insert>
-
-    <delete id="deleteByPk" parameterType="String">
-        delete from s_organization where u_id =#{id}
-    </delete>
-
-    <delete id="delete" parameterType="org.hswebframework.web.commons.entity.Entity">
-        <include refid="config"/>
-        <include refid="BasicMapper.buildDeleteSql"/>
-    </delete>
-
-    <update id="update" parameterType="org.hswebframework.web.commons.entity.Entity">
-        <include refid="config"/>
-        <include refid="BasicMapper.buildUpdateSql"/>
-    </update>
-
-    <select id="query" parameterType="org.hswebframework.web.commons.entity.Entity" resultMap="OrganizationalResultMap">
-        <include refid="config"/>
-        <include refid="BasicMapper.buildSelectSql"/>
-    </select>
-
-    <select id="count" parameterType="org.hswebframework.web.commons.entity.Entity" resultType="int">
-        <include refid="config"/>
-        <include refid="BasicMapper.buildTotalSql"/>
-    </select>
-</mapper>

+ 0 - 71
hsweb-examples/hsweb-examples-custom-entity/src/main/resources/custom/mappers/UserMapper.xml

@@ -1,71 +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.
-  ~
-  -->
-
-<!DOCTYPE mapper
-        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-        "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
-
-<mapper namespace="UserDao">
-    <resultMap id="UserResultMap" type="UserEntity">
-        <id property="id" column="u_id" javaType="string" jdbcType="VARCHAR"/>
-        <result property="name" column="name" javaType="string" jdbcType="VARCHAR"/>
-        <result property="username" column="username" javaType="string" jdbcType="VARCHAR"/>
-        <result property="password" column="password" javaType="String" jdbcType="VARCHAR"/>
-        <result property="salt" column="salt" javaType="String" jdbcType="VARCHAR"/>
-        <result property="status" column="status" javaType="Byte" jdbcType="NUMERIC"/>
-        <result property="createTime" column="create_time" javaType="Long" jdbcType="NUMERIC"/>
-        <result property="creatorId" column="creator_id" javaType="String" jdbcType="VARCHAR"/>
-        <result property="nickName" column="nick_name" javaType="String" jdbcType="VARCHAR"/>
-        <result property="creatorId" column="creator_id" javaType="String" jdbcType="VARCHAR"/>
-    </resultMap>
-
-    <!--用于动态生成sql所需的配置-->
-    <sql id="config">
-        <bind name="resultMapId" value="'UserResultMap'"/>
-        <bind name="tableName" value="'s_user'"/>
-    </sql>
-
-    <insert id="insert" parameterType="UserEntity">
-        <include refid="config"/>
-        <include refid="BasicMapper.buildInsertSql"/>
-    </insert>
-
-    <delete id="deleteByPk" parameterType="String">
-        delete from s_user where u_id =#{id}
-    </delete>
-
-    <delete id="delete" parameterType="org.hswebframework.web.commons.entity.Entity">
-        <include refid="config"/>
-        <include refid="BasicMapper.buildDeleteSql"/>
-    </delete>
-
-    <update id="update" parameterType="org.hswebframework.web.commons.entity.Entity">
-        <include refid="config"/>
-        <include refid="BasicMapper.buildUpdateSql"/>
-    </update>
-
-    <select id="query" parameterType="org.hswebframework.web.commons.entity.Entity" resultMap="UserResultMap">
-        <include refid="config"/>
-        <include refid="BasicMapper.buildSelectSql"/>
-    </select>
-
-    <select id="count" parameterType="org.hswebframework.web.commons.entity.Entity" resultType="int">
-        <include refid="config"/>
-        <include refid="BasicMapper.buildTotalSql"/>
-    </select>
-</mapper>

+ 0 - 65
hsweb-examples/hsweb-examples-custom-entity/src/main/resources/hsweb-starter.js

@@ -1,65 +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-organizational",
-    author: "admin@hsweb.me",
-    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_organization")
-        .addColumn().name("u_id").alias("id").comment("ID").jdbcType(java.sql.JDBCType.VARCHAR).length(32).primaryKey().commit()
-        .addColumn().name("name_en").alias("nameEn").comment("名称(英文)").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit()
-        .addColumn().name("leader").alias("leader").comment("机构负责人").jdbcType(java.sql.JDBCType.VARCHAR).length(256).commit()
-        .addColumn().name("other_property").alias("otherProperty").comment("其他属性").jdbcType(java.sql.JDBCType.VARCHAR).length(32).commit()
-        .comment("组织机构表").commit();
-
-    database.createOrAlter("s_user")
-        .addColumn().name("u_id").alias("id").comment("ID").jdbcType(java.sql.JDBCType.VARCHAR).length(32).primaryKey().commit()
-        .addColumn().name("nick_name").alias("nickName").comment("昵称").jdbcType(java.sql.JDBCType.VARCHAR).length(32).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 - 5
hsweb-examples/hsweb-examples-oauth2/README.md

@@ -1,5 +0,0 @@
-# OAuth2.0 例子
-
-客户端:[hsweb-examples-oauth2-client](hsweb-examples-oauth2-client)
-
-服务端:[hsweb-examples-oauth2-server](hsweb-examples-oauth2-server)

+ 0 - 7
hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-client/README.md

@@ -1,7 +0,0 @@
-# hsweb OAuth2.0 客户端演示
-
-1. 运行`OAuth2ClientApplication.main`启动项目,启动前先保证[服务端](../hsweb-examples-oauth2-server)已启动
-2. 访问 `http://localhost:8808/login.html?redirect=/test` ,点击使用hsweb登录引导到服务端
-3. 登录成功后会自动跳转到 `http://localhost:8808/test`,显示`admin角色`相关数据则代表运行成功
-
-4. 试试使用github登录吧

+ 0 - 122
hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-client/pom.xml

@@ -1,122 +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-examples-oauth2</artifactId>
-        <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>hsweb-examples-oauth2-client</artifactId>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-deploy-plugin</artifactId>
-                <version>2.8.2</version>
-                <configuration>
-                    <skip>true</skip>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-                <version>${spring.boot.version}</version>
-                <configuration>
-                    <mainClass>org.hswebframework.web.example.oauth2.OAuth2ClientApplication</mainClass>
-                    <layout>ZIP</layout>
-                </configuration>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>repackage</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-    <dependencies>
-        <dependency>
-            <groupId>org.codehaus.groovy</groupId>
-            <artifactId>groovy-all</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.h2database</groupId>
-            <artifactId>h2</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>druid</artifactId>
-            <version>1.0.26</version>
-        </dependency>
-        <dependency>
-            <groupId>ch.qos.logback</groupId>
-            <artifactId>logback-classic</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-jdbc</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-logging</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-spring-boot-starter</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <!--<dependency>-->
-        <!--<groupId>org.hswebframework.web</groupId>-->
-        <!--<artifactId>hsweb-system-authorization-starter</artifactId>-->
-        <!--<version>${project.version}</version>-->
-        <!--</dependency>-->
-
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-authorization-basic</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-system-oauth2-client-starter</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-concurrent-cache</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-    </dependencies>
-</project>

+ 0 - 51
hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-client/src/main/java/org/hswebframework/web/example/oauth2/IndexController.java

@@ -1,51 +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.example.oauth2;
-
-import org.hswebframework.web.authorization.Authentication;
-import org.hswebframework.web.authorization.annotation.Authorize;
-import org.hswebframework.web.controller.message.ResponseMessage;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * @author zhouhao
- */
-@RestController
-@RequestMapping("/")
-public class IndexController {
-
-    @GetMapping
-    public ResponseMessage index(Authentication authentication) {
-        return ResponseMessage.ok(authentication);
-    }
-
-    @GetMapping("/test")
-    @Authorize(role = "admin")
-    public ResponseMessage auth(Authentication authentication) {
-        return ResponseMessage.ok(authentication);
-    }
-
-    @GetMapping("/test2")
-    @Authorize(role = "admin2")//此角色应该是不存在的
-    public ResponseMessage auth2() {
-        return ResponseMessage.ok("admin2角色");
-    }
-}

+ 0 - 32
hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-client/src/main/java/org/hswebframework/web/example/oauth2/MemoryAuthenticationManager.java

@@ -1,32 +0,0 @@
-package org.hswebframework.web.example.oauth2;
-
-import org.hswebframework.web.authorization.Authentication;
-import org.hswebframework.web.authorization.AuthenticationManager;
-import org.hswebframework.web.authorization.AuthenticationRequest;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class MemoryAuthenticationManager implements AuthenticationManager {
-    static Map<String, Authentication> users = new HashMap<>();
-
-    public static void addAuthentication(Authentication authentication) {
-        users.put(authentication.getUser().getId(), authentication);
-    }
-
-    @Override
-    public Authentication authenticate(AuthenticationRequest request) {
-        return null;
-    }
-
-    @Override
-    public Authentication getByUserId(String userId) {
-
-        return users.get(userId);
-    }
-
-    @Override
-    public Authentication sync(Authentication authentication) {
-        return authentication;
-    }
-}

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

@@ -1,124 +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.example.oauth2;
-
-import org.hswebframework.web.authorization.basic.configuration.EnableAopAuthorize;
-import org.hswebframework.web.authorization.basic.web.SessionIdUserTokenParser;
-import org.hswebframework.web.authorization.oauth2.client.OAuth2RequestService;
-import org.hswebframework.web.authorization.oauth2.client.OAuth2ServerConfig;
-import org.hswebframework.web.authorization.oauth2.client.simple.OAuth2ServerConfigRepository;
-import org.hswebframework.web.authorization.token.UserTokenManager;
-import org.hswebframework.web.commons.entity.DataStatus;
-import org.hswebframework.web.commons.entity.factory.EntityFactory;
-import org.hswebframework.web.example.oauth2.github.GithubResponseConvert;
-import org.hswebframework.web.example.oauth2.github.GithubResponseJudge;
-import org.hswebframework.web.example.oauth2.github.GithubSSOAuthorizingListener;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.CommandLineRunner;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.cache.annotation.EnableCaching;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-
-/**
- *
- * @author zhouhao
- */
-@SpringBootApplication
-@Configuration
-@EnableCaching
-@EnableAspectJAutoProxy
-@EnableAopAuthorize
-public class OAuth2ClientApplication implements CommandLineRunner {
-
-    public static void main(String[] args) {
-        SpringApplication.run(OAuth2ClientApplication.class);
-    }
-
-    @Bean
-    public GithubResponseConvert githubResponseConvert() {
-        return new GithubResponseConvert();
-    }
-
-    @Bean
-    public GithubResponseJudge githubResponseJudge() {
-        return new GithubResponseJudge();
-    }
-
-    @Bean
-    public MemoryAuthenticationManager memoryAuthenticationManager() {
-        return new MemoryAuthenticationManager();
-    }
-
-    @Autowired
-    EntityFactory entityFactory;
-    @Autowired
-    OAuth2ServerConfigRepository repository;
-    @Autowired
-    OAuth2RequestService oAuth2RequestService;
-
-    @Autowired
-    UserTokenManager userTokenManager;
-
-    @Override
-    public void run(String... strings) throws Exception {
-        //github
-        OAuth2ServerConfig github = OAuth2ServerConfig.builder()
-                .id("github")
-                .name("github test")
-                .clientId("b9cd11eae646a5a5c4bf")
-                .clientSecret("6b664ebfc051f5919589ccd20cc9e774b026f6f5")
-                .apiBaseUrl("https://api.github.com/")
-                .authUrl("https://github.com/login/oauth/authorize")
-                .accessTokenUrl("https://github.com/login/oauth/access_token")
-                .redirectUri("http://localhost:8808/")
-                .provider("github")
-                .status(DataStatus.STATUS_ENABLED)
-                .build();
-        repository.save(github);
-
-
-        OAuth2ServerConfig hsweb = OAuth2ServerConfig.builder()
-                .id("hsweb-oauth-server")
-                .name("hsweb OAuth2")
-                .clientId("hsweb_oauth2_example")
-                .clientSecret("hsweb_oauth2_example_secret")
-                .apiBaseUrl("http://localhost:8080/")
-                .authUrl("oauth2/login.html")
-                .accessTokenUrl("oauth2/token")
-                .redirectUri("http://localhost:8808/")
-                .provider("hsweb")
-                .status(DataStatus.STATUS_ENABLED)
-                .build();
-
-        repository.save(hsweb);
-
-
-        OAuth2SSOAuthorizingListener listener = new OAuth2SSOAuthorizingListener(oAuth2RequestService, hsweb.getId(), userTokenManager);
-
-        GithubSSOAuthorizingListener githubSSOAuthorizingListener = new GithubSSOAuthorizingListener(oAuth2RequestService, github.getId(), userTokenManager);
-
-        oAuth2RequestService.registerListener(hsweb.getId(), listener);
-        oAuth2RequestService.registerListener(github.getId(), githubSSOAuthorizingListener);
-    }
-
-
-}

+ 0 - 82
hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-client/src/main/java/org/hswebframework/web/example/oauth2/OAuth2SSOAuthorizingListener.java

@@ -1,82 +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.example.oauth2;
-
-import org.hswebframework.web.WebUtil;
-import org.hswebframework.web.authorization.Authentication;
-import org.hswebframework.web.authorization.oauth2.client.OAuth2RequestService;
-import org.hswebframework.web.authorization.oauth2.client.listener.OAuth2CodeAuthBeforeEvent;
-import org.hswebframework.web.authorization.oauth2.client.listener.OAuth2Listener;
-import org.hswebframework.web.authorization.oauth2.client.request.OAuth2Session;
-import org.hswebframework.web.authorization.oauth2.client.response.OAuth2Response;
-import org.hswebframework.web.authorization.token.UserTokenManager;
-
-import javax.servlet.http.HttpSession;
-
-/**
- * @author zhouhao
- */
-public class OAuth2SSOAuthorizingListener
-        implements OAuth2Listener<OAuth2CodeAuthBeforeEvent> {
-
-    private OAuth2RequestService oAuth2RequestService;
-
-    private UserTokenManager userTokenManager;
-
-
-    private String userCenterServerId;
-
-    private String userAuthInfoApi = "oauth2/user-auth-info";
-
-    public OAuth2SSOAuthorizingListener(OAuth2RequestService oAuth2RequestService, String userCenterServerId, UserTokenManager userTokenManager) {
-        this.oAuth2RequestService = oAuth2RequestService;
-        this.userCenterServerId = userCenterServerId;
-        this.userTokenManager = userTokenManager;
-    }
-
-    public void setUserAuthInfoApi(String userAuthInfoApi) {
-        this.userAuthInfoApi = userAuthInfoApi;
-    }
-
-    public void setUserCenterServerId(String userCenterServerId) {
-        this.userCenterServerId = userCenterServerId;
-    }
-
-    @Override
-    public void on(OAuth2CodeAuthBeforeEvent event) {
-        OAuth2Session session = oAuth2RequestService
-                .create(userCenterServerId)
-                .byAuthorizationCode(event.getCode())
-                .authorize();
-
-        Authentication authentication = session
-                .request(userAuthInfoApi)
-                .get().onError(OAuth2Response.throwOnError)
-                .as(Authentication.class);
-
-        //添加用户信息
-        MemoryAuthenticationManager.addAuthentication(authentication);
-
-        HttpSession httpSession = WebUtil.getHttpServletRequest().getSession();
-
-        userTokenManager.signIn(httpSession.getId(), "sessionId",authentication.getUser().getId(), 60 * 60 * 1000L);
-
-
-    }
-}

+ 0 - 68
hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-client/src/main/java/org/hswebframework/web/example/oauth2/github/GithubResponseConvert.java

@@ -1,68 +0,0 @@
-package org.hswebframework.web.example.oauth2.github;
-
-import com.alibaba.fastjson.JSON;
-import lombok.extern.slf4j.Slf4j;
-import org.hswebframework.web.WebUtil;
-import org.hswebframework.web.authorization.oauth2.client.AccessTokenInfo;
-import org.hswebframework.web.authorization.oauth2.client.request.definition.ResponseConvertForProviderDefinition;
-import org.hswebframework.web.authorization.oauth2.client.response.OAuth2Response;
-
-import java.util.List;
-import java.util.Map;
-
-@Slf4j
-public class GithubResponseConvert implements ResponseConvertForProviderDefinition {
-    @Override
-    public String getProvider() {
-        return "github";
-    }
-
-    @Override
-    public <T> T convert(OAuth2Response response, Class<T> type) {
-        String result = response.asString();
-
-        if (result.startsWith("{")) {
-            return JSON.parseObject(result, type);
-        }
-        if (result.startsWith("[")) {
-            throw new UnsupportedOperationException("response is json array,you should call convertList method !");
-        }
-        Map<String, String> responseMap = WebUtil.queryStringToMap(result, "utf-8");
-        if (type == Map.class) {
-            return ((T) responseMap);
-        }
-        if (AccessTokenInfo.class.isAssignableFrom(type)) {
-            AccessTokenInfo info;
-            if(type!=AccessTokenInfo.class) {
-                try {
-                    info = ((AccessTokenInfo) type.newInstance());
-                } catch (Exception e) {
-                    log.warn("can not new instance {} use default AccessTokenInfo", type, e);
-                    info = new AccessTokenInfo();
-                }
-            }else{
-                info = new AccessTokenInfo();
-            }
-            info.setAccessToken(responseMap.get("access_token"));
-            info.setScope(responseMap.get("scope"));
-            info.setTokenType(responseMap.get("token_type"));
-            info.setExpiresIn(-1);
-            return ((T) info);
-        }
-        return null;
-    }
-
-    @Override
-    public <T> List<T> convertList(OAuth2Response response, Class<T> type) {
-        String result = response.asString();
-
-        if (result.startsWith("{")) {
-            throw new UnsupportedOperationException("response is json array,you should call convertList method !");
-        }
-        if (result.startsWith("[")) {
-            return JSON.parseArray(result, type);
-        }
-        throw new UnsupportedOperationException("response format is not support yet,you can call response.as(ResponseConvert) method!");
-
-    }
-}

+ 0 - 38
hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-client/src/main/java/org/hswebframework/web/example/oauth2/github/GithubResponseJudge.java

@@ -1,38 +0,0 @@
-package org.hswebframework.web.example.oauth2.github;
-
-import com.alibaba.fastjson.JSON;
-import org.hswebframework.web.WebUtil;
-import org.hswebframework.web.authorization.oauth2.client.exception.OAuth2RequestException;
-import org.hswebframework.web.authorization.oauth2.client.request.definition.ResponseJudgeForProviderDefinition;
-import org.hswebframework.web.authorization.oauth2.client.response.OAuth2Response;
-import org.hswebframework.web.oauth2.core.ErrorType;
-
-import java.util.Map;
-
-public class GithubResponseJudge implements ResponseJudgeForProviderDefinition {
-    @Override
-    public String getProvider() {
-        return "github";
-    }
-
-    @Override
-    @SuppressWarnings("all")
-    public ErrorType judge(OAuth2Response response) {
-
-        String res= response.asString();
-        Map<String,Object> responseMap ;
-        if(res.startsWith("{")){
-            responseMap= JSON.parseObject(res);
-        }else{
-            responseMap= (Map) WebUtil.queryStringToMap(res,"utf-8");
-        }
-        if(response.status()==401){
-            throw new OAuth2RequestException(String.valueOf(responseMap.get("message")),ErrorType.UNAUTHORIZED_CLIENT,response);
-        }
-        if(responseMap.get("error")!=null){
-            throw new OAuth2RequestException(String.valueOf(responseMap.get("error_description")),ErrorType.EXPIRED_CODE,response);
-
-        }
-        return null;
-    }
-}

+ 0 - 73
hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-client/src/main/java/org/hswebframework/web/example/oauth2/github/GithubSSOAuthorizingListener.java

@@ -1,73 +0,0 @@
-package org.hswebframework.web.example.oauth2.github;
-
-import org.hswebframework.web.WebUtil;
-import org.hswebframework.web.authorization.Authentication;
-import org.hswebframework.web.authorization.basic.web.UserTokenGenerator;
-import org.hswebframework.web.authorization.oauth2.client.OAuth2RequestService;
-import org.hswebframework.web.authorization.oauth2.client.listener.OAuth2CodeAuthBeforeEvent;
-import org.hswebframework.web.authorization.oauth2.client.listener.OAuth2Listener;
-import org.hswebframework.web.authorization.simple.SimplePermission;
-import org.hswebframework.web.authorization.simple.SimpleRole;
-import org.hswebframework.web.authorization.simple.SimpleUser;
-import org.hswebframework.web.authorization.simple.builder.SimpleAuthenticationBuilder;
-import org.hswebframework.web.authorization.simple.builder.SimpleDataAccessConfigBuilderFactory;
-import org.hswebframework.web.authorization.token.UserTokenManager;
-import org.hswebframework.web.example.oauth2.MemoryAuthenticationManager;
-
-import javax.servlet.http.HttpSession;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Map;
-
-public class GithubSSOAuthorizingListener
-        implements OAuth2Listener<OAuth2CodeAuthBeforeEvent> {
-
-
-    private OAuth2RequestService oAuth2RequestService;
-
-    private UserTokenManager userTokenManager;
-
-    private String userCenterServerId;
-
-    private String userAuthInfoApi = "/user";
-
-    public GithubSSOAuthorizingListener(OAuth2RequestService oAuth2RequestService, String userCenterServerId, UserTokenManager userTokenManager) {
-        this.oAuth2RequestService = oAuth2RequestService;
-        this.userCenterServerId = userCenterServerId;
-        this.userTokenManager = userTokenManager;
-    }
-
-    @Override
-    @SuppressWarnings("all")
-    public void on(OAuth2CodeAuthBeforeEvent event) {
-        String code = event.getCode();
-
-        Map<String, Object> userInfo = oAuth2RequestService
-                .create(userCenterServerId)
-                .byAuthorizationCode(code)
-                .authorize()
-                .request(userAuthInfoApi)
-                .get()
-                .as(Map.class);
-
-        String name = String.valueOf(userInfo.get("name"));
-        String id = String.valueOf(userInfo.get("id"));
-        String login = String.valueOf(userInfo.get("login"));
-
-        Authentication authentication = new SimpleAuthenticationBuilder(new SimpleDataAccessConfigBuilderFactory())
-                .user(SimpleUser.builder().username(login).name(name)
-                        .type("github").id("github-user:" + id).build())
-                .role(Arrays.asList(SimpleRole.builder().id("admin").name("github用户").build()))
-                .permission(Arrays.asList(SimplePermission.builder().id("user-info").actions(new HashSet<>(Arrays.asList("get"))).build()))
-                .attributes((Map) userInfo)
-                .build();
-
-        MemoryAuthenticationManager.addAuthentication(authentication);
-
-        HttpSession session = WebUtil.getHttpServletRequest().getSession();
-
-        userTokenManager.signIn(session.getId(), UserTokenGenerator.TOKEN_TYPE_SESSION_ID, authentication.getUser().getId(), -1);
-
-
-    }
-}

+ 0 - 19
hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-client/src/main/resources/application.yml

@@ -1,19 +0,0 @@
-
-spring:
-    aop:
-        auto: true
-        proxy-target-class: true
-    datasource:
-       url : jdbc:h2:mem:example-oauth2-client
-       username : sa
-       password :
-       type: com.alibaba.druid.pool.DruidDataSource
-       driver-class-name : org.h2.Driver
-    cache:
-       type: simple
-hsweb:
-    app:
-      name: hsweb-oauth2 客户端示例
-      version: 3.0.0
-server:
-  port: 8808

+ 0 - 54
hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-client/src/main/resources/static/login.html

@@ -1,54 +0,0 @@
-<!DOCTYPE html>
-<!--
-  ~  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.
-  ~
-  ~
-  -->
-
-<html lang="zh-cn">
-<head>
-    <meta charset="UTF-8">
-    <meta http-equiv=Content-Type content="text/html;charset=utf-8">
-    <title>登录</title>
-    <script type="application/javascript" src="//cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
-
-</head>
-<body style="text-align: center">
-<button onclick="doOAuth2Login('hsweb-oauth-server')">使用hsweb登录</button>&nbsp;&nbsp;
-<button onclick="doOAuth2Login('github')">使用github登录</button>
-</body>
-</html>
-<script type="text/javascript">
-
-    function doOAuth2Login(provider) {
-        var uri = getRequest()["redirect"];
-        if (!uri) uri = "/";
-        window.open('/oauth2/boot/' + provider + '?redirect=' + uri);
-    }
-
-    function getRequest() {
-        var url = location.search; //获取url中"?"符后的字串
-        var theRequest = new Object();
-        if (url.indexOf("?") != -1) {
-            var str = url.substr(1);
-            strs = str.split("&");
-            for (var i = 0; i < strs.length; i++) {
-                theRequest[strs[i].split("=")[0]] = unescape((strs[i].split("=")[1]));
-            }
-        }
-        return theRequest;
-    }
-
-</script>

+ 0 - 4
hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-server/README.md

@@ -1,4 +0,0 @@
-# hsweb OAuth2.0 服务端演示
-
-1. 运行 `OAuth2ServerApplication.main` 启动项目
-2. 试试运行[客户端](../hsweb-examples-oauth2-client)

+ 0 - 116
hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-server/pom.xml

@@ -1,116 +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-examples-oauth2</artifactId>
-        <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>hsweb-examples-oauth2-server</artifactId>
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-deploy-plugin</artifactId>
-                <version>2.8.2</version>
-                <configuration>
-                    <skip>true</skip>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-                <version>${spring.boot.version}</version>
-                <configuration>
-                    <mainClass>org.hswebframework.web.example.oauth2.org.hswebframework.web.example.oauth2.OAuth2ServerApplication</mainClass>
-                    <layout>ZIP</layout>
-                </configuration>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>repackage</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-    <dependencies>
-        <dependency>
-            <groupId>org.codehaus.groovy</groupId>
-            <artifactId>groovy-all</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.h2database</groupId>
-            <artifactId>h2</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>druid</artifactId>
-            <version>1.0.26</version>
-        </dependency>
-        <dependency>
-            <groupId>ch.qos.logback</groupId>
-            <artifactId>logback-classic</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-jdbc</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-logging</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-spring-boot-starter</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-system-authorization-starter</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-authorization-basic</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-system-oauth2-server-starter</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-
-    </dependencies>
-</project>

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

@@ -1,171 +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.example.oauth2;
-
-import com.alibaba.fastjson.JSON;
-import org.hswebframework.web.authorization.Permission;
-import org.hswebframework.web.authorization.access.DataAccessConfig;
-import org.hswebframework.web.entity.oauth2.server.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.oauth2.server.OAuth2ClientDao;
-import org.hswebframework.web.entity.authorization.*;
-import org.hswebframework.web.entity.authorization.bind.BindRoleUserEntity;
-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;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.CommandLineRunner;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.cache.annotation.EnableCaching;
-import org.springframework.context.annotation.Configuration;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashSet;
-
-
-/**
- * TODO 完成注释
- *
- * @author zhouhao
- */
-@SpringBootApplication
-@Configuration
-@EnableCaching
-public class OAuth2ServerApplication implements CommandLineRunner {
-
-    public static void main(String[] args) {
-        SpringApplication.run(OAuth2ServerApplication.class);
-    }
-
-
-    @Autowired
-    UserService       userService;
-    @Autowired
-    RoleService       roleService;
-    @Autowired
-    PermissionService permissionService;
-    @Autowired
-    EntityFactory     entityFactory;
-    @Autowired
-    OAuth2ClientDao   oAuth2ClientDao;
-
-    @Autowired
-    AuthorizationSettingService authorizationSettingService;
-
-    @Override
-    public void run(String... strings) throws Exception {
-        //添加示例数据,实际项目应该在前端进行维护
-        /*
-           ---------------------------------------------
-           ------------------添加权限信息----------------
-           -------------用户名: admin,密码: admin--------
-           -------------角色: admin----------------------
-           -------------权限: admin----------------------
-         */
-        //只能查询自己创建的数据
-        DataAccessEntity accessEntity = new DataAccessEntity();
-        accessEntity.setType(DataAccessConfig.DefaultType.OWN_CREATED);
-        accessEntity.setAction(Permission.ACTION_QUERY);
-
-        //只能修改自己创建的数据
-        DataAccessEntity updateAccessEntity = new DataAccessEntity();
-        updateAccessEntity.setType(DataAccessConfig.DefaultType.OWN_CREATED);
-        updateAccessEntity.setAction(Permission.ACTION_UPDATE);
-
-        DataAccessEntity denyFields = new DataAccessEntity();
-        denyFields.setType(DataAccessConfig.DefaultType.DENY_FIELDS);
-        denyFields.setAction(Permission.ACTION_UPDATE);
-        denyFields.setConfig(JSON.toJSONString(new SimpleFieldFilterDataAccessConfig("password")));
-
-        //脚本方式自定义控制
-//        updateAccessEntity.setConfig(JSON.toJSONString(new SimpleScriptDataAccess("" +
-//                "println(id);" +
-//                "println(entity);" +
-//                "println('脚本权限控制');" +
-//                "return true;" +
-//                "","groovy")));
-
-
-        PermissionEntity permission = entityFactory.newInstance(PermissionEntity.class);
-        permission.setName("测试");
-        permission.setId("test");
-        permission.setStatus((byte) 1);
-        permission.setActions(ActionEntity.create(Permission.ACTION_QUERY, Permission.ACTION_UPDATE));
-        permissionService.insert(permission);
-
-        RoleEntity roleEntity = entityFactory.newInstance(RoleEntity.class);
-        roleEntity.setId("admin");
-        roleEntity.setName("test");
-        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));
-
-        settingEntity.setDetails(Arrays.asList(detailEntity));
-
-        authorizationSettingService.insert(settingEntity);
-
-        BindRoleUserEntity userEntity = entityFactory.newInstance(BindRoleUserEntity.class);
-        userEntity.setId("admin");
-        userEntity.setName("admin");
-        userEntity.setCreateTimeNow();
-        userEntity.setCreatorId("admin");
-        userEntity.setUsername("admin");
-        userEntity.setPassword("admin");
-        userEntity.setRoles(Arrays.asList("admin"));
-        userService.insert(userEntity);
-
-        /*
-            ------------------------添加OAuth2客户端---------------------
-            ------------------client_id:hsweb_oauth2_example------------
-            ------------------client_secret:hsweb_oauth2_example_secret--
-         */
-        OAuth2ClientEntity clientEntity = entityFactory.newInstance(OAuth2ClientEntity.class);
-
-        clientEntity.setId("hsweb_oauth2_example");
-        clientEntity.setSecret("hsweb_oauth2_example_secret");
-        clientEntity.setOwnerId("admin");
-        clientEntity.setName("测试");
-        clientEntity.setType("test");
-        clientEntity.setCreatorId("admin");
-        clientEntity.setRedirectUri("http://localhost:8808/");
-        clientEntity.setCreateTime(System.currentTimeMillis());
-        clientEntity.setSupportGrantTypes(new HashSet<>(Collections.singletonList("*")));
-        clientEntity.setStatus(DataStatus.STATUS_ENABLED);
-        oAuth2ClientDao.insert(clientEntity);
-    }
-
-}

+ 0 - 16
hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-server/src/main/resources/application.yml

@@ -1,16 +0,0 @@
-spring:
-    aop:
-        auto: true
-        proxy-target-class: true
-    datasource:
-       url : jdbc:h2:mem:example-oauth2
-       username : sa
-       password :
-       type: com.alibaba.druid.pool.DruidDataSource
-       driver-class-name : org.h2.Driver
-    cache:
-       type: simple
-hsweb:
-    app:
-      name: hsweb-oauth2示例
-      version: 3.0.0

+ 0 - 139
hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-server/src/main/resources/static/oauth2/login.html

@@ -1,139 +0,0 @@
-<!DOCTYPE html>
-<!--
-  ~  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.
-  ~
-  ~
-  -->
-
-<html lang="zh-cn">
-<head>
-    <meta charset="UTF-8">
-    <meta http-equiv=Content-Type content="text/html;charset=utf-8">
-    <title>OAuth2授权页面</title>
-    <script type="application/javascript" src="//cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
-    <link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
-    <script src="//cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
-    <style type="text/css">
-        .login,.isLogin {
-            width: 500px;
-            margin: auto;
-        }
-    </style>
-</head>
-<body>
-<div class="login">
-    <h2 align="center">用户登录</h2>
-    <div class="input-group">
-        <span class="input-group-addon" id="basic-addon1">用户名</span>
-        <input type="text" id="username" class="form-control" placeholder="username" aria-describedby="basic-addon1">
-    </div>
-    <br>
-    <div class="input-group">
-        <span class="input-group-addon">密<span style="margin-left: 1em"></span>码</span>
-        <input type="password" id="password" class="form-control" placeholder="password" aria-describedby="basic-addon1">
-    </div>
-
-    <div style="width: 100px;margin: 10px auto auto;">
-        <button type="button" onclick="doLogin()" class="btn btn-default">登录</button>
-    </div>
-</div>
-<div class="isLogin">
-    当前已登录: <span class="login-username"></span>
-    <button type="button" onclick="doAuth()" class="btn btn-default">授权</button>
-    <button type="button" onclick="changeUser()" class="btn btn-default">更换用户</button>
-</div>
-</body>
-</html>
-<script type="text/javascript">
-    function getParam(name) {
-        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
-        var r = window.location.search.substr(1).match(reg);
-        if (r != null) return unescape(r[2]);
-        return null;
-    }
-
-    init();
-    function init() {
-        $(".login").hide();
-        $(".isLogin").hide();
-        doAjax("GET", "/authorize/me", {}, function (d) {
-            $(".login-username").text(d.result.user.username);
-            $(".isLogin").show();
-        }, function (e) {
-            $(".login").show();
-        })
-    }
-    function changeUser() {
-        $(".login").show();
-        $(".isLogin").hide();
-    }
-
-    function doLogin() {
-        var username = $("#username").val();
-        var password = $("#password").val();
-        if ($.trim(username) == "") {
-            $("#username").focus();
-            return;
-        }
-        if ($.trim(password) == "") {
-            $("#password").focus();
-            return;
-        }
-        doAjax("POST", "/authorize/login", {username: username, password: password}, function (e, r) {
-            doAuth();
-        }, function (e) {
-            alert(e.message)
-        })
-    }
-    function doAuth() {
-        var param = getRequest();
-        param.scope = "public";
-        //执行OAuth认证
-        doAjax("GET", "/oauth2/authorize", param, function (e, r) {
-            var redirect =e.redirectUri;
-            var uri = redirect.indexOf("?") != -1 ? "&" : "?";
-            uri += "code=" + e.code + "&state=" + e.state;
-            window.location.href = (redirect + uri);
-        }, function (e) {
-            alert(e.message);
-        })
-    }
-
-    function getRequest() {
-        var url = location.search; //获取url中"?"符后的字串
-        var theRequest = new Object();
-        if (url.indexOf("?") != -1) {
-            var str = url.substr(1);
-            strs = str.split("&");
-            for (var i = 0; i < strs.length; i++) {
-                theRequest[strs[i].split("=")[0]] = unescape((strs[i].split("=")[1]));
-            }
-        }
-        return theRequest;
-    }
-
-    function doAjax(method, url, data, success, error) {
-        $.ajax({
-            type: method,
-            url: url,
-            data: data,
-            success: success,
-            error: function (e) {
-                error(e.responseJSON);
-            },
-            dataType: "json"
-        });
-    }
-</script>

+ 0 - 49
hsweb-examples/hsweb-examples-oauth2/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-examples</artifactId>
-        <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>hsweb-examples-oauth2</artifactId>
-    <packaging>pom</packaging>
-    <modules>
-        <module>hsweb-examples-oauth2-server</module>
-        <module>hsweb-examples-oauth2-client</module>
-    </modules>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-deploy-plugin</artifactId>
-                <version>2.8.2</version>
-                <configuration>
-                    <skip>true</skip>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-</project>

+ 0 - 19
hsweb-examples/hsweb-examples-simple/README.md

@@ -1,19 +0,0 @@
-# 演示
-简单示例,无页面
-
-## 运行
-
-1. IDE
-导入项目后,运行: `org.hswebframework.web.example.simple.SpringBootExample.main`
-
-2. maven
-先安装 `hsweb-framework`
-```bash
- /hsweb-framework $ mvn install
- /hsweb-framework $ cd hsweb-examples/hsweb-examples-simple
- /hsweb-examples-simple $ mvn spring-boot:run
-  
-```
-
-## 测试
-打开页面: `http://localhost:8081/swagger-ui.html`

+ 0 - 191
hsweb-examples/hsweb-examples-simple/pom.xml

@@ -1,191 +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-examples</artifactId>
-        <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>hsweb-examples-simple</artifactId>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-deploy-plugin</artifactId>
-                <version>2.8.2</version>
-                <configuration>
-                    <skip>true</skip>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-                <version>${spring.boot.version}</version>
-                <configuration>
-                    <mainClass>org.hswebframework.web.example.simple.SpringBootExample</mainClass>
-                    <layout>ZIP</layout>
-                </configuration>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>repackage</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-    <dependencies>
-        <dependency>
-            <groupId>org.codehaus.groovy</groupId>
-            <artifactId>groovy-all</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.h2database</groupId>
-            <artifactId>h2</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>druid</artifactId>
-            <version>1.0.26</version>
-        </dependency>
-        <dependency>
-            <groupId>ch.qos.logback</groupId>
-            <artifactId>logback-classic</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-access-logging-aop</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-jdbc</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-logging</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-spring-boot-starter</artifactId>
-            <version>${project.version}</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.springframework.boot</groupId>
-                    <artifactId>spring-boot-starter-tomcat</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-concurrent-cache</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-undertow</artifactId>
-        </dependency>
-        <!--权限管理-->
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-system-authorization-starter</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <!--使用基础权限控制-->
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-authorization-basic</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-authorization-jwt</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-system-dictionary-starter</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <!--组织架构-->
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-system-organizational-starter</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-system-file-starter</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-system-schedule-starter</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <!--动态表单-->
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-system-dynamic-form-starter</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-system-oauth2-client-starter</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.hswebframework.web</groupId>
-            <artifactId>hsweb-system-oauth2-server-starter</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-configuration-processor</artifactId>
-            <optional>true</optional>
-        </dependency>
-
-        <dependency>
-            <groupId>io.springfox</groupId>
-            <artifactId>springfox-swagger2</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>io.springfox</groupId>
-            <artifactId>springfox-swagger-ui</artifactId>
-        </dependency>
-    </dependencies>
-</project>

+ 0 - 314
hsweb-examples/hsweb-examples-simple/src/main/java/org/hswebframework/web/example/simple/SpringBootExample.java

@@ -1,314 +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.example.simple;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.serializer.SerializerFeature;
-import org.hswebframework.web.authorization.Authentication;
-import org.hswebframework.web.authorization.Permission;
-import org.hswebframework.web.authorization.access.DataAccessConfig;
-import org.hswebframework.web.authorization.basic.configuration.EnableAopAuthorize;
-import org.hswebframework.web.authorization.define.AuthorizeDefinitionInitializedEvent;
-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.entity.authorization.*;
-import org.hswebframework.web.entity.authorization.bind.BindRoleUserEntity;
-import org.hswebframework.web.entity.organizational.*;
-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;
-import org.hswebframework.web.service.organizational.*;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.CommandLineRunner;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.cache.annotation.EnableCaching;
-import org.springframework.context.ApplicationListener;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.web.multipart.MultipartFile;
-import springfox.documentation.builders.ApiInfoBuilder;
-import springfox.documentation.builders.PathSelectors;
-import springfox.documentation.builders.RequestHandlerSelectors;
-import springfox.documentation.service.ApiInfo;
-import springfox.documentation.spi.DocumentationType;
-import springfox.documentation.spring.web.plugins.Docket;
-import springfox.documentation.swagger2.annotations.EnableSwagger2;
-
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.stream.Stream;
-
-/**
- * TODO 完成注释
- *
- * @author zhouhao
- */
-@SpringBootApplication
-@Configuration
-@EnableSwagger2
-@EnableCaching
-@EnableAspectJAutoProxy
-@EnableAccessLogger
-@EnableAopAuthorize
-public class SpringBootExample
-        implements CommandLineRunner ,ApplicationListener<AuthorizeDefinitionInitializedEvent>{
-
-//    @Bean
-//    public AopMethodAuthorizeDefinitionCustomizerParser customizerParser(){
-//        //自定义权限声明
-//        //所有控制都通过
-//        return (type,method,context) -> EmptyAuthorizeDefinition.instance;
-//    }
-
-    @Bean
-    public AccessLoggerListener accessLoggerListener() {
-        Class excludes[] = {
-                ServletRequest.class,
-                ServletResponse.class,
-                InputStream.class,
-                OutputStream.class,
-                MultipartFile.class,
-                MultipartFile[].class
-        };
-        return loggerInfo -> {
-            Map<String, Object> loggerMap = loggerInfo.toSimpleMap(obj -> {
-                if (Stream.of(excludes).anyMatch(aClass -> aClass.isInstance(obj))) {
-                    return obj.getClass().getName();
-                }
-                return JSON.toJSONString(obj);
-            });
-//            loggerMap.put("userToken", UserTokenHolder.currentToken());
-
-            System.out.println(JSON.toJSONString(loggerMap, SerializerFeature.SortField, SerializerFeature.PrettyFormat));
-
-        };
-    }
-
-    @Bean
-    public Docket createRestApi() {
-        return new Docket(DocumentationType.SWAGGER_2)
-                .apiInfo(apiInfo())
-                .groupName("example")
-                .ignoredParameterTypes(HttpSession.class, Authentication.class, HttpServletRequest.class, HttpServletResponse.class)
-                .select()
-                .apis(RequestHandlerSelectors.basePackage("org.hswebframework.web"))
-                .paths(PathSelectors.any())
-                .build();
-    }
-
-    private ApiInfo apiInfo() {
-        return new ApiInfoBuilder()
-                .title("hsweb 3.0 api")
-                .description("hsweb 企业后台管理基础框架")
-                .termsOfServiceUrl("http://www.hsweb.me/")
-                .license("apache 2.0")
-                .version("3.0")
-                .build();
-    }
-
-
-    @Autowired
-    UserService       userService;
-    @Autowired
-    RoleService       roleService;
-    @Autowired
-    PermissionService permissionService;
-    @Autowired
-    EntityFactory     entityFactory;
-
-    @Autowired
-    OrganizationalService organizationalService;
-    @Autowired
-    DepartmentService     departmentService;
-    @Autowired
-    PositionService       positionService;
-    @Autowired
-    PersonService         personService;
-
-    @Autowired
-    AuthorizationSettingService authorizationSettingService;
-
-    @Autowired
-    RelationInfoService relationInfoService;
-
-    public static void main(String[] args) {
-        SpringApplication.run(SpringBootExample.class);
-    }
-
-    // main
-    //    @Override
-    @Override
-    public void run(String... strings) throws Exception {
-        //只能查询自己创建的数据
-        DataAccessEntity accessEntity = new DataAccessEntity();
-        accessEntity.setType(DataAccessConfig.DefaultType.OWN_CREATED);
-        accessEntity.setAction(Permission.ACTION_QUERY);
-        accessEntity.setDescribe("只能查询自己创建的数据");
-
-        //只能修改自己创建的数据
-        DataAccessEntity updateAccessEntity = new DataAccessEntity();
-        updateAccessEntity.setType(DataAccessConfig.DefaultType.OWN_CREATED);
-        updateAccessEntity.setAction(Permission.ACTION_UPDATE);
-        updateAccessEntity.setDescribe("只能修改自己的数据");
-        //不能查询password
-        DataAccessEntity denyQueryFields = new DataAccessEntity();
-        denyQueryFields.setType(DataAccessConfig.DefaultType.DENY_FIELDS);
-        denyQueryFields.setAction(Permission.ACTION_QUERY);
-        denyQueryFields.setConfig(JSON.toJSONString(new SimpleFieldFilterDataAccessConfig("password")));
-        denyQueryFields.setDescribe("不能查询密码");
-        //不能修改password
-        DataAccessEntity denyUpdateFields = new DataAccessEntity();
-        denyUpdateFields.setType(DataAccessConfig.DefaultType.DENY_FIELDS);
-        denyUpdateFields.setAction(Permission.ACTION_UPDATE);
-        denyUpdateFields.setConfig(JSON.toJSONString(new SimpleFieldFilterDataAccessConfig("password")));
-        denyUpdateFields.setDescribe("不能直接修改密码");
-        //只能查看自己部门的数据
-        DataAccessEntity onlyDepartmentData = new DataAccessEntity();
-        onlyDepartmentData.setType(DataAccessType.DEPARTMENT_SCOPE);
-        onlyDepartmentData.setAction(Permission.ACTION_QUERY);
-        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(DataStatus.STATUS_ENABLED);
-        permission.setActions(ActionEntity.create(Permission.ACTION_QUERY, Permission.ACTION_UPDATE));
-        permission.setSupportDataAccessTypes(Arrays.asList("*"));
-        permissionService.insert(permission);
-
-        //角色
-        RoleEntity roleEntity = entityFactory.newInstance(RoleEntity.class);
-        roleEntity.setId("admin");
-        roleEntity.setName("test");
-        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");
-        userEntity.setCreateTimeNow();
-        userEntity.setCreatorId("admin");
-        userEntity.setUsername("admin");
-        userEntity.setPassword("admin");
-        userEntity.setRoles(Arrays.asList("admin"));
-        userService.insert(userEntity);
-
-
-        OrganizationalEntity org = entityFactory.newInstance(OrganizationalEntity.class);
-
-        org.setName("测试机构");
-        org.setStatus(DataStatus.STATUS_ENABLED);
-        org.setId("test");
-        org.setParentId("-1");
-
-        organizationalService.insert(org);
-
-        DepartmentEntity department = entityFactory.newInstance(DepartmentEntity.class);
-        department.setStatus(DataStatus.STATUS_ENABLED);
-        department.setOrgId("test");
-        department.setId("test");
-        department.setName("部门");
-        department.setParentId("-1");
-
-        DepartmentEntity department2 = entityFactory.newInstance(DepartmentEntity.class);
-        department2.setStatus(DataStatus.STATUS_ENABLED);
-        department2.setOrgId("test");
-        department2.setId("test2");
-        department2.setName("部门2");
-        department2.setParentId("test");
-        department.setChildren(Collections.singletonList(department2));
-        departmentService.insert(department);
-
-
-        PositionEntity position = entityFactory.newInstance(PositionEntity.class);
-        position.setName("职务");
-        position.setId("test");
-        position.setDepartmentId("test");
-        position.setParentId("-1");
-        position.setRoles(Collections.singletonList("admin"));
-        positionService.insert(position);
-
-        PersonAuthBindEntity personEntity = entityFactory.newInstance(PersonAuthBindEntity.class);
-        personEntity.setName("测试人员");
-        personEntity.setPositionIds(Collections.singleton(position.getId()));
-        personEntity.setUserId(userEntity.getId());
-
-        PersonUserEntity personUserEntity = new PersonUserEntity();
-        personUserEntity.setUsername("admin");
-        personEntity.setPersonUser(personUserEntity);
-
-        personService.insert(personEntity);
-
-        RelationInfoEntity relationInfo = relationInfoService.createEntity();
-
-        relationInfo.setRelationFrom(personEntity.getId());
-        relationInfo.setRelationTo("zhangsan");
-        relationInfo.setRelationTypeFrom("person");
-        relationInfo.setRelationTypeTo("person");
-        relationInfo.setStatus(DataStatus.STATUS_ENABLED);
-        relationInfo.setRelationId("leader");
-        relationInfoService.insert(relationInfo);
-
-//        relationInfoService
-//                .getRelations("person","王伟")
-//                .findRev("直属上级");
-    }
-
-    @Override
-    public void onApplicationEvent(AuthorizeDefinitionInitializedEvent event) {
-        System.out.println(event.getAllDefinition());
-    }
-}

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

@@ -1,139 +0,0 @@
-package org.hswebframework.web.example.simple;
-
-import io.swagger.annotations.ApiOperation;
-import org.hswebframework.web.authorization.Authentication;
-import org.hswebframework.web.authorization.Permission;
-import org.hswebframework.web.authorization.annotation.Authorize;
-import org.hswebframework.web.authorization.annotation.RequiresDataAccess;
-import org.hswebframework.web.authorization.controller.model.UserModel;
-import org.hswebframework.web.authorization.exception.UnAuthorizedException;
-import org.hswebframework.web.commons.entity.Entity;
-import org.hswebframework.web.commons.entity.PagerResult;
-import org.hswebframework.web.commons.entity.param.QueryParamEntity;
-import org.hswebframework.web.controller.QueryController;
-import org.hswebframework.web.controller.message.ResponseMessage;
-import org.hswebframework.web.entity.authorization.SimpleUserEntity;
-import org.hswebframework.web.entity.authorization.UserEntity;
-import org.hswebframework.web.logging.AccessLogger;
-import org.hswebframework.web.organizational.authorization.PersonnelAuthentication;
-import org.hswebframework.web.service.QueryByEntityService;
-import org.hswebframework.web.service.QueryService;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-
-
-/**
- * TODO 完成注释
- *
- * @author zhouhao
- */
-@RestController
-@RequestMapping("/test")
-@Authorize(permission = "test")
-@AccessLogger("测试")
-public class TestController implements QueryController<UserEntity, String, QueryParamEntity> {
-
-    @GetMapping("/test1")
-    @Authorize(action = "query")
-    public ResponseMessage testSimple(Authentication authentication) {
-        return ResponseMessage.ok(
-                PersonnelAuthentication.current()
-                        //查找人员关系
-                        .map(PersonnelAuthentication::getRelations)
-                        .map(relations -> relations.findPos("leader"))
-                        .orElse(null));
-    }
-
-    @GetMapping("/test2")
-    public ResponseMessage test2(Authentication authentication) {
-        return ResponseMessage.ok(authentication);
-    }
-
-    @GetMapping("/testQuery")
-    @Authorize
-    @RequiresDataAccess(permission = "test", action = Permission.ACTION_QUERY)
-    @ApiOperation("测试查询")
-    @AccessLogger("查询")
-    public ResponseMessage<QueryParamEntity> testQuery(QueryParamEntity entity) {
-
-        /*
-        @RequiresDataAccess 数据级别权限控制
-        entity.terms 被嵌入查询条件
-        */
-        return ResponseMessage.ok(entity);
-    }
-
-    @PutMapping("/testUpdate/{id}")
-    @RequiresDataAccess(permission = "test", action = Permission.ACTION_UPDATE)
-    public ResponseMessage<UserModel> testUpdate(@PathVariable String id, @RequestBody UserModel model) {
-        return ResponseMessage.ok(model);
-    }
-
-
-    @PutMapping("/testUpdateBatch")
-    @Authorize(ignore = true)
-    public ResponseMessage<List<UserModel>> testUpdate(@RequestBody List<UserModel> model) {
-        return ResponseMessage.ok(model);
-    }
-
-
-    @PutMapping("/test/testPersonnel")
-    public ResponseMessage<PersonnelAuthentication> testPersonnel() {
-        return ResponseMessage.ok(PersonnelAuthentication.current().orElseThrow(UnAuthorizedException::new));
-    }
-    @PostMapping("/test/testDict")
-    public ResponseMessage<TestEntity> testPersonnel(@RequestBody TestEntity entity) {
-        return ResponseMessage.ok(entity);
-    }
-    @Override
-    public TestService getService() {
-        return new TestService();
-    }
-
-    public static class TestService implements QueryByEntityService<UserEntity>, QueryService<UserEntity, String> {
-
-        @Override
-        public UserEntity selectByPk(String id) {
-            SimpleUserEntity userEntity = new SimpleUserEntity();
-            // 同一个用户
-            userEntity.setCreatorId(Authentication.current().orElseThrow(UnAuthorizedException::new).getUser().getId());
-            return userEntity;
-        }
-
-        @Override
-        public List<UserEntity> selectByPk(List<String> id) {
-            return null;
-        }
-
-        @Override
-        public List<UserEntity> select() {
-            return null;
-        }
-
-        @Override
-        public int count() {
-            return 0;
-        }
-
-        @Override
-        public PagerResult<UserEntity> selectPager(Entity param) {
-            return null;
-        }
-
-        @Override
-        public List<UserEntity> select(Entity param) {
-            return null;
-        }
-
-        @Override
-        public int count(Entity param) {
-            return 0;
-        }
-
-        @Override
-        public UserEntity selectSingle(Entity param) {
-            return null;
-        }
-    }
-}

+ 0 - 27
hsweb-examples/hsweb-examples-simple/src/main/java/org/hswebframework/web/example/simple/TestEntity.java

@@ -1,27 +0,0 @@
-package org.hswebframework.web.example.simple;
-
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import org.hswebframework.web.dict.Dict;
-import org.hswebframework.web.dict.Item;
-
-/**
- * @author zhouhao
- * @since 3.0
- */
-@Data
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-public class TestEntity {
-
-    @Dict(alias = "sexText", items = {
-            @Item(text = "男", value = "1"),
-            @Item(text = "女", value = "2")
-    })
-    private Byte sex;
-
-    private String sexText;
-}

+ 0 - 45
hsweb-examples/hsweb-examples-simple/src/main/resources/application.yml

@@ -1,45 +0,0 @@
-spring:
-    aop:
-        auto: true
-        proxy-target-class: true
-    datasource:
-       url : jdbc:h2:mem:example
-       username : sa
-       password :
-       type: com.alibaba.druid.pool.DruidDataSource
-       driver-class-name : org.h2.Driver
-    cache:
-       type: simple
-    http:
-      multipart:
-        enabled: true
-        max-file-size: 100Mb
-hsweb:
-    cors:
-      enable: on
-      allowed-origins: "*"
-      allowed-methods: "*"
-      allowed-headers: "*"
-    authorize:
-      auto-parse: true # 自动解析所有代码中到权限,并触发 ApplicationListener<AuthorizeDefinitionInitializedEvent>
-      basic-authorization: true #开启basic认证
-      sync: true # 自动同步权限信息到数据库
-      jwt:
-        id: test
-        secret: dGVzdA==
-#      filters:
-#           "/swagger-ui.html": "authc"
-    app:
-      name: hsweb示例
-      version: 3.0.0
-    entity:
-      mappings:
-          -  source-base-package: org.hswebframework.web.entity.authorization
-             target-base-package: org.hswebframework.web.entity.authorization
-             mapping:
-                UserEntity: SimpleUserEntity
-server:
-  port: 8081
-logging:
-  level:
-    org.hswebframework: debug

+ 0 - 50
hsweb-examples/pom.xml

@@ -1,50 +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-framework</artifactId>
-        <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>hsweb-examples</artifactId>
-    <packaging>pom</packaging>
-    <modules>
-        <module>hsweb-examples-simple</module>
-        <module>hsweb-examples-oauth2</module>
-        <module>hsweb-examples-custom-entity</module>
-    </modules>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-deploy-plugin</artifactId>
-                <version>2.8.2</version>
-                <configuration>
-                    <skip>true</skip>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-
-</project>

+ 1 - 1
hsweb-logging/hsweb-access-logging-aop/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-logging</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

+ 1 - 1
hsweb-logging/hsweb-access-logging-api/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-logging</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

+ 1 - 1
hsweb-logging/pom.xml

@@ -23,7 +23,7 @@
     <parent>
         <artifactId>hsweb-framework</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

+ 1 - 1
hsweb-message/hsweb-message-api/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-message</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-message/hsweb-message-jms/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-message</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-message/hsweb-message-redis/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-message</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-message/hsweb-message-websocket/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-message</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-message/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-framework</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-starter/hsweb-spring-boot-starter/pom.xml

@@ -23,7 +23,7 @@
     <parent>
         <artifactId>hsweb-starter</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-starter/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-framework</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-system/hsweb-system-authorization/hsweb-system-authorization-api/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-system-authorization</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-system/hsweb-system-authorization/hsweb-system-authorization-local/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-system-authorization</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-system/hsweb-system-authorization/hsweb-system-authorization-starter/pom.xml

@@ -22,7 +22,7 @@
     <parent>
         <artifactId>hsweb-system-authorization</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-system/hsweb-system-authorization/hsweb-system-authorization-web/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-system-authorization</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-system/hsweb-system-authorization/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-system</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-system/hsweb-system-config/hsweb-system-config-api/pom.xml

@@ -23,7 +23,7 @@
     <parent>
         <artifactId>hsweb-system-config</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
 
         <relativePath>../pom.xml</relativePath>
     </parent>

+ 1 - 1
hsweb-system/hsweb-system-config/hsweb-system-config-local/pom.xml

@@ -23,7 +23,7 @@
     <parent>
         <artifactId>hsweb-system-config</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

+ 1 - 1
hsweb-system/hsweb-system-config/hsweb-system-config-starter/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-system-config</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

+ 1 - 1
hsweb-system/hsweb-system-config/hsweb-system-config-web/pom.xml

@@ -23,7 +23,7 @@
     <parent>
         <artifactId>hsweb-system-config</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

+ 1 - 1
hsweb-system/hsweb-system-config/pom.xml

@@ -23,7 +23,7 @@
     <parent>
         <artifactId>hsweb-system</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 1 - 1
hsweb-system/hsweb-system-dashboard/hsweb-system-dashboard-api/pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <artifactId>hsweb-system-dashboard</artifactId>
         <groupId>org.hswebframework.web</groupId>
-        <version>3.0.0-RC-SNAPSHOT</version>
+        <version>3.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

+ 0 - 0
hsweb-system/hsweb-system-dashboard/hsweb-system-dashboard-local/pom.xml


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