backbone_bucket/exports/
services.rs1use std::sync::Arc;
9
10use anyhow::Result;
11use async_trait::async_trait;
12use uuid::Uuid;
13
14use super::types::*;
15
16#[async_trait]
25pub trait BucketQueryService: Send + Sync {
26 async fn get_access_log(&self, id: AccessLogId) -> Result<Option<AccessLogDto>>;
28
29 async fn get_access_log_summary(&self, id: AccessLogId) -> Result<Option<AccessLogSummary>>;
31
32 async fn access_log_exists(&self, id: AccessLogId) -> Result<bool>;
34
35 async fn get_bucket(&self, id: BucketId) -> Result<Option<BucketDto>>;
37
38 async fn get_bucket_summary(&self, id: BucketId) -> Result<Option<BucketSummary>>;
40
41 async fn bucket_exists(&self, id: BucketId) -> Result<bool>;
43
44 async fn get_content_hash(&self, id: ContentHashId) -> Result<Option<ContentHashDto>>;
46
47 async fn get_content_hash_summary(&self, id: ContentHashId) -> Result<Option<ContentHashSummary>>;
49
50 async fn content_hash_exists(&self, id: ContentHashId) -> Result<bool>;
52
53 async fn get_conversion_job(&self, id: ConversionJobId) -> Result<Option<ConversionJobDto>>;
55
56 async fn get_conversion_job_summary(&self, id: ConversionJobId) -> Result<Option<ConversionJobSummary>>;
58
59 async fn conversion_job_exists(&self, id: ConversionJobId) -> Result<bool>;
61
62 async fn get_file_comment(&self, id: FileCommentId) -> Result<Option<FileCommentDto>>;
64
65 async fn get_file_comment_summary(&self, id: FileCommentId) -> Result<Option<FileCommentSummary>>;
67
68 async fn file_comment_exists(&self, id: FileCommentId) -> Result<bool>;
70
71 async fn get_file_lock(&self, id: FileLockId) -> Result<Option<FileLockDto>>;
73
74 async fn get_file_lock_summary(&self, id: FileLockId) -> Result<Option<FileLockSummary>>;
76
77 async fn file_lock_exists(&self, id: FileLockId) -> Result<bool>;
79
80 async fn get_file_share(&self, id: FileShareId) -> Result<Option<FileShareDto>>;
82
83 async fn get_file_share_summary(&self, id: FileShareId) -> Result<Option<FileShareSummary>>;
85
86 async fn file_share_exists(&self, id: FileShareId) -> Result<bool>;
88
89 async fn get_file_version(&self, id: FileVersionId) -> Result<Option<FileVersionDto>>;
91
92 async fn get_file_version_summary(&self, id: FileVersionId) -> Result<Option<FileVersionSummary>>;
94
95 async fn file_version_exists(&self, id: FileVersionId) -> Result<bool>;
97
98 async fn get_processing_job(&self, id: ProcessingJobId) -> Result<Option<ProcessingJobDto>>;
100
101 async fn get_processing_job_summary(&self, id: ProcessingJobId) -> Result<Option<ProcessingJobSummary>>;
103
104 async fn processing_job_exists(&self, id: ProcessingJobId) -> Result<bool>;
106
107 async fn get_stored_file(&self, id: StoredFileId) -> Result<Option<StoredFileDto>>;
109
110 async fn get_stored_file_summary(&self, id: StoredFileId) -> Result<Option<StoredFileSummary>>;
112
113 async fn stored_file_exists(&self, id: StoredFileId) -> Result<bool>;
115
116 async fn get_thumbnail(&self, id: ThumbnailId) -> Result<Option<ThumbnailDto>>;
118
119 async fn get_thumbnail_summary(&self, id: ThumbnailId) -> Result<Option<ThumbnailSummary>>;
121
122 async fn thumbnail_exists(&self, id: ThumbnailId) -> Result<bool>;
124
125 async fn get_upload_session(&self, id: UploadSessionId) -> Result<Option<UploadSessionDto>>;
127
128 async fn get_upload_session_summary(&self, id: UploadSessionId) -> Result<Option<UploadSessionSummary>>;
130
131 async fn upload_session_exists(&self, id: UploadSessionId) -> Result<bool>;
133
134 async fn get_user_quota(&self, id: UserQuotaId) -> Result<Option<UserQuotaDto>>;
136
137 async fn get_user_quota_summary(&self, id: UserQuotaId) -> Result<Option<UserQuotaSummary>>;
139
140 async fn user_quota_exists(&self, id: UserQuotaId) -> Result<bool>;
142
143}
144
145pub struct BucketQueryServiceImpl<R> {
151 #[allow(dead_code)]
154 repository: Arc<R>,
155}
156
157impl<R> BucketQueryServiceImpl<R> {
158 pub fn new(repository: Arc<R>) -> Self {
159 Self { repository }
160 }
161}
162
163