fix: fix issues

This commit is contained in:
2025-06-17 02:23:02 +08:00
parent 721eee9c88
commit 35312ea1ff
15 changed files with 404 additions and 185 deletions

View File

@@ -3,7 +3,7 @@ use std::{fmt::Debug, sync::Arc};
use once_cell::sync::OnceCell;
use typed_builder::TypedBuilder;
use crate::{app::AppContextTrait, test_utils::storage::TestingStorageService};
use crate::app::AppContextTrait;
#[derive(TypedBuilder)]
#[builder(field_defaults(default, setter(strip_option)))]
@@ -15,7 +15,7 @@ pub struct TestingAppContext {
mikan: Option<crate::extract::mikan::MikanClient>,
auth: Option<crate::auth::AuthService>,
graphql: Option<crate::graphql::GraphQLService>,
storage: Option<TestingStorageService>,
storage: Option<crate::storage::StorageService>,
crypto: Option<crate::crypto::CryptoService>,
#[builder(default = Arc::new(OnceCell::new()), setter(!strip_option))]
task: Arc<OnceCell<crate::task::TaskService>>,
@@ -67,7 +67,7 @@ impl AppContextTrait for TestingAppContext {
self.graphql.as_ref().expect("should set graphql")
}
fn storage(&self) -> &dyn crate::storage::StorageServiceTrait {
fn storage(&self) -> &crate::storage::StorageService {
self.storage.as_ref().expect("should set storage")
}