Skip to main content

EpisodeRepository

Struct EpisodeRepository 

Source
pub struct EpisodeRepository { /* private fields */ }
Expand description

话数仓储

Implementations§

Source§

impl EpisodeRepository

Source

pub fn new(pool: PgPool) -> Self

PgPool 构造

Source

pub fn from_db(db: DatabaseConnection) -> Self

DatabaseConnection 构造

Source

pub async fn list_by_manga_id( &self, manga_id: i32, ) -> ApiResult<Vec<EpisodeSimpleListVo>>

按漫画 ID 查询话数简单列表

Source

pub async fn list_full_by_manga_id( &self, manga_id: i32, ) -> ApiResult<Vec<EpisodeListVo>>

按漫画 ID 查询话数完整列表

Source

pub async fn page_episodes_by_manga( &self, manga_id: i32, page: i32, page_size: i32, episode_type: EpisodeType, ) -> ApiResult<(i64, Vec<EpisodeListVo>)>

按漫画 ID 分页查询话数列表

Source

pub async fn get_by_id(&self, id: i32) -> ApiResult<Option<EpisodeDetailVo>>

按 ID 查询话数详情

Source

pub async fn get_manga_id_by_episode_id( &self, episode_id: i32, ) -> ApiResult<Option<i32>>

按话数 ID 查询所属漫画 ID

Source

pub async fn lock_by_id_with<C: ConnectionTrait>( db: &C, episode_id: i32, ) -> ApiResult<Option<Model>>

在事务中锁定话数主记录,串行化图源页面重建。

Source

pub async fn has_downstream_submission_with<C: ConnectionTrait>( db: &C, episode_id: i32, ) -> ApiResult<bool>

判断话数是否已有下游岗位交稿,避免重建图源破坏已开始的工作。

Source

pub async fn touch_detail_submit_time( &self, episode_id: i32, role: &str, ) -> ApiResult<()>

回写话数交稿时间到 mangaepisodedetail(编辑器整话确认)

roletranslatortranslatorUpdateTimeproofreaderproofreaderUpdateTime。 详情行不存在时插入新行。

Source

pub async fn get_provider_oss_id( &self, episode_id: i32, ) -> ApiResult<Option<i32>>

查询话数图源 OSS 记录 ID(provider_file_oss_id)

Source

pub async fn get_post_member_ids(&self, episode_id: i32) -> ApiResult<Vec<i32>>

查询话数各岗位已指派组员 ID(去重)

Source

pub async fn get_legacy_file_path( &self, id: i32, post_name: &str, ) -> ApiResult<Option<String>>

查询话数本地稿件路径

Source

pub async fn set_legacy_file_path( &self, id: i32, post_name: &str, path: &str, ) -> ApiResult<()>

更新话数本地稿件路径

Source

pub async fn get_newest_by_manga_id( &self, manga_id: i32, ) -> ApiResult<Option<NewestEpisodeVo>>

查询漫画最新话

Source

pub async fn page_uploaded_submit( &self, page: i32, page_size: i32, manga_tran_name: Option<&str>, username: Option<&str>, ) -> ApiResult<(i64, Vec<UploadPageVo>)>

分页查询已上传稿件

Source

pub async fn count_episode_by_number( &self, manga_id: i32, manga_episode: &str, episode_type: EpisodeType, ) -> ApiResult<i64>

统计同漫画、同分类下相同话数标签数量

Source

pub async fn touch_manga_update_time(&self, manga_id: i32) -> ApiResult<()>

刷新漫画更新时间

Source

pub async fn insert(&self, dto: &EpisodeEditDto) -> ApiResult<i32>

新增话数

Source

pub async fn insert_detail( &self, episode_id: i32, dto: &EpisodeEditDto, ) -> ApiResult<()>

新增话数详情及岗位接稿时间

Source

pub async fn insert_batch( &self, dtos: &[EpisodeEditDto], manga_id: i32, ) -> ApiResult<()>

在单个事务中新增一批话数及详情。

仅更新发布链接

Source

pub async fn update(&self, dto: &EpisodeEditDto) -> ApiResult<()>

更新话数

Source

pub async fn delete_by_id(&self, id: i32) -> ApiResult<()>

删除话数及详情

批量更新发布链接

检测发布链接是否重复

Source

pub async fn get_statistic_count( &self, start: DateTime<Utc>, end: DateTime<Utc>, ) -> ApiResult<PostCompletionStats>

统计时间段内各岗位完成数

Source

pub async fn get_statistic_counts_batch( &self, ranges: &[(DateTime<Utc>, DateTime<Utc>)], ) -> ApiResult<Vec<PostCompletionStats>>

批量统计多时间段(单 SQL FILTER)

Source

pub fn stats_from_post(stats: &PostCompletionStats) -> Statistics

转为 Statistics

Source

pub async fn get_member_statistics( &self, start: DateTime<Utc>, end: DateTime<Utc>, member_id: Option<i32>, ) -> ApiResult<Vec<MemberStatistics>>

查询组员完成统计

Source

pub async fn rollback_episode( &self, episode_id: i32, workflow_type: &str, member_id: Option<i32>, ) -> ApiResult<Option<i32>>

回退指定岗位流程

Source

pub async fn list_unpublished_with_detail( &self, ) -> ApiResult<Vec<EpisodeListVo>>

查询未发布话数

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more