Skip to content

Commit

Permalink
feat re-add swagger grouping + fix gradle file
Browse files Browse the repository at this point in the history
  • Loading branch information
NuttyShrimp committed Mar 28, 2024
1 parent 208c062 commit 942963c
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 1 deletion.
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ idea {
inheritOutputDirs = true
}
}
build.finalizedBy(javadoc)
build {
finalizedBy(javadoc)
}

dependencies {
// Web framework stuff
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/telraam/api/AcceptedLapsResource.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package telraam.api;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
Expand All @@ -11,6 +12,7 @@
import java.util.List;

@Path("/accepted-laps")
@Tag(name="Accpted Laps")
@Produces(MediaType.APPLICATION_JSON)
public class AcceptedLapsResource {
@GET
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/telraam/api/BatonResource.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package telraam.api;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;
Expand All @@ -11,6 +12,7 @@
import java.util.Optional;

@Path("/baton") // dropwizard
@Tag(name = "Baton")
@Produces(MediaType.APPLICATION_JSON)
public class BatonResource extends AbstractListableResource<Baton> {
public BatonResource(BatonDAO dao) {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/telraam/api/BatonSwitchoverResource.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package telraam.api;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;
Expand All @@ -11,6 +12,7 @@
import java.util.Optional;

@Path("/batonswitchover") // dropwizard
@Tag(name="Baton Switchover")
@Produces(MediaType.APPLICATION_JSON)
public class BatonSwitchoverResource extends AbstractListableResource<BatonSwitchover> {
public BatonSwitchoverResource(BatonSwitchoverDAO dao) {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/telraam/api/DetectionResource.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package telraam.api;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.ws.rs.*;
import jakarta.ws.rs.core.MediaType;
import telraam.database.daos.DetectionDAO;
Expand All @@ -11,6 +12,7 @@

@Path("/detection")
@Produces(MediaType.APPLICATION_JSON)
@Tag(name="Detection")
public class DetectionResource extends AbstractListableResource<Detection> {

private final DetectionDAO detectionDAO;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/telraam/api/LapCountResource.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package telraam.api;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.ws.rs.*;
import jakarta.ws.rs.core.MediaType;
import telraam.database.daos.TeamDAO;
Expand All @@ -13,6 +14,7 @@
import java.util.Optional;

@Path("/lap-counts")
@Tag(name="Lap Counts")
@Produces(MediaType.APPLICATION_JSON)
public class LapCountResource {
TeamDAO teamDAO;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/telraam/api/LapResource.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package telraam.api;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.ws.rs.*;
import jakarta.ws.rs.core.MediaType;
import telraam.database.daos.LapDAO;
Expand All @@ -10,6 +11,7 @@
import java.util.Optional;

@Path("/lap")
@Tag(name="Lap")
@Produces(MediaType.APPLICATION_JSON)
public class LapResource extends AbstractResource<Lap> {
private final LapDAO lapDAO;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/telraam/api/LapSourceResource.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package telraam.api;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.ws.rs.*;
import jakarta.ws.rs.core.MediaType;
import telraam.database.daos.DAO;
Expand All @@ -10,6 +11,7 @@
import java.util.Optional;

@Path("/lap-source")
@Tag(name = "Lap Source")
@Produces(MediaType.APPLICATION_JSON)
public class LapSourceResource extends AbstractListableResource<LapSource> {
public LapSourceResource(DAO<LapSource> dao) {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/telraam/api/LapSourceSwitchoverResource.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package telraam.api;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.ws.rs.*;
import jakarta.ws.rs.core.MediaType;
import telraam.database.daos.LapSourceSwitchoverDAO;
Expand All @@ -10,6 +11,7 @@
import java.util.Optional;

@Path("/lapsourceswitchover") // dropwizard
@Tag(name="Lap Source Switchover")
@Produces(MediaType.APPLICATION_JSON)
public class LapSourceSwitchoverResource extends AbstractListableResource<LapSourceSwitchover> {
public LapSourceSwitchoverResource(LapSourceSwitchoverDAO dao) {
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/telraam/api/MonitoringResource.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package telraam.api;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.jdbi.v3.core.Jdbi;
import telraam.database.daos.*;
import telraam.database.models.Lap;
Expand All @@ -17,9 +18,11 @@

import jakarta.ws.rs.*;
import jakarta.ws.rs.core.MediaType;

import java.util.*;

@Path("/monitoring")
@Tag(name = "Monitoring")
@Produces(MediaType.APPLICATION_JSON)
public class MonitoringResource {
private final BatonStatusHolder batonStatusHolder;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/telraam/api/StationResource.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package telraam.api;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.ws.rs.Produces;
import telraam.database.daos.DAO;
import telraam.database.models.Station;
Expand All @@ -11,6 +12,7 @@
import java.util.Optional;

@Path("/station")
@Tag(name="Station")
@Produces(MediaType.APPLICATION_JSON)
public class StationResource extends AbstractListableResource<Station> {
public StationResource(DAO<Station> dao) {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/telraam/api/TeamResource.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package telraam.api;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.ws.rs.Produces;
import telraam.database.daos.BatonSwitchoverDAO;
import telraam.database.daos.TeamDAO;
Expand All @@ -17,6 +18,7 @@


@Path("/team")
@Tag(name="Team")
@Produces(MediaType.APPLICATION_JSON)
public class TeamResource extends AbstractListableResource<Team> {
BatonSwitchoverDAO batonSwitchoverDAO;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/telraam/api/TimeResource.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package telraam.api;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;

@Path("/time")
@Tag(name = "Time")
@Produces(MediaType.APPLICATION_JSON)
public class TimeResource {
static class TimeResponse {
Expand Down

0 comments on commit 942963c

Please sign in to comment.