Progress pring page fix and work? update

This commit is contained in:
2026-09-17 16:03:03 +03:00
parent 64b271cd4e
commit 4256cd0a94
3 changed files with 224 additions and 0 deletions

View File

@ -1,9 +1,11 @@
use axum::{
extract::{DefaultBodyLimit, Multipart, Path as AxumPath, State},
http::StatusCode,
response::IntoResponse,
routing::{get, post},
Json, Router,
};
use serde::{Deserialize, Serialize};
use std::{
collections::HashMap,
@ -20,6 +22,14 @@ use tokio::fs;
use tower_http::cors::CorsLayer;
use tracing::{error, info, warn};
async fn get_version() -> impl IntoResponse {
Json(serde_json::json!({
"version": "1.0.1",
"timestamp": chrono::Utc::now().timestamp()
}))
}
// ─────────────────────────────── Модели ───────────────────────────────
#[derive(Deserialize, Clone, Debug)]
@ -132,6 +142,7 @@ async fn main() {
let cors = CorsLayer::permissive();
let app = Router::new()
.route("/api/version", get(get_version))
.route("/print", post(create_print))
.route("/print/{job_id}", get(job_status))
.route("/print/{job_id}/advance", post(job_advance))