diff --git a/src/activitypub/user/outbox.rs b/src/activitypub/user/outbox.rs index aeb55e7..669339c 100644 --- a/src/activitypub/user/outbox.rs +++ b/src/activitypub/user/outbox.rs @@ -1,7 +1,7 @@ use axum::{extract::{Path, Query, State}, http::StatusCode, response::IntoResponse, Json}; use sea_orm::{ColumnTrait, Condition, EntityTrait, IntoActiveModel, Order, QueryFilter, QueryOrder, QuerySelect, SelectColumns, Set}; -use crate::{activitypub::{jsonld::LD, JsonLD, Pagination}, activitystream::{object::{activity::{Activity, ActivityMut, ActivityType}, collection::{page::CollectionPageMut, CollectionMut, CollectionType}, Addressed, Object, ObjectMut}, Base, BaseMut, BaseType, Node, ObjectType}, auth::{AuthIdentity, Identity}, model::{self, activity, object}, server::Context, url}; +use crate::{activitypub::{jsonld::LD, JsonLD, Pagination}, activitystream::{object::{activity::{Activity, ActivityMut, ActivityType}, collection::{page::CollectionPageMut, CollectionMut, CollectionType}, Addressed}, Base, BaseMut, BaseType, Node, ObjectType}, auth::{AuthIdentity, Identity}, model::{self, activity, object}, server::Context, url}; pub async fn get( State(ctx): State, diff --git a/src/main.rs b/src/main.rs index 43bd455..6603c9a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -49,7 +49,7 @@ enum CliCommand { /// generate fake user, note and activity Faker{ /// how many fake statuses to insert for root user - count: usize, + count: u64, }, /// fetch a single AP object @@ -89,7 +89,7 @@ async fn main() { CliCommand::Migrate => migrations::Migrator::up(&db, None) .await.expect("error applying migrations"), - CliCommand::Faker => model::faker::faker(&db, args.domain) + CliCommand::Faker { count } => model::faker::faker(&db, args.domain, count) .await.expect("error creating fake entities"), CliCommand::Fetch { uri, save } => fetch(&db, &uri, save) diff --git a/src/model/faker.rs b/src/model/faker.rs index 65ed55a..1e37d20 100644 --- a/src/model/faker.rs +++ b/src/model/faker.rs @@ -2,7 +2,7 @@ use crate::{activitypub::PUBLIC_TARGET, model::{config, credential}}; use super::{activity, object, user, Audience}; use sea_orm::IntoActiveModel; -pub async fn faker(db: &sea_orm::DatabaseConnection, domain: String, count: usize) -> Result<(), sea_orm::DbErr> { +pub async fn faker(db: &sea_orm::DatabaseConnection, domain: String, count: u64) -> Result<(), sea_orm::DbErr> { use sea_orm::{EntityTrait, Set}; let root = super::user::Model {