From 3747204267e8b75bc77d6c0962b67bbe018dad15 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Thu, 9 Jan 2025 21:20:17 +0100 Subject: Add string id for project and reduce usage of numeric ids in general User: username must be unique, use as primary key and drop id. --- server/src/api_model.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'server/src/api_model.rs') diff --git a/server/src/api_model.rs b/server/src/api_model.rs index 1b0d7b2..6c614e5 100644 --- a/server/src/api_model.rs +++ b/server/src/api_model.rs @@ -18,10 +18,8 @@ pub enum UserReviewRole { #[derive(Debug, Deserialize, Serialize, PartialEq, ToSchema)] pub struct User { - #[schema(example = 1337u64)] - pub id: u64, #[schema(example = "jsmith")] - pub username: String, + pub id: String, #[schema(example = "John Smith")] pub name: String, #[schema(example = true)] @@ -113,8 +111,8 @@ pub struct ProjectUserEntryData { #[derive(Debug, Deserialize, PartialEq, Serialize, ToSchema)] pub struct Project { - #[schema(example = 1u64)] - pub id: u64, + #[schema(example = "fake")] + pub id: String, #[schema(example = "FAKE: Features All Kids Erase")] pub title: String, #[schema(example = "Example project")] @@ -140,8 +138,8 @@ pub struct ProjectData<'r> { #[derive(Deserialize, Serialize, ToSchema)] pub struct ProjectEntry { - #[schema(example = 1u64)] - pub id: u64, + #[schema(example = "fake")] + pub id: String, #[schema(example = "FAKE: Features All Kids Erase")] pub title: String, } -- cgit v1.2.3-70-g09d2