Skip to content

Commit f1c3c6a

Browse files
authored
Merge pull request #95 from lajp/main
refactor: split database.rs into multiple files
2 parents 1c10070 + af49891 commit f1c3c6a

File tree

13 files changed

+1134
-1062
lines changed

13 files changed

+1134
-1062
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "testaustime-rs"
3-
version = "0.3.0"
3+
version = "0.3.1"
44
edition = "2021"
55
authors = ["Ville Järvinen <[email protected]>", "Luukas Pörtfors <[email protected]>"]
66

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 Ville Järvinen
3+
Copyright (c) 2023 Ville Järvinen and Luukas Pörtfors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

src/api/users.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use crate::{
1010
api::{activity::HeartBeatMemoryStore, auth::UserIdentityOptional},
1111
database::DatabaseWrapper,
1212
error::TimeError,
13-
models::{CurrentActivity, UserId, UserIdentity},
13+
models::{CurrentActivity, PrivateLeaderboardMember, UserId, UserIdentity},
1414
requests::DataRequest,
1515
utils::group_by_language,
1616
};
@@ -30,6 +30,15 @@ pub async fn my_profile(user: UserIdentity) -> Result<impl Responder, TimeError>
3030
pub struct ListLeaderboard {
3131
pub name: String,
3232
pub member_count: i32,
33+
pub top_member: PrivateLeaderboardMember,
34+
pub my_position: i32,
35+
pub me: PrivateLeaderboardMember,
36+
}
37+
38+
#[derive(serde::Serialize)]
39+
pub struct MinimalLeaderboard {
40+
pub name: String,
41+
pub member_count: i32,
3342
}
3443

3544
#[get("/users/@me/leaderboards")]

0 commit comments

Comments
 (0)