diff --git a/maxkey-lib/mybatis-jpa-extra-3.2.jar b/maxkey-lib/mybatis-jpa-extra-3.2.jar index 8c33c983..0d977d24 100644 Binary files a/maxkey-lib/mybatis-jpa-extra-3.2.jar and b/maxkey-lib/mybatis-jpa-extra-3.2.jar differ diff --git a/maxkey-protocols/maxkey-protocol-authorize/src/main/java/org/dromara/maxkey/authz/endpoint/AuthorizeBaseEndpoint.java b/maxkey-protocols/maxkey-protocol-authorize/src/main/java/org/dromara/maxkey/authz/endpoint/AuthorizeBaseEndpoint.java index 9d5df42f..b25612ef 100644 --- a/maxkey-protocols/maxkey-protocol-authorize/src/main/java/org/dromara/maxkey/authz/endpoint/AuthorizeBaseEndpoint.java +++ b/maxkey-protocols/maxkey-protocol-authorize/src/main/java/org/dromara/maxkey/authz/endpoint/AuthorizeBaseEndpoint.java @@ -31,6 +31,7 @@ import org.dromara.maxkey.persistence.service.AccountsService; import org.dromara.maxkey.persistence.service.AppsService; import org.dromara.maxkey.web.WebConstants; import org.dromara.maxkey.web.WebContext; +import org.dromara.mybatis.jpa.query.Query; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -77,7 +78,7 @@ public class AuthorizeBaseEndpoint { account.setAppName(app.getAppName()); if(loadApp.getCredential().equalsIgnoreCase(Apps.CREDENTIALS.USER_DEFINED)){ - account = accountsService.load(new Accounts(userInfo.getId(),loadApp.getId())); + account = accountsService.load( Query.builder().eq("appId", loadApp.getId()).eq("userid", userInfo.getId())); if(account != null){ account.setRelatedPassword( PasswordReciprocal.getInstance().decoder(account.getRelatedPassword())); diff --git a/maxkey-webs/maxkey-web-maxkey/src/main/java/org/dromara/maxkey/web/contorller/AppListController.java b/maxkey-webs/maxkey-web-maxkey/src/main/java/org/dromara/maxkey/web/contorller/AppListController.java index d5404d1a..2269d94c 100644 --- a/maxkey-webs/maxkey-web-maxkey/src/main/java/org/dromara/maxkey/web/contorller/AppListController.java +++ b/maxkey-webs/maxkey-web-maxkey/src/main/java/org/dromara/maxkey/web/contorller/AppListController.java @@ -30,6 +30,7 @@ import org.dromara.maxkey.entity.apps.UserApps; import org.dromara.maxkey.persistence.service.AccountsService; import org.dromara.maxkey.persistence.service.AppsService; import org.dromara.maxkey.persistence.service.UserInfoService; +import org.dromara.mybatis.jpa.query.Query; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -92,7 +93,7 @@ public class AppListController { Accounts account = null ; if (credential.equalsIgnoreCase(Apps.CREDENTIALS.USER_DEFINED)) { - account = accountsService.load(new Accounts(currentUser.getId(), appId)); + account = accountsService.load(Query.builder().eq("appId", appId).eq("userid", currentUser.getId())); account.setRelatedPassword( PasswordReciprocal.getInstance().decoder( account.getRelatedPassword())); @@ -115,7 +116,7 @@ public class AppListController { @CurrentUser UserInfo currentUser) { Accounts appUsers = new Accounts(); if (credential.equalsIgnoreCase(Apps.CREDENTIALS.USER_DEFINED)) { - appUsers = accountsService.load(new Accounts(currentUser.getId(), account.getAppId())); + appUsers = accountsService.load(Query.builder().eq("appId", account.getAppId()).eq("userid", currentUser.getId())); if (appUsers == null) { appUsers = new Accounts(); appUsers.setId(appUsers.generateId()); diff --git a/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/access/contorller/RolesController.java b/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/access/contorller/RolesController.java index 8e5f2960..fa568101 100644 --- a/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/access/contorller/RolesController.java +++ b/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/access/contorller/RolesController.java @@ -69,7 +69,7 @@ public class RolesController { public ResponseEntity query(@ModelAttribute Roles role,@CurrentUser UserInfo currentUser) { _logger.debug("-query :" + role); role.setInstId(currentUser.getInstId()); - if (rolesService.load(role)!=null) { + if (rolesService.query(role)!=null) { return new Message(Message.SUCCESS).buildResponse(); } else { return new Message(Message.FAIL).buildResponse(); diff --git a/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/apps/contorller/ApplicationsController.java b/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/apps/contorller/ApplicationsController.java index ae63ed47..117f3d6a 100644 --- a/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/apps/contorller/ApplicationsController.java +++ b/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/apps/contorller/ApplicationsController.java @@ -80,7 +80,7 @@ public class ApplicationsController extends BaseAppContorller { @RequestMapping(value={"/query"}, produces = {MediaType.APPLICATION_JSON_VALUE}) public ResponseEntity query(@ModelAttribute Apps apps,@CurrentUser UserInfo currentUser) { _logger.debug("-query :" + apps); - if (appsService.load(apps)!=null) { + if (appsService.query(apps)!=null) { return new Message(Message.SUCCESS).buildResponse(); } else { return new Message(Message.SUCCESS).buildResponse(); diff --git a/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/config/contorller/AccountsStrategyController.java b/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/config/contorller/AccountsStrategyController.java index f60ab3f9..75fb55f2 100644 --- a/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/config/contorller/AccountsStrategyController.java +++ b/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/config/contorller/AccountsStrategyController.java @@ -65,7 +65,7 @@ public class AccountsStrategyController { @RequestMapping(value={"/query"}, produces = {MediaType.APPLICATION_JSON_VALUE}) public ResponseEntity query(@ModelAttribute AccountsStrategy accountsStrategy,@CurrentUser UserInfo currentUser) { _logger.debug("-query :" + accountsStrategy); - if (accountsStrategyService.load(accountsStrategy)!=null) { + if (accountsStrategyService.query(accountsStrategy)!=null) { return new Message(Message.SUCCESS).buildResponse(); } else { return new Message(Message.SUCCESS).buildResponse(); diff --git a/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/config/contorller/AdaptersController.java b/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/config/contorller/AdaptersController.java index 22d58773..4d4fda76 100644 --- a/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/config/contorller/AdaptersController.java +++ b/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/config/contorller/AdaptersController.java @@ -57,7 +57,7 @@ public class AdaptersController { @RequestMapping(value={"/query"}, produces = {MediaType.APPLICATION_JSON_VALUE}) public ResponseEntity query(@ModelAttribute AppsAdapters appsAdapter,@CurrentUser UserInfo currentUser) { _logger.debug("-query :" + appsAdapter); - if (appsAdaptersService.load(appsAdapter)!=null) { + if (appsAdaptersService.query(appsAdapter)!=null) { return new Message(Message.SUCCESS).buildResponse(); } else { return new Message(Message.SUCCESS).buildResponse(); diff --git a/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/config/contorller/SocialsProviderController.java b/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/config/contorller/SocialsProviderController.java index 5085e1cc..915967b4 100644 --- a/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/config/contorller/SocialsProviderController.java +++ b/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/config/contorller/SocialsProviderController.java @@ -60,7 +60,7 @@ public class SocialsProviderController { public ResponseEntity query(@ModelAttribute SocialsProvider socialsProvider,@CurrentUser UserInfo currentUser) { _logger.debug("-query :" + socialsProvider); socialsProvider.setInstId(currentUser.getInstId()); - if (socialsProviderService.load(socialsProvider)!=null) { + if (socialsProviderService.query(socialsProvider)!=null) { return new Message(Message.SUCCESS).buildResponse(); } else { return new Message(Message.SUCCESS).buildResponse(); diff --git a/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/contorller/AccountsController.java b/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/contorller/AccountsController.java index 1214390c..029ed74f 100644 --- a/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/contorller/AccountsController.java +++ b/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/contorller/AccountsController.java @@ -80,7 +80,7 @@ public class AccountsController { public ResponseEntity query(@ModelAttribute Accounts account,@CurrentUser UserInfo currentUser) { _logger.debug("-query :" + account); account.setInstId(currentUser.getInstId()); - if (accountsService.load(account)!=null) { + if (accountsService.query(account)!=null) { return new Message(Message.SUCCESS).buildResponse(); } else { return new Message(Message.SUCCESS).buildResponse(); diff --git a/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/contorller/UserAdjointController.java b/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/contorller/UserAdjointController.java index aa914420..0b7246a1 100644 --- a/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/contorller/UserAdjointController.java +++ b/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/contorller/UserAdjointController.java @@ -106,7 +106,7 @@ public class UserAdjointController { @CurrentUser UserInfo currentUser) { _logger.debug("-query :" + userInfoAdjoint); userInfoAdjoint.setInstId(currentUser.getInstId()); - if (userInfoAdjointService.load(userInfoAdjoint)!=null) { + if (userInfoAdjointService.query(userInfoAdjoint)!=null) { return new Message(Message.SUCCESS).buildResponse(); } else { diff --git a/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/contorller/UserInfoController.java b/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/contorller/UserInfoController.java index 87103eef..abff1191 100644 --- a/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/contorller/UserInfoController.java +++ b/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/contorller/UserInfoController.java @@ -99,7 +99,7 @@ public class UserInfoController { @RequestMapping(value={"/query"}, produces = {MediaType.APPLICATION_JSON_VALUE}) public ResponseEntity query(@ModelAttribute UserInfo userInfo,@CurrentUser UserInfo currentUser) { _logger.debug("-query :" + userInfo); - if (userInfoService.load(userInfo)!=null) { + if (userInfoService.query(userInfo)!=null) { return new Message(Message.SUCCESS).buildResponse(); } else { return new Message(Message.SUCCESS).buildResponse();