Skip to content
Clone
a06673b
97 lines 2.6 KB Rust
use uuid::Uuid;
use crate::error::RepoResult;
use crate::features::RepoService;
use super::types::{
ArchiveRepoOption, CreateRepoOption, ForkRepoOption, GenerateRepoOption, ListRepoQuery,
RenameRepoOption, RepoPage, RepoView, TransferRepoOption, UpdateRepoOption,
};
use super::usecase;
impl RepoService {
pub async fn create_repo(&self, actor: Uuid, input: CreateRepoOption) -> RepoResult<RepoView> {
usecase::create_repo(self, actor, input).await
}
pub async fn get_repo(
&self,
actor: Uuid,
channel_id: Uuid,
repo_id: Uuid,
) -> RepoResult<RepoView> {
usecase::get_repo(self, actor, channel_id, repo_id).await
}
pub async fn list_repos(&self, actor: Uuid, q: ListRepoQuery) -> RepoResult<RepoPage> {
usecase::list_repos(self, actor, q).await
}
pub async fn update_repo(
&self,
actor: Uuid,
channel_id: Uuid,
repo_id: Uuid,
input: UpdateRepoOption,
) -> RepoResult<RepoView> {
usecase::update_repo(self, actor, channel_id, repo_id, input).await
}
pub async fn delete_repo(
&self,
actor: Uuid,
channel_id: Uuid,
repo_id: Uuid,
) -> RepoResult<()> {
usecase::delete_repo(self, actor, channel_id, repo_id).await
}
pub async fn transfer_repo(
&self,
actor: Uuid,
channel_id: Uuid,
repo_id: Uuid,
input: TransferRepoOption,
) -> RepoResult<RepoView> {
usecase::transfer_repo(self, actor, channel_id, repo_id, input).await
}
pub async fn archive_repo(
&self,
actor: Uuid,
channel_id: Uuid,
repo_id: Uuid,
input: ArchiveRepoOption,
) -> RepoResult<RepoView> {
usecase::archive_repo(self, actor, channel_id, repo_id, input).await
}
pub async fn rename_repo(
&self,
actor: Uuid,
channel_id: Uuid,
repo_id: Uuid,
input: RenameRepoOption,
) -> RepoResult<RepoView> {
usecase::rename_repo(self, actor, channel_id, repo_id, input).await
}
pub async fn fork_repo(
&self,
actor: Uuid,
channel_id: Uuid,
repo_id: Uuid,
input: ForkRepoOption,
) -> RepoResult<RepoView> {
usecase::fork_repo(self, actor, channel_id, repo_id, input).await
}
pub async fn generate_repo(
&self,
actor: Uuid,
repo_id: Uuid,
input: GenerateRepoOption,
) -> RepoResult<RepoView> {
usecase::generate_repo(self, actor, repo_id, input).await
}
}