From aa9df77208d2e3314011f70ae621a3f7a272d9f7 Mon Sep 17 00:00:00 2001 From: "Brian M. Long" Date: Mon, 27 May 2024 12:44:22 -0400 Subject: [PATCH] fix GolferApi --- .../com/poststats/golf/rs/api/GolferApi.java | 23 ++++++------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/poststats/golf/rs/api/GolferApi.java b/src/main/java/com/poststats/golf/rs/api/GolferApi.java index 6bc7bf8..7203a2e 100644 --- a/src/main/java/com/poststats/golf/rs/api/GolferApi.java +++ b/src/main/java/com/poststats/golf/rs/api/GolferApi.java @@ -16,18 +16,13 @@ import jakarta.ws.rs.Produces; /** * @author brian.long@poststats.com */ -@Path("/golfer/{personId}") +@Path("/golfer/{personId:[0-9]+}") @Tag(name = "Golfer API") -public abstract class GolferApi { - - @NotNull - @Positive - @PathParam("personId") - private long personId; - - protected long getPersonId() { - return this.personId; - } +@ApiResponses({ + @ApiResponse(responseCode = "200", description = "Success"), + @ApiResponse(responseCode = "404", description = "A golfer with the specified ID could not be found") +}) +public interface GolferApi { @GET @Produces(Constants.V1_JSON) @@ -35,10 +30,6 @@ public abstract class GolferApi { summary = "Retrieves limited meta-data about a golfer.", description = "Retreives name, location, and other direct meta-data about the specified golfer." ) - @ApiResponses({ - @ApiResponse(responseCode = "200", description = "Success"), - @ApiResponse(responseCode = "404", description = "A golfer with the specified ID could not be found") - }) - public abstract Golfer get(); + Golfer get(@NotNull @Positive @PathParam("personId") long personId); }