[INFRA-421] | Anoop | Add api to list all manifests

This commit is contained in:
anoop narang
2020-07-23 03:42:58 +05:30
parent c00b504389
commit 8ae529cd52
4 changed files with 14 additions and 1 deletions

View File

@@ -55,10 +55,15 @@ public class ManifestController {
}
@GetMapping("/list/{environment}")
List<ManifestName> fetchListByEnvironment(@PathVariable String environment) throws VaultException, RestException {
List<ManifestName> fetchListByEnvironment(@PathVariable String environment) {
return manifestService.fetchListByEnvironment(environment);
}
@GetMapping("/list")
List<ManifestName> fetchCompleteList() {
return manifestService.fetchCompleteList();
}
@GetMapping("/{id}/copy")
public Manifest copyManifest(@PathVariable Long id) {
return manifestService.copyManifest(id);

View File

@@ -5,4 +5,6 @@ public interface ManifestName {
Long getId();
String getName();
String getEnvironment();
}

View File

@@ -12,4 +12,6 @@ public interface ManifestRepository extends JpaRepository<Manifest, Long> {
Optional<Manifest> findByNameAndEnvironment(String name, String environment);
List<ManifestName> findIdAndNameByEnvironment(String environment);
List<ManifestName> findIdAndNameAndEnvironmentBy();
}

View File

@@ -183,4 +183,8 @@ public class ManifestService {
public List<ManifestName> fetchListByEnvironment(String environment) {
return manifestRepository.findIdAndNameByEnvironment(environment);
}
public List<ManifestName> fetchCompleteList() {
return manifestRepository.findIdAndNameAndEnvironmentBy();
}
}