Skip to content
Clone
a06673b
80 lines 2.0 KB Rust
use uuid::Uuid;
use crate::error::RepoResult;
use crate::features::RepoService;
use super::types::{
ApplyDiffPatchFileOptions, ChangeFilesOptions, ContentsListResponse, ContentsQuery,
ContentsResponse, CreateFileOption, DeleteFileOption, UpdateFileOption,
};
use super::usecase;
impl RepoService {
pub async fn list_contents(
&self,
actor: Uuid,
repo_id: Uuid,
path: &str,
q: ContentsQuery,
) -> RepoResult<ContentsListResponse> {
usecase::list_contents(self, actor, repo_id, path, q).await
}
pub async fn get_contents(
&self,
actor: Uuid,
repo_id: Uuid,
path: &str,
q: ContentsQuery,
) -> RepoResult<ContentsResponse> {
usecase::get_contents(self, actor, repo_id, path, q).await
}
pub async fn create_file(
&self,
actor: Uuid,
repo_id: Uuid,
path: &str,
input: CreateFileOption,
) -> RepoResult<ContentsResponse> {
usecase::create_file(self, actor, repo_id, path, input).await
}
pub async fn update_file(
&self,
actor: Uuid,
repo_id: Uuid,
path: &str,
input: UpdateFileOption,
) -> RepoResult<ContentsResponse> {
usecase::update_file(self, actor, repo_id, path, input).await
}
pub async fn delete_file(
&self,
actor: Uuid,
repo_id: Uuid,
path: &str,
input: DeleteFileOption,
) -> RepoResult<()> {
usecase::delete_file(self, actor, repo_id, path, input).await
}
pub async fn change_files(
&self,
actor: Uuid,
repo_id: Uuid,
input: ChangeFilesOptions,
) -> RepoResult<ContentsListResponse> {
usecase::change_files(self, actor, repo_id, input).await
}
pub async fn apply_diff_patch(
&self,
actor: Uuid,
repo_id: Uuid,
input: ApplyDiffPatchFileOptions,
) -> RepoResult<ContentsResponse> {
usecase::apply_diff_patch(self, actor, repo_id, input).await
}
}