030e59e
zhenyi
refactor(lib): migrate storage and security tier to central lib/config (auth, cache, db, email, jwt, payment, queue, rate_limit, storage)
030e59e
use uuid::Uuid;
use super::usecase;
use super::{CreateDocumentCmd, DocumentPage, DocumentView, UpdateDocumentCmd};
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
}
}