-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Bit more standared on raid names * pb models * job appears to be working * Start of rl commands * Get longggg boss name * Ready to to save pb * Redesign of clan details view for leaderboards * Decent select bar * Commiting cause its been a min * wip it up (members view) * Clanmate rank comp * Do activity routing * Good version 1? * clean up * removed comment
- Loading branch information
1 parent
0885f02
commit 023861a
Showing
53 changed files
with
1,545 additions
and
226 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
35 changes: 35 additions & 0 deletions
35
trackscape-discord-api/src/controllers/application_data_controller.rs
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
use actix_web::{get, web, Error, HttpResponse, Scope}; | ||
use serde::{Deserialize, Serialize}; | ||
use trackscape_discord_shared::database::clan_mates::ClanMateModel; | ||
use trackscape_discord_shared::database::BotMongoDb; | ||
use web::Data; | ||
|
||
#[derive(Deserialize, Serialize)] | ||
struct ClanViewModel { | ||
id: String, | ||
name: String, | ||
registered_members: u64, | ||
} | ||
|
||
#[derive(Deserialize, Serialize)] | ||
struct ClanDetail { | ||
id: String, | ||
name: String, | ||
discord_guild_id: String, | ||
registered_members: u64, | ||
members: Vec<ClanMateModel>, | ||
} | ||
|
||
#[get("/activities")] | ||
async fn get_pb_activities(mongodb: Data<BotMongoDb>) -> Result<HttpResponse, Error> { | ||
let result = mongodb.pb_activities.get_activities().await; | ||
|
||
match result { | ||
Ok(activities) => Ok(HttpResponse::Ok().json(activities)), | ||
Err(_) => Ok(HttpResponse::InternalServerError().body("Failed to list activities.")), | ||
} | ||
} | ||
|
||
pub fn application_data_controller() -> Scope { | ||
web::scope("/resources").service(get_pb_activities) | ||
} |
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
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
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
Oops, something went wrong.