cf0555d
use uuid::Uuid;
use crate::error::IssueResult;
use crate::features::IssueService;
use super::{
CommentPage, CommentView, CreateCommentOption, ListCommentQuery, UpdateCommentOption,
};
use super::usecase;
impl IssueService {
pub async fn create_comment(
&self,
actor: Uuid,
channel_id: Uuid,
issue_id: Uuid,
input: CreateCommentOption,
) -> IssueResult<CommentView> {
usecase::create_comment(self, actor, channel_id, issue_id, input).await
}
pub async fn get_comment(
&self,
actor: Uuid,
channel_id: Uuid,
issue_id: Uuid,
comment_id: Uuid,
) -> IssueResult<CommentView> {
usecase::get_comment(self, actor, channel_id, issue_id, comment_id).await
}
pub async fn list_comments(
&self,
actor: Uuid,
channel_id: Uuid,
issue_id: Uuid,
q: ListCommentQuery,
) -> IssueResult<CommentPage> {
usecase::list_comments(self, actor, channel_id, issue_id, q).await
}
pub async fn update_comment(
&self,
actor: Uuid,
channel_id: Uuid,
issue_id: Uuid,
comment_id: Uuid,
input: UpdateCommentOption,
) -> IssueResult<CommentView> {
usecase::update_comment(self, actor, channel_id, issue_id, comment_id, input).await
}
pub async fn delete_comment(
&self,
actor: Uuid,
channel_id: Uuid,
issue_id: Uuid,
comment_id: Uuid,
) -> IssueResult<()> {
usecase::delete_comment(self, actor, channel_id, issue_id, comment_id).await
}
}