diff --git a/src/main/java/io/hardingadonis/saledock/api/v1/DemoAPI.java b/src/main/java/io/hardingadonis/saledock/api/v1/DemoAPI.java new file mode 100644 index 0000000..02451b4 --- /dev/null +++ b/src/main/java/io/hardingadonis/saledock/api/v1/DemoAPI.java @@ -0,0 +1,16 @@ +package io.hardingadonis.saledock.api.v1; + +import io.hardingadonis.saledock.model.*; +import io.hardingadonis.saledock.utils.*; +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.*; + +@Path("v1/demo") +public class DemoAPI { + + @GET + @Produces(MediaType.APPLICATION_JSON) + public Product getProduct() { + return Singleton.productDAO.getByID(1).get(); + } +} diff --git a/src/main/java/io/hardingadonis/saledock/config/SaleDockApplication.java b/src/main/java/io/hardingadonis/saledock/config/SaleDockApplication.java new file mode 100644 index 0000000..0f0bc6d --- /dev/null +++ b/src/main/java/io/hardingadonis/saledock/config/SaleDockApplication.java @@ -0,0 +1,12 @@ +package io.hardingadonis.saledock.config; + +import jakarta.ws.rs.*; +import org.glassfish.jersey.server.*; + +@ApplicationPath("api") +public class SaleDockApplication extends ResourceConfig { + + public SaleDockApplication() { + packages("io.hardingadonis.saledock.api"); + } +}