未验证 提交 1b3304d1 编写于 作者: 智布道's avatar 智布道 👁 提交者: GitHub

Merge pull request #13 from Mvbbb/dev

optimize JapUserService interface
......@@ -39,7 +39,7 @@ public interface JapUserService {
/**
* Get user info by username.
* <p>
* 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
* <p>
* 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){
}
}
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册