feature/share-libs
rs 71 lines 1.4 KB
Raw
1 use crate_error_codes::ErrorCode;
2 use serde::{Deserialize, Serialize};
3 use super::player::TauriResponse;
4
5 #[derive(Serialize)]
6 #[derive(Debug)]
7 pub struct AccountLoginResponse {
8 pub status: TauriResponse,
9 pub message: String,
10 pub access_token: Option<String>,
11 pub user: Option<User>,
12 }
13
14 #[derive(Serialize, Deserialize)]
15 #[derive(Debug)]
16 pub struct ErrorResponse {
17 pub error_code: ErrorCode,
18 pub message: String,
19 }
20
21 #[derive(Serialize, Deserialize)]
22 #[derive(Debug)]
23 pub struct LoginResponse {
24 code: i32,
25 pub message: String,
26 pub user: Option<User>,
27 }
28
29 #[derive(Serialize, Deserialize, Debug)]
30 pub struct User {
31 id: i32,
32 pub email: String,
33 pub username: String,
34 pub name: String,
35 pub gravatar_url: String,
36 pub followers_count: i32,
37 pub following_count: i32,
38 pub about: String
39 }
40
41 #[derive(Serialize)]
42 #[derive(Debug)]
43 pub struct AccountRegisterResponse {
44 pub status: TauriResponse,
45 pub message: String,
46 pub user: Option<User>,
47 }
48
49 #[derive(Serialize, Deserialize)]
50 #[derive(Debug)]
51 pub struct RegisterResponse {
52 pub code: i32,
53 pub message: String,
54 pub user: Option<User>,
55 }
56
57 #[derive(Serialize)]
58 #[derive(Debug)]
59 pub struct AccountProfileResponse {
60 pub status: TauriResponse,
61 pub message: String,
62 pub user: Option<User>,
63 }
64
65 #[derive(Serialize, Deserialize)]
66 #[derive(Debug)]
67 pub struct ProfileResponse {
68 pub code: i32,
69 pub message: String,
70 pub user: Option<User>
71 }