d5939db
use uuid::Uuid;
use super::{CreateDocumentCmd, DocumentPage, DocumentView, UpdateDocumentCmd};
use super::usecase;
impl crate::service::ProjectService {
pub async fn create_document(
&self,
actor: Uuid,
space_id: Uuid,
project_id: Uuid,
cmd: CreateDocumentCmd,
) -> crate::error::ProjectResult<DocumentView> {
usecase::create_document(self, actor, space_id, project_id, cmd).await
}
pub async fn list_documents(
&self,
actor: Uuid,
space_id: Uuid,
project_id: Uuid,
) -> crate::error::ProjectResult<DocumentPage> {
usecase::list_documents(self, actor, space_id, project_id).await
}
pub async fn get_document(
&self,
actor: Uuid,
space_id: Uuid,
project_id: Uuid,
doc_id: Uuid,
) -> crate::error::ProjectResult<DocumentView> {
usecase::get_document(self, actor, space_id, project_id, doc_id).await
}
pub async fn update_document(
&self,
actor: Uuid,
space_id: Uuid,
project_id: Uuid,
doc_id: Uuid,
cmd: UpdateDocumentCmd,
) -> crate::error::ProjectResult<DocumentView> {
usecase::update_document(self, actor, space_id, project_id, doc_id, cmd).await
}
pub async fn delete_document(
&self,
actor: Uuid,
space_id: Uuid,
project_id: Uuid,
doc_id: Uuid,
) -> crate::error::ProjectResult<()> {
usecase::delete_document(self, actor, space_id, project_id, doc_id).await
}
}