refactor: extract business logic from handlers to application layer
Move domain logic out of 7 handlers into use cases:
- activity feed: FollowingFilter construction
- user profile: social counts + pending followers
- users list: parallel local+remote actor loading
- watchlist page: local-vs-remote branching
- sync_poster: movie lookup + validation
- get_profile: avatar URL construction
- post_register: register+login orchestration
Add SocialQueryPort.{count_following,count_accepted_followers,
get_pending_followers} to AppContext behind federation feature gate.
This commit is contained in:
@@ -6,8 +6,8 @@ use domain::ports::{
|
||||
AuthService, DiaryExporter, DiaryRepository, DocumentParser, EventPublisher, ImageStorage,
|
||||
ImportProfileRepository, ImportSessionRepository, MetadataClient, MovieProfileRepository,
|
||||
MovieRepository, PasswordHasher, PersonCommand, PersonQuery, PosterFetcherClient,
|
||||
ReviewRepository, SearchCommand, SearchPort, StatsRepository, UserProfileFieldsRepository,
|
||||
UserRepository, WatchlistRepository,
|
||||
ReviewRepository, SearchCommand, SearchPort, SocialQueryPort, StatsRepository,
|
||||
UserProfileFieldsRepository, UserRepository, WatchlistRepository,
|
||||
};
|
||||
|
||||
use crate::config::AppConfig;
|
||||
@@ -38,5 +38,7 @@ pub struct AppContext {
|
||||
pub profile_fields_repository: Arc<dyn UserProfileFieldsRepository>,
|
||||
#[cfg(feature = "federation")]
|
||||
pub remote_watchlist_repository: Arc<dyn RemoteWatchlistRepository>,
|
||||
#[cfg(feature = "federation")]
|
||||
pub social_query: Arc<dyn SocialQueryPort>,
|
||||
pub config: AppConfig,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user