diff options
| author | Joel Klinghed <the_jk@spawned.biz> | 2025-01-09 21:20:17 +0100 |
|---|---|---|
| committer | Joel Klinghed <the_jk@spawned.biz> | 2025-01-09 21:20:17 +0100 |
| commit | 3747204267e8b75bc77d6c0962b67bbe018dad15 (patch) | |
| tree | 4b134c6719b5bab425da8d0840102f27489eb67b /server/src/api_model.rs | |
| parent | 6c6dd808a1005771f50696e1568dd6c653e2731b (diff) | |
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.
Diffstat (limited to 'server/src/api_model.rs')
| -rw-r--r-- | server/src/api_model.rs | 12 |
1 files changed, 5 insertions, 7 deletions
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, } |
