Skip to content

Commit

Permalink
Merge pull request #95 from lajp/main
Browse files Browse the repository at this point in the history
refactor: split database.rs into multiple files
  • Loading branch information
DrVilepis authored Nov 30, 2023
2 parents 1c10070 + af49891 commit f1c3c6a
Show file tree
Hide file tree
Showing 13 changed files with 1,134 additions and 1,062 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "testaustime-rs"
version = "0.3.0"
version = "0.3.1"
edition = "2021"
authors = ["Ville Järvinen <jarvinenville606@gmail.com>", "Luukas Pörtfors <lajp@iki.fi>"]

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Ville Järvinen
Copyright (c) 2023 Ville Järvinen and Luukas Pörtfors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
11 changes: 10 additions & 1 deletion src/api/users.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::{
api::{activity::HeartBeatMemoryStore, auth::UserIdentityOptional},
database::DatabaseWrapper,
error::TimeError,
models::{CurrentActivity, UserId, UserIdentity},
models::{CurrentActivity, PrivateLeaderboardMember, UserId, UserIdentity},
requests::DataRequest,
utils::group_by_language,
};
Expand All @@ -30,6 +30,15 @@ pub async fn my_profile(user: UserIdentity) -> Result<impl Responder, TimeError>
pub struct ListLeaderboard {
pub name: String,
pub member_count: i32,
pub top_member: PrivateLeaderboardMember,
pub my_position: i32,
pub me: PrivateLeaderboardMember,
}

#[derive(serde::Serialize)]
pub struct MinimalLeaderboard {
pub name: String,
pub member_count: i32,
}

#[get("/users/@me/leaderboards")]
Expand Down
Loading

0 comments on commit f1c3c6a

Please sign in to comment.