1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use crate::types::ID;
#[derive(Deserialize, Serialize, Debug)]
pub struct User {
pub id: ID,
pub username: String,
pub email: String,
pub created_at: Option<DateTime<Utc>>,
pub updated_at: Option<DateTime<Utc>>,
}
#[derive(Deserialize, Serialize, Debug)]
pub struct RegisterInfo {
pub username: String,
pub password: String,
pub email: String,
pub client_name: String,
}
#[derive(Deserialize, Serialize, Debug)]
pub struct NewlyRegisteredInfo {
pub id: ID,
pub username: String,
pub email: String,
pub created_at: Option<DateTime<Utc>>,
pub updated_at: Option<DateTime<Utc>>,
pub default_client: ClientInfo,
}
#[derive(Deserialize, Serialize, Debug)]
pub struct ClientInfo {
client_id: String,
client_secret: String,
name: String,
}