a06673b
use uuid::Uuid;
use crate::error::UserResult;
use crate::features::UserService;
use super::types::{BlockedSummary, FollowerSummary, ListBlocksQuery, ListFollowersQuery, ListFollowingQuery};
use super::usecase;
impl UserService {
pub async fn follow_user(&self, follower: Uuid, target: Uuid) -> UserResult<()> {
usecase::follow(self, follower, target).await
}
pub async fn unfollow_user(&self, follower: Uuid, target: Uuid) -> UserResult<()> {
usecase::unfollow(self, follower, target).await
}
pub async fn list_followers(
&self,
q: ListFollowersQuery,
) -> UserResult<Vec<FollowerSummary>> {
usecase::list_followers(self, q).await
}
pub async fn list_following(
&self,
q: ListFollowingQuery,
) -> UserResult<Vec<FollowerSummary>> {
usecase::list_following(self, q).await
}
pub async fn block_user(&self, blocker: Uuid, target: Uuid) -> UserResult<()> {
usecase::block(self, blocker, target).await
}
pub async fn unblock_user(&self, blocker: Uuid, target: Uuid) -> UserResult<()> {
usecase::unblock(self, blocker, target).await
}
pub async fn list_blocks(
&self,
caller: Uuid,
q: ListBlocksQuery,
) -> UserResult<Vec<BlockedSummary>> {
usecase::list_blocks(self, caller, q).await
}
}