Skip to content
Clone
d5939db
43 lines 1.2 KB Rust
use db::attachment::attachments::OwnerType;
use uuid::Uuid;
use crate::error::IssueResult;
use crate::features::IssueService;
use super::{AttachmentPage, AttachmentView, ListAttachmentQuery, UploadAttachmentInput};
use super::usecase;
impl IssueService {
pub async fn upload_attachment(
&self,
actor: Uuid,
channel_id: Uuid,
owner_type: OwnerType,
owner_id: Uuid,
input: UploadAttachmentInput,
) -> IssueResult<AttachmentView> {
usecase::upload_attachment(self, actor, channel_id, owner_type, owner_id, input).await
}
pub async fn list_attachments(
&self,
actor: Uuid,
channel_id: Uuid,
owner_type: OwnerType,
owner_id: Uuid,
q: ListAttachmentQuery,
) -> IssueResult<AttachmentPage> {
usecase::list_attachments(self, actor, channel_id, owner_type, owner_id, q).await
}
pub async fn delete_attachment(
&self,
actor: Uuid,
channel_id: Uuid,
owner_type: OwnerType,
owner_id: Uuid,
att_id: Uuid,
) -> IssueResult<()> {
usecase::delete_attachment(self, actor, channel_id, owner_type, owner_id, att_id).await
}
}