pub struct MemberService;Expand description
组员服务
提供组员账号生命周期管理的完整业务逻辑。
所有方法为关联函数,通过 &AppState 获取数据库连接和配置。
Implementations§
Source§impl MemberService
impl MemberService
Sourcepub async fn page(
state: &AppState,
page: i32,
page_size: i32,
username: Option<String>,
post: Option<i16>,
intern: Option<i16>,
email: Option<String>,
) -> ApiResult<PageBean<MemberListVo>>
pub async fn page( state: &AppState, page: i32, page_size: i32, username: Option<String>, post: Option<i16>, intern: Option<i16>, email: Option<String>, ) -> ApiResult<PageBean<MemberListVo>>
分页查询组员
Sourcepub async fn get_member_list(state: &AppState) -> ApiResult<Vec<MemberCache>>
pub async fn get_member_list(state: &AppState) -> ApiResult<Vec<MemberCache>>
全量组员缓存列表
Sourcepub async fn new_member(
state: &AppState,
req: MemberAddRequest,
) -> ApiResult<()>
pub async fn new_member( state: &AppState, req: MemberAddRequest, ) -> ApiResult<()>
新增组员
Sourcepub async fn update_member(
state: &AppState,
req: MemberUpdateRequest,
) -> ApiResult<()>
pub async fn update_member( state: &AppState, req: MemberUpdateRequest, ) -> ApiResult<()>
更新组员信息
Sourcepub async fn update_member_self(
state: &AppState,
req: MemberSelfUpdateRequest,
) -> ApiResult<()>
pub async fn update_member_self( state: &AppState, req: MemberSelfUpdateRequest, ) -> ApiResult<()>
组员自助更新昵称与 QQ
Sourcepub async fn find_stationed_mangas(
state: &AppState,
id: i32,
) -> ApiResult<Vec<StationedManga>>
pub async fn find_stationed_mangas( state: &AppState, id: i32, ) -> ApiResult<Vec<StationedManga>>
查询组员常驻漫画
Sourcepub async fn update_member_password(
state: &AppState,
reset: ResetPassword,
) -> ApiResult<()>
pub async fn update_member_password( state: &AppState, reset: ResetPassword, ) -> ApiResult<()>
修改密码
Sourcepub async fn page_episode(
state: &AppState,
page: i32,
page_size: i32,
id: i32,
) -> ApiResult<PageBean<MemberEpisodeVo>>
pub async fn page_episode( state: &AppState, page: i32, page_size: i32, id: i32, ) -> ApiResult<PageBean<MemberEpisodeVo>>
分页查询组员话数
Sourcepub async fn take_episode(state: &AppState, ep: MemberEpisode) -> ApiResult<()>
pub async fn take_episode(state: &AppState, ep: MemberEpisode) -> ApiResult<()>
接稿
Sourcepub async fn submit_episode(
state: &AppState,
ep: MemberEpisode,
) -> ApiResult<()>
pub async fn submit_episode( state: &AppState, ep: MemberEpisode, ) -> ApiResult<()>
交稿
Sourcepub async fn get_invitation_codes(
state: &AppState,
) -> ApiResult<Vec<InvitationCode>>
pub async fn get_invitation_codes( state: &AppState, ) -> ApiResult<Vec<InvitationCode>>
邀请码列表
Sourcepub async fn add_invitation_code(
state: &AppState,
code: InvitationCode,
) -> ApiResult<()>
pub async fn add_invitation_code( state: &AppState, code: InvitationCode, ) -> ApiResult<()>
新增邀请码
Auto Trait Implementations§
impl Freeze for MemberService
impl RefUnwindSafe for MemberService
impl Send for MemberService
impl Sync for MemberService
impl Unpin for MemberService
impl UnsafeUnpin for MemberService
impl UnwindSafe for MemberService
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