init
This commit is contained in:
@@ -4,9 +4,9 @@ use crate::http::error::HTTPError;
|
||||
use crate::routes::group::dto::{CreateGroupRequest, GroupResponse, UpdateGroupRequest};
|
||||
use crate::routes::group::mapper;
|
||||
use axum::{
|
||||
Json,
|
||||
extract::{Path, State},
|
||||
http::StatusCode,
|
||||
Json,
|
||||
};
|
||||
use uuid::Uuid;
|
||||
|
||||
@@ -68,7 +68,10 @@ pub async fn get_by_id(
|
||||
(status = 404, description = "Serveur non trouvé"),
|
||||
(status = 500, description = "Erreur interne du serveur")
|
||||
),
|
||||
tag = "Groups"
|
||||
tag = "Groups",
|
||||
security(
|
||||
("bearerAuth" = [])
|
||||
)
|
||||
)]
|
||||
pub async fn create(
|
||||
_admin: Superuser,
|
||||
@@ -104,7 +107,10 @@ pub async fn create(
|
||||
params(
|
||||
("id" = Uuid, Path, description = "ID du groupe")
|
||||
),
|
||||
tag = "Groups"
|
||||
tag = "Groups",
|
||||
security(
|
||||
("bearerAuth" = [])
|
||||
)
|
||||
)]
|
||||
pub async fn update(
|
||||
_admin: Superuser,
|
||||
@@ -138,7 +144,10 @@ pub async fn update(
|
||||
params(
|
||||
("id" = Uuid, Path, description = "ID du groupe")
|
||||
),
|
||||
tag = "Groups"
|
||||
tag = "Groups",
|
||||
security(
|
||||
("bearerAuth" = [])
|
||||
)
|
||||
)]
|
||||
pub async fn delete(
|
||||
_admin: Superuser,
|
||||
|
||||
@@ -7,7 +7,7 @@ pub fn router() -> Router<AppState> {
|
||||
Router::new()
|
||||
.route("/groups", get(handlers::get_all).post(handlers::create))
|
||||
.route(
|
||||
"/groups/:id",
|
||||
"/groups/{id}",
|
||||
get(handlers::get_by_id)
|
||||
.put(handlers::update)
|
||||
.delete(handlers::delete),
|
||||
|
||||
Reference in New Issue
Block a user