Init
This commit is contained in:
@@ -0,0 +1 @@
|
||||
pub struct Group {}
|
||||
@@ -0,0 +1,10 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct CreateGroupRequest {}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct UpdateGroupRequest {}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct GroupResponse {}
|
||||
@@ -0,0 +1,22 @@
|
||||
use axum::http::StatusCode;
|
||||
use axum::response::IntoResponse;
|
||||
|
||||
pub async fn get_all() -> impl IntoResponse {
|
||||
StatusCode::NOT_IMPLEMENTED
|
||||
}
|
||||
|
||||
pub async fn get_by_id() -> impl IntoResponse {
|
||||
StatusCode::NOT_IMPLEMENTED
|
||||
}
|
||||
|
||||
pub async fn create() -> impl IntoResponse {
|
||||
StatusCode::NOT_IMPLEMENTED
|
||||
}
|
||||
|
||||
pub async fn update() -> impl IntoResponse {
|
||||
StatusCode::NOT_IMPLEMENTED
|
||||
}
|
||||
|
||||
pub async fn delete() -> impl IntoResponse {
|
||||
StatusCode::NOT_IMPLEMENTED
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
use super::{domain::Group, dto::GroupResponse};
|
||||
|
||||
pub fn to_response(_item: Group) -> GroupResponse {
|
||||
todo!()
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
pub mod domain;
|
||||
pub mod dto;
|
||||
pub mod handlers;
|
||||
pub mod mapper;
|
||||
pub mod routes;
|
||||
pub mod service;
|
||||
@@ -0,0 +1,14 @@
|
||||
use axum::{Router, routing::get};
|
||||
|
||||
use super::handlers;
|
||||
|
||||
pub fn router() -> Router {
|
||||
Router::new()
|
||||
.route("/groups", get(handlers::get_all).post(handlers::create))
|
||||
.route(
|
||||
"/groups/:id",
|
||||
get(handlers::get_by_id)
|
||||
.put(handlers::update)
|
||||
.delete(handlers::delete),
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
use super::domain::Group;
|
||||
|
||||
pub async fn find_all() -> Vec<Group> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
pub async fn find_by_id(_id: u64) -> Option<Group> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
pub async fn create(_item: Group) -> Group {
|
||||
todo!()
|
||||
}
|
||||
|
||||
pub async fn update(_id: u64, _item: Group) -> Option<Group> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
pub async fn delete(_id: u64) -> bool {
|
||||
todo!()
|
||||
}
|
||||
Reference in New Issue
Block a user