Current tour endpoint

This commit is contained in:
Filip Izydorczyk 2021-01-20 16:00:09 +01:00
parent 20a6db61cc
commit af29d0a54a
3 changed files with 15 additions and 3 deletions

View File

@ -173,9 +173,20 @@ public class ConfigController {
/** /**
* @return api response entity * @return api response entity
*/ */
@GetMapping(path = "/config/tour")
@ApiOperation("It will return what tour is currently on.")
public ResponseEntity<ConfigTourResponse> 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") @GetMapping(path = "/admin/tour")
@PreAuthorize("hasRole('ROLE_ADMIN')") @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<ConfigTourResponse> getTourDate() { public ResponseEntity<ConfigTourResponse> getTourDate() {
final ConfigTourResponse response = new ConfigTourResponse(this.contrl.getCurrentConfig().getCurrentState()); final ConfigTourResponse response = new ConfigTourResponse(this.contrl.getCurrentConfig().getCurrentState());
return new ResponseEntity<>(response, HttpStatus.OK); return new ResponseEntity<>(response, HttpStatus.OK);

View File

@ -39,7 +39,7 @@ public class GroupDefaultResponse {
@ApiModelProperty(value = "Value shows how many places is already taken by other students.") @ApiModelProperty(value = "Value shows how many places is already taken by other students.")
private Integer takenPlaces; private Integer takenPlaces;
@ApiModelProperty(value = "Used only in resposnes realted to user assignments. For example in <code>/api/v1/users/schedule</code>.") @ApiModelProperty(value = "Used only in resposnes realted to user assignments. For example in /api/v1/users/schedule.")
private Boolean isAccepted; private Boolean isAccepted;
/** /**

View File

@ -40,7 +40,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override @Override
public void configure(final WebSecurity webSecurity) { public void configure(final WebSecurity webSecurity) {
webSecurity.ignoring().antMatchers("/token**").antMatchers("/token/refresh**") 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", .antMatchers("/v2/api-docs", "/configuration/ui", "/swagger-resources/**", "/configuration/security",
"/swagger-ui.html", "/webjars/**"); "/swagger-ui.html", "/webjars/**");
} }