From 5ce0b3ce58fe493d5d5ce3b227a391206c4cb892 Mon Sep 17 00:00:00 2001 From: MaxKey Date: Mon, 22 May 2023 14:02:56 +0800 Subject: [PATCH] REST search API default InstId --- .../web/apis/identity/rest/RestOrganizationController.java | 4 ++++ .../web/apis/identity/rest/RestUserInfoController.java | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/maxkey-web-apis/maxkey-web-api-rest/src/main/java/org/maxkey/web/apis/identity/rest/RestOrganizationController.java b/maxkey-web-apis/maxkey-web-api-rest/src/main/java/org/maxkey/web/apis/identity/rest/RestOrganizationController.java index c89a962b1..01975d6d5 100644 --- a/maxkey-web-apis/maxkey-web-api-rest/src/main/java/org/maxkey/web/apis/identity/rest/RestOrganizationController.java +++ b/maxkey-web-apis/maxkey-web-api-rest/src/main/java/org/maxkey/web/apis/identity/rest/RestOrganizationController.java @@ -19,6 +19,7 @@ package org.maxkey.web.apis.identity.rest; import java.io.IOException; +import org.apache.commons.lang3.StringUtils; import org.apache.mybatis.jpa.persistence.JpaPageResults; import org.maxkey.entity.Message; import org.maxkey.entity.Organizations; @@ -100,6 +101,9 @@ public class RestOrganizationController { @RequestMapping(value = { "/.search" }, produces = {MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public ResponseEntity search(@ModelAttribute Organizations org) { + if(StringUtils.isBlank(org.getInstId())){ + org.setInstId("1"); + } _logger.debug("Organizations {}" , org); return new Message>( organizationsService.queryPageResults(org)).buildResponse(); diff --git a/maxkey-web-apis/maxkey-web-api-rest/src/main/java/org/maxkey/web/apis/identity/rest/RestUserInfoController.java b/maxkey-web-apis/maxkey-web-api-rest/src/main/java/org/maxkey/web/apis/identity/rest/RestUserInfoController.java index 92962087f..635ff0d36 100644 --- a/maxkey-web-apis/maxkey-web-api-rest/src/main/java/org/maxkey/web/apis/identity/rest/RestUserInfoController.java +++ b/maxkey-web-apis/maxkey-web-api-rest/src/main/java/org/maxkey/web/apis/identity/rest/RestUserInfoController.java @@ -19,6 +19,7 @@ package org.maxkey.web.apis.identity.rest; import java.io.IOException; +import org.apache.commons.lang3.StringUtils; import org.apache.mybatis.jpa.persistence.JpaPageResults; import org.maxkey.entity.ChangePassword; import org.maxkey.entity.Message; @@ -123,7 +124,10 @@ public class RestUserInfoController { @RequestMapping(value = { "/.search" }, produces = {MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public ResponseEntity search(@ModelAttribute UserInfo userInfo) { - _logger.debug("UserInfo {}"+userInfo); + _logger.debug("UserInfo {}",userInfo); + if(StringUtils.isBlank(userInfo.getInstId())){ + userInfo.setInstId("1"); + } return new Message>( userInfoService.queryPageResults(userInfo)).buildResponse(); }