refactor!: CQRS repository split — v0.3.0
FederationRepository (34 methods) → 4 focused traits:
ActivityRepository (2) — idempotency tracking
FollowRepository (18) — follower/following graph + migration
ActorRepository (6) — keypairs, remote actor cache, announce tracking
BlocklistRepository (8) — domain + actor blocklists
ApObjectHandler (10 methods) → 2 traits:
ApContentReader (3) — get_local_objects_for_user/page, count_local_posts
ApObjectHandler (9) — all inbox callbacks (on_create, on_mention, etc.)
Builder changes from positional args to named setters:
ActivityPubService::builder(base_url)
.activity_repo(arc)
.follow_repo(arc)
.actor_repo(arc)
.blocklist_repo(arc)
.user_repo(arc)
.content_reader(arc)
.object_handler(arc)
.build()
No behaviour changes.
This commit is contained in:
@@ -66,7 +66,7 @@ pub async fn outbox_handler(
|
||||
// if count_local_posts returns 0. In practice this trait method is called
|
||||
// infrequently (only on the root collection endpoint).
|
||||
let total = data
|
||||
.object_handler
|
||||
.content_reader
|
||||
.count_local_posts()
|
||||
.await
|
||||
.map_err(|e| Error::from(anyhow::anyhow!("{}", e)))?;
|
||||
@@ -75,7 +75,7 @@ pub async fn outbox_handler(
|
||||
let before: Option<DateTime<Utc>> = query.before.as_deref().and_then(|s| s.parse().ok());
|
||||
|
||||
let items = data
|
||||
.object_handler
|
||||
.content_reader
|
||||
.get_local_objects_page(uuid, before, AP_PAGE_SIZE)
|
||||
.await
|
||||
.map_err(|e| Error::from(anyhow::anyhow!("{}", e)))?;
|
||||
|
||||
Reference in New Issue
Block a user