REST search API default InstId

This commit is contained in:
MaxKey
2023-05-22 14:02:56 +08:00
parent b05f8f7ef0
commit 5ce0b3ce58
2 changed files with 9 additions and 1 deletions

View File

@@ -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<JpaPageResults<Organizations>>(
organizationsService.queryPageResults(org)).buildResponse();

View File

@@ -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<JpaPageResults<UserInfo>>(
userInfoService.queryPageResults(userInfo)).buildResponse();
}