mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 00:35:38 +08:00
refactor: remove unused HTTP-specific structs to streamline service code
This commit is contained in:
@@ -7,7 +7,6 @@ use crate::{
|
|||||||
};
|
};
|
||||||
use anyhow::{Context, Result, bail};
|
use anyhow::{Context, Result, bail};
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
use serde::{Deserialize, Serialize};
|
|
||||||
use std::{env::current_exe, path::PathBuf, process::Command as StdCommand};
|
use std::{env::current_exe, path::PathBuf, process::Command as StdCommand};
|
||||||
use tokio::sync::Mutex;
|
use tokio::sync::Mutex;
|
||||||
|
|
||||||
@@ -24,23 +23,6 @@ pub enum ServiceStatus {
|
|||||||
Unavailable(String),
|
Unavailable(String),
|
||||||
}
|
}
|
||||||
|
|
||||||
// 保留核心数据结构,但将HTTP特定的结构体合并为通用结构体
|
|
||||||
#[derive(Debug, Deserialize, Serialize, Clone)]
|
|
||||||
pub struct ResponseBody {
|
|
||||||
pub core_type: Option<String>,
|
|
||||||
pub bin_path: String,
|
|
||||||
pub config_dir: String,
|
|
||||||
pub log_file: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
// 保留通用的响应结构体,用于IPC通信后的数据解析
|
|
||||||
#[derive(Debug, Deserialize, Serialize, Clone)]
|
|
||||||
pub struct JsonResponse {
|
|
||||||
pub code: u64,
|
|
||||||
pub msg: String,
|
|
||||||
pub data: Option<ResponseBody>,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct ServiceManager(ServiceStatus);
|
pub struct ServiceManager(ServiceStatus);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user