refactor: replace long arg lists with input/config structs and builder
- Thought::new_local → NewThought struct (7 args → 1) - UserWriter::update_profile → UpdateProfileInput struct (6 args → 2) - update_profile use case → UpdateProfileInput (8 args → 3) - ActivityPubService::new → builder pattern (9 args → 5 required + 4 optional setters) - accept_note → AcceptNoteInput struct (8 args → 1) - ThoughtNote::new_public → ThoughtNoteInput struct (8 args → 1) Remove all #[allow(clippy::too_many_arguments)] annotations.
This commit is contained in:
@@ -40,7 +40,7 @@ pub async fn build(database_url: &str, base_url: &str, nats_url: &str) -> Worker
|
||||
|
||||
// ActivityPub service (for federation fan-out)
|
||||
let ap_service = Arc::new(
|
||||
ActivityPubService::new(
|
||||
ActivityPubService::builder(
|
||||
Arc::new(PostgresFederationRepository::new(pool.clone())),
|
||||
Arc::new(PostgresApUserRepository::new(
|
||||
pool.clone(),
|
||||
@@ -52,13 +52,11 @@ pub async fn build(database_url: &str, base_url: &str, nats_url: &str) -> Worker
|
||||
None,
|
||||
Arc::new(postgres::tag::PgTagRepository::new(pool.clone())),
|
||||
)),
|
||||
base_url.to_string(),
|
||||
false,
|
||||
"thoughts".to_string(),
|
||||
false,
|
||||
None,
|
||||
base_url,
|
||||
Arc::new(PgRemoteActorConnectionRepository::new(pool.clone())),
|
||||
)
|
||||
.software_name("thoughts")
|
||||
.build()
|
||||
.await
|
||||
.expect("ActivityPubService build failed"),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user