Skip to content
Clone
a06673b
39 lines 1.1 KB Rust
use uuid::Uuid;
use crate::error::SpaceResult;
use crate::features::SpaceService;
use super::types::{CreateSpaceCmd, SpacePage, SpaceView, UpdateSpaceCmd};
use super::usecase;
impl SpaceService {
pub async fn create_space(&self, caller: Uuid, cmd: CreateSpaceCmd) -> SpaceResult<SpaceView> {
usecase::create_space(self, caller, cmd).await
}
pub async fn get_space(&self, caller: Option<Uuid>, id: Uuid) -> SpaceResult<SpaceView> {
usecase::get_space(self, caller, id).await
}
pub async fn update_space(
&self,
caller: Uuid,
id: Uuid,
cmd: UpdateSpaceCmd,
) -> SpaceResult<SpaceView> {
usecase::update_space(self, caller, id, cmd).await
}
pub async fn delete_space(&self, caller: Uuid, id: Uuid) -> SpaceResult<()> {
usecase::delete_space(self, caller, id).await
}
pub async fn list_spaces(
&self,
caller: Uuid,
limit: u64,
offset: u64,
) -> SpaceResult<SpacePage> {
usecase::list_spaces(self, caller, limit, offset).await
}
}