feat(project): add favorites impls
zhenyi committed
Added lib/project/features/favorites/impls.rs lib/project/features/favorites/impls.rs +35 −0 View lib/project/features/favorites/impls.rs
@@ -0,0 +1,35 @@
1use uuid::Uuid;
2
3use super::{AddFavoriteCmd, FavoritePage, FavoriteView};
4use super::usecase;
5
6impl crate::service::ProjectService {
7 pub async fn add_favorite(
8 &self,
9 actor: Uuid,
10 space_id: Uuid,
11 project_id: Uuid,
12 cmd: AddFavoriteCmd,
13 ) -> crate::error::ProjectResult<FavoriteView> {
14 usecase::add_favorite(self, actor, space_id, project_id, cmd).await
15 }
16
17 pub async fn list_favorites(
18 &self,
19 actor: Uuid,
20 space_id: Uuid,
21 project_id: Uuid,
22 ) -> crate::error::ProjectResult<FavoritePage> {
23 usecase::list_favorites(self, actor, space_id, project_id).await
24 }
25
26 pub async fn remove_favorite(
27 &self,
28 actor: Uuid,
29 space_id: Uuid,
30 project_id: Uuid,
31 favorite_id: Uuid,
32 ) -> crate::error::ProjectResult<()> {
33 usecase::remove_favorite(self, actor, space_id, project_id, favorite_id).await
34 }
35}
No newline at end of file