Skip to main content

EpisodeRepository

Struct EpisodeRepository 

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

话数仓储

Implementations§

Source§

impl EpisodeRepository

Source

pub fn new(pool: Pool<MySql>) -> Self

构造仓储

Source

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

按漫画 ID 查询话数简单列表(含文件信息)。

§返回值

返回漫画下所有话数,按 manga_episode 数字降序排列。

Source

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

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

Source

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

按 ID 查询话数详情。

§返回值
  • Ok(Some(detail)) — 找到话数
  • Ok(None) — 话数不存在
Source

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

查询话数本地稿件路径(translatorFile / proofreaderFile / timerFile)

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>)>

分页查询已上传稿件(SQL LIMIT/OFFSET,对齐 Java PageHelper)

Source

pub async fn count_episode_by_number( &self, manga_id: i32, manga_episode: &str, ) -> 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>

新增话数(对齐 Java insertEpisode)

Source

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

新增话数详情及岗位接稿时间(对齐 Java insertEpisodeDetail)

仅更新发布链接

Source

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

更新话数(对齐 Java updateMangaEpisode)

Source

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

删除话数及详情

批量更新发布链接

检测发布链接是否重复

Source

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

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

Source

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

转为 Statistics(对齐 Java getStatisticCount)

Source

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

查询组员完成统计(对齐 Java MembertbDao.selectMemberStatistics)

Source

pub async fn rollback_episode( &self, episode_id: i32, workflow_type: &str, ) -> 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> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

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