use std::sync::Arc;

use axum::{
    routing::{delete, get, post, put},
    Router,
};

use crate::models::error::ApiResult;
use crate::AppState;

pub fn router() -> Router<Arc<AppState>> {
    Router::new()
        .route("/", get(list_plugins))
        .route("/install", post(install_plugin))
        .route("/{id}", put(update_plugin))
        .route("/{id}", delete(delete_plugin))
        .route("/{id}/reload", post(reload_plugin))
        .route("/search", get(search_umod))
}

async fn list_plugins() -> ApiResult<impl axum::response::IntoResponse> {
    todo!()
}

async fn install_plugin() -> ApiResult<impl axum::response::IntoResponse> {
    todo!()
}

async fn update_plugin() -> ApiResult<impl axum::response::IntoResponse> {
    todo!()
}

async fn delete_plugin() -> ApiResult<impl axum::response::IntoResponse> {
    todo!()
}

async fn reload_plugin() -> ApiResult<impl axum::response::IntoResponse> {
    todo!()
}

async fn search_umod() -> ApiResult<impl axum::response::IntoResponse> {
    todo!()
}
