From f787af4e91104e30f2937fbc5da9fb679fffa058 Mon Sep 17 00:00:00 2001 From: zhouhao Date: Tue, 9 May 2017 17:14:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/GenericEntityController.java | 2 +- hsweb-commons/hsweb-commons-utils/pom.xml | 5 + .../hswebframework/web/ExpressionUtils.java | 97 +++++++++++++++++++ .../org/hswebframework/web/RegexUtils.java | 29 ++++++ .../oauth2/OAuth2ServerApplication.java | 2 +- .../web/example/simple/SpringBootExample.java | 2 +- .../simple/SimpleUserService.java | 4 +- .../pom.xml | 5 + .../controller/OAuth2AuthorizeController.java | 2 - .../controller/OAuth2UserInfoController.java | 5 - .../pom.xml | 2 +- .../web/dao/oauth2/AuthorizationCodeDao.java | 2 +- .../web/dao/oauth2/OAuth2AccessDao.java | 2 +- .../web/dao/oauth2/OAuth2ClientDao.java | 2 +- .../mappers/oauth2/OAuth2AccessMapper.xml | 4 +- .../mappers/oauth2/OAuth2ClientMapper.xml | 4 +- .../mappers/oauth2/OAuth2CodeMapper.xml | 4 +- .../hsweb-system-oauth2-server-entity/pom.xml | 39 ++++++++ .../simple/SimpleAccessTokenService.java | 3 +- .../SimpleAuthorizationCodeService.java | 3 +- .../hsweb-system-oauth2-server/pom.xml | 1 + 21 files changed, 194 insertions(+), 25 deletions(-) create mode 100644 hsweb-commons/hsweb-commons-utils/src/main/java/org/hswebframework/web/ExpressionUtils.java create mode 100644 hsweb-commons/hsweb-commons-utils/src/main/java/org/hswebframework/web/RegexUtils.java create mode 100644 hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-entity/pom.xml diff --git a/hsweb-commons/hsweb-commons-controller/src/main/java/org/hswebframework/web/controller/GenericEntityController.java b/hsweb-commons/hsweb-commons-controller/src/main/java/org/hswebframework/web/controller/GenericEntityController.java index 15acff2b0..0bb2fd4fe 100644 --- a/hsweb-commons/hsweb-commons-controller/src/main/java/org/hswebframework/web/controller/GenericEntityController.java +++ b/hsweb-commons/hsweb-commons-controller/src/main/java/org/hswebframework/web/controller/GenericEntityController.java @@ -55,7 +55,7 @@ public interface GenericEntityController, PK, Q exte @ApiResponse(code = 403, message = "无权限"), @ApiResponse(code = 409, message = "存在重复的资源") }) - default ResponseMessage saveOrUpdate(@PathVariable PK id, @RequestBody M data) { + default ResponseMessage saveOrUpdate(@PathVariable PK id, @RequestBody M data) { E entity = getService().createEntity(); entity.setId(id); return ResponseMessage.ok(getService().saveOrUpdate(modelToEntity(data, entity))); diff --git a/hsweb-commons/hsweb-commons-utils/pom.xml b/hsweb-commons/hsweb-commons-utils/pom.xml index 6b0de8622..2b8d6e1ac 100644 --- a/hsweb-commons/hsweb-commons-utils/pom.xml +++ b/hsweb-commons/hsweb-commons-utils/pom.xml @@ -55,5 +55,10 @@ aspectjweaver true + + org.hswebframework + hsweb-expands-script + true + \ No newline at end of file diff --git a/hsweb-commons/hsweb-commons-utils/src/main/java/org/hswebframework/web/ExpressionUtils.java b/hsweb-commons/hsweb-commons-utils/src/main/java/org/hswebframework/web/ExpressionUtils.java new file mode 100644 index 000000000..7fdfc50c9 --- /dev/null +++ b/hsweb-commons/hsweb-commons-utils/src/main/java/org/hswebframework/web/ExpressionUtils.java @@ -0,0 +1,97 @@ +package org.hswebframework.web; + +import org.hswebframework.expands.script.engine.DynamicScriptEngine; +import org.hswebframework.expands.script.engine.DynamicScriptEngineFactory; +import org.hswebframework.expands.script.engine.ExecuteResult; + +import java.util.HashMap; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * 表达式工具,用户解析表达式为字符串 + * + * @author zhouhao + * @since 3.0 + */ +public class ExpressionUtils { + + //表达式提取正则 ${.+?} + private static final Pattern PATTERN = Pattern.compile("(?<=\\$\\{)(.+?)(?=})"); + + /** + * 获取默认的表达式变量 + * + * @return 变量集合 + */ + public static Map getDefaultVar() { + return new HashMap<>(); + } + + /** + * 获取默认的表达式变量并将制定的变量合并在一起 + * + * @param var 要合并的变量集合 + * @return 变量集合 + */ + public static Map getDefaultVar(Map var) { + Map vars = getDefaultVar(); + vars.putAll(var); + return vars; + } + + /** + * 使用默认的变量解析表达式 + * + * @param expression 表达式字符串 + * @param language 表达式语言 + * @return 解析结果 + * @throws Exception 解析错误 + * @see ExpressionUtils#analytical(String, Map, String) + */ + public static String analytical(String expression, String language) throws Exception { + return analytical(expression, new HashMap<>(), language); + } + + /** + * 解析表达式,表达式使用{@link ExpressionUtils#PATTERN}进行提取
+ * 如调用 analytical("http://${3+2}/test",var,"spel")
+ * 支持的表达式语言: + *
    + *
  • freemarker
  • + *
  • spel
  • + *
  • ognl
  • + *
  • groovy
  • + *
  • js
  • + *
+ * + * @param expression 表达式字符串 + * @param vars 变量 + * @param language 表达式语言 + * @return 解析结果 + * @throws Exception 解析错误 + */ + public static String analytical(String expression, Map vars, String language) throws Exception { + Matcher matcher = PATTERN.matcher(expression); + DynamicScriptEngine engine = DynamicScriptEngineFactory.getEngine(language); + if (engine == null) return expression; + vars = new HashMap<>(vars); + vars.putAll(getDefaultVar()); + while (matcher.find()) { + String real_expression = matcher.group(); + String e_id = String.valueOf(real_expression.hashCode()); + if (!engine.compiled(e_id)) { + engine.compile(e_id, real_expression); + } + ExecuteResult result = engine.execute(e_id, vars); + if (!result.isSuccess()) + throw new RuntimeException(result.getMessage(), result.getException()); + String obj = String.valueOf(result.get()); + // expression = matcher.replaceFirst(obj); + expression = expression.replace("${" + real_expression + "}", obj); + } + return expression; + } + +} diff --git a/hsweb-commons/hsweb-commons-utils/src/main/java/org/hswebframework/web/RegexUtils.java b/hsweb-commons/hsweb-commons-utils/src/main/java/org/hswebframework/web/RegexUtils.java new file mode 100644 index 000000000..c78c33d8d --- /dev/null +++ b/hsweb-commons/hsweb-commons-utils/src/main/java/org/hswebframework/web/RegexUtils.java @@ -0,0 +1,29 @@ +package org.hswebframework.web; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * TODO 完成注释 + * + * @author zhouhao + */ +public class RegexUtils { + static Set SPECIAL_WORDS = new HashSet<>(Arrays.asList('\\', '$', '(', ')', '*', '+', '.', '[', ']', '?', '^', '{', '}', '|')); + + public static String escape(String regex) { + if (regex == null || regex.isEmpty()) return regex; + char[] chars = regex.toCharArray(); + StringBuilder builder = new StringBuilder(); + for (int i = 0; i < chars.length; i++) { + if (SPECIAL_WORDS.contains(chars[i])) { + builder.append('\\'); + } + builder.append(chars[i]); + } + return builder.toString(); + } + +} diff --git a/hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-server/src/main/java/org/hswebframework/web/example/oauth2/OAuth2ServerApplication.java b/hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-server/src/main/java/org/hswebframework/web/example/oauth2/OAuth2ServerApplication.java index 237b1bfe7..476e456ba 100644 --- a/hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-server/src/main/java/org/hswebframework/web/example/oauth2/OAuth2ServerApplication.java +++ b/hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-server/src/main/java/org/hswebframework/web/example/oauth2/OAuth2ServerApplication.java @@ -22,7 +22,7 @@ import org.hsweb.ezorm.rdb.executor.AbstractJdbcSqlExecutor; import org.hsweb.ezorm.rdb.executor.SqlExecutor; import org.hswebframework.web.authorization.Permission; import org.hswebframework.web.authorization.access.DataAccessConfig; -import org.hswebframework.web.authorization.oauth2.api.entity.OAuth2ClientEntity; +import org.hswebframework.web.authorization.oauth2.server.entity.OAuth2ClientEntity; import org.hswebframework.web.commons.entity.factory.EntityFactory; import org.hswebframework.web.dao.datasource.DataSourceHolder; import org.hswebframework.web.dao.datasource.DatabaseType; 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 d17d991e6..112f3fb8a 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 @@ -22,7 +22,7 @@ import org.hsweb.ezorm.rdb.executor.SqlExecutor; import org.hswebframework.web.authorization.Authentication; import org.hswebframework.web.authorization.Permission; import org.hswebframework.web.authorization.access.DataAccessConfig; -import org.hswebframework.web.authorization.oauth2.api.entity.OAuth2ClientEntity; +import org.hswebframework.web.authorization.oauth2.server.entity.OAuth2ClientEntity; import org.hswebframework.web.commons.entity.factory.EntityFactory; import org.hswebframework.web.dao.oauth2.OAuth2ClientDao; import org.hswebframework.web.dao.datasource.DataSourceHolder; diff --git a/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-service/hsweb-system-authorization-service-simple/src/main/java/org/hswebframework/web/service/authorization/simple/SimpleUserService.java b/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-service/hsweb-system-authorization-service-simple/src/main/java/org/hswebframework/web/service/authorization/simple/SimpleUserService.java index 178034b57..28dd366ad 100644 --- a/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-service/hsweb-system-authorization-service-simple/src/main/java/org/hswebframework/web/service/authorization/simple/SimpleUserService.java +++ b/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-service/hsweb-system-authorization-service-simple/src/main/java/org/hswebframework/web/service/authorization/simple/SimpleUserService.java @@ -111,10 +111,10 @@ public class SimpleUserService extends AbstractService @Override @CacheEvict(value = USER_CACHE_NAME, key = "#userEntity.id") public String insert(UserEntity userEntity) { - //判断用户是否已经存在 - tryValidateProperty(null == selectByUsername(userEntity.getUsername()), UserEntity.username, "{username_exists}"); //用户名合法性验证 tryValidateProperty(usernameValidator, UserEntity.username, userEntity.getUsername()); + //判断用户是否已经存在 + tryValidateProperty(null == selectByUsername(userEntity.getUsername()), UserEntity.username, "{username_exists}"); //密码强度验证 tryValidateProperty(passwordStrengthValidator, UserEntity.password, userEntity.getPassword()); userEntity.setCreateTime(System.currentTimeMillis()); diff --git a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-controller/pom.xml b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-controller/pom.xml index fbf9d9b80..a70b46f3f 100644 --- a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-controller/pom.xml +++ b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-controller/pom.xml @@ -45,6 +45,11 @@ hsweb-authorization-oauth2-auth-server ${project.version} + + org.hswebframework.web + hsweb-system-oauth2-server-entity + ${project.version} + javax.servlet servlet-api diff --git a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-controller/src/main/java/org/hswebframework/web/authorization/oauth2/controller/OAuth2AuthorizeController.java b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-controller/src/main/java/org/hswebframework/web/authorization/oauth2/controller/OAuth2AuthorizeController.java index d7d54a913..577e98d6f 100644 --- a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-controller/src/main/java/org/hswebframework/web/authorization/oauth2/controller/OAuth2AuthorizeController.java +++ b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-controller/src/main/java/org/hswebframework/web/authorization/oauth2/controller/OAuth2AuthorizeController.java @@ -23,8 +23,6 @@ import io.swagger.annotations.ApiOperation; import org.hswebframework.web.AuthorizeException; import org.hswebframework.web.authorization.Authentication; import org.hswebframework.web.authorization.annotation.Authorize; -import org.hswebframework.web.authorization.oauth2.api.OAuth2ServerService; -import org.hswebframework.web.authorization.oauth2.api.entity.OAuth2AccessEntity; import org.hswebframework.web.authorization.oauth2.server.OAuth2AccessToken; import org.hswebframework.web.authorization.oauth2.server.support.OAuth2Granter; import org.hswebframework.web.authorization.oauth2.server.support.code.AuthorizationCodeRequest; diff --git a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-controller/src/main/java/org/hswebframework/web/authorization/oauth2/controller/OAuth2UserInfoController.java b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-controller/src/main/java/org/hswebframework/web/authorization/oauth2/controller/OAuth2UserInfoController.java index 3f260e5b5..4d8bb889c 100644 --- a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-controller/src/main/java/org/hswebframework/web/authorization/oauth2/controller/OAuth2UserInfoController.java +++ b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-controller/src/main/java/org/hswebframework/web/authorization/oauth2/controller/OAuth2UserInfoController.java @@ -23,13 +23,8 @@ import io.swagger.annotations.ApiOperation; import org.hswebframework.web.AuthorizeException; import org.hswebframework.web.authorization.Authentication; import org.hswebframework.web.authorization.AuthenticationHolder; -import org.hswebframework.web.authorization.annotation.Authorize; -import org.hswebframework.web.authorization.oauth2.api.OAuth2ServerService; -import org.hswebframework.web.authorization.oauth2.api.entity.OAuth2AccessEntity; import org.hswebframework.web.authorization.oauth2.server.OAuth2AccessToken; import org.hswebframework.web.authorization.oauth2.server.token.AccessTokenService; -import org.hswebframework.web.oauth2.model.AuthorizationCodeModel; -import org.hswebframework.web.oauth2.model.ImplicitAccessTokenModel; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; diff --git a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-dao/hsweb-system-oauth2-server-dao-api/pom.xml b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-dao/hsweb-system-oauth2-server-dao-api/pom.xml index af467b28f..f8e1799b8 100644 --- a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-dao/hsweb-system-oauth2-server-dao-api/pom.xml +++ b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-dao/hsweb-system-oauth2-server-dao-api/pom.xml @@ -37,7 +37,7 @@ org.hswebframework.web - hsweb-authorization-oauth2-auth-server + hsweb-system-oauth2-server-entity ${project.version} diff --git a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-dao/hsweb-system-oauth2-server-dao-api/src/main/java/org/hswebframework/web/dao/oauth2/AuthorizationCodeDao.java b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-dao/hsweb-system-oauth2-server-dao-api/src/main/java/org/hswebframework/web/dao/oauth2/AuthorizationCodeDao.java index a9e6896a7..fccd9b85f 100644 --- a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-dao/hsweb-system-oauth2-server-dao-api/src/main/java/org/hswebframework/web/dao/oauth2/AuthorizationCodeDao.java +++ b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-dao/hsweb-system-oauth2-server-dao-api/src/main/java/org/hswebframework/web/dao/oauth2/AuthorizationCodeDao.java @@ -18,7 +18,7 @@ package org.hswebframework.web.dao.oauth2; -import org.hswebframework.web.authorization.oauth2.api.entity.AuthorizationCodeEntity; +import org.hswebframework.web.authorization.oauth2.server.entity.AuthorizationCodeEntity; import org.hswebframework.web.dao.InsertDao; import org.hswebframework.web.dao.dynamic.DeleteByEntityDao; import org.hswebframework.web.dao.dynamic.QueryByEntityDao; diff --git a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-dao/hsweb-system-oauth2-server-dao-api/src/main/java/org/hswebframework/web/dao/oauth2/OAuth2AccessDao.java b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-dao/hsweb-system-oauth2-server-dao-api/src/main/java/org/hswebframework/web/dao/oauth2/OAuth2AccessDao.java index e230212b5..f9b8eda33 100644 --- a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-dao/hsweb-system-oauth2-server-dao-api/src/main/java/org/hswebframework/web/dao/oauth2/OAuth2AccessDao.java +++ b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-dao/hsweb-system-oauth2-server-dao-api/src/main/java/org/hswebframework/web/dao/oauth2/OAuth2AccessDao.java @@ -18,7 +18,7 @@ package org.hswebframework.web.dao.oauth2; -import org.hswebframework.web.authorization.oauth2.api.entity.OAuth2AccessEntity; +import org.hswebframework.web.authorization.oauth2.server.entity.OAuth2AccessEntity; import org.hswebframework.web.dao.InsertDao; import org.hswebframework.web.dao.dynamic.DeleteByEntityDao; import org.hswebframework.web.dao.dynamic.QueryByEntityDao; diff --git a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-dao/hsweb-system-oauth2-server-dao-api/src/main/java/org/hswebframework/web/dao/oauth2/OAuth2ClientDao.java b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-dao/hsweb-system-oauth2-server-dao-api/src/main/java/org/hswebframework/web/dao/oauth2/OAuth2ClientDao.java index 04cb3e1c5..4ca2f1f4e 100644 --- a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-dao/hsweb-system-oauth2-server-dao-api/src/main/java/org/hswebframework/web/dao/oauth2/OAuth2ClientDao.java +++ b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-dao/hsweb-system-oauth2-server-dao-api/src/main/java/org/hswebframework/web/dao/oauth2/OAuth2ClientDao.java @@ -19,7 +19,7 @@ package org.hswebframework.web.dao.oauth2; -import org.hswebframework.web.authorization.oauth2.api.entity.OAuth2ClientEntity; +import org.hswebframework.web.authorization.oauth2.server.entity.OAuth2ClientEntity; import org.hswebframework.web.dao.CrudDao; /** diff --git a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-dao/hsweb-system-oauth2-server-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/oauth2/OAuth2AccessMapper.xml b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-dao/hsweb-system-oauth2-server-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/oauth2/OAuth2AccessMapper.xml index c614bf363..3559e21dc 100644 --- a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-dao/hsweb-system-oauth2-server-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/oauth2/OAuth2AccessMapper.xml +++ b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-dao/hsweb-system-oauth2-server-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/oauth2/OAuth2AccessMapper.xml @@ -22,7 +22,7 @@ "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -39,7 +39,7 @@ - + diff --git a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-dao/hsweb-system-oauth2-server-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/oauth2/OAuth2ClientMapper.xml b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-dao/hsweb-system-oauth2-server-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/oauth2/OAuth2ClientMapper.xml index d17cf010e..4266ecbb5 100644 --- a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-dao/hsweb-system-oauth2-server-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/oauth2/OAuth2ClientMapper.xml +++ b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-dao/hsweb-system-oauth2-server-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/oauth2/OAuth2ClientMapper.xml @@ -22,7 +22,7 @@ "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -43,7 +43,7 @@ - + diff --git a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-dao/hsweb-system-oauth2-server-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/oauth2/OAuth2CodeMapper.xml b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-dao/hsweb-system-oauth2-server-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/oauth2/OAuth2CodeMapper.xml index fbe010c97..86dfbf19f 100644 --- a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-dao/hsweb-system-oauth2-server-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/oauth2/OAuth2CodeMapper.xml +++ b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-dao/hsweb-system-oauth2-server-dao-mybatis/src/main/resources/org/hswebframework/web/dao/mybatis/mappers/oauth2/OAuth2CodeMapper.xml @@ -22,7 +22,7 @@ "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -37,7 +37,7 @@ - + diff --git a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-entity/pom.xml b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-entity/pom.xml new file mode 100644 index 000000000..e04808875 --- /dev/null +++ b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-entity/pom.xml @@ -0,0 +1,39 @@ + + + + + + hsweb-system-oauth2-server + org.hswebframework.web + 3.0-SNAPSHOT + + 4.0.0 + + hsweb-system-oauth2-server-entity + + + + org.hswebframework.web + hsweb-authorization-oauth2-auth-server + ${project.version} + + + \ No newline at end of file diff --git a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-simple/src/main/java/org/hswebframework/web/oauth2/server/simple/SimpleAccessTokenService.java b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-simple/src/main/java/org/hswebframework/web/oauth2/server/simple/SimpleAccessTokenService.java index 67896b150..900601b55 100644 --- a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-simple/src/main/java/org/hswebframework/web/oauth2/server/simple/SimpleAccessTokenService.java +++ b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-simple/src/main/java/org/hswebframework/web/oauth2/server/simple/SimpleAccessTokenService.java @@ -18,7 +18,8 @@ package org.hswebframework.web.oauth2.server.simple; -import org.hswebframework.web.authorization.oauth2.api.entity.OAuth2AccessEntity; + +import org.hswebframework.web.authorization.oauth2.server.entity.OAuth2AccessEntity; import org.hswebframework.web.authorization.oauth2.server.OAuth2AccessToken; import org.hswebframework.web.authorization.oauth2.server.token.AccessTokenService; import org.hswebframework.web.commons.entity.factory.EntityFactory; diff --git a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-simple/src/main/java/org/hswebframework/web/oauth2/server/simple/SimpleAuthorizationCodeService.java b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-simple/src/main/java/org/hswebframework/web/oauth2/server/simple/SimpleAuthorizationCodeService.java index 05bf9204e..17391cd8e 100644 --- a/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-simple/src/main/java/org/hswebframework/web/oauth2/server/simple/SimpleAuthorizationCodeService.java +++ b/hsweb-system/hsweb-system-oauth2-server/hsweb-system-oauth2-server-simple/src/main/java/org/hswebframework/web/oauth2/server/simple/SimpleAuthorizationCodeService.java @@ -18,8 +18,7 @@ package org.hswebframework.web.oauth2.server.simple; -import com.alibaba.fastjson.JSON; -import org.hswebframework.web.authorization.oauth2.api.entity.AuthorizationCodeEntity; +import org.hswebframework.web.authorization.oauth2.server.entity.AuthorizationCodeEntity; import org.hswebframework.web.authorization.oauth2.server.support.code.AuthorizationCode; import org.hswebframework.web.authorization.oauth2.server.support.code.AuthorizationCodeRequest; import org.hswebframework.web.authorization.oauth2.server.support.code.AuthorizationCodeService; diff --git a/hsweb-system/hsweb-system-oauth2-server/pom.xml b/hsweb-system/hsweb-system-oauth2-server/pom.xml index 30a730e90..fc56c5c0f 100644 --- a/hsweb-system/hsweb-system-oauth2-server/pom.xml +++ b/hsweb-system/hsweb-system-oauth2-server/pom.xml @@ -33,6 +33,7 @@ hsweb-system-oauth2-server-starter hsweb-system-oauth2-server-dao hsweb-system-oauth2-server-model + hsweb-system-oauth2-server-entity pom hsweb-system-oauth2-server