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 ...@@ -56,6 +56,7 @@ public class SmartHarvesterSecurityConfiguration extends WebSecurityConfigurerAd
.exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and() .exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and()
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and() .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
.authorizeRequests().antMatchers("/harvester/auth/**").permitAll().and() .authorizeRequests().antMatchers("/harvester/auth/**").permitAll().and()
.authorizeRequests().antMatchers("/harvester/api/catalogs").permitAll().and()
.authorizeRequests().antMatchers("/resources/**", "/public/error/css/**").permitAll() .authorizeRequests().antMatchers("/resources/**", "/public/error/css/**").permitAll()
.antMatchers("/harvester/api/**").authenticated() .antMatchers("/harvester/api/**").authenticated()
.antMatchers("/public/error/css/**").permitAll().and() .antMatchers("/public/error/css/**").permitAll().and()
......
...@@ -24,6 +24,7 @@ import org.springframework.http.ResponseEntity; ...@@ -24,6 +24,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
@CrossOrigin(origins = "*") @CrossOrigin(origins = "*")
@RestController @RestController
...@@ -55,5 +56,10 @@ public class SmartHarvesterCatalogController { ...@@ -55,5 +56,10 @@ public class SmartHarvesterCatalogController {
return ResponseEntity.ok(new MessageResponse("Catalog deleted succefully!",HttpStatus.OK)); 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