pub struct EpisodeRepository { /* private fields */ }Expand description
话数仓储
Implementations§
Source§impl EpisodeRepository
impl EpisodeRepository
Sourcepub async fn list_by_manga_id(
&self,
manga_id: i32,
) -> ApiResult<Vec<EpisodeSimpleListVo>>
pub async fn list_by_manga_id( &self, manga_id: i32, ) -> ApiResult<Vec<EpisodeSimpleListVo>>
按漫画 ID 查询话数简单列表
Sourcepub async fn list_full_by_manga_id(
&self,
manga_id: i32,
) -> ApiResult<Vec<EpisodeListVo>>
pub async fn list_full_by_manga_id( &self, manga_id: i32, ) -> ApiResult<Vec<EpisodeListVo>>
按漫画 ID 查询话数完整列表
Sourcepub async fn page_episodes_by_manga(
&self,
manga_id: i32,
page: i32,
page_size: i32,
episode_type: EpisodeType,
) -> ApiResult<(i64, Vec<EpisodeListVo>)>
pub async fn page_episodes_by_manga( &self, manga_id: i32, page: i32, page_size: i32, episode_type: EpisodeType, ) -> ApiResult<(i64, Vec<EpisodeListVo>)>
按漫画 ID 分页查询话数列表
Sourcepub async fn get_manga_id_by_episode_id(
&self,
episode_id: i32,
) -> ApiResult<Option<i32>>
pub async fn get_manga_id_by_episode_id( &self, episode_id: i32, ) -> ApiResult<Option<i32>>
按话数 ID 查询所属漫画 ID
Sourcepub async fn lock_by_id_with<C: ConnectionTrait>(
db: &C,
episode_id: i32,
) -> ApiResult<Option<Model>>
pub async fn lock_by_id_with<C: ConnectionTrait>( db: &C, episode_id: i32, ) -> ApiResult<Option<Model>>
在事务中锁定话数主记录,串行化图源页面重建。
Sourcepub async fn has_downstream_submission_with<C: ConnectionTrait>(
db: &C,
episode_id: i32,
) -> ApiResult<bool>
pub async fn has_downstream_submission_with<C: ConnectionTrait>( db: &C, episode_id: i32, ) -> ApiResult<bool>
判断话数是否已有下游岗位交稿,避免重建图源破坏已开始的工作。
Sourcepub async fn touch_detail_submit_time(
&self,
episode_id: i32,
role: &str,
) -> ApiResult<()>
pub async fn touch_detail_submit_time( &self, episode_id: i32, role: &str, ) -> ApiResult<()>
回写话数交稿时间到 mangaepisodedetail(编辑器整话确认)
role 为 translator 写 translatorUpdateTime,proofreader 写 proofreaderUpdateTime。
详情行不存在时插入新行。
Sourcepub async fn get_provider_oss_id(
&self,
episode_id: i32,
) -> ApiResult<Option<i32>>
pub async fn get_provider_oss_id( &self, episode_id: i32, ) -> ApiResult<Option<i32>>
查询话数图源 OSS 记录 ID(provider_file_oss_id)
Sourcepub async fn get_post_member_ids(&self, episode_id: i32) -> ApiResult<Vec<i32>>
pub async fn get_post_member_ids(&self, episode_id: i32) -> ApiResult<Vec<i32>>
查询话数各岗位已指派组员 ID(去重)
Sourcepub async fn get_legacy_file_path(
&self,
id: i32,
post_name: &str,
) -> ApiResult<Option<String>>
pub async fn get_legacy_file_path( &self, id: i32, post_name: &str, ) -> ApiResult<Option<String>>
查询话数本地稿件路径
Sourcepub async fn set_legacy_file_path(
&self,
id: i32,
post_name: &str,
path: &str,
) -> ApiResult<()>
pub async fn set_legacy_file_path( &self, id: i32, post_name: &str, path: &str, ) -> ApiResult<()>
更新话数本地稿件路径
Sourcepub async fn get_newest_by_manga_id(
&self,
manga_id: i32,
) -> ApiResult<Option<NewestEpisodeVo>>
pub async fn get_newest_by_manga_id( &self, manga_id: i32, ) -> ApiResult<Option<NewestEpisodeVo>>
查询漫画最新话
Sourcepub async fn page_uploaded_submit(
&self,
page: i32,
page_size: i32,
manga_tran_name: Option<&str>,
username: Option<&str>,
) -> ApiResult<(i64, Vec<UploadPageVo>)>
pub async fn page_uploaded_submit( &self, page: i32, page_size: i32, manga_tran_name: Option<&str>, username: Option<&str>, ) -> ApiResult<(i64, Vec<UploadPageVo>)>
分页查询已上传稿件
Sourcepub async fn count_episode_by_number(
&self,
manga_id: i32,
manga_episode: &str,
episode_type: EpisodeType,
) -> ApiResult<i64>
pub async fn count_episode_by_number( &self, manga_id: i32, manga_episode: &str, episode_type: EpisodeType, ) -> ApiResult<i64>
统计同漫画、同分类下相同话数标签数量
Sourcepub async fn touch_manga_update_time(&self, manga_id: i32) -> ApiResult<()>
pub async fn touch_manga_update_time(&self, manga_id: i32) -> ApiResult<()>
刷新漫画更新时间
Sourcepub async fn insert(&self, dto: &EpisodeEditDto) -> ApiResult<i32>
pub async fn insert(&self, dto: &EpisodeEditDto) -> ApiResult<i32>
新增话数
Sourcepub async fn insert_detail(
&self,
episode_id: i32,
dto: &EpisodeEditDto,
) -> ApiResult<()>
pub async fn insert_detail( &self, episode_id: i32, dto: &EpisodeEditDto, ) -> ApiResult<()>
新增话数详情及岗位接稿时间
Sourcepub async fn insert_batch(
&self,
dtos: &[EpisodeEditDto],
manga_id: i32,
) -> ApiResult<()>
pub async fn insert_batch( &self, dtos: &[EpisodeEditDto], manga_id: i32, ) -> ApiResult<()>
在单个事务中新增一批话数及详情。
Sourcepub async fn update_publish_link_only(
&self,
id: i32,
publish_link: Option<String>,
) -> ApiResult<()>
pub async fn update_publish_link_only( &self, id: i32, publish_link: Option<String>, ) -> ApiResult<()>
仅更新发布链接
Sourcepub async fn update(&self, dto: &EpisodeEditDto) -> ApiResult<()>
pub async fn update(&self, dto: &EpisodeEditDto) -> ApiResult<()>
更新话数
Sourcepub async fn delete_by_id(&self, id: i32) -> ApiResult<()>
pub async fn delete_by_id(&self, id: i32) -> ApiResult<()>
删除话数及详情
Sourcepub async fn update_publish_links_batch(
&self,
requests: &[PublishLinkRequest],
) -> ApiResult<()>
pub async fn update_publish_links_batch( &self, requests: &[PublishLinkRequest], ) -> ApiResult<()>
批量更新发布链接
Sourcepub async fn count_publish_link(
&self,
publish_link: &str,
exclude_id: Option<i32>,
) -> ApiResult<i64>
pub async fn count_publish_link( &self, publish_link: &str, exclude_id: Option<i32>, ) -> ApiResult<i64>
检测发布链接是否重复
Sourcepub async fn get_statistic_count(
&self,
start: DateTime<Utc>,
end: DateTime<Utc>,
) -> ApiResult<PostCompletionStats>
pub async fn get_statistic_count( &self, start: DateTime<Utc>, end: DateTime<Utc>, ) -> ApiResult<PostCompletionStats>
统计时间段内各岗位完成数
Sourcepub async fn get_statistic_counts_batch(
&self,
ranges: &[(DateTime<Utc>, DateTime<Utc>)],
) -> ApiResult<Vec<PostCompletionStats>>
pub async fn get_statistic_counts_batch( &self, ranges: &[(DateTime<Utc>, DateTime<Utc>)], ) -> ApiResult<Vec<PostCompletionStats>>
批量统计多时间段(单 SQL FILTER)
Sourcepub fn stats_from_post(stats: &PostCompletionStats) -> Statistics
pub fn stats_from_post(stats: &PostCompletionStats) -> Statistics
转为 Statistics
Sourcepub async fn get_member_statistics(
&self,
start: DateTime<Utc>,
end: DateTime<Utc>,
member_id: Option<i32>,
) -> ApiResult<Vec<MemberStatistics>>
pub async fn get_member_statistics( &self, start: DateTime<Utc>, end: DateTime<Utc>, member_id: Option<i32>, ) -> ApiResult<Vec<MemberStatistics>>
查询组员完成统计
Sourcepub async fn rollback_episode(
&self,
episode_id: i32,
workflow_type: &str,
member_id: Option<i32>,
) -> ApiResult<Option<i32>>
pub async fn rollback_episode( &self, episode_id: i32, workflow_type: &str, member_id: Option<i32>, ) -> ApiResult<Option<i32>>
回退指定岗位流程
Sourcepub async fn list_unpublished_with_detail(
&self,
) -> ApiResult<Vec<EpisodeListVo>>
pub async fn list_unpublished_with_detail( &self, ) -> ApiResult<Vec<EpisodeListVo>>
查询未发布话数
Auto Trait Implementations§
impl Freeze for EpisodeRepository
impl !RefUnwindSafe for EpisodeRepository
impl Send for EpisodeRepository
impl Sync for EpisodeRepository
impl Unpin for EpisodeRepository
impl UnsafeUnpin for EpisodeRepository
impl !UnwindSafe for EpisodeRepository
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