mirror of
https://gitee.com/dromara/MaxKey.git
synced 2025-12-07 09:28:49 +08:00
add REST search API
user / Organization search
This commit is contained in:
parent
1cb66a7e5f
commit
b05f8f7ef0
@ -19,13 +19,18 @@ package org.maxkey.web.apis.identity.rest;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.mybatis.jpa.persistence.JpaPageResults;
|
||||
import org.maxkey.entity.Message;
|
||||
import org.maxkey.entity.Organizations;
|
||||
import org.maxkey.persistence.service.OrganizationsService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@ -91,4 +96,12 @@ public class RestOrganizationController {
|
||||
organizationsService.remove(id);
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping(value = { "/.search" }, produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
@ResponseBody
|
||||
public ResponseEntity<?> search(@ModelAttribute Organizations org) {
|
||||
_logger.debug("Organizations {}" , org);
|
||||
return new Message<JpaPageResults<Organizations>>(
|
||||
organizationsService.queryPageResults(org)).buildResponse();
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,7 +19,9 @@ package org.maxkey.web.apis.identity.rest;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.mybatis.jpa.persistence.JpaPageResults;
|
||||
import org.maxkey.entity.ChangePassword;
|
||||
import org.maxkey.entity.Message;
|
||||
import org.maxkey.entity.UserInfo;
|
||||
import org.maxkey.persistence.service.UserInfoService;
|
||||
import org.slf4j.Logger;
|
||||
@ -27,7 +29,10 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@ -114,4 +119,13 @@ public class RestUserInfoController {
|
||||
_logger.debug("UserInfo id {} ", id );
|
||||
userInfoService.logicDelete(id);
|
||||
}
|
||||
|
||||
@RequestMapping(value = { "/.search" }, produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
@ResponseBody
|
||||
public ResponseEntity<?> search(@ModelAttribute UserInfo userInfo) {
|
||||
_logger.debug("UserInfo {}"+userInfo);
|
||||
return new Message<JpaPageResults<UserInfo>>(
|
||||
userInfoService.queryPageResults(userInfo)).buildResponse();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user