diff --git a/jap-core/src/main/java/com/fujieid/jap/core/JapUserService.java b/jap-core/src/main/java/com/fujieid/jap/core/JapUserService.java index 8e19b364a70197f4958e37ba619cbbf3c8bb6bf0..ca14bb23bfdd9ee0a4f78652fc06cff8925dfdbc 100644 --- a/jap-core/src/main/java/com/fujieid/jap/core/JapUserService.java +++ b/jap-core/src/main/java/com/fujieid/jap/core/JapUserService.java @@ -39,7 +39,7 @@ public interface JapUserService { /** * Get user info by username. *

- * It is suitable for the {@code jap-simple} module + * It is suitable for {@code jap-simple} and {@code jap-http-api} module * * @param username username of the business system * @return JapUser @@ -114,14 +114,14 @@ public interface JapUserService { } /** - * Save the http authed user information to the database and return JapUser + * Save the http authed user information to the database and return JapUser when using 'HTTP BEARER' authentication *

* It is suitable for the {@code jap-http-api} module - * @param userinfo user information + * @param japUser jap user information. * @return When saving successfully, return {@code JapUser}, otherwise return {@code null} */ - default JapUser createAndGetHttpApiUser(Object userinfo){ - return null; + default void saveHttpAuthedJapUser(JapUser japUser){ + } } diff --git a/jap-http-api/src/main/java/com/fujieid/jap/httpapi/HttpApiStrategy.java b/jap-http-api/src/main/java/com/fujieid/jap/httpapi/HttpApiStrategy.java index b0296b6612f40849230f144d7931031c2dd07f4f..e5d383ebbe359a89aa22f591961c202c4f7f8f4d 100644 --- a/jap-http-api/src/main/java/com/fujieid/jap/httpapi/HttpApiStrategy.java +++ b/jap-http-api/src/main/java/com/fujieid/jap/httpapi/HttpApiStrategy.java @@ -79,7 +79,7 @@ public class HttpApiStrategy extends AbstractJapStrategy { if (authResponse != null && authResponse.isSuccess()) { if (config.getAuthSchema() == AuthSchemaEnum.BASIC || config.getAuthSchema() == AuthSchemaEnum.DIGEST) { - japUserService.createAndGetHttpApiUser(japUser); + japUserService.saveHttpAuthedJapUser(japUser); } return JapResponse.success(authResponse.getBody()); } else { @@ -259,7 +259,7 @@ public class HttpApiStrategy extends AbstractJapStrategy { // save jap user to db japUser.setToken(token); - japUserService.createAndGetHttpApiUser(japUser); + japUserService.saveHttpAuthedJapUser(japUser); return token; }