diff --git a/hsweb-authorization/hsweb-authorization-api/pom.xml b/hsweb-authorization/hsweb-authorization-api/pom.xml index d5a642fcc..99a69567e 100644 --- a/hsweb-authorization/hsweb-authorization-api/pom.xml +++ b/hsweb-authorization/hsweb-authorization-api/pom.xml @@ -5,7 +5,7 @@ hsweb-authorization org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 4.0.0 @@ -42,8 +42,7 @@ javax.servlet - servlet-api - 2.5 + javax.servlet-api true diff --git a/hsweb-authorization/hsweb-authorization-basic/README.md b/hsweb-authorization/hsweb-authorization-basic/README.md index 00183e893..1a7b8b986 100644 --- a/hsweb-authorization/hsweb-authorization-basic/README.md +++ b/hsweb-authorization/hsweb-authorization-basic/README.md @@ -4,7 +4,20 @@ 2. 实现数据权限控制 3. 可动态进行权限配置设置 -默认仅提供了aop方式的权限控制,控制逻辑如下: + +## 授权 +使用`hsweb-authorization-api`提供的监听器,类`UserOnSignIn`监听用户授权事件`AuthorizationSuccessEvent` +当用户完成授权(授权方式可自行实现或者使用框架默认的授权方式,主要触发该事件即可).授权通过后会触发该事件.流程如下 +1. 完成授权,触发`AuthorizationSuccessEvent` +2. `UserOnSignIn` 收到`AuthorizationSuccessEvent`事件,获取参数`token_type`(默认为`sessionId`),以及授权信息 +3. 根据`token_type` 生成token. +4. 将token和授权信息中的userId注册到`UserTokenManager` +5. 将token返回给授权接口 + +![授权](./img/autz-flow.png "授权") + + +## 权限控制 1. `AopAuthorizingController` aop拦截所有controller方法(注解了:`Controller`或者`RestController`的类的方法) 2. 在客户端发起请求的时候,将拦截到的方法信息(`MethodInterceptorContext`)传给权限定义解析器(`AopMethodAuthorizeDefinitionParser`) 进行解析 @@ -14,15 +27,9 @@ 5. 默认的权限控制实现`DefaultAuthorizingHandler`,将分别进行RBAC,数据权限,表达式方式的权限控制. 6. 如果授权未通过,则抛出`AccessDenyException`异常 -## 授权 -使用`hsweb-authorization-api`提供的监听器,类`UserOnSignIn`监听用户授权事件`AuthorizationSuccessEvent` -当用户完成授权(授权方式可自行实现或者使用框架默认的授权方式,主要触发该事件即可).授权通过后会触发该事件.流程如下 +![权限控制](./img/autz-handle-flow.png "权限控制") + -1. 完成授权,触发`AuthorizationSuccessEvent` -2. `UserOnSignIn` 收到`AuthorizationSuccessEvent`事件,获取参数`token_type`(默认为`sessionId`),以及授权信息 -3. 根据`token_type` 生成token. -4. 将token和授权信息中的userId注册到`UserTokenManager` -5. 将token返回给授权接口 ## 注销 与授权同理,类`UserOnSignOut`监听`AuthorizationExitEvent` ,当触发事件后,调用`UserTokenManager`移除当前登录的token信息 diff --git a/hsweb-authorization/hsweb-authorization-basic/img/autz-flow.png b/hsweb-authorization/hsweb-authorization-basic/img/autz-flow.png new file mode 100644 index 000000000..4a8378c28 Binary files /dev/null and b/hsweb-authorization/hsweb-authorization-basic/img/autz-flow.png differ diff --git a/hsweb-authorization/hsweb-authorization-basic/img/autz-handle-flow.png b/hsweb-authorization/hsweb-authorization-basic/img/autz-handle-flow.png new file mode 100644 index 000000000..b2a3ba162 Binary files /dev/null and b/hsweb-authorization/hsweb-authorization-basic/img/autz-handle-flow.png differ diff --git a/hsweb-authorization/hsweb-authorization-basic/pom.xml b/hsweb-authorization/hsweb-authorization-basic/pom.xml index e32c94680..07556b2c7 100644 --- a/hsweb-authorization/hsweb-authorization-basic/pom.xml +++ b/hsweb-authorization/hsweb-authorization-basic/pom.xml @@ -5,7 +5,7 @@ hsweb-authorization org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 4.0.0 @@ -81,8 +81,7 @@ javax.servlet - servlet-api - 2.5 + javax.servlet-api provided diff --git a/hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/aop/DefaultAopMethodAuthorizeDefinitionParser.java b/hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/aop/DefaultAopMethodAuthorizeDefinitionParser.java index 4998a851c..9c39262e5 100644 --- a/hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/aop/DefaultAopMethodAuthorizeDefinitionParser.java +++ b/hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/aop/DefaultAopMethodAuthorizeDefinitionParser.java @@ -29,13 +29,13 @@ public class DefaultAopMethodAuthorizeDefinitionParser implements AopMethodAutho private Map cache = new ConcurrentHashMap<>(); - private List parserCustomers; + private List parserCustomizers; private static Set excludeMethodName = new HashSet<>(Arrays.asList("toString", "clone", "hashCode", "getClass")); @Autowired(required = false) - public void setParserCustomers(List parserCustomers) { - this.parserCustomers = parserCustomers; + public void setParserCustomizers(List parserCustomizers) { + this.parserCustomizers = parserCustomizers; } @Override @@ -59,9 +59,9 @@ public AuthorizeDefinition parse(Class target, Method method, MethodInterceptorC return definition; } //使用自定义 - if (!CollectionUtils.isEmpty(parserCustomers)) { - definition = parserCustomers.stream() - .map(customer -> customer.parse(target, method, context)) + if (!CollectionUtils.isEmpty(parserCustomizers)) { + definition = parserCustomizers.stream() + .map(customizer -> customizer.parse(target, method, context)) .filter(Objects::nonNull) .findAny().orElse(null); if (definition instanceof EmptyAuthorizeDefinition) { diff --git a/hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/web/AuthorizationController.java b/hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/web/AuthorizationController.java index b2c1f1638..ec7f4289f 100644 --- a/hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/web/AuthorizationController.java +++ b/hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/web/AuthorizationController.java @@ -91,6 +91,9 @@ public ResponseMessage> authorize(@RequestParam @ApiParam(" return doLogin(username, password, WebUtil.getParameters(request)); } + /** + * + */ @SneakyThrows protected ResponseMessage> doLogin(String username, String password, Map parameter) { Assert.hasLength(username, "用户名不能为空"); diff --git a/hsweb-authorization/hsweb-authorization-jwt/pom.xml b/hsweb-authorization/hsweb-authorization-jwt/pom.xml index 478e1bca4..6f261cc2d 100644 --- a/hsweb-authorization/hsweb-authorization-jwt/pom.xml +++ b/hsweb-authorization/hsweb-authorization-jwt/pom.xml @@ -5,7 +5,7 @@ hsweb-authorization org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 4.0.0 @@ -35,8 +35,7 @@ javax.servlet - servlet-api - 2.5 + javax.servlet-api provided diff --git a/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/pom.xml b/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/pom.xml index 87d3590f6..bb1e32275 100644 --- a/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/pom.xml +++ b/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-auth-server/pom.xml @@ -23,7 +23,7 @@ hsweb-authorization-oauth2 org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 4.0.0 @@ -44,8 +44,7 @@ javax.servlet - servlet-api - 2.5 + javax.servlet-api true diff --git a/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-client/pom.xml b/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-client/pom.xml index cbcf3ae79..da5f0c5a7 100644 --- a/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-client/pom.xml +++ b/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-client/pom.xml @@ -23,7 +23,7 @@ hsweb-authorization-oauth2 org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 4.0.0 diff --git a/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-core/pom.xml b/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-core/pom.xml index 7e1c4281d..cdfaad9e1 100644 --- a/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-core/pom.xml +++ b/hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-core/pom.xml @@ -23,7 +23,7 @@ hsweb-authorization-oauth2 org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 4.0.0 diff --git a/hsweb-authorization/hsweb-authorization-oauth2/pom.xml b/hsweb-authorization/hsweb-authorization-oauth2/pom.xml index 3d1a992f7..0376e7a08 100644 --- a/hsweb-authorization/hsweb-authorization-oauth2/pom.xml +++ b/hsweb-authorization/hsweb-authorization-oauth2/pom.xml @@ -5,7 +5,7 @@ hsweb-authorization org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 4.0.0 diff --git a/hsweb-authorization/pom.xml b/hsweb-authorization/pom.xml index a9e838f0d..b895f4682 100644 --- a/hsweb-authorization/pom.xml +++ b/hsweb-authorization/pom.xml @@ -5,7 +5,7 @@ hsweb-framework org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 4.0.0 diff --git a/hsweb-boost/hsweb-boost-aop/pom.xml b/hsweb-boost/hsweb-boost-aop/pom.xml index f32a78b9d..fdfe05512 100644 --- a/hsweb-boost/hsweb-boost-aop/pom.xml +++ b/hsweb-boost/hsweb-boost-aop/pom.xml @@ -23,7 +23,7 @@ hsweb-boost org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 4.0.0 diff --git a/hsweb-boost/hsweb-boost-excel/pom.xml b/hsweb-boost/hsweb-boost-excel/pom.xml index bdd689fc5..2e2aae0c4 100644 --- a/hsweb-boost/hsweb-boost-excel/pom.xml +++ b/hsweb-boost/hsweb-boost-excel/pom.xml @@ -5,7 +5,7 @@ hsweb-boost org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 4.0.0 diff --git a/hsweb-boost/hsweb-boost-ftp/pom.xml b/hsweb-boost/hsweb-boost-ftp/pom.xml index cee03befc..8ea07a066 100644 --- a/hsweb-boost/hsweb-boost-ftp/pom.xml +++ b/hsweb-boost/hsweb-boost-ftp/pom.xml @@ -5,7 +5,7 @@ hsweb-boost org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 4.0.0 diff --git a/hsweb-boost/pom.xml b/hsweb-boost/pom.xml index 057c583e7..0398c7915 100644 --- a/hsweb-boost/pom.xml +++ b/hsweb-boost/pom.xml @@ -23,7 +23,7 @@ hsweb-framework org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 4.0.0 diff --git a/hsweb-commons/hsweb-commons-bean/pom.xml b/hsweb-commons/hsweb-commons-bean/pom.xml index 24e986bf3..e4906a714 100644 --- a/hsweb-commons/hsweb-commons-bean/pom.xml +++ b/hsweb-commons/hsweb-commons-bean/pom.xml @@ -5,7 +5,7 @@ hsweb-commons org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 ../pom.xml 4.0.0 diff --git a/hsweb-commons/hsweb-commons-controller/pom.xml b/hsweb-commons/hsweb-commons-controller/pom.xml index 39e57bdca..8ce4e1694 100644 --- a/hsweb-commons/hsweb-commons-controller/pom.xml +++ b/hsweb-commons/hsweb-commons-controller/pom.xml @@ -23,7 +23,7 @@ hsweb-commons org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 ../pom.xml 4.0.0 diff --git a/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-api/pom.xml b/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-api/pom.xml index bbe6139bf..6d5a278a1 100644 --- a/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-api/pom.xml +++ b/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-api/pom.xml @@ -23,7 +23,7 @@ hsweb-commons-dao org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 ../pom.xml 4.0.0 diff --git a/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/pom.xml b/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/pom.xml index 34cd2446f..4c55b2f39 100644 --- a/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/pom.xml +++ b/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/pom.xml @@ -23,7 +23,7 @@ hsweb-commons-dao org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 ../pom.xml 4.0.0 diff --git a/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/MybatisDaoAutoConfiguration.java b/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/MybatisDaoAutoConfiguration.java index b11a9ee09..7fba7d3c5 100644 --- a/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/MybatisDaoAutoConfiguration.java +++ b/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/MybatisDaoAutoConfiguration.java @@ -20,7 +20,7 @@ import org.hswebframework.ezorm.rdb.render.dialect.Dialect; import org.hswebframework.web.dao.Dao; -import org.hswebframework.web.dao.mybatis.mapper.SqlTermCustomer; +import org.hswebframework.web.dao.mybatis.mapper.SqlTermCustomizer; import org.hswebframework.web.dao.mybatis.mapper.dict.DictInTermTypeMapper; import org.hswebframework.web.dao.mybatis.mapper.dict.DictTermTypeMapper; import org.mybatis.spring.annotation.MapperScan; @@ -34,7 +34,6 @@ import java.util.Arrays; import java.util.List; -import java.util.Set; @Configuration @ComponentScan("org.hswebframework.web.dao.mybatis") @@ -65,7 +64,7 @@ public DictInTermTypeMapper dictNotInTermTypeMapper() { } @Bean - public BeanPostProcessor SqlTermCustomerRegister() { + public BeanPostProcessor sqlTermCustomizerRegister() { List dialects = Arrays.asList( Dialect.H2 @@ -82,14 +81,14 @@ public Object postProcessBeforeInitialization(Object bean, String beanName) thro @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { - if (bean instanceof SqlTermCustomer) { - SqlTermCustomer customer = ((SqlTermCustomer) bean); - if (customer.forDialect() != null) { - for (Dialect dialect : customer.forDialect()) { - dialect.setTermTypeMapper(customer.getTermType(), customer); + if (bean instanceof SqlTermCustomizer) { + SqlTermCustomizer customizer = ((SqlTermCustomizer) bean); + if (customizer.forDialect() != null) { + for (Dialect dialect : customizer.forDialect()) { + dialect.setTermTypeMapper(customizer.getTermType(), customizer); } } else { - dialects.forEach(dialect -> dialect.setTermTypeMapper(customer.getTermType(), customer)); + dialects.forEach(dialect -> dialect.setTermTypeMapper(customizer.getTermType(), customizer)); } } return bean; diff --git a/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/MybatisMapperCustomer.java b/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/MybatisMapperCustomizer.java similarity index 81% rename from hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/MybatisMapperCustomer.java rename to hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/MybatisMapperCustomizer.java index c0893a68a..14f969a08 100644 --- a/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/MybatisMapperCustomer.java +++ b/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/MybatisMapperCustomizer.java @@ -6,7 +6,7 @@ * @author zhouhao * @since 3.0 */ -public interface MybatisMapperCustomer { +public interface MybatisMapperCustomizer { String[] getExcludes(); String[] getIncludes(); diff --git a/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/MybatisProperties.java b/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/MybatisProperties.java index e2d53c20f..2f64dacbe 100644 --- a/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/MybatisProperties.java +++ b/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/MybatisProperties.java @@ -61,10 +61,10 @@ public class MybatisProperties extends org.mybatis.spring.boot.autoconfigure.Myb */ private boolean useJpa = true; - private List mybatisMappers; + private List mybatisMappers; @Autowired(required = false) - public void setMybatisMappers(List mybatisMappers) { + public void setMybatisMappers(List mybatisMappers) { this.mybatisMappers = mybatisMappers; } @@ -107,7 +107,7 @@ public Resource[] resolveMapperLocations() { if (mybatisMappers != null) { mybatisMappers.stream() - .map(MybatisMapperCustomer::getIncludes) + .map(MybatisMapperCustomizer::getIncludes) .flatMap(Arrays::stream) .forEach(locations::add); } @@ -125,7 +125,7 @@ public Resource[] resolveMapperLocations() { Set excludes = new HashSet<>(); if (mybatisMappers != null) { mybatisMappers.stream() - .map(MybatisMapperCustomer::getExcludes) + .map(MybatisMapperCustomizer::getExcludes) .flatMap(Arrays::stream) .forEach(excludes::add); } diff --git a/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/mapper/AbstractSqlTermCustomer.java b/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/mapper/AbstractSqlTermCustomizer.java similarity index 96% rename from hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/mapper/AbstractSqlTermCustomer.java rename to hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/mapper/AbstractSqlTermCustomizer.java index c41d22b47..1b76996f8 100644 --- a/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/mapper/AbstractSqlTermCustomer.java +++ b/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/mapper/AbstractSqlTermCustomizer.java @@ -15,7 +15,7 @@ * @since 3.0.0-RC */ @AllArgsConstructor -public abstract class AbstractSqlTermCustomer implements SqlTermCustomer { +public abstract class AbstractSqlTermCustomizer implements SqlTermCustomizer { @Getter protected final String termType; diff --git a/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/mapper/SqlTermCustomer.java b/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/mapper/SqlTermCustomizer.java similarity index 76% rename from hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/mapper/SqlTermCustomer.java rename to hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/mapper/SqlTermCustomizer.java index f36a00441..4d67cedb1 100644 --- a/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/mapper/SqlTermCustomer.java +++ b/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/mapper/SqlTermCustomizer.java @@ -6,7 +6,7 @@ * @author zhouhao * @since 3.0.0-RC */ -public interface SqlTermCustomer extends Dialect.TermTypeMapper { +public interface SqlTermCustomizer extends Dialect.TermTypeMapper { String getTermType(); Dialect[] forDialect(); diff --git a/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/mapper/TreeStructureSqlTermCustomer.java b/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/mapper/TreeStructureSqlTermCustomizer.java similarity index 93% rename from hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/mapper/TreeStructureSqlTermCustomer.java rename to hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/mapper/TreeStructureSqlTermCustomizer.java index d0302e4fd..a68751668 100644 --- a/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/mapper/TreeStructureSqlTermCustomer.java +++ b/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/mapper/TreeStructureSqlTermCustomizer.java @@ -18,12 +18,12 @@ * @since 3.0.0-RC */ @Slf4j -public abstract class TreeStructureSqlTermCustomer extends AbstractSqlTermCustomer { +public abstract class TreeStructureSqlTermCustomizer extends AbstractSqlTermCustomizer { boolean not = false; boolean parent = false; - public TreeStructureSqlTermCustomer(String termType, boolean not,boolean parent) { + public TreeStructureSqlTermCustomizer(String termType, boolean not, boolean parent) { super(termType); this.not = not; } diff --git a/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/mapper/dict/DictInTermTypeMapper.java b/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/mapper/dict/DictInTermTypeMapper.java index 2f67e5b3b..059cc10a9 100644 --- a/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/mapper/dict/DictInTermTypeMapper.java +++ b/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/mapper/dict/DictInTermTypeMapper.java @@ -9,21 +9,20 @@ import org.hswebframework.ezorm.rdb.render.dialect.RenderPhase; import org.hswebframework.ezorm.rdb.render.dialect.function.SqlFunction; 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 org.hswebframework.web.dict.EnumDict; import java.sql.JDBCType; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.List; /** * @author zhouhao * @since 3.0.0-RC */ -public class DictInTermTypeMapper extends AbstractSqlTermCustomer { +public class DictInTermTypeMapper extends AbstractSqlTermCustomizer { private boolean not; diff --git a/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/mapper/dict/DictTermTypeMapper.java b/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/mapper/dict/DictTermTypeMapper.java index fbe359c9d..69e02a333 100644 --- a/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/mapper/dict/DictTermTypeMapper.java +++ b/hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/mapper/dict/DictTermTypeMapper.java @@ -6,17 +6,14 @@ import org.hswebframework.ezorm.rdb.meta.RDBColumnMetaData; import org.hswebframework.ezorm.rdb.render.SqlAppender; 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.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 org.hswebframework.web.dict.EnumDict; import java.sql.JDBCType; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.List; import static org.hswebframework.web.dao.mybatis.mapper.dict.DictInTermTypeMapper.USE_DICT_MASK_FLAG; @@ -25,7 +22,7 @@ * @author zhouhao * @since 3.0.0-RC */ -public class DictTermTypeMapper extends AbstractSqlTermCustomer { +public class DictTermTypeMapper extends AbstractSqlTermCustomizer { private boolean not; diff --git a/hsweb-commons/hsweb-commons-dao/pom.xml b/hsweb-commons/hsweb-commons-dao/pom.xml index bf306adc1..d3d754c30 100644 --- a/hsweb-commons/hsweb-commons-dao/pom.xml +++ b/hsweb-commons/hsweb-commons-dao/pom.xml @@ -23,7 +23,7 @@ hsweb-commons org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 ../pom.xml 4.0.0 diff --git a/hsweb-commons/hsweb-commons-entity/pom.xml b/hsweb-commons/hsweb-commons-entity/pom.xml index d876140f1..efc36abb1 100644 --- a/hsweb-commons/hsweb-commons-entity/pom.xml +++ b/hsweb-commons/hsweb-commons-entity/pom.xml @@ -23,7 +23,7 @@ hsweb-commons org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 4.0.0 diff --git a/hsweb-commons/hsweb-commons-model/pom.xml b/hsweb-commons/hsweb-commons-model/pom.xml index 778392646..94163a360 100644 --- a/hsweb-commons/hsweb-commons-model/pom.xml +++ b/hsweb-commons/hsweb-commons-model/pom.xml @@ -23,7 +23,7 @@ hsweb-commons org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 4.0.0 diff --git a/hsweb-commons/hsweb-commons-service/hsweb-commons-service-api/pom.xml b/hsweb-commons/hsweb-commons-service/hsweb-commons-service-api/pom.xml index fe49e1519..cc55102a9 100644 --- a/hsweb-commons/hsweb-commons-service/hsweb-commons-service-api/pom.xml +++ b/hsweb-commons/hsweb-commons-service/hsweb-commons-service-api/pom.xml @@ -23,7 +23,7 @@ hsweb-commons-service org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 ../pom.xml 4.0.0 diff --git a/hsweb-commons/hsweb-commons-service/hsweb-commons-service-oauth2/pom.xml b/hsweb-commons/hsweb-commons-service/hsweb-commons-service-oauth2/pom.xml index 7d71d4c57..b0c4438b1 100644 --- a/hsweb-commons/hsweb-commons-service/hsweb-commons-service-oauth2/pom.xml +++ b/hsweb-commons/hsweb-commons-service/hsweb-commons-service-oauth2/pom.xml @@ -5,7 +5,7 @@ hsweb-commons-service org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 ../pom.xml diff --git a/hsweb-commons/hsweb-commons-service/hsweb-commons-service-simple/pom.xml b/hsweb-commons/hsweb-commons-service/hsweb-commons-service-simple/pom.xml index 4fc9d5bff..afc77d9d0 100644 --- a/hsweb-commons/hsweb-commons-service/hsweb-commons-service-simple/pom.xml +++ b/hsweb-commons/hsweb-commons-service/hsweb-commons-service-simple/pom.xml @@ -23,7 +23,7 @@ hsweb-commons-service org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 ../pom.xml diff --git a/hsweb-commons/hsweb-commons-service/pom.xml b/hsweb-commons/hsweb-commons-service/pom.xml index cd5b28838..f5ff16c69 100644 --- a/hsweb-commons/hsweb-commons-service/pom.xml +++ b/hsweb-commons/hsweb-commons-service/pom.xml @@ -23,7 +23,7 @@ hsweb-commons org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 ../pom.xml diff --git a/hsweb-commons/hsweb-commons-utils/pom.xml b/hsweb-commons/hsweb-commons-utils/pom.xml index a45d8abf8..7e16c93d2 100644 --- a/hsweb-commons/hsweb-commons-utils/pom.xml +++ b/hsweb-commons/hsweb-commons-utils/pom.xml @@ -23,7 +23,7 @@ hsweb-commons org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 ../pom.xml 4.0.0 @@ -33,10 +33,10 @@ 通用模块-工具类 + javax.servlet - servlet-api - 2.5 + javax.servlet-api true diff --git a/hsweb-commons/pom.xml b/hsweb-commons/pom.xml index 54540ae9f..1d4174f76 100644 --- a/hsweb-commons/pom.xml +++ b/hsweb-commons/pom.xml @@ -23,7 +23,7 @@ hsweb-framework org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 ../pom.xml 4.0.0 diff --git a/hsweb-concurrent/hsweb-concurrent-async-job/pom.xml b/hsweb-concurrent/hsweb-concurrent-async-job/pom.xml index c61b77bdf..a549c3f11 100644 --- a/hsweb-concurrent/hsweb-concurrent-async-job/pom.xml +++ b/hsweb-concurrent/hsweb-concurrent-async-job/pom.xml @@ -5,7 +5,7 @@ hsweb-concurrent org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 4.0.0 diff --git a/hsweb-concurrent/hsweb-concurrent-cache/pom.xml b/hsweb-concurrent/hsweb-concurrent-cache/pom.xml index 27824cca4..8ecb1b4fa 100644 --- a/hsweb-concurrent/hsweb-concurrent-cache/pom.xml +++ b/hsweb-concurrent/hsweb-concurrent-cache/pom.xml @@ -22,7 +22,7 @@ hsweb-concurrent org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 4.0.0 diff --git a/hsweb-concurrent/hsweb-concurrent-counter/hsweb-concurrent-counter-api/pom.xml b/hsweb-concurrent/hsweb-concurrent-counter/hsweb-concurrent-counter-api/pom.xml index aa68ce797..b0abd66ce 100644 --- a/hsweb-concurrent/hsweb-concurrent-counter/hsweb-concurrent-counter-api/pom.xml +++ b/hsweb-concurrent/hsweb-concurrent-counter/hsweb-concurrent-counter-api/pom.xml @@ -22,7 +22,7 @@ hsweb-concurrent-counter org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 4.0.0 diff --git a/hsweb-concurrent/hsweb-concurrent-counter/hsweb-concurrent-counter-redis/pom.xml b/hsweb-concurrent/hsweb-concurrent-counter/hsweb-concurrent-counter-redis/pom.xml index 3f8e2e08d..072284c8f 100644 --- a/hsweb-concurrent/hsweb-concurrent-counter/hsweb-concurrent-counter-redis/pom.xml +++ b/hsweb-concurrent/hsweb-concurrent-counter/hsweb-concurrent-counter-redis/pom.xml @@ -5,7 +5,7 @@ hsweb-concurrent-counter org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 4.0.0 diff --git a/hsweb-concurrent/hsweb-concurrent-counter/pom.xml b/hsweb-concurrent/hsweb-concurrent-counter/pom.xml index 678ff310b..1aa0d04c8 100644 --- a/hsweb-concurrent/hsweb-concurrent-counter/pom.xml +++ b/hsweb-concurrent/hsweb-concurrent-counter/pom.xml @@ -22,7 +22,7 @@ hsweb-concurrent org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 4.0.0 diff --git a/hsweb-concurrent/hsweb-concurrent-lock/hsweb-concurrent-lock-api/pom.xml b/hsweb-concurrent/hsweb-concurrent-lock/hsweb-concurrent-lock-api/pom.xml index 2b3aa4cbc..b852345e4 100644 --- a/hsweb-concurrent/hsweb-concurrent-lock/hsweb-concurrent-lock-api/pom.xml +++ b/hsweb-concurrent/hsweb-concurrent-lock/hsweb-concurrent-lock-api/pom.xml @@ -5,7 +5,7 @@ hsweb-concurrent-lock org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 4.0.0 diff --git a/hsweb-concurrent/hsweb-concurrent-lock/hsweb-concurrent-lock-redis/pom.xml b/hsweb-concurrent/hsweb-concurrent-lock/hsweb-concurrent-lock-redis/pom.xml index d1ce25364..4b4e8ae57 100644 --- a/hsweb-concurrent/hsweb-concurrent-lock/hsweb-concurrent-lock-redis/pom.xml +++ b/hsweb-concurrent/hsweb-concurrent-lock/hsweb-concurrent-lock-redis/pom.xml @@ -5,7 +5,7 @@ hsweb-concurrent-lock org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 4.0.0 diff --git a/hsweb-concurrent/hsweb-concurrent-lock/hsweb-concurrent-lock-starter/pom.xml b/hsweb-concurrent/hsweb-concurrent-lock/hsweb-concurrent-lock-starter/pom.xml index 4e1625032..b75618df7 100644 --- a/hsweb-concurrent/hsweb-concurrent-lock/hsweb-concurrent-lock-starter/pom.xml +++ b/hsweb-concurrent/hsweb-concurrent-lock/hsweb-concurrent-lock-starter/pom.xml @@ -5,7 +5,7 @@ hsweb-concurrent-lock org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 4.0.0 diff --git a/hsweb-concurrent/hsweb-concurrent-lock/pom.xml b/hsweb-concurrent/hsweb-concurrent-lock/pom.xml index 2e2d3ffa4..f4e7a589b 100644 --- a/hsweb-concurrent/hsweb-concurrent-lock/pom.xml +++ b/hsweb-concurrent/hsweb-concurrent-lock/pom.xml @@ -22,7 +22,7 @@ hsweb-concurrent org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 4.0.0 diff --git a/hsweb-concurrent/pom.xml b/hsweb-concurrent/pom.xml index 7738f48d8..29509e1ff 100644 --- a/hsweb-concurrent/pom.xml +++ b/hsweb-concurrent/pom.xml @@ -22,7 +22,7 @@ hsweb-framework org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 4.0.0 diff --git a/hsweb-core/pom.xml b/hsweb-core/pom.xml index c175d0ceb..db9072f14 100644 --- a/hsweb-core/pom.xml +++ b/hsweb-core/pom.xml @@ -5,7 +5,7 @@ hsweb-framework org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 ../pom.xml 4.0.0 diff --git a/hsweb-datasource/hsweb-datasource-api/pom.xml b/hsweb-datasource/hsweb-datasource-api/pom.xml index 918bfb253..b0c489b74 100644 --- a/hsweb-datasource/hsweb-datasource-api/pom.xml +++ b/hsweb-datasource/hsweb-datasource-api/pom.xml @@ -5,7 +5,7 @@ hsweb-datasource org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 ../pom.xml diff --git a/hsweb-datasource/hsweb-datasource-jta/pom.xml b/hsweb-datasource/hsweb-datasource-jta/pom.xml index 39668f4f9..3d63e1122 100644 --- a/hsweb-datasource/hsweb-datasource-jta/pom.xml +++ b/hsweb-datasource/hsweb-datasource-jta/pom.xml @@ -5,7 +5,7 @@ hsweb-datasource org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 ../pom.xml diff --git a/hsweb-datasource/hsweb-datasource-web/pom.xml b/hsweb-datasource/hsweb-datasource-web/pom.xml index 0e8486680..08bb9c9d8 100644 --- a/hsweb-datasource/hsweb-datasource-web/pom.xml +++ b/hsweb-datasource/hsweb-datasource-web/pom.xml @@ -5,7 +5,7 @@ hsweb-datasource org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 ../pom.xml diff --git a/hsweb-datasource/pom.xml b/hsweb-datasource/pom.xml index acac695fb..9b90f58fa 100644 --- a/hsweb-datasource/pom.xml +++ b/hsweb-datasource/pom.xml @@ -5,7 +5,7 @@ hsweb-framework org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 ../pom.xml diff --git a/hsweb-logging/hsweb-access-logging-aop/pom.xml b/hsweb-logging/hsweb-access-logging-aop/pom.xml index d11176546..a86feec64 100644 --- a/hsweb-logging/hsweb-access-logging-aop/pom.xml +++ b/hsweb-logging/hsweb-access-logging-aop/pom.xml @@ -5,7 +5,7 @@ hsweb-logging org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 ../pom.xml 4.0.0 @@ -53,8 +53,7 @@ javax.servlet - servlet-api - 2.5 + javax.servlet-api provided diff --git a/hsweb-logging/hsweb-access-logging-api/pom.xml b/hsweb-logging/hsweb-access-logging-api/pom.xml index c3f5b2251..61a7d3c8a 100644 --- a/hsweb-logging/hsweb-access-logging-api/pom.xml +++ b/hsweb-logging/hsweb-access-logging-api/pom.xml @@ -5,7 +5,7 @@ hsweb-logging org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 ../pom.xml 4.0.0 diff --git a/hsweb-logging/pom.xml b/hsweb-logging/pom.xml index 22e404d05..0a5211209 100644 --- a/hsweb-logging/pom.xml +++ b/hsweb-logging/pom.xml @@ -23,7 +23,7 @@ hsweb-framework org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 ../pom.xml 4.0.0 diff --git a/hsweb-message/hsweb-message-api/pom.xml b/hsweb-message/hsweb-message-api/pom.xml index 4e296cfbd..ed9d1cc76 100644 --- a/hsweb-message/hsweb-message-api/pom.xml +++ b/hsweb-message/hsweb-message-api/pom.xml @@ -5,7 +5,7 @@ hsweb-message org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 4.0.0 diff --git a/hsweb-message/hsweb-message-jms/pom.xml b/hsweb-message/hsweb-message-jms/pom.xml index 98d198ae2..2556e5411 100644 --- a/hsweb-message/hsweb-message-jms/pom.xml +++ b/hsweb-message/hsweb-message-jms/pom.xml @@ -5,7 +5,7 @@ hsweb-message org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 4.0.0 diff --git a/hsweb-message/hsweb-message-redis/pom.xml b/hsweb-message/hsweb-message-redis/pom.xml index b54ef7946..7c7d23ffe 100644 --- a/hsweb-message/hsweb-message-redis/pom.xml +++ b/hsweb-message/hsweb-message-redis/pom.xml @@ -5,7 +5,7 @@ hsweb-message org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 4.0.0 diff --git a/hsweb-message/hsweb-message-websocket/pom.xml b/hsweb-message/hsweb-message-websocket/pom.xml index cccb50376..0c311e776 100644 --- a/hsweb-message/hsweb-message-websocket/pom.xml +++ b/hsweb-message/hsweb-message-websocket/pom.xml @@ -5,7 +5,7 @@ hsweb-message org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 4.0.0 diff --git a/hsweb-message/pom.xml b/hsweb-message/pom.xml index 0da14c853..1e2a5ef30 100644 --- a/hsweb-message/pom.xml +++ b/hsweb-message/pom.xml @@ -5,7 +5,7 @@ hsweb-framework org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 4.0.0 diff --git a/hsweb-starter/hsweb-spring-boot-starter/pom.xml b/hsweb-starter/hsweb-spring-boot-starter/pom.xml index 5088133d2..c2a0cf1ce 100644 --- a/hsweb-starter/hsweb-spring-boot-starter/pom.xml +++ b/hsweb-starter/hsweb-spring-boot-starter/pom.xml @@ -23,7 +23,7 @@ hsweb-starter org.hswebframework.web - 3.0.2-SNAPSHOT + 3.0.2 4.0.0 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 Object postProcessAfterInitialization(Object bean, String beanName) throw } 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 @@ /** * @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..485192800 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.2 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..57f20452e 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.2 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 @@ 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..78b00b335 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.2 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.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 @@ * @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..8bbb4cd83 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.2 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..b5b3c875c 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.2 4.0.0 diff --git a/hsweb-system/hsweb-system-authorization/pom.xml b/hsweb-system/hsweb-system-authorization/pom.xml index 8213dd5e5..516098b9f 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.2 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..da54ebfe2 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.2 ../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..49ce60fe3 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.2 ../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..c0f09928a 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.2 ../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..cdefbd217 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.2 ../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..ec498c0f6 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.2 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..e0e3602dc 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.2 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..b723c16a6 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.2 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..a28a28715 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.2 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..a92601355 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.2 4.0.0 diff --git a/hsweb-system/hsweb-system-dashboard/pom.xml b/hsweb-system/hsweb-system-dashboard/pom.xml index ce7935227..40b1e71d1 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.2 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..efb3a3da4 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.2 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..5d0c7a7e7 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.2 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..264e4e186 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.2 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..88adf8ded 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.2 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..51873bd16 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.2 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..c8342ead9 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.2 ../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..49d856763 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.2 ../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..698d58dfd 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.2 ../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..07cb9e1e7 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.2 ../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..e03185224 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.2 ../pom.xml diff --git a/hsweb-system/hsweb-system-dev-tools/pom.xml b/hsweb-system/hsweb-system-dev-tools/pom.xml index 5ff0328ae..776e704d4 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.2 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..4749652bf 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.2 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..777630fab 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.2 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..8d29d890c 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.2 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..9f5f4c452 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.2 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..af2171d58 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.2 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..a19d970c8 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.2 ../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 @@ * @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..4291b823a 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.2 ../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.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 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 RDBTableMetaData getTable() { return table; } }; - if (!CollectionUtils.isEmpty(initializeCustomers)) { - initializeCustomers.forEach(customer -> customer.customTableSetting(context)); + if (!CollectionUtils.isEmpty(initializeCustomizers)) { + initializeCustomizers.forEach(customizer -> customizer.customTableSetting(context)); } } @@ -644,8 +641,8 @@ public RDBTableMetaData getTable() { return table; } }; - if (!CollectionUtils.isEmpty(initializeCustomers)) { - initializeCustomers.forEach(customer -> 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..bc64eec69 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.2 ../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..9aa7f7280 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.2 ../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..c26488e9d 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.2 ../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..96b038a38 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.2 ../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..738ac780e 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.2 ../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..e19dc57b9 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.2 ../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..186c7961d 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.2 ../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..46bd2fce6 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.2 ../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.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 ResponseMessage> upload(@RequestPart("files") Multip @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..a277ab369 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.2 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..cd3decdfc 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.2 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..05504c67a 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.2 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..0a1a14cda 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.2 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..e72aa630e 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.2 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..f4dc815e8 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.2 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..aeb2ca1b1 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.2 ../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..9611dbbd8 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.2 ../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..16652c8b6 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.2 ../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..b866bafb4 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.2 ../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..e97b883e9 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.2 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..fdeb74785 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.2 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..dad3ad2c4 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.2 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 @@ * @author zhouhao * @since 3.0.0-RC */ -public class InServiceTreeInSqlTerm extends TreeStructureSqlTermCustomer { +public class InServiceTreeInSqlTerm extends TreeStructureSqlTermCustomizer { private QueryService, 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.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 @@ * @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..fbe4ae667 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.2 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..b926f2750 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.2 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..aa426f81d 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.2 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..6e83648ce 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.2 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..266f08ee5 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.2 ../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..361a761f9 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.2 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..f9017885a 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.2 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..4484cdd54 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.2 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..b005bce1b 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.2 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..92ae0e6e8 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.2 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..96451e7a1 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.2 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..5ad7b9719 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.2 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..fa7b4b684 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.2 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..f6542fc7b 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.2 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..50a4840df 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.2 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..0843936a5 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.2 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..4ced50b94 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.2 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..4134784d6 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.2 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..2788eb475 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.2 ../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 @@ 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.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 @@ */ @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.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 @@ * @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.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 @@ * @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.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 @@ * @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.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 @@ * @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..52b2836d2 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.2 ../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..01c6d35d2 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.2 ../pom.xml 4.0.0 diff --git a/hsweb-system/pom.xml b/hsweb-system/pom.xml index b209ab2fe..3b2a5f836 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.2 ../pom.xml 4.0.0 diff --git a/hsweb-tests/pom.xml b/hsweb-tests/pom.xml index 0c017f7ff..2a649afb7 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.2 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.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..ea06f8990 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.2 ../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 void init() { 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 @@ private String getDownloadPath(HttpServletRequest request) { */ @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..7a521383f 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.2 4.0.0 diff --git a/pom.xml b/pom.xml index bc92fb1b6..6af129666 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ org.hswebframework.web hsweb-framework - 3.0.2-SNAPSHOT + 3.0.2 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 385618643..08d336e0c 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)