From 98d7eac51bd705af1b3b6112416a575b83a47679 Mon Sep 17 00:00:00 2001 From: naskya Date: Mon, 3 Jun 2024 08:20:39 +0900 Subject: [PATCH] chore (backend-rs): use sea_orm::prelude --- .../backend-rs/src/misc/remove_old_attestation_challenges.rs | 2 +- packages/backend-rs/src/service/antenna/check_hit.rs | 2 +- packages/backend-rs/src/service/antenna/process_new_note.rs | 2 +- packages/backend-rs/src/service/note/watch.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/backend-rs/src/misc/remove_old_attestation_challenges.rs b/packages/backend-rs/src/misc/remove_old_attestation_challenges.rs index 58c0ea8f3a..9102d1ce39 100644 --- a/packages/backend-rs/src/misc/remove_old_attestation_challenges.rs +++ b/packages/backend-rs/src/misc/remove_old_attestation_challenges.rs @@ -3,7 +3,7 @@ use crate::database::db_conn; use crate::model::entity::attestation_challenge; use chrono::{Duration, Utc}; -use sea_orm::{ColumnTrait, DbErr, EntityTrait, QueryFilter}; +use sea_orm::prelude::*; /// Delete all entries in the [attestation_challenge] table created at more than 5 minutes ago #[crate::export] diff --git a/packages/backend-rs/src/service/antenna/check_hit.rs b/packages/backend-rs/src/service/antenna/check_hit.rs index 9dfbd65e8b..8a0bec6e0a 100644 --- a/packages/backend-rs/src/service/antenna/check_hit.rs +++ b/packages/backend-rs/src/service/antenna/check_hit.rs @@ -2,7 +2,7 @@ use crate::config::CONFIG; use crate::database::{cache, db_conn}; use crate::federation::acct::Acct; use crate::model::entity::{antenna, blocking, following, note, sea_orm_active_enums::*}; -use sea_orm::{ColumnTrait, DbErr, EntityTrait, QueryFilter, QuerySelect}; +use sea_orm::{prelude::*, QuerySelect}; #[derive(thiserror::Error, Debug)] pub enum AntennaCheckError { diff --git a/packages/backend-rs/src/service/antenna/process_new_note.rs b/packages/backend-rs/src/service/antenna/process_new_note.rs index 1ec44f6e6b..d28af982b6 100644 --- a/packages/backend-rs/src/service/antenna/process_new_note.rs +++ b/packages/backend-rs/src/service/antenna/process_new_note.rs @@ -6,7 +6,7 @@ use crate::service::antenna::check_hit::{check_hit_antenna, AntennaCheckError}; use crate::service::stream; use crate::util::id::{get_timestamp, InvalidIdError}; use redis::{streams::StreamMaxlen, AsyncCommands, RedisError}; -use sea_orm::{DbErr, EntityTrait}; +use sea_orm::prelude::*; #[derive(thiserror::Error, Debug)] pub enum Error { diff --git a/packages/backend-rs/src/service/note/watch.rs b/packages/backend-rs/src/service/note/watch.rs index 69e30c0f9b..aca8d58827 100644 --- a/packages/backend-rs/src/service/note/watch.rs +++ b/packages/backend-rs/src/service/note/watch.rs @@ -1,7 +1,7 @@ use crate::database::db_conn; use crate::model::entity::note_watching; use crate::util::id::gen_id; -use sea_orm::{ActiveValue, ColumnTrait, DbErr, EntityTrait, ModelTrait, QueryFilter}; +use sea_orm::{prelude::*, ActiveValue}; #[crate::export] pub async fn watch_note(