From d56dbbe9521223c821a6a376d13afe765db13913 Mon Sep 17 00:00:00 2001 From: Ethan O'Brien <77750390+ethanaobrien@users.noreply.github.com> Date: Mon, 8 Apr 2024 17:32:32 -0500 Subject: [PATCH] Implement dummy `/api/live/ranking` --- src/main.rs | 4 ++++ src/router/live.rs | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/main.rs b/src/main.rs index 6595c49..2c21607 100644 --- a/src/main.rs +++ b/src/main.rs @@ -102,6 +102,9 @@ async fn live_guest(req: HttpRequest, body: String) -> HttpResponse { router::li #[post("/api/live/mission")] async fn live_mission(req: HttpRequest, body: String) -> HttpResponse { router::live::mission(req, body) } +#[post("/api/live/ranking")] +async fn live_ranking(req: HttpRequest, body: String) -> HttpResponse { router::live::ranking(req, body) } + #[post("/api/event")] async fn event(req: HttpRequest, body: String) -> HttpResponse { router::event::event(req, body) } @@ -205,6 +208,7 @@ async fn main() -> std::io::Result<()> { .service(reward) .service(live_guest) .service(live_mission) + .service(live_ranking) .service(live_clearrate) .service(live_start) .service(live_end) diff --git a/src/router/live.rs b/src/router/live.rs index bf14806..011b89f 100644 --- a/src/router/live.rs +++ b/src/router/live.rs @@ -42,6 +42,18 @@ pub fn mission(_req: HttpRequest, _body: String) -> HttpResponse { global::send(resp) } +// /api/live/ranking +pub fn ranking(_req: HttpRequest, _body: String) -> HttpResponse { + //todo + let resp = object!{ + "code": 0, + "server_time": global::timestamp(), + "data": { + "ranking_list": [] + } + }; + global::send(resp) +} pub fn start(_req: HttpRequest, _body: String) -> HttpResponse { let resp = object!{