errorResults = results.getResults();
+ return ResponseMessage
+ .error(400, errorResults.isEmpty() ? "" : errorResults.get(0).getMessage())
+ .result(errorResults);
+ }
+
@ExceptionHandler(MethodArgumentNotValidException.class)
@ResponseStatus(HttpStatus.BAD_REQUEST)
ResponseMessage handleException(MethodArgumentNotValidException e) {
@@ -152,11 +167,11 @@ public class RestControllerExceptionTranslator {
/**
* 404异常,Spring MVC DispatcherServlet 当没找到 Handler处理请求时,
* 如果配置了 throwExceptionIfNoHandlerFound 为 true时,会抛出此异常
- *
+ *
* 在配置文件中使用:
- * spring:
- * mvc:
- * throw-exception-if-no-handler-found: true
+ * spring:
+ * mvc:
+ * throw-exception-if-no-handler-found: true
*
* @see org.springframework.web.servlet.DispatcherServlet#noHandlerFound(HttpServletRequest, HttpServletResponse)
*/
@@ -189,5 +204,4 @@ public class RestControllerExceptionTranslator {
}
-
}
\ No newline at end of file
diff --git a/hsweb-starter/hsweb-spring-boot-starter/src/main/java/org/hswebframework/web/starter/entity/EntityFactoryInitConfiguration.java b/hsweb-starter/hsweb-spring-boot-starter/src/main/java/org/hswebframework/web/starter/entity/EntityFactoryInitConfiguration.java
index a161b2d58..30f95587d 100644
--- a/hsweb-starter/hsweb-spring-boot-starter/src/main/java/org/hswebframework/web/starter/entity/EntityFactoryInitConfiguration.java
+++ b/hsweb-starter/hsweb-spring-boot-starter/src/main/java/org/hswebframework/web/starter/entity/EntityFactoryInitConfiguration.java
@@ -24,8 +24,8 @@ public class EntityFactoryInitConfiguration implements BeanPostProcessor {
} else if (bean instanceof PropertyCopier) {
mapperEntityFactory.addCopier(((PropertyCopier) bean));
}
- if (bean instanceof EntityMappingCustomer) {
- ((EntityMappingCustomer) bean).customize(mapperEntityFactory);
+ if (bean instanceof EntityMappingCustomizer) {
+ ((EntityMappingCustomizer) bean).customize(mapperEntityFactory);
}
return bean;
}
diff --git a/hsweb-starter/hsweb-spring-boot-starter/src/main/java/org/hswebframework/web/starter/entity/EntityMappingCustomer.java b/hsweb-starter/hsweb-spring-boot-starter/src/main/java/org/hswebframework/web/starter/entity/EntityMappingCustomizer.java
similarity index 82%
rename from hsweb-starter/hsweb-spring-boot-starter/src/main/java/org/hswebframework/web/starter/entity/EntityMappingCustomer.java
rename to hsweb-starter/hsweb-spring-boot-starter/src/main/java/org/hswebframework/web/starter/entity/EntityMappingCustomizer.java
index fcee63ba0..16ed7e86d 100644
--- a/hsweb-starter/hsweb-spring-boot-starter/src/main/java/org/hswebframework/web/starter/entity/EntityMappingCustomer.java
+++ b/hsweb-starter/hsweb-spring-boot-starter/src/main/java/org/hswebframework/web/starter/entity/EntityMappingCustomizer.java
@@ -5,6 +5,6 @@ import org.hswebframework.web.commons.entity.factory.MapperEntityFactory;
/**
* @author zhouhao
*/
-public interface EntityMappingCustomer {
+public interface EntityMappingCustomizer {
void customize(MapperEntityFactory entityFactory);
}
diff --git a/hsweb-starter/pom.xml b/hsweb-starter/pom.xml
index 961a67e51..5cb6d4c8a 100644
--- a/hsweb-starter/pom.xml
+++ b/hsweb-starter/pom.xml
@@ -5,7 +5,7 @@
hsweb-framework
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-api/pom.xml b/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-api/pom.xml
index dac667e7a..4cbec660f 100644
--- a/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-api/pom.xml
+++ b/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-api/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-authorization
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-api/src/main/java/org/hswebframework/web/entity/authorization/DataAccessEntity.java b/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-api/src/main/java/org/hswebframework/web/entity/authorization/DataAccessEntity.java
index 8ec5d0720..0b05d6348 100644
--- a/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-api/src/main/java/org/hswebframework/web/entity/authorization/DataAccessEntity.java
+++ b/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-api/src/main/java/org/hswebframework/web/entity/authorization/DataAccessEntity.java
@@ -3,8 +3,6 @@ package org.hswebframework.web.entity.authorization;
import org.hswebframework.web.commons.entity.CloneableEntity;
/**
- * TODO 完成注释
- *
* @author zhouhao
*/
public class DataAccessEntity implements CloneableEntity {
diff --git a/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-local/pom.xml b/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-local/pom.xml
index 2ac660535..b1d1dfd3f 100644
--- a/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-local/pom.xml
+++ b/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-local/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-authorization
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-local/src/main/java/org/hswebframework/web/service/authorization/simple/terms/UserInRoleSqlTerm.java b/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-local/src/main/java/org/hswebframework/web/service/authorization/simple/terms/UserInRoleSqlTerm.java
index d52fa743c..5394c7dda 100644
--- a/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-local/src/main/java/org/hswebframework/web/service/authorization/simple/terms/UserInRoleSqlTerm.java
+++ b/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-local/src/main/java/org/hswebframework/web/service/authorization/simple/terms/UserInRoleSqlTerm.java
@@ -4,7 +4,7 @@ import org.hswebframework.ezorm.core.param.Term;
import org.hswebframework.ezorm.rdb.meta.RDBColumnMetaData;
import org.hswebframework.ezorm.rdb.render.SqlAppender;
import org.hswebframework.ezorm.rdb.render.dialect.term.BoostTermTypeMapper;
-import org.hswebframework.web.dao.mybatis.mapper.AbstractSqlTermCustomer;
+import org.hswebframework.web.dao.mybatis.mapper.AbstractSqlTermCustomizer;
import org.hswebframework.web.dao.mybatis.mapper.ChangedTermValue;
import java.util.List;
@@ -13,7 +13,7 @@ import java.util.List;
* @author zhouhao
* @since 3.0
*/
-public class UserInRoleSqlTerm extends AbstractSqlTermCustomer {
+public class UserInRoleSqlTerm extends AbstractSqlTermCustomizer {
private boolean not;
diff --git a/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-starter/pom.xml b/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-starter/pom.xml
index d02ed2316..3fef553b2 100644
--- a/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-starter/pom.xml
+++ b/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-starter/pom.xml
@@ -22,7 +22,7 @@
hsweb-system-authorization
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-starter/src/test/groovy/org/hswebframework/web/authorization/starter/UserSettingControllerTest.groovy b/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-starter/src/test/groovy/org/hswebframework/web/authorization/starter/UserSettingControllerTest.groovy
index 41be44131..2efcb0252 100644
--- a/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-starter/src/test/groovy/org/hswebframework/web/authorization/starter/UserSettingControllerTest.groovy
+++ b/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-starter/src/test/groovy/org/hswebframework/web/authorization/starter/UserSettingControllerTest.groovy
@@ -3,6 +3,8 @@ package org.hswebframework.web.authorization.starter
import com.alibaba.fastjson.JSON
import org.hswebframework.web.authorization.Authentication
import org.hswebframework.web.authorization.AuthenticationInitializeService
+import org.hswebframework.web.authorization.access.DataAccessConfig
+import org.hswebframework.web.tests.HswebCrudWebApiSpecification
import org.junit.runner.RunWith
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
@@ -27,32 +29,26 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
/**
* @author zhouhao
- * @since
+ * @since 3.0
*/
-@WebAppConfiguration
-@ContextConfiguration
-@SpringBootTest(classes = [TestApplication.class], properties = ["classpath:application.yml"])
-class UserSettingControllerTest extends Specification {
- @Autowired
- private ConfigurableApplicationContext context;
-
- @Shared
- private MockMvc mockMvc;
+class UserSettingControllerTest extends HswebCrudWebApiSpecification {
@Autowired
private AuthenticationInitializeService initializeService;
- void setup() {
- mockMvc = MockMvcBuilders.webAppContextSetup(context).build();
+ @Override
+ protected String getBaseApi() {
+ return "/autz-setting"
}
+
def "Add Permission"() {
def permissions = [
[
- "id" : "user",
- "name" : "用户管理",
- "actions": [["action": "query", "describe": "查询"], ["action": "update", "describe": "修改"]]
-
+ "id" : "user",
+ "name" : "用户管理",
+ "actions" : [["action": "query", "describe": "查询"], ["action": "update", "describe": "修改"]],
+ "supportDataAccessTypes": [DataAccessConfig.DefaultType.DENY_FIELDS]
],
[
"id" : "role",
@@ -99,45 +95,52 @@ class UserSettingControllerTest extends Specification {
"Add Permission"()
def userId = "Add User"()
//添加用户权限
- mockMvc.perform(
- post("/autz-setting")
- .contentType(MediaType.APPLICATION_JSON)
- .content(JSON.toJSONString
- ([
- type : "user", //设置类型:user
- settingFor: userId, //设置给具体的user
- describe : "测试",
- details :
+ doAddRequest(JSON.toJSONString
+ ([
+ type : "user", //设置类型:user
+ settingFor: userId, //设置给具体的user
+ describe : "测试",
+ details :
+ [
[
- [
- permissionId: "user", //赋予user权限
- actions : ["query", "update"],
- status : 1
- ],
- [
- permissionId: "role", //赋予role权限
- actions : ["query", "get"],
- status : 1
+ permissionId: "user", //赋予user权限
+ actions : ["query", "update"],
+ status : 1,
+ dataAccesses: [ //数据权限,控制查询的时候不能查询password字段
+ [
+ type : DataAccessConfig.DefaultType.DENY_FIELDS,
+ action: "query",
+ config: """{"fields": ["password"]}"""
+ ]
]
],
- menus :
[
- [
- menuId: "user-menu"
- ],
- [
- menuId: "role-menu"
- ]
+ permissionId: "role", //赋予role权限
+ actions : ["query", "get"],
+ status : 1
]
- ])
- )).andDo({ result -> println result.response.contentAsString })
-// .andExpect(status().is(201))
+ ],
+ menus :
+ [
+ [
+ menuId: "user-menu"
+ ],
+ [
+ menuId: "role-menu"
+ ]
+ ]
+ ]))
+
expect:
userId != null
def autz = initializeService.initUserAuthorization(userId)
autz != null
autz.hasPermission("user", "query")
autz.hasPermission("role", "query", "get")
-
+ autz.getPermission("user")
+ .map({ per -> per.findDenyFields("query") })
+ .map({ fields -> fields.contains("password") })
+ .orElse(false)
}
+
}
diff --git a/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-web/pom.xml b/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-web/pom.xml
index 21314bdbe..fb4d7d0c4 100644
--- a/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-web/pom.xml
+++ b/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-web/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-authorization
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-authorization/pom.xml b/hsweb-system/hsweb-system-authorization/pom.xml
index 8213dd5e5..94ec56eb8 100644
--- a/hsweb-system/hsweb-system-authorization/pom.xml
+++ b/hsweb-system/hsweb-system-authorization/pom.xml
@@ -5,7 +5,7 @@
hsweb-system
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-config/hsweb-system-config-api/pom.xml b/hsweb-system/hsweb-system-config/hsweb-system-config-api/pom.xml
index bf63c91b9..45ed138f5 100644
--- a/hsweb-system/hsweb-system-config/hsweb-system-config-api/pom.xml
+++ b/hsweb-system/hsweb-system-config/hsweb-system-config-api/pom.xml
@@ -23,7 +23,7 @@
hsweb-system-config
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
../pom.xml
diff --git a/hsweb-system/hsweb-system-config/hsweb-system-config-local/pom.xml b/hsweb-system/hsweb-system-config/hsweb-system-config-local/pom.xml
index 9dcfe38cd..73d4bd114 100644
--- a/hsweb-system/hsweb-system-config/hsweb-system-config-local/pom.xml
+++ b/hsweb-system/hsweb-system-config/hsweb-system-config-local/pom.xml
@@ -23,7 +23,7 @@
hsweb-system-config
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
../pom.xml
4.0.0
diff --git a/hsweb-system/hsweb-system-config/hsweb-system-config-starter/pom.xml b/hsweb-system/hsweb-system-config/hsweb-system-config-starter/pom.xml
index 6484cdcdc..66c35bd55 100644
--- a/hsweb-system/hsweb-system-config/hsweb-system-config-starter/pom.xml
+++ b/hsweb-system/hsweb-system-config/hsweb-system-config-starter/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-config
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
../pom.xml
4.0.0
diff --git a/hsweb-system/hsweb-system-config/hsweb-system-config-web/pom.xml b/hsweb-system/hsweb-system-config/hsweb-system-config-web/pom.xml
index 62a0678b7..33db45cc3 100644
--- a/hsweb-system/hsweb-system-config/hsweb-system-config-web/pom.xml
+++ b/hsweb-system/hsweb-system-config/hsweb-system-config-web/pom.xml
@@ -23,7 +23,7 @@
hsweb-system-config
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
../pom.xml
4.0.0
diff --git a/hsweb-system/hsweb-system-config/pom.xml b/hsweb-system/hsweb-system-config/pom.xml
index 0adf5543a..dc3ad9988 100644
--- a/hsweb-system/hsweb-system-config/pom.xml
+++ b/hsweb-system/hsweb-system-config/pom.xml
@@ -23,7 +23,7 @@
hsweb-system
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-dashboard/hsweb-system-dashboard-api/pom.xml b/hsweb-system/hsweb-system-dashboard/hsweb-system-dashboard-api/pom.xml
index b2dc1cd8d..d73524c4a 100644
--- a/hsweb-system/hsweb-system-dashboard/hsweb-system-dashboard-api/pom.xml
+++ b/hsweb-system/hsweb-system-dashboard/hsweb-system-dashboard-api/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-dashboard
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-dashboard/hsweb-system-dashboard-local/pom.xml b/hsweb-system/hsweb-system-dashboard/hsweb-system-dashboard-local/pom.xml
index 6383672fc..61b92bbef 100644
--- a/hsweb-system/hsweb-system-dashboard/hsweb-system-dashboard-local/pom.xml
+++ b/hsweb-system/hsweb-system-dashboard/hsweb-system-dashboard-local/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-dashboard
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-dashboard/hsweb-system-dashboard-starter/pom.xml b/hsweb-system/hsweb-system-dashboard/hsweb-system-dashboard-starter/pom.xml
index 09d52beec..19cac8ffc 100644
--- a/hsweb-system/hsweb-system-dashboard/hsweb-system-dashboard-starter/pom.xml
+++ b/hsweb-system/hsweb-system-dashboard/hsweb-system-dashboard-starter/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-dashboard
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
@@ -68,8 +68,7 @@
javax.servlet
- servlet-api
- 2.5
+ javax.servlet-api
test
diff --git a/hsweb-system/hsweb-system-dashboard/hsweb-system-dashboard-web/pom.xml b/hsweb-system/hsweb-system-dashboard/hsweb-system-dashboard-web/pom.xml
index 3c2d46bc7..fc437ba45 100644
--- a/hsweb-system/hsweb-system-dashboard/hsweb-system-dashboard-web/pom.xml
+++ b/hsweb-system/hsweb-system-dashboard/hsweb-system-dashboard-web/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-dashboard
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-dashboard/pom.xml b/hsweb-system/hsweb-system-dashboard/pom.xml
index ce7935227..6c7034555 100644
--- a/hsweb-system/hsweb-system-dashboard/pom.xml
+++ b/hsweb-system/hsweb-system-dashboard/pom.xml
@@ -5,7 +5,7 @@
hsweb-system
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-database-manager/hsweb-system-database-manager-api/pom.xml b/hsweb-system/hsweb-system-database-manager/hsweb-system-database-manager-api/pom.xml
index 7abee41bb..322b97257 100644
--- a/hsweb-system/hsweb-system-database-manager/hsweb-system-database-manager-api/pom.xml
+++ b/hsweb-system/hsweb-system-database-manager/hsweb-system-database-manager-api/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-database-manager
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-database-manager/hsweb-system-database-manager-local/pom.xml b/hsweb-system/hsweb-system-database-manager/hsweb-system-database-manager-local/pom.xml
index 6f6d82c55..720964ee0 100644
--- a/hsweb-system/hsweb-system-database-manager/hsweb-system-database-manager-local/pom.xml
+++ b/hsweb-system/hsweb-system-database-manager/hsweb-system-database-manager-local/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-database-manager
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-database-manager/hsweb-system-database-manager-starter/pom.xml b/hsweb-system/hsweb-system-database-manager/hsweb-system-database-manager-starter/pom.xml
index 171c03dcb..4888d849b 100644
--- a/hsweb-system/hsweb-system-database-manager/hsweb-system-database-manager-starter/pom.xml
+++ b/hsweb-system/hsweb-system-database-manager/hsweb-system-database-manager-starter/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-database-manager
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-database-manager/hsweb-system-database-manager-web/pom.xml b/hsweb-system/hsweb-system-database-manager/hsweb-system-database-manager-web/pom.xml
index 410009e14..489e151bb 100644
--- a/hsweb-system/hsweb-system-database-manager/hsweb-system-database-manager-web/pom.xml
+++ b/hsweb-system/hsweb-system-database-manager/hsweb-system-database-manager-web/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-database-manager
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-database-manager/pom.xml b/hsweb-system/hsweb-system-database-manager/pom.xml
index 733e9d0a0..b9db4b370 100644
--- a/hsweb-system/hsweb-system-database-manager/pom.xml
+++ b/hsweb-system/hsweb-system-database-manager/pom.xml
@@ -5,7 +5,7 @@
hsweb-system
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-datasource/hsweb-system-datasource-api/pom.xml b/hsweb-system/hsweb-system-datasource/hsweb-system-datasource-api/pom.xml
index 635fc0b31..05460cfa6 100644
--- a/hsweb-system/hsweb-system-datasource/hsweb-system-datasource-api/pom.xml
+++ b/hsweb-system/hsweb-system-datasource/hsweb-system-datasource-api/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-datasource
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
../pom.xml
4.0.0
diff --git a/hsweb-system/hsweb-system-datasource/hsweb-system-datasource-local/pom.xml b/hsweb-system/hsweb-system-datasource/hsweb-system-datasource-local/pom.xml
index 263b0229e..10976b805 100644
--- a/hsweb-system/hsweb-system-datasource/hsweb-system-datasource-local/pom.xml
+++ b/hsweb-system/hsweb-system-datasource/hsweb-system-datasource-local/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-datasource
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
../pom.xml
4.0.0
diff --git a/hsweb-system/hsweb-system-datasource/hsweb-system-datasource-starter/pom.xml b/hsweb-system/hsweb-system-datasource/hsweb-system-datasource-starter/pom.xml
index 1499caa26..5bf59878e 100644
--- a/hsweb-system/hsweb-system-datasource/hsweb-system-datasource-starter/pom.xml
+++ b/hsweb-system/hsweb-system-datasource/hsweb-system-datasource-starter/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-datasource
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
../pom.xml
4.0.0
@@ -72,8 +72,7 @@
javax.servlet
- servlet-api
- 2.5
+ javax.servlet-api
test
diff --git a/hsweb-system/hsweb-system-datasource/hsweb-system-datasource-web/pom.xml b/hsweb-system/hsweb-system-datasource/hsweb-system-datasource-web/pom.xml
index 3824fdd16..1432b6c79 100644
--- a/hsweb-system/hsweb-system-datasource/hsweb-system-datasource-web/pom.xml
+++ b/hsweb-system/hsweb-system-datasource/hsweb-system-datasource-web/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-datasource
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
../pom.xml
4.0.0
@@ -17,8 +17,7 @@
javax.servlet
- servlet-api
- 2.5
+ javax.servlet-api
true
diff --git a/hsweb-system/hsweb-system-datasource/pom.xml b/hsweb-system/hsweb-system-datasource/pom.xml
index 52b09b3f6..8d9bae4bf 100644
--- a/hsweb-system/hsweb-system-datasource/pom.xml
+++ b/hsweb-system/hsweb-system-datasource/pom.xml
@@ -5,7 +5,7 @@
hsweb-system
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
../pom.xml
diff --git a/hsweb-system/hsweb-system-dev-tools/pom.xml b/hsweb-system/hsweb-system-dev-tools/pom.xml
index 5ff0328ae..ed4cce92c 100644
--- a/hsweb-system/hsweb-system-dev-tools/pom.xml
+++ b/hsweb-system/hsweb-system-dev-tools/pom.xml
@@ -5,7 +5,7 @@
hsweb-system
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-api/pom.xml b/hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-api/pom.xml
index 45b0b8104..b7f561738 100644
--- a/hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-api/pom.xml
+++ b/hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-api/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-dictionary
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-local/pom.xml b/hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-local/pom.xml
index 39130441c..d4180f8ec 100644
--- a/hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-local/pom.xml
+++ b/hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-local/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-dictionary
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-starter/pom.xml b/hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-starter/pom.xml
index 0da9e55bd..37bbdeaa9 100644
--- a/hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-starter/pom.xml
+++ b/hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-starter/pom.xml
@@ -22,7 +22,7 @@
hsweb-system-dictionary
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
@@ -78,8 +78,7 @@
javax.servlet
- servlet-api
- 2.5
+ javax.servlet-api
test
diff --git a/hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-web/pom.xml b/hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-web/pom.xml
index 12163fd20..f86a2396a 100644
--- a/hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-web/pom.xml
+++ b/hsweb-system/hsweb-system-dictionary/hsweb-system-dictionary-web/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-dictionary
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
@@ -24,8 +24,7 @@
javax.servlet
- servlet-api
- 2.5
+ javax.servlet-api
true
diff --git a/hsweb-system/hsweb-system-dictionary/pom.xml b/hsweb-system/hsweb-system-dictionary/pom.xml
index 813cdedd4..5d04253c4 100644
--- a/hsweb-system/hsweb-system-dictionary/pom.xml
+++ b/hsweb-system/hsweb-system-dictionary/pom.xml
@@ -22,7 +22,7 @@
hsweb-system
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-api/pom.xml b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-api/pom.xml
index 258861a12..22ed66eda 100644
--- a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-api/pom.xml
+++ b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-api/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-dynamic-form
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
../pom.xml
4.0.0
diff --git a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-api/src/main/java/org/hswebframework/web/service/form/initialize/DynamicFormInitializeCustomer.java b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-api/src/main/java/org/hswebframework/web/service/form/initialize/DynamicFormInitializeCustomizer.java
similarity index 81%
rename from hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-api/src/main/java/org/hswebframework/web/service/form/initialize/DynamicFormInitializeCustomer.java
rename to hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-api/src/main/java/org/hswebframework/web/service/form/initialize/DynamicFormInitializeCustomizer.java
index 701ee11c4..5bd6fde5b 100644
--- a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-api/src/main/java/org/hswebframework/web/service/form/initialize/DynamicFormInitializeCustomer.java
+++ b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-api/src/main/java/org/hswebframework/web/service/form/initialize/DynamicFormInitializeCustomizer.java
@@ -4,7 +4,7 @@ package org.hswebframework.web.service.form.initialize;
* @author zhouhao
* @since 3.0
*/
-public interface DynamicFormInitializeCustomer {
+public interface DynamicFormInitializeCustomizer {
void customTableSetting(TableInitializeContext context);
void customTableColumnSetting(ColumnInitializeContext context);
diff --git a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-local/pom.xml b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-local/pom.xml
index e5c6c63d5..1832e656e 100644
--- a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-local/pom.xml
+++ b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-local/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-dynamic-form
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
../pom.xml
4.0.0
diff --git a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-local/src/main/java/org/hswebframework/web/service/form/simple/SimpleDynamicFormService.java b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-local/src/main/java/org/hswebframework/web/service/form/simple/SimpleDynamicFormService.java
index e8ddd8409..e26f65562 100644
--- a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-local/src/main/java/org/hswebframework/web/service/form/simple/SimpleDynamicFormService.java
+++ b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-local/src/main/java/org/hswebframework/web/service/form/simple/SimpleDynamicFormService.java
@@ -31,10 +31,8 @@ import org.hswebframework.web.service.GenericEntityService;
import org.hswebframework.web.service.form.*;
import org.hswebframework.web.service.form.events.FormDeployEvent;
import org.hswebframework.web.service.form.initialize.ColumnInitializeContext;
-import org.hswebframework.web.service.form.initialize.DynamicFormInitializeCustomer;
+import org.hswebframework.web.service.form.initialize.DynamicFormInitializeCustomizer;
import org.hswebframework.web.service.form.initialize.TableInitializeContext;
-import org.hswebframework.web.service.form.simple.cluster.ClusterDatabase;
-import org.hswebframework.web.service.form.simple.convert.SmartValueConverter;
import org.hswebframework.web.service.form.simple.dict.EnumDictValueConverter;
import org.hswebframework.web.validator.group.CreateGroup;
import org.hswebframework.web.validator.group.UpdateGroup;
@@ -53,7 +51,6 @@ import org.springframework.util.StringUtils;
import java.math.BigDecimal;
import java.math.BigInteger;
-import java.sql.Array;
import java.sql.JDBCType;
import java.sql.SQLException;
import java.util.*;
@@ -94,7 +91,7 @@ public class SimpleDynamicFormService extends GenericEntityService initializeCustomers;
+ private List initializeCustomizers;
@Autowired
private ValidatorFactory validatorFactory;
@@ -608,8 +605,8 @@ public class SimpleDynamicFormService extends GenericEntityService customer.customTableSetting(context));
+ if (!CollectionUtils.isEmpty(initializeCustomizers)) {
+ initializeCustomizers.forEach(customizer -> customizer.customTableSetting(context));
}
}
@@ -644,8 +641,8 @@ public class SimpleDynamicFormService extends GenericEntityService customer.customTableColumnSetting(context));
+ if (!CollectionUtils.isEmpty(initializeCustomizers)) {
+ initializeCustomizers.forEach(customer -> customer.customTableColumnSetting(context));
}
}
diff --git a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-starter/pom.xml b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-starter/pom.xml
index 7065dda0e..6d8fbd574 100644
--- a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-starter/pom.xml
+++ b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-starter/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-dynamic-form
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
../pom.xml
4.0.0
@@ -69,8 +69,7 @@
javax.servlet
- servlet-api
- 2.5
+ javax.servlet-api
test
diff --git a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-web/pom.xml b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-web/pom.xml
index 30a0b1a41..feca4b8c3 100644
--- a/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-web/pom.xml
+++ b/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-web/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-dynamic-form
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
../pom.xml
4.0.0
@@ -16,8 +16,7 @@
javax.servlet
- servlet-api
- 2.5
+ javax.servlet-api
true
diff --git a/hsweb-system/hsweb-system-dynamic-form/pom.xml b/hsweb-system/hsweb-system-dynamic-form/pom.xml
index 5460cec7d..4a0ba0f2e 100644
--- a/hsweb-system/hsweb-system-dynamic-form/pom.xml
+++ b/hsweb-system/hsweb-system-dynamic-form/pom.xml
@@ -5,7 +5,7 @@
hsweb-system
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
../pom.xml
4.0.0
diff --git a/hsweb-system/hsweb-system-file/hsweb-system-file-api/pom.xml b/hsweb-system/hsweb-system-file/hsweb-system-file-api/pom.xml
index 2de3f1da3..fc260747e 100644
--- a/hsweb-system/hsweb-system-file/hsweb-system-file-api/pom.xml
+++ b/hsweb-system/hsweb-system-file/hsweb-system-file-api/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-file
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
../pom.xml
4.0.0
diff --git a/hsweb-system/hsweb-system-file/hsweb-system-file-local/pom.xml b/hsweb-system/hsweb-system-file/hsweb-system-file-local/pom.xml
index 7b9de7a3d..3ad72e6c7 100644
--- a/hsweb-system/hsweb-system-file/hsweb-system-file-local/pom.xml
+++ b/hsweb-system/hsweb-system-file/hsweb-system-file-local/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-file
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
../pom.xml
4.0.0
diff --git a/hsweb-system/hsweb-system-file/hsweb-system-file-oauth2/pom.xml b/hsweb-system/hsweb-system-file/hsweb-system-file-oauth2/pom.xml
index 82a9d562b..3ffa3e7c0 100644
--- a/hsweb-system/hsweb-system-file/hsweb-system-file-oauth2/pom.xml
+++ b/hsweb-system/hsweb-system-file/hsweb-system-file-oauth2/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-file
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
../pom.xml
4.0.0
diff --git a/hsweb-system/hsweb-system-file/hsweb-system-file-starter/pom.xml b/hsweb-system/hsweb-system-file/hsweb-system-file-starter/pom.xml
index b2e71125b..98b3d7534 100644
--- a/hsweb-system/hsweb-system-file/hsweb-system-file-starter/pom.xml
+++ b/hsweb-system/hsweb-system-file/hsweb-system-file-starter/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-file
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
../pom.xml
4.0.0
@@ -76,8 +76,7 @@
javax.servlet
- servlet-api
- 2.5
+ javax.servlet-api
test
diff --git a/hsweb-system/hsweb-system-file/hsweb-system-file-starter/src/test/java/org/hswebframework/web/service/file/FixBug93Test.java b/hsweb-system/hsweb-system-file/hsweb-system-file-starter/src/test/java/org/hswebframework/web/service/file/FixBug93Test.java
new file mode 100644
index 000000000..fa045a907
--- /dev/null
+++ b/hsweb-system/hsweb-system-file/hsweb-system-file-starter/src/test/java/org/hswebframework/web/service/file/FixBug93Test.java
@@ -0,0 +1,32 @@
+package org.hswebframework.web.service.file;
+
+import com.alibaba.fastjson.JSON;
+import org.hswebframework.web.tests.SimpleWebApplicationTests;
+import org.junit.Assert;
+import org.junit.Test;
+import org.springframework.http.MediaType;
+import org.springframework.mock.web.MockMultipartFile;
+import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
+
+/**
+ * fix bug #93 test
+ *
+ * @author zhouhao
+ * @since 3.0.2
+ */
+public class FixBug93Test extends SimpleWebApplicationTests {
+
+ @Test
+ public void testUploadFile() throws Exception {
+ String result = mvc.perform(
+ MockMvcRequestBuilders
+ .fileUpload("/file/upload")
+ .file(new MockMultipartFile("file", "test中文.txt", MediaType.TEXT_PLAIN_VALUE, "test".getBytes()))
+ ).andReturn()
+ .getResponse()
+ .getContentAsString();
+
+ Assert.assertEquals(JSON.parseObject(result).getJSONObject("result").getString("name"), "test中文.txt");
+ }
+
+}
diff --git a/hsweb-system/hsweb-system-file/hsweb-system-file-web/pom.xml b/hsweb-system/hsweb-system-file/hsweb-system-file-web/pom.xml
index 6b86ee635..2fb9dc7e5 100644
--- a/hsweb-system/hsweb-system-file/hsweb-system-file-web/pom.xml
+++ b/hsweb-system/hsweb-system-file/hsweb-system-file-web/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-file
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
../pom.xml
4.0.0
@@ -16,8 +16,7 @@
javax.servlet
- servlet-api
- 2.5
+ javax.servlet-api
true
diff --git a/hsweb-system/hsweb-system-file/hsweb-system-file-web/src/main/java/org/hswebframework/web/controller/file/FileController.java b/hsweb-system/hsweb-system-file/hsweb-system-file-web/src/main/java/org/hswebframework/web/controller/file/FileController.java
index 50ded359e..c36d27a09 100644
--- a/hsweb-system/hsweb-system-file/hsweb-system-file-web/src/main/java/org/hswebframework/web/controller/file/FileController.java
+++ b/hsweb-system/hsweb-system-file/hsweb-system-file-web/src/main/java/org/hswebframework/web/controller/file/FileController.java
@@ -33,6 +33,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -254,35 +255,27 @@ public class FileController {
@ApiOperation("上传单个文件")
@Authorize(action = "upload", description = "上传文件")
public ResponseMessage upload(@RequestPart("file") MultipartFile file) {
- List fileInfoList = new LinkedList<>();
Authentication authentication = Authentication.current().orElse(null);
String creator = authentication == null ? null : authentication.getUser().getId();
if (file.isEmpty()) {
return ResponseMessage.ok();
}
String fileName = file.getOriginalFilename();
- String contentType = Optional.ofNullable(WebUtil.getHttpServletRequest())
- .orElseThrow(UnsupportedOperationException::new)
- .getContentType();
- ParameterParser parser = new ParameterParser();
- Map params = parser.parse(contentType, ';');
- if (params.get("charset") == null) {
- try {
- fileName = new String(file.getOriginalFilename().getBytes("ISO-8859-1"), "utf-8");
- } catch (@SuppressWarnings("all") UnsupportedEncodingException ignore) {
- }
- }
- if (logger.isInfoEnabled()) {
- logger.info("start write file:{}", fileName);
- }
-
+ //fix bug #93
+// String contentType = Optional.ofNullable(WebUtil.getHttpServletRequest())
+// .orElseThrow(UnsupportedOperationException::new)
+// .getContentType();
+// ParameterParser parser = new ParameterParser();
+// Map params = parser.parse(contentType, ';');
+// if (params.get("charset") == null) {
+// fileName = new String(file.getOriginalFilename().getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8);
+// }
FileInfoEntity fileInfo;
try {
fileInfo = fileService.saveFile(file.getInputStream(), fileName, file.getContentType(), creator);
} catch (IOException e) {
throw new BusinessException("save file error", e);
}
- fileInfoList.add(fileInfo);
return ResponseMessage.ok(fileInfo)
.include(FileInfoEntity.class, FileInfoEntity.id,
FileInfoEntity.name,
diff --git a/hsweb-system/hsweb-system-file/pom.xml b/hsweb-system/hsweb-system-file/pom.xml
index fc01ab5de..55b4c6580 100644
--- a/hsweb-system/hsweb-system-file/pom.xml
+++ b/hsweb-system/hsweb-system-file/pom.xml
@@ -5,7 +5,7 @@
hsweb-system
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-oauth2-client/hsweb-system-oauth2-client-api/pom.xml b/hsweb-system/hsweb-system-oauth2-client/hsweb-system-oauth2-client-api/pom.xml
index 47d34b7b1..2793f5af1 100644
--- a/hsweb-system/hsweb-system-oauth2-client/hsweb-system-oauth2-client-api/pom.xml
+++ b/hsweb-system/hsweb-system-oauth2-client/hsweb-system-oauth2-client-api/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-oauth2-client
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-oauth2-client/hsweb-system-oauth2-client-local/pom.xml b/hsweb-system/hsweb-system-oauth2-client/hsweb-system-oauth2-client-local/pom.xml
index 2f148f205..45deb51f0 100644
--- a/hsweb-system/hsweb-system-oauth2-client/hsweb-system-oauth2-client-local/pom.xml
+++ b/hsweb-system/hsweb-system-oauth2-client/hsweb-system-oauth2-client-local/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-oauth2-client
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-oauth2-client/hsweb-system-oauth2-client-starter/pom.xml b/hsweb-system/hsweb-system-oauth2-client/hsweb-system-oauth2-client-starter/pom.xml
index 051760758..54e11118f 100644
--- a/hsweb-system/hsweb-system-oauth2-client/hsweb-system-oauth2-client-starter/pom.xml
+++ b/hsweb-system/hsweb-system-oauth2-client/hsweb-system-oauth2-client-starter/pom.xml
@@ -22,7 +22,7 @@
hsweb-system-oauth2-client
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
@@ -78,8 +78,7 @@
javax.servlet
- servlet-api
- 2.5
+ javax.servlet-api
test
diff --git a/hsweb-system/hsweb-system-oauth2-client/hsweb-system-oauth2-client-web/pom.xml b/hsweb-system/hsweb-system-oauth2-client/hsweb-system-oauth2-client-web/pom.xml
index 046fefb89..ee15aaf4b 100644
--- a/hsweb-system/hsweb-system-oauth2-client/hsweb-system-oauth2-client-web/pom.xml
+++ b/hsweb-system/hsweb-system-oauth2-client/hsweb-system-oauth2-client-web/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-oauth2-client
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
@@ -15,8 +15,7 @@
javax.servlet
- servlet-api
- 2.5
+ javax.servlet-api
true
diff --git a/hsweb-system/hsweb-system-oauth2-client/pom.xml b/hsweb-system/hsweb-system-oauth2-client/pom.xml
index cc30a77e2..9535cc562 100644
--- a/hsweb-system/hsweb-system-oauth2-client/pom.xml
+++ b/hsweb-system/hsweb-system-oauth2-client/pom.xml
@@ -23,7 +23,7 @@
hsweb-system
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-local/pom.xml b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-local/pom.xml
index 7459be93a..be28e4161 100644
--- a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-local/pom.xml
+++ b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-local/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-oauth2-server
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
../pom.xml
4.0.0
diff --git a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-starter/pom.xml b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-starter/pom.xml
index e8c8630f6..df92e63f5 100644
--- a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-starter/pom.xml
+++ b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-starter/pom.xml
@@ -23,7 +23,7 @@
hsweb-system-oauth2-server
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
../pom.xml
4.0.0
@@ -51,8 +51,7 @@
javax.servlet
- servlet-api
- 2.5
+ javax.servlet-api
provided
diff --git a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-web/pom.xml b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-web/pom.xml
index 1aa30aece..07c9a47b9 100644
--- a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-web/pom.xml
+++ b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-web/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-oauth2-server
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
../pom.xml
4.0.0
@@ -32,8 +32,7 @@
javax.servlet
- servlet-api
- 2.5
+ javax.servlet-api
true
diff --git a/hsweb-system/hsweb-system-oauth2-server/pom.xml b/hsweb-system/hsweb-system-oauth2-server/pom.xml
index d46ba0e14..f91ce320f 100644
--- a/hsweb-system/hsweb-system-oauth2-server/pom.xml
+++ b/hsweb-system/hsweb-system-oauth2-server/pom.xml
@@ -23,7 +23,7 @@
hsweb-system
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
../pom.xml
4.0.0
diff --git a/hsweb-system/hsweb-system-organizational/hsweb-system-organizational-api/pom.xml b/hsweb-system/hsweb-system-organizational/hsweb-system-organizational-api/pom.xml
index 160abadf5..1721752db 100644
--- a/hsweb-system/hsweb-system-organizational/hsweb-system-organizational-api/pom.xml
+++ b/hsweb-system/hsweb-system-organizational/hsweb-system-organizational-api/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-organizational
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-organizational/hsweb-system-organizational-authorization/pom.xml b/hsweb-system/hsweb-system-organizational/hsweb-system-organizational-authorization/pom.xml
index 94f68633d..c3518b195 100644
--- a/hsweb-system/hsweb-system-organizational/hsweb-system-organizational-authorization/pom.xml
+++ b/hsweb-system/hsweb-system-organizational/hsweb-system-organizational-authorization/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-organizational
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-organizational/hsweb-system-organizational-local/pom.xml b/hsweb-system/hsweb-system-organizational/hsweb-system-organizational-local/pom.xml
index aaa9fa23f..2f34a3288 100644
--- a/hsweb-system/hsweb-system-organizational/hsweb-system-organizational-local/pom.xml
+++ b/hsweb-system/hsweb-system-organizational/hsweb-system-organizational-local/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-organizational
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-organizational/hsweb-system-organizational-local/src/main/java/org/hswebframework/web/service/organizational/simple/terms/InServiceTreeInSqlTerm.java b/hsweb-system/hsweb-system-organizational/hsweb-system-organizational-local/src/main/java/org/hswebframework/web/service/organizational/simple/terms/InServiceTreeInSqlTerm.java
index 632b4c5ef..0c01724be 100644
--- a/hsweb-system/hsweb-system-organizational/hsweb-system-organizational-local/src/main/java/org/hswebframework/web/service/organizational/simple/terms/InServiceTreeInSqlTerm.java
+++ b/hsweb-system/hsweb-system-organizational/hsweb-system-organizational-local/src/main/java/org/hswebframework/web/service/organizational/simple/terms/InServiceTreeInSqlTerm.java
@@ -1,7 +1,7 @@
package org.hswebframework.web.service.organizational.simple.terms;
import org.hswebframework.web.commons.entity.TreeSupportEntity;
-import org.hswebframework.web.dao.mybatis.mapper.TreeStructureSqlTermCustomer;
+import org.hswebframework.web.dao.mybatis.mapper.TreeStructureSqlTermCustomizer;
import org.hswebframework.web.service.QueryService;
import java.util.List;
@@ -12,7 +12,7 @@ import java.util.stream.Collectors;
* @author zhouhao
* @since 3.0.0-RC
*/
-public class InServiceTreeInSqlTerm extends TreeStructureSqlTermCustomer {
+public class InServiceTreeInSqlTerm extends TreeStructureSqlTermCustomizer {
private QueryService extends TreeSupportEntity, PK> treeService;
diff --git a/hsweb-system/hsweb-system-organizational/hsweb-system-organizational-local/src/main/java/org/hswebframework/web/service/organizational/simple/terms/UserInSqlTerm.java b/hsweb-system/hsweb-system-organizational/hsweb-system-organizational-local/src/main/java/org/hswebframework/web/service/organizational/simple/terms/UserInSqlTerm.java
index 47390de08..770657732 100644
--- a/hsweb-system/hsweb-system-organizational/hsweb-system-organizational-local/src/main/java/org/hswebframework/web/service/organizational/simple/terms/UserInSqlTerm.java
+++ b/hsweb-system/hsweb-system-organizational/hsweb-system-organizational-local/src/main/java/org/hswebframework/web/service/organizational/simple/terms/UserInSqlTerm.java
@@ -8,7 +8,7 @@ import org.hswebframework.ezorm.rdb.render.dialect.Dialect;
import org.hswebframework.ezorm.rdb.render.dialect.RenderPhase;
import org.hswebframework.ezorm.rdb.render.dialect.function.SqlFunction;
import org.hswebframework.web.commons.entity.TreeSupportEntity;
-import org.hswebframework.web.dao.mybatis.mapper.AbstractSqlTermCustomer;
+import org.hswebframework.web.dao.mybatis.mapper.AbstractSqlTermCustomizer;
import org.hswebframework.web.service.QueryService;
import java.util.Arrays;
@@ -24,7 +24,7 @@ import java.util.stream.Collectors;
* @since 3.0.0-RC
*/
@Slf4j
-public abstract class UserInSqlTerm extends AbstractSqlTermCustomer {
+public abstract class UserInSqlTerm extends AbstractSqlTermCustomizer {
@Setter
diff --git a/hsweb-system/hsweb-system-organizational/hsweb-system-organizational-starter/pom.xml b/hsweb-system/hsweb-system-organizational/hsweb-system-organizational-starter/pom.xml
index 195904385..5a71264ca 100644
--- a/hsweb-system/hsweb-system-organizational/hsweb-system-organizational-starter/pom.xml
+++ b/hsweb-system/hsweb-system-organizational/hsweb-system-organizational-starter/pom.xml
@@ -22,7 +22,7 @@
hsweb-system-organizational
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
@@ -78,8 +78,7 @@
javax.servlet
- servlet-api
- 2.5
+ javax.servlet-api
test
diff --git a/hsweb-system/hsweb-system-organizational/hsweb-system-organizational-web/pom.xml b/hsweb-system/hsweb-system-organizational/hsweb-system-organizational-web/pom.xml
index 369b12bda..2ef4f80df 100644
--- a/hsweb-system/hsweb-system-organizational/hsweb-system-organizational-web/pom.xml
+++ b/hsweb-system/hsweb-system-organizational/hsweb-system-organizational-web/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-organizational
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
@@ -15,8 +15,7 @@
javax.servlet
- servlet-api
- 2.5
+ javax.servlet-api
true
diff --git a/hsweb-system/hsweb-system-organizational/pom.xml b/hsweb-system/hsweb-system-organizational/pom.xml
index d500a81c0..dee8388b3 100644
--- a/hsweb-system/hsweb-system-organizational/pom.xml
+++ b/hsweb-system/hsweb-system-organizational/pom.xml
@@ -22,7 +22,7 @@
hsweb-system
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-schedule/hsweb-system-schedule-api/pom.xml b/hsweb-system/hsweb-system-schedule/hsweb-system-schedule-api/pom.xml
index d3612dece..c62a695f1 100644
--- a/hsweb-system/hsweb-system-schedule/hsweb-system-schedule-api/pom.xml
+++ b/hsweb-system/hsweb-system-schedule/hsweb-system-schedule-api/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-schedule
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-schedule/hsweb-system-schedule-local/pom.xml b/hsweb-system/hsweb-system-schedule/hsweb-system-schedule-local/pom.xml
index 827b6402a..98de1a4c8 100644
--- a/hsweb-system/hsweb-system-schedule/hsweb-system-schedule-local/pom.xml
+++ b/hsweb-system/hsweb-system-schedule/hsweb-system-schedule-local/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-schedule
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
../pom.xml
4.0.0
diff --git a/hsweb-system/hsweb-system-schedule/hsweb-system-schedule-starter/pom.xml b/hsweb-system/hsweb-system-schedule/hsweb-system-schedule-starter/pom.xml
index fb8aae077..d3c2f6c90 100644
--- a/hsweb-system/hsweb-system-schedule/hsweb-system-schedule-starter/pom.xml
+++ b/hsweb-system/hsweb-system-schedule/hsweb-system-schedule-starter/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-schedule
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
@@ -77,8 +77,7 @@
javax.servlet
- servlet-api
- 2.5
+ javax.servlet-api
test
diff --git a/hsweb-system/hsweb-system-schedule/hsweb-system-schedule-web/pom.xml b/hsweb-system/hsweb-system-schedule/hsweb-system-schedule-web/pom.xml
index 81b393cb1..eebe9dffb 100644
--- a/hsweb-system/hsweb-system-schedule/hsweb-system-schedule-web/pom.xml
+++ b/hsweb-system/hsweb-system-schedule/hsweb-system-schedule-web/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-schedule
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
@@ -14,8 +14,7 @@
javax.servlet
- servlet-api
- 2.5
+ javax.servlet-api
true
diff --git a/hsweb-system/hsweb-system-schedule/pom.xml b/hsweb-system/hsweb-system-schedule/pom.xml
index 6ca9f3591..ffb1f5c65 100644
--- a/hsweb-system/hsweb-system-schedule/pom.xml
+++ b/hsweb-system/hsweb-system-schedule/pom.xml
@@ -5,7 +5,7 @@
hsweb-system
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
pom
diff --git a/hsweb-system/hsweb-system-script/hsweb-system-script-api/pom.xml b/hsweb-system/hsweb-system-script/hsweb-system-script-api/pom.xml
index 2da1d9f00..1ab81b56c 100644
--- a/hsweb-system/hsweb-system-script/hsweb-system-script-api/pom.xml
+++ b/hsweb-system/hsweb-system-script/hsweb-system-script-api/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-script
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-script/hsweb-system-script-local/pom.xml b/hsweb-system/hsweb-system-script/hsweb-system-script-local/pom.xml
index 05f4064f0..1c0b6386a 100644
--- a/hsweb-system/hsweb-system-script/hsweb-system-script-local/pom.xml
+++ b/hsweb-system/hsweb-system-script/hsweb-system-script-local/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-script
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-script/hsweb-system-script-starter/pom.xml b/hsweb-system/hsweb-system-script/hsweb-system-script-starter/pom.xml
index 73a9602a4..3ec421509 100644
--- a/hsweb-system/hsweb-system-script/hsweb-system-script-starter/pom.xml
+++ b/hsweb-system/hsweb-system-script/hsweb-system-script-starter/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-script
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
@@ -63,8 +63,7 @@
javax.servlet
- servlet-api
- 2.5
+ javax.servlet-api
test
diff --git a/hsweb-system/hsweb-system-script/hsweb-system-script-web/pom.xml b/hsweb-system/hsweb-system-script/hsweb-system-script-web/pom.xml
index 1f81e43d4..5532eb6df 100644
--- a/hsweb-system/hsweb-system-script/hsweb-system-script-web/pom.xml
+++ b/hsweb-system/hsweb-system-script/hsweb-system-script-web/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-script
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
@@ -14,8 +14,7 @@
javax.servlet
- servlet-api
- 2.5
+ javax.servlet-api
true
diff --git a/hsweb-system/hsweb-system-script/pom.xml b/hsweb-system/hsweb-system-script/pom.xml
index 947da2b52..a925cf6d8 100644
--- a/hsweb-system/hsweb-system-script/pom.xml
+++ b/hsweb-system/hsweb-system-script/pom.xml
@@ -5,7 +5,7 @@
hsweb-system
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-template/hsweb-system-template-api/pom.xml b/hsweb-system/hsweb-system-template/hsweb-system-template-api/pom.xml
index f545e5654..a23ffd58d 100644
--- a/hsweb-system/hsweb-system-template/hsweb-system-template-api/pom.xml
+++ b/hsweb-system/hsweb-system-template/hsweb-system-template-api/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-template
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-template/hsweb-system-template-local/pom.xml b/hsweb-system/hsweb-system-template/hsweb-system-template-local/pom.xml
index e9cb224cb..ec3c26f8f 100644
--- a/hsweb-system/hsweb-system-template/hsweb-system-template-local/pom.xml
+++ b/hsweb-system/hsweb-system-template/hsweb-system-template-local/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-template
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-template/hsweb-system-template-starter/pom.xml b/hsweb-system/hsweb-system-template/hsweb-system-template-starter/pom.xml
index f2f1f7173..a2289dc52 100644
--- a/hsweb-system/hsweb-system-template/hsweb-system-template-starter/pom.xml
+++ b/hsweb-system/hsweb-system-template/hsweb-system-template-starter/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-template
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
@@ -63,8 +63,7 @@
javax.servlet
- servlet-api
- 2.5
+ javax.servlet-api
test
diff --git a/hsweb-system/hsweb-system-template/hsweb-system-template-web/pom.xml b/hsweb-system/hsweb-system-template/hsweb-system-template-web/pom.xml
index 40a01b3e2..a38dc9729 100644
--- a/hsweb-system/hsweb-system-template/hsweb-system-template-web/pom.xml
+++ b/hsweb-system/hsweb-system-template/hsweb-system-template-web/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-template
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
@@ -14,8 +14,7 @@
javax.servlet
- servlet-api
- 2.5
+ javax.servlet-api
true
diff --git a/hsweb-system/hsweb-system-template/pom.xml b/hsweb-system/hsweb-system-template/pom.xml
index b10dcc57f..ab725f69a 100644
--- a/hsweb-system/hsweb-system-template/pom.xml
+++ b/hsweb-system/hsweb-system-template/pom.xml
@@ -5,7 +5,7 @@
hsweb-system
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/pom.xml b/hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/pom.xml
index 523dc576c..4f93cb985 100644
--- a/hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/pom.xml
+++ b/hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-workflow
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
../pom.xml
4.0.0
diff --git a/hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/src/main/java/org/hswebframework/web/workflow/service/imp/WorkFlowFormServiceImpl.java b/hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/src/main/java/org/hswebframework/web/workflow/service/imp/WorkFlowFormServiceImpl.java
index 88ee2e258..ca0b42b1b 100644
--- a/hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/src/main/java/org/hswebframework/web/workflow/service/imp/WorkFlowFormServiceImpl.java
+++ b/hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/src/main/java/org/hswebframework/web/workflow/service/imp/WorkFlowFormServiceImpl.java
@@ -3,7 +3,6 @@ package org.hswebframework.web.workflow.service.imp;
import org.activiti.engine.impl.persistence.entity.ExecutionEntity;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
-import org.hswebframework.ezorm.rdb.RDBTable;
import org.hswebframework.ezorm.rdb.meta.RDBColumnMetaData;
import org.hswebframework.ezorm.rdb.meta.RDBTableMetaData;
import org.hswebframework.ezorm.rdb.meta.converter.DateTimeConverter;
@@ -13,21 +12,17 @@ import org.hswebframework.web.commons.entity.PagerResult;
import org.hswebframework.web.commons.entity.param.QueryParamEntity;
import org.hswebframework.web.service.form.DynamicFormOperationService;
import org.hswebframework.web.service.form.initialize.ColumnInitializeContext;
-import org.hswebframework.web.service.form.initialize.DynamicFormInitializeCustomer;
+import org.hswebframework.web.service.form.initialize.DynamicFormInitializeCustomizer;
import org.hswebframework.web.service.form.initialize.TableInitializeContext;
import org.hswebframework.web.workflow.dao.entity.ActivityConfigEntity;
import org.hswebframework.web.workflow.dao.entity.ProcessDefineConfigEntity;
import org.hswebframework.web.workflow.service.ActivityConfigService;
import org.hswebframework.web.workflow.service.ProcessDefineConfigService;
-import org.hswebframework.web.workflow.service.config.ProcessConfigurationService;
import org.hswebframework.web.workflow.service.WorkFlowFormService;
-import org.hswebframework.web.workflow.service.config.ActivityConfiguration;
-import org.hswebframework.web.workflow.service.config.ProcessConfiguration;
import org.hswebframework.web.workflow.service.request.SaveFormRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.sql.JDBCType;
@@ -39,7 +34,7 @@ import java.util.*;
*/
@Service
@Transactional(rollbackFor = Exception.class)
-public class WorkFlowFormServiceImpl extends AbstractFlowableService implements WorkFlowFormService, DynamicFormInitializeCustomer {
+public class WorkFlowFormServiceImpl extends AbstractFlowableService implements WorkFlowFormService, DynamicFormInitializeCustomizer {
@Autowired
private DynamicFormOperationService dynamicFormOperationService;
diff --git a/hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/src/main/java/org/hswebframework/web/workflow/terms/ClaimSqlTerm.java b/hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/src/main/java/org/hswebframework/web/workflow/terms/ClaimSqlTerm.java
index 9d49971d7..7f5a03dac 100644
--- a/hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/src/main/java/org/hswebframework/web/workflow/terms/ClaimSqlTerm.java
+++ b/hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/src/main/java/org/hswebframework/web/workflow/terms/ClaimSqlTerm.java
@@ -4,7 +4,7 @@ import org.hswebframework.ezorm.core.param.Term;
import org.hswebframework.ezorm.rdb.meta.RDBColumnMetaData;
import org.hswebframework.ezorm.rdb.render.SqlAppender;
import org.hswebframework.ezorm.rdb.render.dialect.term.BoostTermTypeMapper;
-import org.hswebframework.web.dao.mybatis.mapper.AbstractSqlTermCustomer;
+import org.hswebframework.web.dao.mybatis.mapper.AbstractSqlTermCustomizer;
import org.hswebframework.web.dao.mybatis.mapper.ChangedTermValue;
import java.util.List;
@@ -15,7 +15,7 @@ import java.util.List;
* @author zhouhao
* @since 3.0.0-RC
*/
-public class ClaimSqlTerm extends AbstractSqlTermCustomer {
+public class ClaimSqlTerm extends AbstractSqlTermCustomizer {
public ClaimSqlTerm(String termType) {
super(termType);
}
diff --git a/hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/src/main/java/org/hswebframework/web/workflow/terms/CompletedSqlTerm.java b/hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/src/main/java/org/hswebframework/web/workflow/terms/CompletedSqlTerm.java
index 0dfe30722..093ab9264 100644
--- a/hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/src/main/java/org/hswebframework/web/workflow/terms/CompletedSqlTerm.java
+++ b/hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/src/main/java/org/hswebframework/web/workflow/terms/CompletedSqlTerm.java
@@ -4,7 +4,7 @@ import org.hswebframework.ezorm.core.param.Term;
import org.hswebframework.ezorm.rdb.meta.RDBColumnMetaData;
import org.hswebframework.ezorm.rdb.render.SqlAppender;
import org.hswebframework.ezorm.rdb.render.dialect.term.BoostTermTypeMapper;
-import org.hswebframework.web.dao.mybatis.mapper.AbstractSqlTermCustomer;
+import org.hswebframework.web.dao.mybatis.mapper.AbstractSqlTermCustomizer;
import org.hswebframework.web.dao.mybatis.mapper.ChangedTermValue;
import java.util.List;
@@ -15,7 +15,7 @@ import java.util.List;
* @author zhouhao
* @since 3.0.0-RC
*/
-public class CompletedSqlTerm extends AbstractSqlTermCustomer {
+public class CompletedSqlTerm extends AbstractSqlTermCustomizer {
public CompletedSqlTerm(String termType) {
super(termType);
}
diff --git a/hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/src/main/java/org/hswebframework/web/workflow/terms/ProcessParticipateSqlTerm.java b/hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/src/main/java/org/hswebframework/web/workflow/terms/ProcessParticipateSqlTerm.java
index 1b4f8aa4a..0bbf6d868 100644
--- a/hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/src/main/java/org/hswebframework/web/workflow/terms/ProcessParticipateSqlTerm.java
+++ b/hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/src/main/java/org/hswebframework/web/workflow/terms/ProcessParticipateSqlTerm.java
@@ -4,7 +4,7 @@ import org.hswebframework.ezorm.core.param.Term;
import org.hswebframework.ezorm.rdb.meta.RDBColumnMetaData;
import org.hswebframework.ezorm.rdb.render.SqlAppender;
import org.hswebframework.ezorm.rdb.render.dialect.term.BoostTermTypeMapper;
-import org.hswebframework.web.dao.mybatis.mapper.AbstractSqlTermCustomer;
+import org.hswebframework.web.dao.mybatis.mapper.AbstractSqlTermCustomizer;
import org.hswebframework.web.dao.mybatis.mapper.ChangedTermValue;
import java.util.List;
@@ -15,7 +15,7 @@ import java.util.List;
* @author zhouhao
* @since 3.0.0-RC
*/
-public class ProcessParticipateSqlTerm extends AbstractSqlTermCustomer {
+public class ProcessParticipateSqlTerm extends AbstractSqlTermCustomizer {
public ProcessParticipateSqlTerm(String termType) {
super(termType);
}
diff --git a/hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/src/main/java/org/hswebframework/web/workflow/terms/TodoSqlTerm.java b/hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/src/main/java/org/hswebframework/web/workflow/terms/TodoSqlTerm.java
index 5732c7b01..ccb1afff8 100644
--- a/hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/src/main/java/org/hswebframework/web/workflow/terms/TodoSqlTerm.java
+++ b/hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/src/main/java/org/hswebframework/web/workflow/terms/TodoSqlTerm.java
@@ -4,7 +4,7 @@ import org.hswebframework.ezorm.core.param.Term;
import org.hswebframework.ezorm.rdb.meta.RDBColumnMetaData;
import org.hswebframework.ezorm.rdb.render.SqlAppender;
import org.hswebframework.ezorm.rdb.render.dialect.term.BoostTermTypeMapper;
-import org.hswebframework.web.dao.mybatis.mapper.AbstractSqlTermCustomer;
+import org.hswebframework.web.dao.mybatis.mapper.AbstractSqlTermCustomizer;
import org.hswebframework.web.dao.mybatis.mapper.ChangedTermValue;
import java.util.List;
@@ -15,7 +15,7 @@ import java.util.List;
* @author zhouhao
* @since 3.0.0-RC
*/
-public class TodoSqlTerm extends AbstractSqlTermCustomer {
+public class TodoSqlTerm extends AbstractSqlTermCustomizer {
public TodoSqlTerm(String termType) {
super(termType);
}
diff --git a/hsweb-system/hsweb-system-workflow/hsweb-system-workflow-starter/pom.xml b/hsweb-system/hsweb-system-workflow/hsweb-system-workflow-starter/pom.xml
index 3ded1d7c4..97bd7f00c 100644
--- a/hsweb-system/hsweb-system-workflow/hsweb-system-workflow-starter/pom.xml
+++ b/hsweb-system/hsweb-system-workflow/hsweb-system-workflow-starter/pom.xml
@@ -5,7 +5,7 @@
hsweb-system-workflow
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
../pom.xml
4.0.0
diff --git a/hsweb-system/hsweb-system-workflow/pom.xml b/hsweb-system/hsweb-system-workflow/pom.xml
index 534496f0f..7cef4cad0 100644
--- a/hsweb-system/hsweb-system-workflow/pom.xml
+++ b/hsweb-system/hsweb-system-workflow/pom.xml
@@ -5,7 +5,7 @@
hsweb-system
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
../pom.xml
4.0.0
diff --git a/hsweb-system/pom.xml b/hsweb-system/pom.xml
index b209ab2fe..d43f81398 100644
--- a/hsweb-system/pom.xml
+++ b/hsweb-system/pom.xml
@@ -5,7 +5,7 @@
hsweb-framework
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
../pom.xml
4.0.0
diff --git a/hsweb-tests/pom.xml b/hsweb-tests/pom.xml
index 0c017f7ff..65cc08e2d 100644
--- a/hsweb-tests/pom.xml
+++ b/hsweb-tests/pom.xml
@@ -5,7 +5,7 @@
hsweb-framework
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/hsweb-tests/src/main/groovy/org/hswebframework/web/tests/HswebCrudWebApiSpecification.groovy b/hsweb-tests/src/main/groovy/org/hswebframework/web/tests/HswebCrudWebApiSpecification.groovy
new file mode 100644
index 000000000..9bdb9480d
--- /dev/null
+++ b/hsweb-tests/src/main/groovy/org/hswebframework/web/tests/HswebCrudWebApiSpecification.groovy
@@ -0,0 +1,121 @@
+package org.hswebframework.web.tests
+
+import com.alibaba.fastjson.JSON
+import org.hswebframework.ezorm.core.dsl.Query
+import org.hswebframework.web.WebUtil
+import org.hswebframework.web.commons.entity.param.QueryParamEntity
+import org.springframework.http.MediaType
+import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;
+
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*
+
+
+/**
+ * @author zhouhao
+ * @since 3.0.2
+ */
+abstract class HswebCrudWebApiSpecification extends HswebSpecification {
+
+ protected abstract String getBaseApi();
+
+ def doAddRequest(String requestBody) {
+ def response = mockMvc.perform(post(getBaseApi())
+ .content(requestBody)
+ .contentType(MediaType.APPLICATION_JSON))
+ .andReturn()
+ .response
+ .contentAsString;
+ return JSON.parseObject(response);
+ }
+
+ def doUpdateRequest(String id, String requestBody) {
+ def response = mockMvc.perform(put("${getBaseApi()}/{id}", id)
+ .content(requestBody)
+ .contentType(MediaType.APPLICATION_JSON))
+ .andReturn()
+ .response
+ .contentAsString;
+ return JSON.parseObject(response);
+ }
+
+ def doDeleteRequest(String id) {
+ def response = mockMvc
+ .perform(delete("${getBaseApi()}/{id}", id))
+ .andReturn()
+ .response
+ .contentAsString;
+ return JSON.parseObject(response);
+ }
+
+ def doGetRequest(String id) {
+ def response = mockMvc
+ .perform(get("${getBaseApi()}/{id}", id))
+ .andReturn()
+ .response
+ .contentAsString;
+ return JSON.parseObject(response);
+ }
+
+
+ Query createQuery() {
+ return Query.empty(new QueryParamEntity());
+ }
+
+ def doQueryRequest(Query query) {
+ MockHttpServletRequestBuilder get = get("${getBaseApi()}")
+ WebUtil.objectToHttpParameters(query.param)
+ .forEach({ k, v -> get.param(k, v) })
+ def response = mockMvc
+ .perform(get)
+ .andReturn()
+ .response
+ .contentAsString;
+ return JSON.parseObject(response);
+ }
+
+ def doQueryByIdsRequest(String ids) {
+ def response = mockMvc
+ .perform(get("${getBaseApi()}/ids").param("ids", ids))
+ .andReturn()
+ .response
+ .contentAsString;
+ return JSON.parseObject(response);
+ }
+
+ def doTotalRequest(Query query) {
+ MockHttpServletRequestBuilder get = get("${getBaseApi()}/total")
+ WebUtil.objectToHttpParameters(query.param)
+ .forEach({ k, v -> get.param(k, v) })
+
+ def response = mockMvc
+ .perform(get)
+ .andReturn()
+ .response
+ .contentAsString;
+ return JSON.parseObject(response);
+ }
+
+ def doCountRequest(Query query) {
+ MockHttpServletRequestBuilder get = get("${getBaseApi()}/count")
+ WebUtil.objectToHttpParameters(query.param)
+ .forEach({ k, v -> get.param(k, v) })
+ def response = mockMvc
+ .perform(get)
+ .andReturn()
+ .response
+ .contentAsString;
+ return JSON.parseObject(response);
+ }
+
+ def doNoPagingRequest(Query query) {
+ MockHttpServletRequestBuilder get = get("${getBaseApi()}/no-paging")
+ WebUtil.objectToHttpParameters(query.param)
+ .forEach({ k, v -> get.param(k, v) })
+ def response = mockMvc
+ .perform(get)
+ .andReturn()
+ .response
+ .contentAsString;
+ return JSON.parseObject(response);
+ }
+}
diff --git a/hsweb-tests/src/main/groovy/org/hswebframework/web/tests/HswebSpecification.groovy b/hsweb-tests/src/main/groovy/org/hswebframework/web/tests/HswebSpecification.groovy
new file mode 100644
index 000000000..750aec1a2
--- /dev/null
+++ b/hsweb-tests/src/main/groovy/org/hswebframework/web/tests/HswebSpecification.groovy
@@ -0,0 +1,31 @@
+package org.hswebframework.web.tests
+
+import org.springframework.beans.factory.annotation.Autowired
+import org.springframework.boot.test.context.SpringBootTest
+import org.springframework.context.ConfigurableApplicationContext
+import org.springframework.test.context.ContextConfiguration
+import org.springframework.test.context.web.WebAppConfiguration
+import org.springframework.test.web.servlet.MockMvc
+import org.springframework.test.web.servlet.setup.MockMvcBuilders
+import spock.lang.Shared
+import spock.lang.Specification
+
+/**
+ * @author zhouhao
+ * @since 3.0.2
+ */
+@WebAppConfiguration
+@ContextConfiguration
+@SpringBootTest(classes = [HswebTestApplication.class], properties = ["classpath:application.yml"])
+class HswebSpecification extends Specification {
+ @Autowired
+ protected ConfigurableApplicationContext context;
+
+ @Shared
+ protected MockMvc mockMvc;
+
+ void setup() {
+ mockMvc = MockMvcBuilders.webAppContextSetup(context).build();
+ }
+
+}
diff --git a/hsweb-tests/src/main/groovy/org/hswebframework/web/tests/HswebTestApplication.groovy b/hsweb-tests/src/main/groovy/org/hswebframework/web/tests/HswebTestApplication.groovy
new file mode 100644
index 000000000..90455765c
--- /dev/null
+++ b/hsweb-tests/src/main/groovy/org/hswebframework/web/tests/HswebTestApplication.groovy
@@ -0,0 +1,15 @@
+package org.hswebframework.web.tests;
+
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.test.context.web.WebAppConfiguration;
+
+/**
+ * @author zhouhao
+ * @since 3.0.2
+ */
+@SpringBootApplication
+@WebAppConfiguration
+@Configuration
+class HswebTestApplication {
+}
diff --git a/hsweb-tests/src/main/java/org/hswebframework/web/tests/SimpleWebApplicationTests.java b/hsweb-tests/src/main/java/org/hswebframework/web/tests/SimpleWebApplicationTests.java
index fbf1b9441..b9f4e6510 100644
--- a/hsweb-tests/src/main/java/org/hswebframework/web/tests/SimpleWebApplicationTests.java
+++ b/hsweb-tests/src/main/java/org/hswebframework/web/tests/SimpleWebApplicationTests.java
@@ -41,12 +41,13 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder
import static org.springframework.test.web.servlet.setup.MockMvcBuilders.webAppContextSetup;
/**
- * TODO 完成注释
+ * 已弃用,请使用 {@link HswebSpecification} {@link HswebCrudWebApiSpecification }
*
* @author zhouhao
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = SimpleWebApplicationTests.Config.class)
+@Deprecated
public class SimpleWebApplicationTests extends AbstractTransactionalJUnit4SpringContextTests {
protected MockMvc mvc;
diff --git a/hsweb-tests/src/test/groovy/org/hswebframework/web/tests/HswebCrudWebApiSpecificationTest.groovy b/hsweb-tests/src/test/groovy/org/hswebframework/web/tests/HswebCrudWebApiSpecificationTest.groovy
new file mode 100644
index 000000000..82d8c681f
--- /dev/null
+++ b/hsweb-tests/src/test/groovy/org/hswebframework/web/tests/HswebCrudWebApiSpecificationTest.groovy
@@ -0,0 +1,88 @@
+package org.hswebframework.web.tests
+
+import com.alibaba.fastjson.JSONObject
+import spock.lang.Specification
+
+/**
+ * @author zhouhao
+ * @since 3.0.2
+ */
+class HswebCrudWebApiSpecificationTest extends HswebCrudWebApiSpecification {
+
+ @Override
+ protected String getBaseApi() {
+ return "/test"
+ }
+
+ def "测试初始化"() {
+ expect:
+ mockMvc != null
+ context != null
+ }
+
+ def "测试新增"() {
+ given:
+ def response = doAddRequest(JSONObject.toJSONString([name: "test"]));
+ expect:
+ response != null
+ response.status == 200 || response.status == 201
+ }
+
+ def "测试修改"() {
+ given:
+ def response = doUpdateRequest("test", JSONObject.toJSONString([name: "test"]));
+ expect:
+ response != null
+ response.status == 200
+ }
+
+ def "测试删除"() {
+ given:
+ def response = doDeleteRequest("test");
+ expect:
+ response != null
+ response.status == 200
+ }
+
+ def "测试查询"() {
+ given:
+ def response = doQueryRequest(createQuery().where("id", "1234"));
+ expect:
+ response != null
+ response.status == 200
+ }
+
+ def "测试根据id查询"() {
+ given:
+ def response = doGetRequest("1");
+ expect:
+ response != null
+ response.status == 200
+ }
+
+ def "测试根据id集合查询"() {
+ given:
+ def response = doQueryByIdsRequest("1,2,3,4");
+ expect:
+ response != null
+ response.status == 200
+ }
+
+ def "测试查询总数"() {
+ given:
+ def response = doCountRequest(createQuery().where("id", "1234"));
+ expect:
+ response != null
+ response.status == 200
+ }
+
+
+ def "测试不分页查询"() {
+ given:
+ def response = doNoPagingRequest(createQuery().where("id", "1234"));
+ expect:
+ response != null
+ response.status == 200
+ }
+
+}
diff --git a/hsweb-tests/src/test/groovy/org/hswebframework/web/tests/TestController.java b/hsweb-tests/src/test/groovy/org/hswebframework/web/tests/TestController.java
new file mode 100644
index 000000000..647f5de88
--- /dev/null
+++ b/hsweb-tests/src/test/groovy/org/hswebframework/web/tests/TestController.java
@@ -0,0 +1,101 @@
+package org.hswebframework.web.tests;
+
+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.SimpleGenericEntityController;
+import org.hswebframework.web.service.CrudService;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author zhouhao
+ * @since 3.0.2
+ */
+@RestController
+@RequestMapping("/test")
+public class TestController implements SimpleGenericEntityController {
+
+ @Override
+ public CrudService getService() {
+ return new CrudService() {
+ @Override
+ public TestEntity createEntity() {
+ return new TestEntity();
+ }
+
+ @Override
+ public Class getEntityInstanceType() {
+ return TestEntity.class;
+ }
+
+ @Override
+ public TestEntity deleteByPk(String s) {
+ return new TestEntity();
+ }
+
+ @Override
+ public String insert(TestEntity data) {
+ return data.getId();
+ }
+
+ @Override
+ public PagerResult selectPager(Entity param) {
+ return PagerResult.empty();
+ }
+
+ @Override
+ public List select(Entity param) {
+ return Collections.emptyList();
+ }
+
+ @Override
+ public int count(Entity param) {
+ return 0;
+ }
+
+ @Override
+ public TestEntity selectSingle(Entity param) {
+ return null;
+ }
+
+ @Override
+ public TestEntity selectByPk(String id) {
+ return new TestEntity();
+ }
+
+ @Override
+ public List selectByPk(List id) {
+ return Collections.emptyList();
+ }
+
+ @Override
+ public List select() {
+ return Collections.emptyList();
+ }
+
+ @Override
+ public int count() {
+ return 0;
+ }
+
+ @Override
+ public int updateByPk(String id, TestEntity data) {
+ return 0;
+ }
+
+ @Override
+ public int updateByPk(List data) {
+ return 0;
+ }
+
+ @Override
+ public String saveOrUpdate(TestEntity testEntity) {
+ return testEntity.getId();
+ }
+ };
+ }
+}
diff --git a/hsweb-tests/src/test/groovy/org/hswebframework/web/tests/TestEntity.java b/hsweb-tests/src/test/groovy/org/hswebframework/web/tests/TestEntity.java
new file mode 100644
index 000000000..244466453
--- /dev/null
+++ b/hsweb-tests/src/test/groovy/org/hswebframework/web/tests/TestEntity.java
@@ -0,0 +1,10 @@
+package org.hswebframework.web.tests;
+
+import org.hswebframework.web.commons.entity.SimpleGenericEntity;
+
+/**
+ * @author zhouhao
+ * @since 3.0.2
+ */
+public class TestEntity extends SimpleGenericEntity {
+}
diff --git a/hsweb-tests/src/test/resources/application.yml b/hsweb-tests/src/test/resources/application.yml
new file mode 100644
index 000000000..027075c17
--- /dev/null
+++ b/hsweb-tests/src/test/resources/application.yml
@@ -0,0 +1,19 @@
+spring:
+ aop:
+ auto: true
+ datasource:
+ url : jdbc:h2:mem:permission_test_mem
+ username : sa
+ password :
+ type: com.alibaba.druid.pool.DruidDataSource
+ driver-class-name : org.h2.Driver
+hsweb:
+ app:
+ name: 测试
+ version: 3.0.0
+
+logging:
+ level:
+ org.springframework: WARN
+ org.hswebframework: WARN
+ org.hswebframework.web: DEBUG
\ No newline at end of file
diff --git a/hsweb-thirdparty/hsweb-thirdparty-ueditor/pom.xml b/hsweb-thirdparty/hsweb-thirdparty-ueditor/pom.xml
index 22b25851d..806e63424 100644
--- a/hsweb-thirdparty/hsweb-thirdparty-ueditor/pom.xml
+++ b/hsweb-thirdparty/hsweb-thirdparty-ueditor/pom.xml
@@ -5,7 +5,7 @@
hsweb-thirdparty
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
../pom.xml
4.0.0
diff --git a/hsweb-thirdparty/hsweb-thirdparty-ueditor/src/main/java/org/hswebframework/web/thirdpart/ueditor/UeditorController.java b/hsweb-thirdparty/hsweb-thirdparty-ueditor/src/main/java/org/hswebframework/web/thirdpart/ueditor/UeditorController.java
index 51e5d6ba3..4b7a27cee 100644
--- a/hsweb-thirdparty/hsweb-thirdparty-ueditor/src/main/java/org/hswebframework/web/thirdpart/ueditor/UeditorController.java
+++ b/hsweb-thirdparty/hsweb-thirdparty-ueditor/src/main/java/org/hswebframework/web/thirdpart/ueditor/UeditorController.java
@@ -58,9 +58,6 @@ public class UeditorController {
private String getDownloadPath(HttpServletRequest request) {
return rootPath;
-// String contextPath = request.getContextPath();
-//
-// return (StringUtils.hasText(contextPath) || contextPath.equals("/") ? "/" : (contextPath.startsWith("/") ? contextPath : "/" + contextPath) + "/");
}
/**
@@ -71,21 +68,9 @@ public class UeditorController {
*/
@RequestMapping(method = RequestMethod.POST, consumes = "multipart/form-data")
@ApiOperation("上传文件")
- public String upload(@RequestParam(value = "upfile", required = false) MultipartFile file,HttpServletRequest request) throws IOException {
+ public String upload(@RequestParam(value = "upfile", required = false) MultipartFile file) throws IOException {
String fileName = file.getOriginalFilename();
- String contentType = Optional.ofNullable(request)
- .orElseThrow(UnsupportedOperationException::new)
- .getContentType();
- ParameterParser parser = new ParameterParser();
- Map params = parser.parse(contentType, ';');
- if (params.get("charset") == null) {
- try {
- fileName = new String(file.getOriginalFilename().getBytes("ISO-8859-1"), "utf-8");
- } catch (@SuppressWarnings("all") UnsupportedEncodingException ignore) {
- }
- }
String suffix = FileType.getSuffixByFilename(fileName);
-
String path = fileService.saveStaticFile(file.getInputStream(), System.currentTimeMillis() + suffix);
State state = new BaseState(true);
state.putInfo("size", file.getSize());
diff --git a/hsweb-thirdparty/pom.xml b/hsweb-thirdparty/pom.xml
index 13424c816..2ed81f4b8 100644
--- a/hsweb-thirdparty/pom.xml
+++ b/hsweb-thirdparty/pom.xml
@@ -5,7 +5,7 @@
hsweb-framework
org.hswebframework.web
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
4.0.0
diff --git a/pom.xml b/pom.xml
index bc92fb1b6..7ad0afaa3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@
org.hswebframework.web
hsweb-framework
- 3.0.2-SNAPSHOT
+ 3.0.3-SNAPSHOT
hsweb-starter
hsweb-core
diff --git a/quick-start/CUSTOM-PROP.md b/quick-start/CUSTOM-PROP.md
new file mode 100644
index 000000000..9ffe2d94e
--- /dev/null
+++ b/quick-start/CUSTOM-PROP.md
@@ -0,0 +1,220 @@
+# 拓展自定义字段
+
+在`hsweb-system`中提供了一些业务功能,但是有的功能只提供了基本的字段信息.`hsweb`提供了拓展字段而无需修改框架源码的方法.
+
+## 拓展实体类
+
+以拓展组织架构中的组织字段为例
+
+1. 编写实体类,继承需要拓展的实体:
+```java
+package com.myproject.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种方式.
+
+ 第一种:java自带的serviceLoader;
+ 第二种:application.yml配置;
+ 第三种:java类方式配置.
+ 注意: 选择其中任意一种即可.
+
+#### serviceLoader方式
+
+创建文件:`META-INF/services/org.hswebframework.web.entity.organizational.OrganizationalEntity`内容:
+
+```text
+com.myproject.entity.CustomOrganizationalEntity
+```
+
+#### application.yml方式
+
+```yaml
+hsweb:
+ entity:
+ mappings:
+ - source-base-package: org.hswebframework.web.entity.organizational
+ target-base-package: com.myproject.entity
+ mapping:
+ OrganizationalEntity: CustomOrganizationalEntity
+```
+
+#### java类方式
+```java
+ @Component
+ public class CustomEntityMappingCustomizer implements EntityMappingCustomizer {
+ @Override
+ public void customize(MapperEntityFactory entityFactory) {
+ //OrganizationalEntity使用CustomOrganizationalEntity实现
+ entityFactory.addMapping(OrganizationalEntity.class,
+ MapperEntityFactory.defaultMapper(CustomOrganizationalEntity.class));
+ }
+ }
+
+```
+
+## 修改Dao字段映射
+
+使用mybatis作为dao实现时,如果实体类上没有使用jpa注解则需要修改`mapper.xml`的配置来拓展字段.
+
+jpa注解和mapper配置各有优势(jpa更简单,但只支持简单的字段.mybatis配置稍微复杂,灵活性更高),请根据实际情况选择合适的方式.
+
+#### 修改mapper配置文件方式
+
+1. 创建mapper.xml,可直接复制旧的xml进行修改.旧的xml可在`hsweb-system`中对应的模块进行查找.
+
+`com/myproject/mappers/OrganizationalMapper.xml`
+
+```xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ delete from s_organization where u_id =#{id}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+2. 覆盖`mapper.xml`配置,将`hsweb`自带的配置替换为新的配置.
+
+ 覆盖方式有2种: application.yml或者java类配置.选择其一即可.
+
+application.yml方式:
+
+```yaml
+mybatis:
+ mapper-location-excludes: classpath*:org/hswebframework/**/OrganizationalMapper.xml #不加载的xml
+ mapper-locations: classpath*:com/myproject/mappers/OrganizationalMapper.xml
+```
+
+java类配置方式:
+```java
+@Component //提供给spring才会生效
+public class CustomMybatisMapperCustomizer implements MybatisMapperCustomizer {
+ @Override
+ public String[] getExcludes() {
+ return new String[]{
+ "classpath*:org/hswebframework/**/OrganizationalMapper.xml"
+ };
+ }
+
+ @Override
+ public String[] getIncludes() {
+ return new String[]{
+ "classpath*:com/myproject/mappers/OrganizationalMapper.xml"
+ };
+ }
+}
+```
+
+#### 使用jpa注解方式
+
+依赖jpa-api:
+```xml
+
+ org.hibernate.javax.persistence
+ hibernate-jpa-2.0-api
+ 1.0.1.Final
+
+```
+
+在拓展的实体类中使用jpa注解:
+```java
+ @Data
+ @Table //此处设置表名是无效的,仅作为一个解析标识
+ public class CustomUserEntity extends SimpleBindRoleUserEntity {
+ @Column(name = "nick_name")
+ private String nickName;
+ }
+```
+注意: 暂时只支持简单的属性。不支持表关联
+
diff --git a/quick-start/README.md b/quick-start/README.md
index 4a3d203b8..7ffc2cefd 100644
--- a/quick-start/README.md
+++ b/quick-start/README.md
@@ -555,5 +555,5 @@ class TestControllerTest extends Specification {
## 更多教程
-[通用增删改查使用](USE-CRUD.md) , [权限控制](AUTZ.md) ,[业务功能](SYSTEM.md) , [实用工具包](UTILS.md)
+[通用增删改查使用](USE-CRUD.md) ,[拓展系统自带功能的字段](CUSTOM-PROP.md) [权限控制](AUTZ.md) ,[业务功能](SYSTEM.md) , [实用工具包](UTILS.md)