From f913f38b702575c24fec49596cac2cf14e864fbe Mon Sep 17 00:00:00 2001 From: Ethan O'Brien Date: Mon, 3 Jun 2024 17:20:22 -0500 Subject: [PATCH] Add /api/location endpoint --- src/main.rs | 1 + src/router.rs | 1 + src/router/location.rs | 8 ++++++++ 3 files changed, 10 insertions(+) create mode 100644 src/router/location.rs diff --git a/src/main.rs b/src/main.rs index 0c3e911..895b4b3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -112,6 +112,7 @@ fn api_req(req: HttpRequest, body: String) -> HttpResponse { "/api/home/announcement" => router::user::announcement(req), "/api/shop" => router::shop::shop(req), "/api/exchange" => router::exchange::exchange(req), + "/api/location" => router::location::location(req), _ => unhandled(req, body) } }; diff --git a/src/router.rs b/src/router.rs index f21ed87..5cc0e2c 100644 --- a/src/router.rs +++ b/src/router.rs @@ -25,3 +25,4 @@ pub mod clear_rate; pub mod exchange; pub mod items; pub mod databases; +pub mod location; diff --git a/src/router/location.rs b/src/router/location.rs new file mode 100644 index 0000000..725dca5 --- /dev/null +++ b/src/router/location.rs @@ -0,0 +1,8 @@ +use json::{object, JsonValue}; +use actix_web::{HttpRequest}; + +pub fn location(_req: HttpRequest) -> Option { + Some(object!{ + "master_location_ids": [] + }) +}