refactor: rename application AppConfig to AppSettings
This commit is contained in:
@@ -2,26 +2,26 @@ use std::sync::Arc;
|
||||
|
||||
use domain::ports::{AuthService, PasswordHasher, RefreshSessionRepository, UserRepository};
|
||||
|
||||
use crate::config::AppConfig;
|
||||
use crate::config::AppSettings;
|
||||
|
||||
pub struct LoginDeps {
|
||||
pub user: Arc<dyn UserRepository>,
|
||||
pub password_hasher: Arc<dyn PasswordHasher>,
|
||||
pub auth: Arc<dyn AuthService>,
|
||||
pub refresh_session: Arc<dyn RefreshSessionRepository>,
|
||||
pub config: AppConfig,
|
||||
pub config: AppSettings,
|
||||
}
|
||||
|
||||
pub struct RegisterDeps {
|
||||
pub user: Arc<dyn UserRepository>,
|
||||
pub password_hasher: Arc<dyn PasswordHasher>,
|
||||
pub config: AppConfig,
|
||||
pub config: AppSettings,
|
||||
}
|
||||
|
||||
pub struct RefreshDeps {
|
||||
pub refresh_session: Arc<dyn RefreshSessionRepository>,
|
||||
pub auth: Arc<dyn AuthService>,
|
||||
pub config: AppConfig,
|
||||
pub config: AppSettings,
|
||||
}
|
||||
|
||||
pub struct RegisterAndLoginDeps {
|
||||
@@ -29,7 +29,7 @@ pub struct RegisterAndLoginDeps {
|
||||
pub password_hasher: Arc<dyn PasswordHasher>,
|
||||
pub auth: Arc<dyn AuthService>,
|
||||
pub refresh_session: Arc<dyn RefreshSessionRepository>,
|
||||
pub config: AppConfig,
|
||||
pub config: AppSettings,
|
||||
}
|
||||
|
||||
pub struct LogoutDeps {
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
#[derive(Clone)]
|
||||
pub struct AppConfig {
|
||||
pub struct AppSettings {
|
||||
pub allow_registration: bool,
|
||||
pub base_url: String,
|
||||
pub rate_limit: u64,
|
||||
pub refresh_ttl_seconds: u64,
|
||||
pub secure_cookies: bool,
|
||||
pub cors_origins: String,
|
||||
pub wrapup: WrapUpConfig,
|
||||
pub wrapup: WrapUpSettings,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct WrapUpConfig {
|
||||
pub struct WrapUpSettings {
|
||||
pub font_path: Option<String>,
|
||||
pub logo_path: Option<String>,
|
||||
pub bg_dir: Option<String>,
|
||||
}
|
||||
|
||||
impl From<&::config::AppConfig> for AppConfig {
|
||||
impl From<&::config::AppConfig> for AppSettings {
|
||||
fn from(config: &::config::AppConfig) -> Self {
|
||||
Self {
|
||||
allow_registration: config.server.allow_registration,
|
||||
@@ -25,12 +25,12 @@ impl From<&::config::AppConfig> for AppConfig {
|
||||
refresh_ttl_seconds: config.auth.refresh_ttl_seconds,
|
||||
secure_cookies: config.server.secure_cookies,
|
||||
cors_origins: config.server.cors_origins.clone(),
|
||||
wrapup: WrapUpConfig::from(&config.wrapup),
|
||||
wrapup: WrapUpSettings::from(&config.wrapup),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&::config::WrapUpConfig> for WrapUpConfig {
|
||||
impl From<&::config::WrapUpConfig> for WrapUpSettings {
|
||||
fn from(config: &::config::WrapUpConfig) -> Self {
|
||||
Self {
|
||||
font_path: config.font_path.clone(),
|
||||
|
||||
@@ -5,7 +5,7 @@ use domain::ports::{
|
||||
MovieProfileRepository, MovieQuery, ReviewRepository, UserRepository,
|
||||
};
|
||||
|
||||
use crate::config::AppConfig;
|
||||
use crate::config::AppSettings;
|
||||
|
||||
pub struct DeleteReviewDeps {
|
||||
pub review: Arc<dyn ReviewRepository>,
|
||||
@@ -28,7 +28,7 @@ pub struct GetMovieSocialPageDeps {
|
||||
pub struct GetActivityFeedDeps {
|
||||
pub diary: Arc<dyn DiaryQuery>,
|
||||
pub social_query: Arc<dyn FollowGraphQuery>,
|
||||
pub config: AppConfig,
|
||||
pub config: AppSettings,
|
||||
}
|
||||
|
||||
pub struct GetUserFeedDeps {
|
||||
|
||||
Reference in New Issue
Block a user