secured/documented AdminApi

This commit is contained in:
2024-04-16 11:46:57 -04:00
parent 07fd0d82e4
commit 5da8830c74

View File

@@ -4,39 +4,49 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses; import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.security.RolesAllowed;
import jakarta.validation.constraints.Min; import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import jakarta.ws.rs.PUT; import jakarta.ws.rs.PUT;
import jakarta.ws.rs.Path; import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam; import jakarta.ws.rs.PathParam;
import jakarta.ws.rs.Produces;
/** /**
* @author brian.long@poststats.com * @author brian.long@poststats.com
*/ */
@Path("/golf/admin") @Path("/golf/admin")
@Tag(name = "Administrative API") @Tag(name = "Administrative API")
@RolesAllowed(Constants.ADMIN_ROLE)
@SecurityRequirement(name = "basic")
public interface AdministrativeApi { public interface AdministrativeApi {
@PUT @PUT
@Path("/init/pointIndex/season/{season}") @Path("/init/pointIndex/season/{season:[0-9]{4}}")
@Operation( @Produces(Constants.V1_JSON)
summary = "Transforms the legacy pointID to the new pointIndexID for the virtual tournament." @Deprecated
) @Operation(description = "Transforms the legacy pointID to the new pointIndexID for the virtual tournament.")
@ApiResponses({ @ApiResponses({
@ApiResponse(responseCode = "200", description = "Success"), @ApiResponse(responseCode = "200", description = "Success"),
@ApiResponse(responseCode = "401", description = "Not authenticated"),
@ApiResponse(responseCode = "403", description = "Authenticated, but not permitted"),
@ApiResponse(responseCode = "404", description = "Season not found"),
}) })
void transformScoringPointSeason(@Parameter(description = "A year") long transformScoringPointSeason(
@NotNull @Min(2000) @PathParam("season") int season); @Parameter(description = "A year") @NotNull @Min(2000) @PathParam("season") int season);
@PUT @PUT
@Path("/init/pointIndex/season") @Path("/init/pointIndex/season")
@Operation( @Produces(Constants.V1_JSON)
summary = "Transforms the legacy pointID to the new pointIndexID for the virtual tournament." @Deprecated
) @Operation(description = "Transforms the legacy pointID to the new pointIndexID for the virtual tournament.")
@ApiResponses({ @ApiResponses({
@ApiResponse(responseCode = "200", description = "Success"), @ApiResponse(responseCode = "200", description = "Success"),
@ApiResponse(responseCode = "401", description = "Not authenticated"),
@ApiResponse(responseCode = "403", description = "Authenticated, but not permitted"),
}) })
void transformScoringPointSeason(); long transformScoringPointSeason();
} }