Skip to content
Clone
030e59e
50 lines 1.3 KB Rust
use uuid::Uuid;
use super::usecase;
use super::{CreateProjectCmd, ListProjectQuery, ProjectPage, ProjectView, UpdateProjectCmd};
impl crate::service::ProjectService {
pub async fn create_project(
&self,
actor: Uuid,
cmd: CreateProjectCmd,
) -> crate::error::ProjectResult<ProjectView> {
usecase::create_project(self, actor, cmd).await
}
pub async fn get_project(
&self,
actor: Uuid,
space_id: Uuid,
project_id: Uuid,
) -> crate::error::ProjectResult<ProjectView> {
usecase::get_project(self, actor, space_id, project_id).await
}
pub async fn list_projects(
&self,
actor: Uuid,
q: ListProjectQuery,
) -> crate::error::ProjectResult<ProjectPage> {
usecase::list_projects(self, actor, q).await
}
pub async fn update_project(
&self,
actor: Uuid,
space_id: Uuid,
project_id: Uuid,
cmd: UpdateProjectCmd,
) -> crate::error::ProjectResult<ProjectView> {
usecase::update_project(self, actor, space_id, project_id, cmd).await
}
pub async fn delete_project(
&self,
actor: Uuid,
space_id: Uuid,
project_id: Uuid,
) -> crate::error::ProjectResult<()> {
usecase::delete_project(self, actor, space_id, project_id).await
}
}