From af29d0a54ae6a2b4a6d3485728726b4a4c86ac8f Mon Sep 17 00:00:00 2001 From: Filip Izydorczyk Date: Wed, 20 Jan 2021 16:00:09 +0100 Subject: [PATCH] Current tour endpoint --- .../plannaplan/controllers/ConfigController.java | 13 ++++++++++++- .../responses/models/GroupDefaultResponse.java | 2 +- .../com/plannaplan/security/WebSecurityConfig.java | 3 ++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/restservice/src/main/java/com/plannaplan/controllers/ConfigController.java b/restservice/src/main/java/com/plannaplan/controllers/ConfigController.java index 59a5bdd..4bee96a 100755 --- a/restservice/src/main/java/com/plannaplan/controllers/ConfigController.java +++ b/restservice/src/main/java/com/plannaplan/controllers/ConfigController.java @@ -173,9 +173,20 @@ public class ConfigController { /** * @return api response entity */ + @GetMapping(path = "/config/tour") + @ApiOperation("It will return what tour is currently on.") + public ResponseEntity getCurrentTourDate() { + final ConfigTourResponse response = new ConfigTourResponse(this.contrl.getCurrentConfig().getCurrentState()); + return new ResponseEntity<>(response, HttpStatus.OK); + } + + /** + * @return api response entity + */ + @Deprecated @GetMapping(path = "/admin/tour") @PreAuthorize("hasRole('ROLE_ADMIN')") - @ApiOperation("It will return what tour is currently on. You need to provide admin token.") + @ApiOperation("It will return what tour is currently on. You need to provide admin token. It is depreaceted use /configurator/config/tour isntead.") public ResponseEntity getTourDate() { final ConfigTourResponse response = new ConfigTourResponse(this.contrl.getCurrentConfig().getCurrentState()); return new ResponseEntity<>(response, HttpStatus.OK); diff --git a/restservice/src/main/java/com/plannaplan/responses/models/GroupDefaultResponse.java b/restservice/src/main/java/com/plannaplan/responses/models/GroupDefaultResponse.java index 171a088..7743560 100755 --- a/restservice/src/main/java/com/plannaplan/responses/models/GroupDefaultResponse.java +++ b/restservice/src/main/java/com/plannaplan/responses/models/GroupDefaultResponse.java @@ -39,7 +39,7 @@ public class GroupDefaultResponse { @ApiModelProperty(value = "Value shows how many places is already taken by other students.") private Integer takenPlaces; - @ApiModelProperty(value = "Used only in resposnes realted to user assignments. For example in /api/v1/users/schedule.") + @ApiModelProperty(value = "Used only in resposnes realted to user assignments. For example in /api/v1/users/schedule.") private Boolean isAccepted; /** diff --git a/restservice/src/main/java/com/plannaplan/security/WebSecurityConfig.java b/restservice/src/main/java/com/plannaplan/security/WebSecurityConfig.java index a5bbce8..420be63 100755 --- a/restservice/src/main/java/com/plannaplan/security/WebSecurityConfig.java +++ b/restservice/src/main/java/com/plannaplan/security/WebSecurityConfig.java @@ -40,7 +40,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { @Override public void configure(final WebSecurity webSecurity) { webSecurity.ignoring().antMatchers("/token**").antMatchers("/token/refresh**") - .antMatchers("/api/v1/courses/all").antMatchers("/api/v1/groups/course/{id}") + .antMatchers("/api/v1/courses/all") + .antMatchers("/api/v1/groups/course/{id}", "/api/v1/configurator/config/tour") .antMatchers("/v2/api-docs", "/configuration/ui", "/swagger-resources/**", "/configuration/security", "/swagger-ui.html", "/webjars/**"); }