anttp 0.26.0

AntTP is an HTTP server for the Autonomi Network
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use actix_web::{Error, HttpResponse};
use actix_web::web::Data;
use log::debug;
use crate::service::command_service::{CommandList, CommandService};

#[utoipa::path(
    get,
    path = "/anttp-0/command",
    responses(
        (status = OK, response = CommandList),
    )
)]
pub async fn get_commands(command_service: Data<CommandService>) -> Result<HttpResponse, Error> {
    debug!("Getting command list");
    Ok(HttpResponse::Ok().json(command_service.get_commands().await?))
}