refactor: refactor graphql

This commit is contained in:
2025-06-27 04:06:58 +08:00
parent 3a8eb88e1a
commit 65505f91b2
43 changed files with 2199 additions and 818 deletions

View File

@@ -18,6 +18,8 @@ use crate::{
#[derive(Snafu, Debug)]
#[snafu(visibility(pub(crate)))]
pub enum RecorderError {
#[snafu(transparent)]
SeaographyError { source: seaography::SeaographyError },
#[snafu(transparent)]
CronError { source: croner::errors::CronError },
#[snafu(display(
@@ -192,20 +194,17 @@ impl RecorderError {
}
}
pub fn from_model_not_found_detail<C: Into<Cow<'static, str>>, T: ToString>(
model: C,
detail: T,
) -> Self {
pub fn from_entity_not_found<E: sea_orm::EntityTrait>() -> Self {
Self::ModelEntityNotFound {
entity: model.into(),
detail: Some(detail.to_string()),
entity: std::any::type_name::<E::Model>().into(),
detail: None,
}
}
pub fn from_model_not_found<C: Into<Cow<'static, str>>>(model: C) -> Self {
pub fn from_entity_not_found_detail<E: sea_orm::EntityTrait, T: ToString>(detail: T) -> Self {
Self::ModelEntityNotFound {
entity: model.into(),
detail: None,
entity: std::any::type_name::<E::Model>().into(),
detail: Some(detail.to_string()),
}
}
}