pub struct MagazineRepository { /* private fields */ }Expand description
杂志仓储
Implementations§
Source§impl MagazineRepository
impl MagazineRepository
Sourcepub async fn get_magazines(
&self,
magazine_id: Option<i16>,
magazine_name: Option<&str>,
) -> ApiResult<Vec<MagazineRow>>
pub async fn get_magazines( &self, magazine_id: Option<i16>, magazine_name: Option<&str>, ) -> ApiResult<Vec<MagazineRow>>
条件查询杂志列表
Sourcepub async fn delete_magazine_by_id(&self, id: i32) -> ApiResult<()>
pub async fn delete_magazine_by_id(&self, id: i32) -> ApiResult<()>
按 ID 删除杂志
Sourcepub async fn insert_magazine(&self, row: &MagazineRow) -> ApiResult<i32>
pub async fn insert_magazine(&self, row: &MagazineRow) -> ApiResult<i32>
新增杂志
Sourcepub async fn get_magazine_by_id(
&self,
id: i32,
) -> ApiResult<Option<MagazineRow>>
pub async fn get_magazine_by_id( &self, id: i32, ) -> ApiResult<Option<MagazineRow>>
按 ID 查询杂志
Sourcepub async fn update_magazine(&self, row: &MagazineRow) -> ApiResult<()>
pub async fn update_magazine(&self, row: &MagazineRow) -> ApiResult<()>
更新杂志
Sourcepub async fn test_magazine_name(
&self,
magazine_name: &str,
) -> ApiResult<Option<MagazineRow>>
pub async fn test_magazine_name( &self, magazine_name: &str, ) -> ApiResult<Option<MagazineRow>>
按名称检测杂志是否已存在
删除前检查是否绑定漫画
Sourcepub async fn get_max_magazine_id(&self) -> ApiResult<Option<i32>>
pub async fn get_max_magazine_id(&self) -> ApiResult<Option<i32>>
获取最大杂志 ID
Sourcepub async fn get_manga_magazine_list(&self) -> ApiResult<Vec<MagazineRow>>
pub async fn get_manga_magazine_list(&self) -> ApiResult<Vec<MagazineRow>>
无条件查询全部杂志
Sourcepub fn to_entity(row: &MagazineRow) -> Magazine
pub fn to_entity(row: &MagazineRow) -> Magazine
将完整行转为实体 Magazine(仅 ID 与名称)
Auto Trait Implementations§
impl Freeze for MagazineRepository
impl !RefUnwindSafe for MagazineRepository
impl Send for MagazineRepository
impl Sync for MagazineRepository
impl Unpin for MagazineRepository
impl UnsafeUnpin for MagazineRepository
impl !UnwindSafe for MagazineRepository
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request