style: 🎨 restructure server folder
This commit is contained in:
parent
d72214eb56
commit
776750578d
5 changed files with 11 additions and 5 deletions
|
@ -6,7 +6,6 @@ use ::uuid::Uuid;
|
|||
use std::time::{SystemTime, UNIX_EPOCH};
|
||||
|
||||
mod uuid;
|
||||
mod channels;
|
||||
|
||||
use crate::{api::v1::auth::check_access_token, Data};
|
||||
|
||||
|
@ -35,8 +34,7 @@ const MAX_SIZE: usize = 262_144;
|
|||
pub fn web() -> Scope {
|
||||
web::scope("/servers")
|
||||
.service(res)
|
||||
.service(channels::web())
|
||||
.service(uuid::res)
|
||||
.service(uuid::web())
|
||||
}
|
||||
|
||||
#[post("")]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use actix_web::{error, post, web, Error, HttpResponse};
|
||||
use actix_web::{error, post, web, Error, HttpResponse, Scope};
|
||||
use futures::StreamExt;
|
||||
use log::error;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -6,6 +6,8 @@ use sqlx::FromRow;
|
|||
use uuid::Uuid;
|
||||
use std::str::FromStr;
|
||||
|
||||
mod channels;
|
||||
|
||||
use crate::{api::v1::auth::check_access_token, Data};
|
||||
|
||||
#[derive(Deserialize)]
|
||||
|
@ -35,7 +37,13 @@ struct Role {
|
|||
|
||||
const MAX_SIZE: usize = 262_144;
|
||||
|
||||
#[post("/{uuid}")]
|
||||
pub fn web() -> Scope {
|
||||
web::scope("/")
|
||||
.service(res)
|
||||
.service(channels::web())
|
||||
}
|
||||
|
||||
#[post("{uuid}")]
|
||||
pub async fn res(mut payload: web::Payload, path: web::Path<(Uuid,)>, data: web::Data<Data>) -> Result<HttpResponse, Error> {
|
||||
let mut body = web::BytesMut::new();
|
||||
while let Some(chunk) = payload.next().await {
|
Loading…
Add table
Add a link
Reference in a new issue