From b34d9eeb12c1ce95dc25a6bf7c43f90aee860216 Mon Sep 17 00:00:00 2001 From: Philip Blumin Date: Mon, 8 Mar 2021 20:46:35 -0500 Subject: [PATCH] added getRest in handler and app --- src/main/java/edu/cooper/ece366/App.java | 1 + src/main/java/edu/cooper/ece366/handler/Handler.java | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/main/java/edu/cooper/ece366/App.java b/src/main/java/edu/cooper/ece366/App.java index fd8a78d..7dc3194 100644 --- a/src/main/java/edu/cooper/ece366/App.java +++ b/src/main/java/edu/cooper/ece366/App.java @@ -70,6 +70,7 @@ public static void main( String[] args ) get("/ping", (req, res) -> "OK"); get("/user/:userId", (req, res) -> handler.getUser(req), gson::toJson); get("/lobby/:lobbyId", (req, res) -> handler.getLobby(req), gson::toJson); + get("/restaurant/:restId", (req, res) -> handler.getRest(req), gson::toJson); //get("/me", (req, res) -> handler.me(req, res), gson::toJson); diff --git a/src/main/java/edu/cooper/ece366/handler/Handler.java b/src/main/java/edu/cooper/ece366/handler/Handler.java index f89fb1b..906ab72 100644 --- a/src/main/java/edu/cooper/ece366/handler/Handler.java +++ b/src/main/java/edu/cooper/ece366/handler/Handler.java @@ -41,6 +41,11 @@ public Lobby getLobby(Request request) { return lobbyStore.get(lobbyID); } + public Restaurant getRest(Request request) { + String restID = request.params(":restID"); + return restaurantStore.get(restID); + } + /* public List getRestList(Request req){