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:
@@ -2,6 +2,8 @@ use std::sync::Arc;
|
||||
|
||||
#[cfg(feature = "federation")]
|
||||
use domain::testing::PanicRemoteWatchlistRepository;
|
||||
#[cfg(feature = "federation")]
|
||||
use domain::testing::PanicSocialQueryPort;
|
||||
use domain::{
|
||||
ports::{
|
||||
AuthService, DiaryExporter, DiaryRepository, DocumentParser, EventPublisher, ImageStorage,
|
||||
@@ -144,6 +146,8 @@ impl TestContextBuilder {
|
||||
config: self.config,
|
||||
#[cfg(feature = "federation")]
|
||||
remote_watchlist_repository: std::sync::Arc::new(PanicRemoteWatchlistRepository),
|
||||
#[cfg(feature = "federation")]
|
||||
social_query: std::sync::Arc::new(PanicSocialQueryPort),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user