Update sea-orm dependencies to use workspace configuration; add dead code annotations in service error handling and settings service
All checks were successful
Test / verify-generated-code (pull_request) Successful in 7m57s
Test / test (pull_request) Successful in 1m9s
Test / lint (pull_request) Successful in 1m9s

This commit is contained in:
GW_MC
2025-12-02 17:12:24 +08:00
parent f71cf370cd
commit f4e6eb56c8
7 changed files with 15 additions and 5 deletions

View File

@@ -17,4 +17,4 @@ tracing = { version = "0.1.41", features = ["std", "attributes"] }
tracing-subscriber = { version = "0.3.20", features = ["smallvec", "fmt", "ansi", "tracing-log", "std", "chrono", "json", "serde", "serde_json", "time", "tracing"] }
serde_json = { version = "1.0.145", features = ["std"] }
serde = { version = "1.0.228", features = ["std", "derive"] }
sea-orm = { version = "2.0.0-rc" }
sea-orm = { workspace = true }

View File

@@ -1,5 +1,6 @@
pub type ServiceError = Box<dyn std::error::Error + Send + Sync>;
#[allow(dead_code)] // TODO: remove when used
pub trait IntoServiceError {
fn into_service_error(self) -> ServiceError;
}

View File

@@ -15,9 +15,10 @@ pub struct AppState {
pub service: Arc<AppService>,
}
pub type ServiceState<T: ?Sized + Send + Sync> = Arc<T>;
pub type ServiceState<T> = Arc<T>;
pub struct AppService {
#[allow(dead_code)] // TODO: remove when used
pub settings: ServiceState<dyn SettingsStore>,
}

View File

@@ -11,11 +11,14 @@ use crate::errors::service_error::{IntoServiceError, ServiceError};
#[async_trait::async_trait]
pub trait SettingsStore: Send + Sync {
#[allow(dead_code)] // TODO: remove when used
async fn get_setting(&self, key: &str) -> Result<String, ServiceError>;
#[allow(dead_code)] // TODO: remove when used
async fn set_setting(&self, key: &str, value: String) -> Result<(), ServiceError>;
}
pub struct SettingsService {
#[allow(dead_code)] // TODO: remove when used
connection: Arc<DatabaseConnection>,
}