Skip to content
Clone

feat(project): add members impls

zhenyi committed
parent d6a3245 commit 26ee5da Browse files

1 file changed

+56 −0

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