Skip to content
Snippets Groups Projects
Commit 5eb4771d authored by Baptiste Toulemonde's avatar Baptiste Toulemonde
Browse files

add getcatalogsid

parent 956f35e6
No related branches found
No related tags found
1 merge request!8add getcatalogsid
......@@ -56,6 +56,7 @@ public class SmartHarvesterSecurityConfiguration extends WebSecurityConfigurerAd
.exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and()
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
.authorizeRequests().antMatchers("/harvester/auth/**").permitAll().and()
.authorizeRequests().antMatchers("/harvester/api/catalogs").permitAll().and()
.authorizeRequests().antMatchers("/resources/**", "/public/error/css/**").permitAll()
.antMatchers("/harvester/api/**").authenticated()
.antMatchers("/public/error/css/**").permitAll().and()
......
......@@ -24,6 +24,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.*;
import java.util.stream.Collectors;
@CrossOrigin(origins = "*")
@RestController
......@@ -55,5 +56,10 @@ public class SmartHarvesterCatalogController {
return ResponseEntity.ok(new MessageResponse("Catalog deleted succefully!",HttpStatus.OK));
}
@GetMapping
public ResponseEntity<List<String>> getAll() {
return ResponseEntity.ok(catalogDoaRepository.findAll().stream().map(catalog -> catalog.getCatId()).collect(Collectors.toList()));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment