Group imports in some modules
This commit is contained in:
parent
05f6bb6091
commit
c26fc9235d
9 changed files with 104 additions and 82 deletions
|
@ -9,12 +9,14 @@ use crate::activitypub::{
|
|||
use crate::config::Config;
|
||||
use crate::database::DatabaseClient;
|
||||
use crate::errors::ValidationError;
|
||||
use crate::models::profiles::queries::get_profile_by_remote_actor_id;
|
||||
use crate::models::relationships::queries::{
|
||||
use crate::models::{
|
||||
profiles::queries::get_profile_by_remote_actor_id,
|
||||
relationships::queries::{
|
||||
follow_request_accepted,
|
||||
get_follow_request_by_id,
|
||||
},
|
||||
relationships::types::FollowRequestStatus,
|
||||
};
|
||||
use crate::models::relationships::types::FollowRequestStatus;
|
||||
use super::HandlerResult;
|
||||
|
||||
#[derive(Deserialize)]
|
||||
|
|
|
@ -8,9 +8,11 @@ use crate::activitypub::{
|
|||
use crate::config::Config;
|
||||
use crate::database::DatabaseClient;
|
||||
use crate::errors::ValidationError;
|
||||
use crate::models::profiles::queries::get_profile_by_remote_actor_id;
|
||||
use crate::models::relationships::queries::subscribe_opt;
|
||||
use crate::models::users::queries::get_user_by_name;
|
||||
use crate::models::{
|
||||
profiles::queries::get_profile_by_remote_actor_id,
|
||||
relationships::queries::subscribe_opt,
|
||||
users::queries::get_user_by_name,
|
||||
};
|
||||
use super::{HandlerError, HandlerResult};
|
||||
|
||||
#[derive(Deserialize)]
|
||||
|
|
|
@ -10,11 +10,13 @@ use crate::activitypub::{
|
|||
use crate::config::Config;
|
||||
use crate::database::{DatabaseClient, DatabaseError};
|
||||
use crate::errors::ValidationError;
|
||||
use crate::models::posts::queries::{
|
||||
use crate::models::{
|
||||
posts::queries::{
|
||||
create_post,
|
||||
get_post_by_remote_object_id,
|
||||
},
|
||||
posts::types::PostCreateData,
|
||||
};
|
||||
use crate::models::posts::types::PostCreateData;
|
||||
use super::HandlerResult;
|
||||
|
||||
#[derive(Deserialize)]
|
||||
|
|
|
@ -21,13 +21,14 @@ use crate::activitypub::{
|
|||
use crate::config::{Config, Instance};
|
||||
use crate::database::{DatabaseClient, DatabaseError};
|
||||
use crate::errors::{ConversionError, ValidationError};
|
||||
use crate::models::attachments::queries::create_attachment;
|
||||
use crate::models::emojis::queries::{
|
||||
use crate::models::{
|
||||
attachments::queries::create_attachment,
|
||||
emojis::queries::{
|
||||
create_emoji,
|
||||
get_emoji_by_remote_object_id,
|
||||
update_emoji,
|
||||
};
|
||||
use crate::models::posts::{
|
||||
},
|
||||
posts::{
|
||||
hashtags::normalize_hashtag,
|
||||
helpers::get_post_by_object_id,
|
||||
mentions::mention_to_address,
|
||||
|
@ -41,9 +42,10 @@ use crate::models::posts::{
|
|||
EMOJI_MEDIA_TYPES,
|
||||
EMOJIS_MAX_NUM,
|
||||
},
|
||||
},
|
||||
profiles::types::DbActorProfile,
|
||||
users::queries::get_user_by_name,
|
||||
};
|
||||
use crate::models::profiles::types::DbActorProfile;
|
||||
use crate::models::users::queries::get_user_by_name;
|
||||
use crate::utils::{
|
||||
html::clean_html,
|
||||
urls::get_hostname,
|
||||
|
|
|
@ -8,13 +8,15 @@ use crate::activitypub::{
|
|||
use crate::config::Config;
|
||||
use crate::database::{DatabaseClient, DatabaseError};
|
||||
use crate::errors::ValidationError;
|
||||
use crate::models::posts::queries::{
|
||||
use crate::models::{
|
||||
posts::queries::{
|
||||
delete_post,
|
||||
get_post_by_remote_object_id,
|
||||
};
|
||||
use crate::models::profiles::queries::{
|
||||
},
|
||||
profiles::queries::{
|
||||
delete_profile,
|
||||
get_profile_by_remote_actor_id,
|
||||
},
|
||||
};
|
||||
use super::HandlerResult;
|
||||
|
||||
|
|
|
@ -9,12 +9,14 @@ use crate::activitypub::{
|
|||
use crate::config::Config;
|
||||
use crate::database::DatabaseClient;
|
||||
use crate::errors::ValidationError;
|
||||
use crate::models::profiles::queries::get_profile_by_remote_actor_id;
|
||||
use crate::models::relationships::queries::{
|
||||
use crate::models::{
|
||||
profiles::queries::get_profile_by_remote_actor_id,
|
||||
relationships::queries::{
|
||||
follow_request_rejected,
|
||||
get_follow_request_by_id,
|
||||
},
|
||||
relationships::types::FollowRequestStatus,
|
||||
};
|
||||
use crate::models::relationships::types::FollowRequestStatus;
|
||||
use super::HandlerResult;
|
||||
|
||||
#[derive(Deserialize)]
|
||||
|
|
|
@ -8,12 +8,14 @@ use crate::activitypub::{
|
|||
use crate::config::Config;
|
||||
use crate::database::{DatabaseClient, DatabaseError};
|
||||
use crate::errors::ValidationError;
|
||||
use crate::models::notifications::queries::{
|
||||
use crate::models::{
|
||||
notifications::queries::{
|
||||
create_subscription_expiration_notification,
|
||||
},
|
||||
profiles::queries::get_profile_by_remote_actor_id,
|
||||
relationships::queries::unsubscribe,
|
||||
users::queries::get_user_by_name,
|
||||
};
|
||||
use crate::models::profiles::queries::get_profile_by_remote_actor_id;
|
||||
use crate::models::relationships::queries::unsubscribe;
|
||||
use crate::models::users::queries::get_user_by_name;
|
||||
use super::{HandlerError, HandlerResult};
|
||||
|
||||
#[derive(Deserialize)]
|
||||
|
|
28
src/cli.rs
28
src/cli.rs
|
@ -11,26 +11,30 @@ use crate::activitypub::{
|
|||
};
|
||||
use crate::config::Config;
|
||||
use crate::database::DatabaseClient;
|
||||
use crate::ethereum::signatures::generate_ecdsa_key;
|
||||
use crate::ethereum::sync::save_current_block_number;
|
||||
use crate::ethereum::utils::key_to_ethereum_address;
|
||||
use crate::models::attachments::queries::delete_unused_attachments;
|
||||
use crate::models::cleanup::find_orphaned_files;
|
||||
use crate::models::emojis::queries::delete_emoji;
|
||||
use crate::models::posts::queries::{delete_post, find_extraneous_posts, get_post_by_id};
|
||||
use crate::models::profiles::queries::{
|
||||
use crate::ethereum::{
|
||||
signatures::generate_ecdsa_key,
|
||||
sync::save_current_block_number,
|
||||
utils::key_to_ethereum_address,
|
||||
};
|
||||
use crate::models::{
|
||||
attachments::queries::delete_unused_attachments,
|
||||
cleanup::find_orphaned_files,
|
||||
emojis::queries::delete_emoji,
|
||||
oauth::queries::delete_oauth_tokens,
|
||||
posts::queries::{delete_post, find_extraneous_posts, get_post_by_id},
|
||||
profiles::queries::{
|
||||
delete_profile,
|
||||
find_empty_profiles,
|
||||
get_profile_by_id,
|
||||
get_profile_by_remote_actor_id,
|
||||
};
|
||||
use crate::models::oauth::queries::delete_oauth_tokens;
|
||||
use crate::models::subscriptions::queries::reset_subscriptions;
|
||||
use crate::models::users::queries::{
|
||||
},
|
||||
subscriptions::queries::reset_subscriptions,
|
||||
users::queries::{
|
||||
create_invite_code,
|
||||
get_invite_codes,
|
||||
get_user_by_id,
|
||||
set_user_password,
|
||||
},
|
||||
};
|
||||
use crate::monero::{
|
||||
helpers::check_expired_invoice,
|
||||
|
|
|
@ -6,20 +6,24 @@ use uuid::Uuid;
|
|||
|
||||
use crate::errors::{HttpError, ValidationError};
|
||||
use crate::identity::did::Did;
|
||||
use crate::mastodon_api::pagination::PageSize;
|
||||
use crate::mastodon_api::uploads::{save_b64_file, UploadError};
|
||||
use crate::models::profiles::types::{
|
||||
use crate::mastodon_api::{
|
||||
pagination::PageSize,
|
||||
uploads::{save_b64_file, UploadError},
|
||||
};
|
||||
use crate::models::{
|
||||
profiles::types::{
|
||||
DbActorProfile,
|
||||
ExtraField,
|
||||
PaymentOption,
|
||||
ProfileImage,
|
||||
ProfileUpdateData,
|
||||
};
|
||||
use crate::models::profiles::validators::validate_username;
|
||||
use crate::models::subscriptions::types::Subscription;
|
||||
use crate::models::users::types::{
|
||||
},
|
||||
profiles::validators::validate_username,
|
||||
subscriptions::types::Subscription,
|
||||
users::types::{
|
||||
validate_local_username,
|
||||
User,
|
||||
},
|
||||
};
|
||||
use crate::utils::{
|
||||
files::get_file_url,
|
||||
|
|
Loading…
Reference in a new issue