refactor: 移除 shadow results 相关模块和接口

This commit is contained in:
fawney19
2026-04-14 09:46:16 +08:00
parent 5fd3240fcf
commit 62e0a0338d
30 changed files with 115 additions and 1991 deletions

View File

@@ -15,7 +15,6 @@ mod candidate_queries;
mod gemini_files;
mod payments;
mod security;
mod shadow_results;
mod usage_queries;
mod user_preferences;
mod wallet;
@@ -100,14 +99,6 @@ impl AppState {
self.data.has_provider_quota_writer()
}
pub fn has_shadow_result_data_writer(&self) -> bool {
self.data.has_shadow_result_writer()
}
pub fn has_shadow_result_data_reader(&self) -> bool {
self.data.has_shadow_result_reader()
}
pub(crate) async fn count_active_admin_users(&self) -> Result<u64, GatewayError> {
#[cfg(test)]
if let Some(store) = self.auth_user_store.as_ref() {

View File

@@ -1,25 +0,0 @@
use crate::{AppState, GatewayError};
impl AppState {
pub(crate) async fn record_shadow_result_sample(
&self,
sample: aether_data::repository::shadow_results::RecordShadowResultSample,
) -> Result<Option<aether_data::repository::shadow_results::StoredShadowResult>, GatewayError>
{
self.data
.record_shadow_result_sample(sample)
.await
.map_err(|err| GatewayError::Internal(err.to_string()))
}
pub(crate) async fn list_recent_shadow_results(
&self,
limit: usize,
) -> Result<Vec<aether_data::repository::shadow_results::StoredShadowResult>, GatewayError>
{
self.data
.list_recent_shadow_results(limit)
.await
.map_err(|err| GatewayError::Internal(err.to_string()))
}
}

View File

@@ -578,27 +578,4 @@ impl AppState {
.insert(provider_type.trim().to_ascii_lowercase(), token_url.into());
self
}
pub(crate) fn with_shadow_result_data_writer_for_tests(
mut self,
repository: Arc<dyn aether_data::repository::shadow_results::ShadowResultWriteRepository>,
) -> Self {
self.replace_data_state(Arc::new(
GatewayDataState::with_shadow_result_writer_for_tests(repository),
));
self
}
pub(crate) fn with_shadow_result_data_repository_for_tests<T>(
mut self,
repository: Arc<T>,
) -> Self
where
T: aether_data::repository::shadow_results::ShadowResultRepository + 'static,
{
self.replace_data_state(Arc::new(
GatewayDataState::with_shadow_result_repository_for_tests(repository),
));
self
}
}