diff --git a/hsweb-commons/hsweb-commons-entity/src/main/java/org/hswebframework/web/commons/entity/factory/MapperEntityFactory.java b/hsweb-commons/hsweb-commons-entity/src/main/java/org/hswebframework/web/commons/entity/factory/MapperEntityFactory.java index aebbf0048..38eaeff86 100644 --- a/hsweb-commons/hsweb-commons-entity/src/main/java/org/hswebframework/web/commons/entity/factory/MapperEntityFactory.java +++ b/hsweb-commons/hsweb-commons-entity/src/main/java/org/hswebframework/web/commons/entity/factory/MapperEntityFactory.java @@ -35,6 +35,9 @@ import java.util.function.Supplier; public class MapperEntityFactory implements EntityFactory { private Map realTypeMapper = new HashMap<>(); + public MapperEntityFactory() { + } + public MapperEntityFactory(Map, Mapper> realTypeMapper) { this.realTypeMapper.putAll(realTypeMapper); } diff --git a/hsweb-examples/hsweb-examples-simple/src/main/java/org/hswebframework/web/example/simple/SpringBootExample.java b/hsweb-examples/hsweb-examples-simple/src/main/java/org/hswebframework/web/example/simple/SpringBootExample.java index dfb8fa976..95ad5eab4 100644 --- a/hsweb-examples/hsweb-examples-simple/src/main/java/org/hswebframework/web/example/simple/SpringBootExample.java +++ b/hsweb-examples/hsweb-examples-simple/src/main/java/org/hswebframework/web/example/simple/SpringBootExample.java @@ -35,7 +35,6 @@ import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.context.TypeExcludeFilter; import org.springframework.context.annotation.*; import org.springframework.jdbc.datasource.DataSourceUtils; diff --git a/hsweb-examples/hsweb-examples-simple/src/main/resources/application.yml b/hsweb-examples/hsweb-examples-simple/src/main/resources/application.yml index 1a45b362d..6cba412d8 100644 --- a/hsweb-examples/hsweb-examples-simple/src/main/resources/application.yml +++ b/hsweb-examples/hsweb-examples-simple/src/main/resources/application.yml @@ -11,4 +11,10 @@ spring: hsweb: app: name: hsweb示例 - version: 3.0.0 \ No newline at end of file + version: 3.0.0 + entity: + mappings: + - source-base-package: org.hswebframework.web.entity.authorization + target-base-package: org.hswebframework.web.entity.authorization + mapping: + UserEntity: SimpleUserEntity \ No newline at end of file diff --git a/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-controller/src/main/java/org/hswebframework/web/controller/authorization/AuthorizationController.java b/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-controller/src/main/java/org/hswebframework/web/controller/authorization/AuthorizationController.java index 59571766b..cd9a7c1e5 100644 --- a/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-controller/src/main/java/org/hswebframework/web/controller/authorization/AuthorizationController.java +++ b/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-controller/src/main/java/org/hswebframework/web/controller/authorization/AuthorizationController.java @@ -41,7 +41,6 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import java.io.IOException; -import java.util.Date; import java.util.List; import static org.hswebframework.web.controller.message.ResponseMessage.ok; diff --git a/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-service/hsweb-system-authorization-service-api/src/main/java/org/hswebframework/web/service/authorization/UserService.java b/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-service/hsweb-system-authorization-service-api/src/main/java/org/hswebframework/web/service/authorization/UserService.java index 342426fb8..c168577da 100644 --- a/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-service/hsweb-system-authorization-service-api/src/main/java/org/hswebframework/web/service/authorization/UserService.java +++ b/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-service/hsweb-system-authorization-service-api/src/main/java/org/hswebframework/web/service/authorization/UserService.java @@ -1,20 +1,19 @@ package org.hswebframework.web.service.authorization; -import org.hswebframework.web.authorization.Authorization; +import org.hswebframework.web.authorization.AuthorizationInitializeService; import org.hswebframework.web.entity.authorization.UserEntity; import org.hswebframework.web.service.CreateEntityService; import org.hswebframework.web.service.InsertService; import org.hswebframework.web.service.QueryByEntityService; import org.hswebframework.web.service.QueryService; -import java.util.Date; - /** * TODO 完成注释 * * @author zhouhao */ public interface UserService extends + AuthorizationInitializeService, CreateEntityService, QueryByEntityService, QueryService, @@ -33,8 +32,4 @@ public interface UserService extends void updateLoginInfo(String userId, String ip, Long loginTime); void updatePassword(String userId, String oldPassword, String newPassword); - - Authorization initUserAuthorization(String userId); - - Authorization initAdminAuthorization(String userId); } diff --git a/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-starter/src/test/java/org/hswebframework/web/starter/authorization/UserTests.java b/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-starter/src/test/java/org/hswebframework/web/starter/authorization/UserTests.java index b911920c6..15c40a0b4 100644 --- a/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-starter/src/test/java/org/hswebframework/web/starter/authorization/UserTests.java +++ b/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-starter/src/test/java/org/hswebframework/web/starter/authorization/UserTests.java @@ -32,7 +32,6 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import java.sql.SQLException; -import java.util.Date; /** * TODO 完成注释 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 47e75e28f..739e3b562 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 @@ -122,19 +122,6 @@ public class SimpleWebApplicationTests { @WebAppConfiguration public static class Config { - @Bean(name = "validator") - @ConditionalOnMissingBean(Validator.class) - public Validator validator() { - ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); - Validator validator = factory.getValidator(); - return validator; - } - - @Bean - public EntityFactory beanFactory() { - return new MapperEntityFactory(); - } - @Bean public SqlExecutor sqlExecutor(DataSource dataSource) throws SQLException { Connection connection = dataSource.getConnection();