Implement users in API

This commit is contained in:
Jai A
2020-09-28 10:48:15 -07:00
parent cd28a75c86
commit 05235f8385
10 changed files with 188 additions and 22 deletions

19
src/models/users.rs Normal file
View 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>,
}