style: move structs to objects and split into several files for readability

This commit is contained in:
Radical 2025-06-02 00:28:48 +02:00
parent 08cb70ce18
commit 7021c80f02
32 changed files with 1591 additions and 1474 deletions

View file

@ -4,7 +4,7 @@ use crate::{
Data,
api::v1::auth::check_access_token,
error::Error,
structs::{Channel, Member},
objects::{Channel, Member},
utils::{get_auth_header, global_checks},
};
use ::uuid::Uuid;

View file

@ -7,12 +7,12 @@ use crate::{
Data,
api::v1::auth::check_access_token,
error::Error,
structs::{Channel, Member},
objects::{Channel, Member},
utils::{get_auth_header, global_checks},
};
use actix_web::{delete, get, patch, web, HttpRequest, HttpResponse};
use uuid::Uuid;
use actix_web::{HttpRequest, HttpResponse, delete, get, patch, web};
use serde::Deserialize;
use uuid::Uuid;
#[get("/{uuid}")]
pub async fn get(
@ -88,7 +88,7 @@ struct NewInfo {
/// "is_above": "398f6d7b-752c-4348-9771-fe6024adbfb1"
/// });
/// ```
///
///
/// ### Response Example
/// ```
/// json!({
@ -132,13 +132,16 @@ pub async fn patch(
}
if let Some(new_description) = &new_info.description {
channel.set_description(&data, new_description.to_string()).await?;
channel
.set_description(&data, new_description.to_string())
.await?;
}
if let Some(new_is_above) = &new_info.is_above {
channel.set_description(&data, new_is_above.to_string()).await?;
channel
.set_description(&data, new_is_above.to_string())
.await?;
}
Ok(HttpResponse::Ok().json(channel))
}

View file

@ -10,7 +10,7 @@ use uuid::Uuid;
use crate::{
Data,
api::v1::auth::check_access_token,
structs::{Channel, Member},
objects::{Channel, Member},
utils::{get_ws_protocol_header, global_checks},
};