-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #128 from 12urenloop/remove-code
Remove some template code
- Loading branch information
Showing
11 changed files
with
20 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,18 @@ | ||
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; | ||
import telraam.database.daos.BatonDAO; | ||
import telraam.database.daos.DAO; | ||
import telraam.database.models.Baton; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
@Path("/baton") // dropwizard | ||
@Tag(name = "Baton") | ||
@Produces(MediaType.APPLICATION_JSON) | ||
public class BatonResource extends AbstractListableResource<Baton> { | ||
public BatonResource(BatonDAO dao) { | ||
public BatonResource(DAO<Baton> dao) { | ||
super(dao); | ||
} | ||
|
||
@Override | ||
@Operation(summary = "Find all batons") | ||
public List<Baton> getListOf() { | ||
return super.getListOf(); | ||
} | ||
|
||
@Override | ||
@Operation(summary = "Add a new baton to the database") | ||
public int create(Baton baton) { | ||
return super.create(baton); | ||
} | ||
|
||
@Override | ||
@Operation(summary = "Find baton by ID") | ||
public Baton get(Optional<Integer> id) { | ||
return super.get(id); | ||
} | ||
|
||
@Override | ||
@Operation(summary = "Update an existing baton") | ||
public Baton update(Baton baton, Optional<Integer> id) { | ||
return super.update(baton, id); | ||
} | ||
|
||
@Override | ||
@Operation(summary = "Delete an existing baton") | ||
public boolean delete(Optional<Integer> id) { | ||
return super.delete(id); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,18 @@ | ||
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; | ||
import telraam.database.daos.BatonSwitchoverDAO; | ||
import telraam.database.models.BatonSwitchover; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
@Path("/batonswitchover") // dropwizard | ||
@Tag(name="Baton Switchover") | ||
@Tag(name = "Baton Switchover") | ||
@Produces(MediaType.APPLICATION_JSON) | ||
public class BatonSwitchoverResource extends AbstractListableResource<BatonSwitchover> { | ||
public BatonSwitchoverResource(BatonSwitchoverDAO dao) { | ||
super(dao); | ||
} | ||
|
||
@Override | ||
@Operation(summary = "Find all baton switchovers") | ||
public List<BatonSwitchover> getListOf() { | ||
return super.getListOf(); | ||
} | ||
|
||
@Override | ||
@Operation(summary = "Find baton switchover by ID") | ||
public BatonSwitchover get(Optional<Integer> id) { | ||
return super.get(id); | ||
} | ||
|
||
@Override | ||
@Operation(summary = "Add a new baton switchover to the database") | ||
public int create(BatonSwitchover batonSwitchover) { | ||
return super.create(batonSwitchover); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,17 @@ | ||
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.Path; | ||
import jakarta.ws.rs.Produces; | ||
import jakarta.ws.rs.core.MediaType; | ||
import telraam.database.daos.DAO; | ||
import telraam.database.models.LapSource; | ||
|
||
import java.util.List; | ||
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) { | ||
super(dao); | ||
} | ||
|
||
@Override | ||
@Operation(summary = "Find all lap sources") | ||
public List<LapSource> getListOf() { | ||
return super.getListOf(); | ||
} | ||
|
||
@Override | ||
@Operation(summary = "Add a new lap source to the database") | ||
public int create(LapSource lapSource) { | ||
return super.create(lapSource); | ||
} | ||
|
||
@Override | ||
@Operation(summary = "Find lap source by ID") | ||
public LapSource get(Optional<Integer> id) { | ||
return super.get(id); | ||
} | ||
|
||
@Override | ||
@Operation(summary = "Update an existing lap source") | ||
public LapSource update(LapSource lapSource, Optional<Integer> id) { | ||
return super.update(lapSource, id); | ||
} | ||
|
||
@Override | ||
@Operation(summary = "Delete an existing lap source") | ||
public boolean delete(Optional<Integer> id) { | ||
return super.delete(id); | ||
} | ||
} |
27 changes: 3 additions & 24 deletions
27
src/main/java/telraam/api/LapSourceSwitchoverResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,18 @@ | ||
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.Path; | ||
import jakarta.ws.rs.Produces; | ||
import jakarta.ws.rs.core.MediaType; | ||
import telraam.database.daos.LapSourceSwitchoverDAO; | ||
import telraam.database.models.LapSourceSwitchover; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
@Path("/lapsourceswitchover") // dropwizard | ||
@Tag(name="Lap Source Switchover") | ||
@Tag(name = "Lap Source Switchover") | ||
@Produces(MediaType.APPLICATION_JSON) | ||
public class LapSourceSwitchoverResource extends AbstractListableResource<LapSourceSwitchover> { | ||
public LapSourceSwitchoverResource(LapSourceSwitchoverDAO dao) { | ||
super(dao); | ||
} | ||
|
||
@Override | ||
@Operation(summary = "Find all lap source switchovers") | ||
public List<LapSourceSwitchover> getListOf() { | ||
return super.getListOf(); | ||
} | ||
|
||
@Override | ||
@Operation(summary = "Find lap source switchover by ID") | ||
public LapSourceSwitchover get(Optional<Integer> id) { | ||
return super.get(id); | ||
} | ||
|
||
@Override | ||
@Operation(summary = "Add a new lap source switchover to the database") | ||
public int create(LapSourceSwitchover lapSourceSwitchover) { | ||
return super.create(lapSourceSwitchover); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,17 @@ | ||
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; | ||
import telraam.database.daos.DAO; | ||
import telraam.database.models.Station; | ||
|
||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.core.MediaType; | ||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
@Path("/station") | ||
@Tag(name="Station") | ||
@Tag(name = "Station") | ||
@Produces(MediaType.APPLICATION_JSON) | ||
public class StationResource extends AbstractListableResource<Station> { | ||
public StationResource(DAO<Station> dao) { | ||
super(dao); | ||
} | ||
|
||
@Override | ||
@Operation(summary = "Find all stations") | ||
public List<Station> getListOf() { | ||
return super.getListOf(); | ||
} | ||
|
||
@Override | ||
@Operation(summary = "Add a new station to the database") | ||
public int create(Station station) { | ||
return super.create(station); | ||
} | ||
|
||
@Override | ||
@Operation(summary = "Find station by ID") | ||
public Station get(Optional<Integer> id) { | ||
return super.get(id); | ||
} | ||
|
||
@Override | ||
@Operation(summary = "Update an existing station") | ||
public Station update(Station station, Optional<Integer> id) { | ||
return super.update(station, id); | ||
} | ||
|
||
@Override | ||
@Operation(summary = "Delete an existing station") | ||
public boolean delete(Optional<Integer> id) { | ||
return super.delete(id); | ||
} | ||
} |
Oops, something went wrong.