fix: add missing imports and update status response type
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
@@ -4,7 +4,7 @@ use axum::{
|
|||||||
response::Json,
|
response::Json,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::modes::server::common::{AppState, ApiResponse};
|
use crate::modes::server::common::{AppState, ApiResponse, StatusInfoResponse};
|
||||||
use crate::common::status::StatusInfo;
|
use crate::common::status::StatusInfo;
|
||||||
|
|
||||||
#[utoipa::path(
|
#[utoipa::path(
|
||||||
@@ -25,7 +25,7 @@ use crate::common::status::StatusInfo;
|
|||||||
)]
|
)]
|
||||||
pub async fn handle_status(
|
pub async fn handle_status(
|
||||||
State(state): State<AppState>,
|
State(state): State<AppState>,
|
||||||
) -> Result<Json<ApiResponse<StatusInfo>>, StatusCode> {
|
) -> Result<Json<StatusInfoResponse>, StatusCode> {
|
||||||
|
|
||||||
// Get database path
|
// Get database path
|
||||||
let db_path = state.db.lock().await.path().unwrap_or("unknown").to_string();
|
let db_path = state.db.lock().await.path().unwrap_or("unknown").to_string();
|
||||||
@@ -37,7 +37,7 @@ pub async fn handle_status(
|
|||||||
db_path.into(),
|
db_path.into(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let response = ApiResponse {
|
let response = StatusInfoResponse {
|
||||||
success: true,
|
success: true,
|
||||||
data: Some(status_info),
|
data: Some(status_info),
|
||||||
error: None,
|
error: None,
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ use crate::meta_plugin::MetaPluginType;
|
|||||||
use crate::compression_engine::CompressionType;
|
use crate::compression_engine::CompressionType;
|
||||||
use clap::Command;
|
use clap::Command;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
use std::str::FromStr;
|
||||||
|
use strum::IntoEnumIterator;
|
||||||
|
|
||||||
pub struct StatusService;
|
pub struct StatusService;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user