Skip to content
Clone

feat(project): add views impls

zhenyi committed
parent a1249ae commit b4f0dbd Browse files

1 file changed

+56 −0

Added lib/project/features/views/impls.rs View lib/project/features/views/impls.rs
@@ -0,0 +1,56 @@
1use uuid::Uuid;
2
3use super::{CreateViewCmd, UpdateViewCmd, ViewPage, ViewView};
4use super::usecase;
5
6impl crate::service::ProjectService {
7 pub async fn create_view(
8 &self,
9 actor: Uuid,
10 space_id: Uuid,
11 project_id: Uuid,
12 cmd: CreateViewCmd,
13 ) -> crate::error::ProjectResult<ViewView> {
14 usecase::create_view(self, actor, space_id, project_id, cmd).await
15 }
16
17 pub async fn list_views(
18 &self,
19 actor: Uuid,
20 space_id: Uuid,
21 project_id: Uuid,
22 ) -> crate::error::ProjectResult<ViewPage> {
23 usecase::list_views(self, actor, space_id, project_id).await
24 }
25
26 pub async fn get_view(
27 &self,
28 actor: Uuid,
29 space_id: Uuid,
30 project_id: Uuid,
31 view_id: Uuid,
32 ) -> crate::error::ProjectResult<ViewView> {
33 usecase::get_view(self, actor, space_id, project_id, view_id).await
34 }
35
36 pub async fn update_view(
37 &self,
38 actor: Uuid,
39 space_id: Uuid,
40 project_id: Uuid,
41 view_id: Uuid,
42 cmd: UpdateViewCmd,
43 ) -> crate::error::ProjectResult<ViewView> {
44 usecase::update_view(self, actor, space_id, project_id, view_id, cmd).await
45 }
46
47 pub async fn delete_view(
48 &self,
49 actor: Uuid,
50 space_id: Uuid,
51 project_id: Uuid,
52 view_id: Uuid,
53 ) -> crate::error::ProjectResult<()> {
54 usecase::delete_view(self, actor, space_id, project_id, view_id).await
55 }
56}
No newline at end of file