mcaptcha/api/v1/account/
mod.rs1use serde::{Deserialize, Serialize};
7
8pub mod delete;
9pub mod email;
10pub mod password;
11pub mod secret;
12#[cfg(test)]
13pub mod test;
14pub mod username;
15
16pub use super::auth;
17pub use super::mcaptcha;
18
19pub mod routes {
20
21 pub struct Account {
22 pub delete: &'static str,
23 pub email_exists: &'static str,
24 pub get_secret: &'static str,
25 pub update_email: &'static str,
26 pub update_password: &'static str,
27 pub update_secret: &'static str,
28 pub username_exists: &'static str,
29 pub update_username: &'static str,
30 }
31
32 impl Account {
33 pub const fn new() -> Account {
34 let get_secret = "/api/v1/account/secret/get";
35 let update_secret = "/api/v1/account/secret/update";
36 let delete = "/api/v1/account/delete";
37 let email_exists = "/api/v1/account/email/exists";
38 let username_exists = "/api/v1/account/username/exists";
39 let update_username = "/api/v1/account/username/update";
40 let update_email = "/api/v1/account/email/update";
41 let update_password = "/api/v1/account/password/update";
42 Account {
43 delete,
44 email_exists,
45 get_secret,
46 update_email,
47 update_password,
48 update_secret,
49 username_exists,
50 update_username,
51 }
52 }
53 }
54}
55
56#[derive(Clone, Debug, Deserialize, Serialize)]
57pub struct AccountCheckPayload {
58 pub val: String,
59}
60
61#[derive(Clone, Debug, Deserialize, Serialize)]
62pub struct AccountCheckResp {
63 pub exists: bool,
64}
65
66pub fn services(cfg: &mut actix_web::web::ServiceConfig) {
67 delete::services(cfg);
68 email::services(cfg);
69 username::services(cfg);
70 secret::services(cfg);
71 password::services(cfg);
72}