pub struct MangaRepository { /* private fields */ }Expand description
漫画仓储
Implementations§
Source§impl MangaRepository
impl MangaRepository
Sourcepub async fn list(
&self,
manga_tran_name: Option<&str>,
manga_ori_name: Option<&str>,
category: Option<i16>,
manga_status: Option<i16>,
author_name: Option<&str>,
magazine_name: Option<&str>,
) -> ApiResult<Vec<MangaCardVo>>
pub async fn list( &self, manga_tran_name: Option<&str>, manga_ori_name: Option<&str>, category: Option<i16>, manga_status: Option<i16>, author_name: Option<&str>, magazine_name: Option<&str>, ) -> ApiResult<Vec<MangaCardVo>>
Sourcepub async fn count_list(
&self,
manga_tran_name: Option<&str>,
manga_ori_name: Option<&str>,
category: Option<i16>,
manga_status: Option<i16>,
author_name: Option<&str>,
magazine_name: Option<&str>,
) -> ApiResult<i64>
pub async fn count_list( &self, manga_tran_name: Option<&str>, manga_ori_name: Option<&str>, category: Option<i16>, manga_status: Option<i16>, author_name: Option<&str>, magazine_name: Option<&str>, ) -> ApiResult<i64>
Sourcepub async fn list_page(
&self,
manga_tran_name: Option<&str>,
manga_ori_name: Option<&str>,
category: Option<i16>,
manga_status: Option<i16>,
author_name: Option<&str>,
magazine_name: Option<&str>,
limit: i32,
offset: i32,
) -> ApiResult<Vec<MangaCardVo>>
pub async fn list_page( &self, manga_tran_name: Option<&str>, manga_ori_name: Option<&str>, category: Option<i16>, manga_status: Option<i16>, author_name: Option<&str>, magazine_name: Option<&str>, limit: i32, offset: i32, ) -> ApiResult<Vec<MangaCardVo>>
条件分页查询漫画卡片(SQL LIMIT/OFFSET)
按作者 ID 查询漫画卡片
Sourcepub async fn list_by_magazine(
&self,
magazine_id: i32,
) -> ApiResult<Vec<MangaCardVo>>
pub async fn list_by_magazine( &self, magazine_id: i32, ) -> ApiResult<Vec<MangaCardVo>>
按杂志 ID 查询漫画卡片
Sourcepub async fn delete_by_id(&self, id: i32) -> ApiResult<()>
pub async fn delete_by_id(&self, id: i32) -> ApiResult<()>
按 ID 删除漫画主表
删除漫画作者关联
删除漫画作者关联(作画作者 type=2)
Sourcepub async fn delete_manga_episode(&self, id: i32) -> ApiResult<()>
pub async fn delete_manga_episode(&self, id: i32) -> ApiResult<()>
删除漫画话数
Sourcepub async fn delete_manga_magazine(&self, id: i32) -> ApiResult<()>
pub async fn delete_manga_magazine(&self, id: i32) -> ApiResult<()>
删除漫画杂志关联
新增漫画作者(type=1)
新增漫画作者(type=2)
Sourcepub async fn insert_manga_magazine(
&self,
manga_id: i32,
magazine_id: i32,
) -> ApiResult<()>
pub async fn insert_manga_magazine( &self, manga_id: i32, magazine_id: i32, ) -> ApiResult<()>
新增漫画杂志关联
Sourcepub async fn get_manga_detail_by_id(
&self,
id: i32,
) -> ApiResult<Option<MangaDetailVo>>
pub async fn get_manga_detail_by_id( &self, id: i32, ) -> ApiResult<Option<MangaDetailVo>>
按 ID 查询漫画详情
Sourcepub async fn get_manga_response_by_id(
&self,
id: i32,
) -> ApiResult<Option<MangaResponse>>
pub async fn get_manga_response_by_id( &self, id: i32, ) -> ApiResult<Option<MangaResponse>>
按 ID 查询漫画(对齐 Java getMangaById)
Sourcepub async fn get_manga_responses_by_ids(
&self,
ids: &[i32],
) -> ApiResult<HashMap<i32, MangaResponse>>
pub async fn get_manga_responses_by_ids( &self, ids: &[i32], ) -> ApiResult<HashMap<i32, MangaResponse>>
批量按 ID 查询漫画
Sourcepub async fn get_manga_card_by_id(
&self,
id: i32,
) -> ApiResult<Option<MangaCardVo>>
pub async fn get_manga_card_by_id( &self, id: i32, ) -> ApiResult<Option<MangaCardVo>>
按 ID 查询漫画卡片详情
Sourcepub async fn update_manga(&self, manga: &Manga) -> ApiResult<()>
pub async fn update_manga(&self, manga: &Manga) -> ApiResult<()>
更新漫画
更新漫画作者(type=1)
更新漫画作者(type=2)
Sourcepub async fn update_manga_magazine(
&self,
manga_id: i32,
magazine_id: i32,
) -> ApiResult<()>
pub async fn update_manga_magazine( &self, manga_id: i32, magazine_id: i32, ) -> ApiResult<()>
更新漫画杂志关联
检测作画作者是否存在
Sourcepub async fn test_ori_name(&self, manga_ori_name: &str) -> ApiResult<bool>
pub async fn test_ori_name(&self, manga_ori_name: &str) -> ApiResult<bool>
检测原名是否重复
Sourcepub async fn exists_tran_name_for_other(
&self,
manga_tran_name: &str,
exclude_id: Option<i32>,
) -> ApiResult<bool>
pub async fn exists_tran_name_for_other( &self, manga_tran_name: &str, exclude_id: Option<i32>, ) -> ApiResult<bool>
检测译名是否与其他漫画重复
Sourcepub async fn exists_ori_name_for_other(
&self,
manga_ori_name: &str,
exclude_id: Option<i32>,
) -> ApiResult<bool>
pub async fn exists_ori_name_for_other( &self, manga_ori_name: &str, exclude_id: Option<i32>, ) -> ApiResult<bool>
检测原名是否与其他漫画重复
Sourcepub async fn test_manga_magazine(&self, manga_id: i32) -> ApiResult<bool>
pub async fn test_manga_magazine(&self, manga_id: i32) -> ApiResult<bool>
检测漫画是否已有杂志关联
检测漫画是否已有原作作者关联(type=1)
Sourcepub async fn get_manga_tran_names(&self) -> ApiResult<Vec<MangaSimpleVo>>
pub async fn get_manga_tran_names(&self) -> ApiResult<Vec<MangaSimpleVo>>
查询全部译名
Sourcepub async fn get_max_manga_id(&self) -> ApiResult<Option<i32>>
pub async fn get_max_manga_id(&self) -> ApiResult<Option<i32>>
获取最大漫画 ID
Sourcepub async fn get_collect_detail(
&self,
manga_id: i32,
member_id: i32,
) -> ApiResult<Option<MangaCollect>>
pub async fn get_collect_detail( &self, manga_id: i32, member_id: i32, ) -> ApiResult<Option<MangaCollect>>
查询收藏详情
Sourcepub async fn get_collect_list(
&self,
member_id: i32,
) -> ApiResult<Vec<MangaCardVo>>
pub async fn get_collect_list( &self, member_id: i32, ) -> ApiResult<Vec<MangaCardVo>>
查询组员收藏列表
Sourcepub async fn get_collected_members(
&self,
manga_id: i32,
) -> ApiResult<Vec<CollectedMembersVo>>
pub async fn get_collected_members( &self, manga_id: i32, ) -> ApiResult<Vec<CollectedMembersVo>>
查询收藏该漫画的组员
Sourcepub async fn list_glossary(
&self,
manga_id: i32,
type_: Option<i16>,
) -> ApiResult<Vec<GlossaryVo>>
pub async fn list_glossary( &self, manga_id: i32, type_: Option<i16>, ) -> ApiResult<Vec<GlossaryVo>>
查询术语列表
Sourcepub async fn delete_glossary_by_id(&self, id: i32) -> ApiResult<()>
pub async fn delete_glossary_by_id(&self, id: i32) -> ApiResult<()>
按 ID 删除术语
Sourcepub async fn insert_glossary(
&self,
req: &GlossaryRequest,
update_by: i32,
) -> ApiResult<i32>
pub async fn insert_glossary( &self, req: &GlossaryRequest, update_by: i32, ) -> ApiResult<i32>
新增术语
Sourcepub async fn get_glossary_by_id(&self, id: i32) -> ApiResult<Option<GlossaryVo>>
pub async fn get_glossary_by_id(&self, id: i32) -> ApiResult<Option<GlossaryVo>>
按 ID 查询术语
Sourcepub async fn update_glossary(
&self,
req: &GlossaryRequest,
update_by: i32,
) -> ApiResult<()>
pub async fn update_glossary( &self, req: &GlossaryRequest, update_by: i32, ) -> ApiResult<()>
更新术语
Sourcepub async fn get_manga_rss(&self) -> ApiResult<Vec<RssMangaRow>>
pub async fn get_manga_rss(&self) -> ApiResult<Vec<RssMangaRow>>
漫画 RSS 列表(对齐 Java MangaMapper.getMangaRss)
Sourcepub async fn get_manga_updated_rss(&self) -> ApiResult<Vec<RssMangaRow>>
pub async fn get_manga_updated_rss(&self) -> ApiResult<Vec<RssMangaRow>>
最近更新漫画 RSS(按 updateTime 降序)
Sourcepub async fn get_episode_rss(&self) -> ApiResult<Vec<EpisodeRssRow>>
pub async fn get_episode_rss(&self) -> ApiResult<Vec<EpisodeRssRow>>
话数 RSS 列表(对齐 Java MangaMapper.getEpisodeRss)
Sourcepub async fn get_work_reminder_rss(
&self,
post_name: &str,
) -> ApiResult<Vec<WorkReminderRssRow>>
pub async fn get_work_reminder_rss( &self, post_name: &str, ) -> ApiResult<Vec<WorkReminderRssRow>>
交稿提醒 RSS(对齐 Java MangaMapper.getWorkReminderRss)
Sourcepub async fn get_pending_stationed_members(&self) -> ApiResult<Vec<Member>>
pub async fn get_pending_stationed_members(&self) -> ApiResult<Vec<Member>>
查询待审批常驻组员(mangaId=0)
Sourcepub async fn del_station(&self, station_id: i32) -> ApiResult<()>
pub async fn del_station(&self, station_id: i32) -> ApiResult<()>
删除常驻记录
Sourcepub async fn get_station_by_id(
&self,
station_id: i32,
) -> ApiResult<Option<StationRecord>>
pub async fn get_station_by_id( &self, station_id: i32, ) -> ApiResult<Option<StationRecord>>
按 ID 查询常驻记录(漫画、组员、岗位)
Sourcepub async fn fill_empty_episodes(
&self,
req: &AddStationRequest,
) -> ApiResult<()>
pub async fn fill_empty_episodes( &self, req: &AddStationRequest, ) -> ApiResult<()>
填充漫画内该岗位为空且未交稿的单话(指派组员)
Sourcepub async fn fill_episode_detail(
&self,
req: &AddStationRequest,
) -> ApiResult<()>
pub async fn fill_episode_detail( &self, req: &AddStationRequest, ) -> ApiResult<()>
填充后写入岗位指派时间(图源岗位跳过)
Sourcepub async fn clear_member_unsubmitted_episodes(
&self,
manga_id: i32,
member_id: i32,
post: i32,
) -> ApiResult<()>
pub async fn clear_member_unsubmitted_episodes( &self, manga_id: i32, member_id: i32, post: i32, ) -> ApiResult<()>
清空组员在该漫画、该岗位上的未交稿单话分配
Sourcepub async fn add_station(
&self,
manga_id: i32,
member_id: i32,
post: i32,
) -> ApiResult<()>
pub async fn add_station( &self, manga_id: i32, member_id: i32, post: i32, ) -> ApiResult<()>
组员申请常驻
Sourcepub async fn add_station_by_admin(
&self,
req: &AddStationRequest,
) -> ApiResult<()>
pub async fn add_station_by_admin( &self, req: &AddStationRequest, ) -> ApiResult<()>
管理员添加常驻
Auto Trait Implementations§
impl Freeze for MangaRepository
impl !RefUnwindSafe for MangaRepository
impl Send for MangaRepository
impl Sync for MangaRepository
impl Unpin for MangaRepository
impl UnsafeUnpin for MangaRepository
impl !UnwindSafe for MangaRepository
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