cloudreve_api/api/v4/models/
user.rs1use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Deserialize)]
7pub struct Quota {
8 pub used: u64,
9 pub total: u64,
10 #[serde(default)]
11 pub storage_pack_total: Option<u64>,
12}
13
14#[derive(Debug, Serialize, Deserialize)]
16pub struct UserSettings {
17 pub theme: Option<String>,
18 pub language: Option<String>,
19 pub timezone: Option<String>,
20}
21
22#[derive(Debug, Serialize)]
24pub struct UpdateProfileRequest<'a> {
25 pub nickname: Option<&'a str>,
26 pub email: Option<&'a str>,
27 pub avatar: Option<&'a str>,
28}
29
30#[derive(Debug, Serialize)]
32pub struct ChangePasswordRequest<'a> {
33 pub old_password: &'a str,
34 pub new_password: &'a str,
35}
36
37#[derive(Debug, Serialize)]
39pub struct SearchUserRequest<'a> {
40 pub query: &'a str,
41 pub page: Option<u32>,
42 pub page_size: Option<u32>,
43}
44
45#[derive(Debug, Serialize)]
47pub struct UpdateUserSettingRequest<'a> {
48 pub key: &'a str,
49 pub value: &'a str,
50}
51
52#[derive(Debug, Serialize, Deserialize)]
54pub struct CreditChangeRecord {
55 pub id: String,
56 pub amount: i64,
57 pub reason: String,
58 pub created_at: String,
59}
60
61#[derive(Debug, Serialize, Deserialize)]
63pub struct PaymentRecord {
64 pub id: String,
65 pub amount: f64,
66 pub method: String,
67 pub status: String,
68 pub created_at: String,
69 pub transaction_id: Option<String>,
70}