24 lines
1.0 KiB
Rust
24 lines
1.0 KiB
Rust
//! 账号管理模块
|
|
|
|
pub mod types;
|
|
pub mod service;
|
|
pub mod handlers;
|
|
|
|
use axum::routing::{delete, get, patch, post};
|
|
|
|
pub fn routes() -> axum::Router<crate::state::AppState> {
|
|
axum::Router::new()
|
|
.route("/api/v1/accounts", get(handlers::list_accounts))
|
|
.route("/api/v1/accounts/:id", get(handlers::get_account))
|
|
.route("/api/v1/accounts/:id", patch(handlers::update_account))
|
|
.route("/api/v1/accounts/:id/status", patch(handlers::update_status))
|
|
.route("/api/v1/tokens", get(handlers::list_tokens))
|
|
.route("/api/v1/tokens", post(handlers::create_token))
|
|
.route("/api/v1/tokens/:id", delete(handlers::revoke_token))
|
|
.route("/api/v1/logs/operations", get(handlers::list_operation_logs))
|
|
.route("/api/v1/stats/dashboard", get(handlers::dashboard_stats))
|
|
.route("/api/v1/devices", get(handlers::list_devices))
|
|
.route("/api/v1/devices/register", post(handlers::register_device))
|
|
.route("/api/v1/devices/heartbeat", post(handlers::device_heartbeat))
|
|
}
|