Skip to content

Commit

Permalink
Move common path to class level request mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
wwelling committed Aug 16, 2024
1 parent bd575c2 commit d94dce2
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*
*/
@RestController
@RequestMapping("/individual")
@RequestMapping("/individual/search")
public class IndividualSearchController implements RepresentationModelProcessor<RepositorySearchesResource> {

@Lazy
Expand All @@ -55,27 +55,27 @@ public class IndividualSearchController implements RepresentationModelProcessor<
@Autowired
private DiscoveryPagedResourcesAssembler<Individual> pagedAssembler;

@GetMapping("/search/findByIdIn")
@GetMapping("/findByIdIn")
public ResponseEntity<CollectionModel<IndividualModel>> findByIdIn(
@RequestParam(required = true) List<String> ids
) {
return ResponseEntity.ok(assembler.toCollectionModel(repo.findByIdIn(ids)));
}

@GetMapping("/search/findByType")
@GetMapping("/findByType")
public ResponseEntity<CollectionModel<IndividualModel>> findByType(@RequestParam(required = true) String type) {
return ResponseEntity.ok(assembler.toCollectionModel(repo.findByType(type)));
}

@GetMapping("/search/recentlyUpdated")
@GetMapping("/recentlyUpdated")
public ResponseEntity<CollectionModel<IndividualModel>> recentlyUpdated(
@RequestParam(value = "limit", defaultValue = "10") int limit,
List<FilterArg> filters
) {
return ResponseEntity.ok(assembler.toCollectionModel(repo.findMostRecentlyUpdate(limit, filters)));
}

@GetMapping("/search/advanced")
@GetMapping("/advanced")
public ResponseEntity<PagedModel<IndividualModel>> search(
QueryArg query,
List<FacetArg> facets,
Expand Down

0 comments on commit d94dce2

Please sign in to comment.