Working on email templating, updating with swagger
This commit is contained in:
@@ -1,13 +1,22 @@
|
||||
use std::env;
|
||||
use actix_web::{get, web, HttpResponse};
|
||||
use actix_web::{HttpResponse, get};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::env;
|
||||
use utoipa::ToSchema;
|
||||
use utoipa_actix_web::scope;
|
||||
use utoipa_actix_web::service_config::ServiceConfig;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
#[derive(Debug, Serialize, Deserialize, ToSchema)]
|
||||
pub struct SystemInfo {
|
||||
version: String,
|
||||
healthy: bool,
|
||||
}
|
||||
|
||||
#[utoipa::path(
|
||||
tag = "System",
|
||||
responses(
|
||||
(status = 200, description = "Successful system info"),
|
||||
)
|
||||
)]
|
||||
#[get("/info")]
|
||||
async fn info() -> HttpResponse {
|
||||
let mut healthy = true;
|
||||
@@ -24,6 +33,6 @@ async fn info() -> HttpResponse {
|
||||
HttpResponse::Ok().json(info)
|
||||
}
|
||||
|
||||
pub fn init_routes(config: &mut web::ServiceConfig) {
|
||||
config.service(web::scope("/system").service(info));
|
||||
pub fn init_routes(config: &mut ServiceConfig) {
|
||||
config.service(scope::scope("/system").service(info));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user