Added method to return jobs with paging
This commit is contained in:
parent
3b3d9ee9e2
commit
8581a54bb9
1
pom.xml
1
pom.xml
|
@ -118,6 +118,7 @@
|
||||||
<version>2.3.1</version>
|
<version>2.3.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- api documentation -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springdoc</groupId>
|
<groupId>org.springdoc</groupId>
|
||||||
<artifactId>springdoc-openapi-ui</artifactId>
|
<artifactId>springdoc-openapi-ui</artifactId>
|
||||||
|
|
|
@ -16,8 +16,16 @@ public class ValidationJobController {
|
||||||
@Autowired
|
@Autowired
|
||||||
ValidationJobRepository validationJobRepository;
|
ValidationJobRepository validationJobRepository;
|
||||||
|
|
||||||
|
@RequestMapping(value = {"/"}, method = RequestMethod.GET)
|
||||||
|
public List<ValidationJob> getJobs(@RequestParam(name = "page", defaultValue = "0") int page,
|
||||||
|
@RequestParam(name="limit", defaultValue = "10") int limit) {
|
||||||
|
return validationJobRepository.getLatestValidationJobs(PageRequest.of(page, limit));
|
||||||
|
}
|
||||||
|
|
||||||
@RequestMapping(value = {"/latest"}, method = RequestMethod.GET)
|
@RequestMapping(value = {"/latest"}, method = RequestMethod.GET)
|
||||||
public List<ValidationJob> getLatestJobs(@RequestParam(name="limit", defaultValue = "10") int limit) {
|
public List<ValidationJob> getLatestJobs(@RequestParam(name="limit", defaultValue = "10") int limit) {
|
||||||
return validationJobRepository.getLatestValidationJobs(PageRequest.of(0, limit));
|
return validationJobRepository.getLatestValidationJobs(PageRequest.of(0, limit));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue