fix: resolve compilation errors by adding missing imports and fixing schema definitions
Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
This commit is contained in:
@@ -11,7 +11,6 @@ use std::path::PathBuf;
|
|||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use std::io::Read;
|
use std::io::Read;
|
||||||
use anyhow::{Result, anyhow};
|
use anyhow::{Result, anyhow};
|
||||||
use utoipa::ToSchema;
|
|
||||||
|
|
||||||
use crate::compression_engine::{CompressionType, get_compression_engine};
|
use crate::compression_engine::{CompressionType, get_compression_engine};
|
||||||
use crate::db;
|
use crate::db;
|
||||||
|
|||||||
@@ -26,12 +26,7 @@ use utoipa_swagger_ui::SwaggerUi;
|
|||||||
),
|
),
|
||||||
components(
|
components(
|
||||||
schemas(
|
schemas(
|
||||||
crate::modes::server::common::ApiResponse<crate::modes::server::api::status::StatusInfo>,
|
crate::common::status::StatusInfo,
|
||||||
crate::modes::server::common::ApiResponse<Vec<crate::modes::server::common::ItemInfo>>,
|
|
||||||
crate::modes::server::common::ApiResponse<crate::modes::server::common::ItemInfo>,
|
|
||||||
crate::modes::server::common::ApiResponse<std::collections::HashMap<std::string::String>>,
|
|
||||||
crate::modes::server::common::ApiResponse<()>,
|
|
||||||
crate::modes::server::api::status::StatusInfo,
|
|
||||||
crate::modes::server::common::ItemInfo,
|
crate::modes::server::common::ItemInfo,
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ use axum::{
|
|||||||
};
|
};
|
||||||
use log::warn;
|
use log::warn;
|
||||||
use std::net::SocketAddr;
|
use std::net::SocketAddr;
|
||||||
use utoipa::ToSchema;
|
|
||||||
|
|
||||||
use crate::modes::server::common::{AppState, ApiResponse, check_auth};
|
use crate::modes::server::common::{AppState, ApiResponse, check_auth};
|
||||||
use crate::common::status::{generate_status_info, StatusInfo};
|
use crate::common::status::{generate_status_info, StatusInfo};
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ use std::str::FromStr;
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::time::Instant;
|
use std::time::Instant;
|
||||||
use tokio::sync::Mutex;
|
use tokio::sync::Mutex;
|
||||||
|
use utoipa::ToSchema;
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct ServerConfig {
|
pub struct ServerConfig {
|
||||||
@@ -33,14 +34,14 @@ pub struct AppState {
|
|||||||
pub password: Option<String>,
|
pub password: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize, ToSchema)]
|
||||||
pub struct ApiResponse<T> {
|
pub struct ApiResponse<T> {
|
||||||
pub success: bool,
|
pub success: bool,
|
||||||
pub data: Option<T>,
|
pub data: Option<T>,
|
||||||
pub error: Option<String>,
|
pub error: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize, ToSchema)]
|
||||||
pub struct ItemInfo {
|
pub struct ItemInfo {
|
||||||
pub id: i64,
|
pub id: i64,
|
||||||
pub ts: String,
|
pub ts: String,
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
use axum::response::Html;
|
||||||
|
use axum::Router;
|
||||||
|
use axum::routing::get;
|
||||||
|
use crate::modes::server::AppState;
|
||||||
|
|
||||||
pub async fn handle_swagger_ui() -> Html<&'static str> {
|
pub async fn handle_swagger_ui() -> Html<&'static str> {
|
||||||
let html = r#"<!DOCTYPE html>
|
let html = r#"<!DOCTYPE html>
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
use crate::db::{self, Item, Tag, Meta};
|
|
||||||
use crate::modes::server::AppState;
|
use crate::modes::server::AppState;
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use axum::{
|
use axum::{
|
||||||
@@ -7,9 +6,6 @@ use axum::{
|
|||||||
};
|
};
|
||||||
use rusqlite::Connection;
|
use rusqlite::Connection;
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use std::collections::HashMap;
|
|
||||||
use std::sync::Arc;
|
|
||||||
use tokio::sync::Mutex;
|
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
pub struct ListQueryParams {
|
pub struct ListQueryParams {
|
||||||
|
|||||||
Reference in New Issue
Block a user