refactor: split modules

This commit is contained in:
2025-04-08 02:12:06 +08:00
parent 376d2b28d3
commit 2686fa1d76
94 changed files with 1125 additions and 580 deletions

View File

@@ -1,6 +0,0 @@
use crate::{errors::app_error::RResult, fetch::HttpClient};
pub fn build_testing_http_client() -> RResult<HttpClient> {
let mikan_client = HttpClient::default();
Ok(mikan_client)
}

View File

@@ -1,17 +1,18 @@
use reqwest::IntoUrl;
use fetch::{FetchError, HttpClientConfig, IntoUrl};
use crate::{
errors::app_error::RResult,
errors::RecorderResult,
extract::mikan::{MikanClient, MikanConfig},
fetch::HttpClientConfig,
};
pub async fn build_testing_mikan_client(base_mikan_url: impl IntoUrl) -> RResult<MikanClient> {
pub async fn build_testing_mikan_client(
base_mikan_url: impl IntoUrl,
) -> RecorderResult<MikanClient> {
let mikan_client = MikanClient::from_config(MikanConfig {
http_client: HttpClientConfig {
..Default::default()
},
base_url: base_mikan_url.into_url()?,
base_url: base_mikan_url.into_url().map_err(FetchError::from)?,
})
.await?;
Ok(mikan_client)

View File

@@ -1,4 +1,3 @@
pub mod app;
pub mod fetch;
pub mod mikan;
pub mod tracing;