You've already forked AstralRinth
forked from didirus/AstralRinth
Implement users in API
This commit is contained in:
19
src/models/users.rs
Normal file
19
src/models/users.rs
Normal file
@@ -0,0 +1,19 @@
|
||||
use super::ids::Base62Id;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(from = "Base62Id")]
|
||||
#[serde(into = "Base62Id")]
|
||||
pub struct UserId(pub u64);
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct User {
|
||||
pub id: UserId,
|
||||
pub github_id: UserId,
|
||||
pub username: String,
|
||||
pub name: String,
|
||||
pub email: Option<String>,
|
||||
pub avatar_url: String,
|
||||
pub bio: String,
|
||||
pub created: chrono::DateTime<chrono::Utc>,
|
||||
}
|
||||
Reference in New Issue
Block a user