Skip to content

Commit 6971f26

Browse files
committed
comment out unused
1 parent 970152b commit 6971f26

File tree

9 files changed

+280
-280
lines changed

9 files changed

+280
-280
lines changed

src/models/admin_user_model.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use super::{BaseModel, Pagination};
1+
use super::BaseModel;
22
use crate::api::proto::admin_user::AdminUserModel as GrpcAdminUserModel;
33
use crate::api::proto::admin_user::RoleModel as GrpcRoleModel;
44
use crate::error::{Error, Result};
@@ -213,15 +213,15 @@ pub struct UpdatableAdminUserModel {
213213
pub role_ids: Vec<String>,
214214
}
215215

216-
/// Represents a paginated response for admin users.
217-
#[derive(Serialize, Debug, Deserialize, Clone, Default)]
218-
pub struct AdminUserPagination {
219-
/// The list of admin users in the current page.
220-
pub data: Vec<AdminUserModel>,
216+
// /// Represents a paginated response for admin users.
217+
// #[derive(Serialize, Debug, Deserialize, Clone, Default)]
218+
// pub struct AdminUserPagination {
219+
// /// The list of admin users in the current page.
220+
// pub data: Vec<AdminUserModel>,
221221

222-
/// The total number of admin users available.
223-
pub pagination: Pagination,
224-
}
222+
// /// The total number of admin users available.
223+
// pub pagination: Pagination,
224+
// }
225225

226226
/// Extension trait for `AdminUserModel` to check resource access
227227
pub trait AdminUserModelExtension {

src/models/asset_model.rs

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use super::{BaseModel, Pagination};
1+
use super::BaseModel;
22
use crate::error::{Error, Result};
33
use prost_types::Timestamp;
44
use serde::{Deserialize, Serialize};
@@ -91,20 +91,20 @@ pub struct MetaDataType {
9191
// }
9292
// }
9393

94-
/// `FileTypeMetaDataStruct` and `FolderTypeMetaDataStruct` are used to deserialize metadata from the database.
95-
#[derive(Deserialize, Debug, Clone, Serialize, Default)]
96-
pub struct FileTypeMetaDataStruct {
94+
// /// `FileTypeMetaDataStruct` and `FolderTypeMetaDataStruct` are used to deserialize metadata from the database.
95+
// #[derive(Deserialize, Debug, Clone, Serialize, Default)]
96+
// pub struct FileTypeMetaDataStruct {
9797

98-
/// Type of the file, e.g., "image/png", "application/pdf".
99-
pub file_type: String,
100-
}
98+
// /// Type of the file, e.g., "image/png", "application/pdf".
99+
// pub file_type: String,
100+
// }
101101

102-
/// `FolderTypeMetaDataStruct` is used to deserialize folder metadata from the database.
103-
#[derive(Deserialize, Debug, Clone, Serialize, Default)]
104-
pub struct FolderTypeMetaDataStruct {
105-
/// Color associated with the folder, used for visual categorization.
106-
pub color: String,
107-
}
102+
// /// `FolderTypeMetaDataStruct` is used to deserialize folder metadata from the database.
103+
// #[derive(Deserialize, Debug, Clone, Serialize, Default)]
104+
// pub struct FolderTypeMetaDataStruct {
105+
// /// Color associated with the folder, used for visual categorization.
106+
// pub color: String,
107+
// }
108108

109109
// impl Default for MetaDataType {
110110
// fn default() -> MetaDataType {
@@ -269,31 +269,31 @@ impl TryFrom<MetaDataType> for Value {
269269
}
270270
}
271271

272-
impl TryFrom<Object> for FileTypeMetaDataStruct {
273-
type Error = Error;
274-
fn try_from(val: Object) -> Result<Self> {
275-
let file_type = val.get("file_type").get_string()?;
276-
Ok(Self { file_type })
277-
}
278-
}
272+
// impl TryFrom<Object> for FileTypeMetaDataStruct {
273+
// type Error = Error;
274+
// fn try_from(val: Object) -> Result<Self> {
275+
// let file_type = val.get("file_type").get_string()?;
276+
// Ok(Self { file_type })
277+
// }
278+
// }
279279

280-
impl TryFrom<Object> for FolderTypeMetaDataStruct {
281-
type Error = Error;
282-
fn try_from(val: Object) -> Result<Self> {
283-
let color = val.get("color").get_string()?;
284-
Ok(Self { color })
285-
}
286-
}
280+
// impl TryFrom<Object> for FolderTypeMetaDataStruct {
281+
// type Error = Error;
282+
// fn try_from(val: Object) -> Result<Self> {
283+
// let color = val.get("color").get_string()?;
284+
// Ok(Self { color })
285+
// }
286+
// }
287287

288-
/// `AssetPagination` is used to paginate a list of assets.
289-
#[derive(Serialize, Debug, Deserialize, Clone, Default)]
290-
pub struct AssetPagination {
291-
/// List of assets in the current page.
292-
pub data: Vec<AssetModel>,
288+
// /// `AssetPagination` is used to paginate a list of assets.
289+
// #[derive(Serialize, Debug, Deserialize, Clone, Default)]
290+
// pub struct AssetPagination {
291+
// /// List of assets in the current page.
292+
// pub data: Vec<AssetModel>,
293293

294-
/// Pagination information for the asset list.
295-
pub pagination: Pagination,
296-
}
294+
// /// Pagination information for the asset list.
295+
// pub pagination: Pagination,
296+
// }
297297

298298

299299

src/models/collection_model.rs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::error::{Error, Result};
2-
use crate::models::{BaseModel, Pagination};
2+
use crate::models::BaseModel;
33
use prost_types::Timestamp;
44
use serde::{Deserialize, Serialize};
55
use std::time::SystemTime;
@@ -41,16 +41,16 @@ pub struct CollectionModel {
4141
// }
4242

4343

44-
/// Represents a paginated response for collections.
45-
#[derive(Serialize, Debug, Deserialize, Clone, Default)]
46-
pub struct CollectionPagination {
44+
// /// Represents a paginated response for collections.
45+
// #[derive(Serialize, Debug, Deserialize, Clone, Default)]
46+
// pub struct CollectionPagination {
4747

48-
/// A vector of collection models.
49-
pub data: Vec<CollectionModel>,
48+
// /// A vector of collection models.
49+
// pub data: Vec<CollectionModel>,
5050

51-
/// Pagination information for the collection data.
52-
pub pagination: Pagination,
53-
}
51+
// /// Pagination information for the collection data.
52+
// pub pagination: Pagination,
53+
// }
5454

5555

5656
/// Represents a creatable collection model.
@@ -102,18 +102,18 @@ pub struct UpdatableCollection {
102102
// pub field_type: CollectionFieldFieldType,
103103
// }
104104

105-
/// Represents a model for updating the collection identifier.
106-
#[derive(Serialize, Deserialize, Debug, Clone)]
107-
pub struct PutCollectionIdentifierModel {
108-
/// Unique identifier for the collection to be updated.
109-
pub id: String,
105+
// /// Represents a model for updating the collection identifier.
106+
// #[derive(Serialize, Deserialize, Debug, Clone)]
107+
// pub struct PutCollectionIdentifierModel {
108+
// /// Unique identifier for the collection to be updated.
109+
// pub id: String,
110110

111-
/// New identifier for the collection.
112-
pub identifier: String,
111+
// /// New identifier for the collection.
112+
// pub identifier: String,
113113

114-
/// Username of the user updating the collection identifier.
115-
pub logged_in_username: String,
116-
}
114+
// /// Username of the user updating the collection identifier.
115+
// pub logged_in_username: String,
116+
// }
117117

118118

119119

@@ -126,14 +126,14 @@ pub struct PutCollectionIdentifierModel {
126126
// Text(String),
127127
// }
128128

129-
/// Represents the field type for collection fields.
130-
#[derive(Deserialize, Debug, Clone, Serialize, Default)]
131-
pub enum CollectionFieldFieldType {
129+
// /// Represents the field type for collection fields.
130+
// #[derive(Deserialize, Debug, Clone, Serialize, Default)]
131+
// pub enum CollectionFieldFieldType {
132132

133-
/// Represents a text field type for collection fields.
134-
#[default]
135-
Text,
136-
}
133+
// /// Represents a text field type for collection fields.
134+
// #[default]
135+
// Text,
136+
// }
137137

138138
// impl Default for CollectionFieldDataType {
139139
// fn default() -> Self {

src/models/content_model.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::error::{Error, Result};
2-
use crate::models::{BaseModel, Pagination};
2+
use crate::models::BaseModel;
33
use prost_types::Timestamp;
44
use serde::{Deserialize, Serialize};
55
use std::collections::BTreeMap;
@@ -8,16 +8,16 @@ use surrealdb::sql::{Datetime, Object, Value};
88

99
// region: Struct, Enum Initialization
1010

11-
/// Represents the pagination structure for content models.
12-
#[derive(Serialize, Debug, Deserialize, Clone, Default)]
13-
pub struct ContentPagination {
11+
// /// Represents the pagination structure for content models.
12+
// #[derive(Serialize, Debug, Deserialize, Clone, Default)]
13+
// pub struct ContentPagination {
1414

15-
/// total number of content model
16-
pub data: Vec<ContentModel>,
15+
// /// total number of content model
16+
// pub data: Vec<ContentModel>,
1717

18-
/// total number of content model
19-
pub pagination: Pagination,
20-
}
18+
// /// total number of content model
19+
// pub pagination: Pagination,
20+
// }
2121

2222
/// Represents the base structure for content models.
2323
#[derive(Serialize, Debug, Deserialize, Clone, Default)]

src/models/mod.rs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -41,36 +41,36 @@ pub mod token_claim_model;
4141
pub mod validation_error;
4242

4343

44-
/// Pagination struct
45-
#[derive(Serialize, Debug, Deserialize, Clone, Default)]
46-
pub struct Pagination {
47-
/// The total number of items in the collection
48-
pub total: i64,
44+
// /// Pagination struct
45+
// #[derive(Serialize, Debug, Deserialize, Clone, Default)]
46+
// pub struct Pagination {
47+
// /// The total number of items in the collection
48+
// pub total: i64,
4949

50-
/// The number of items per page
51-
pub per_page: i64,
50+
// /// The number of items per page
51+
// pub per_page: i64,
5252

53-
/// The current page number
54-
pub current_page: i64,
53+
// /// The current page number
54+
// pub current_page: i64,
5555

56-
/// The from number of collection
57-
pub from: i64,
56+
// /// The from number of collection
57+
// pub from: i64,
5858

59-
/// The to number of collection
60-
pub to: i64,
59+
// /// The to number of collection
60+
// pub to: i64,
6161

62-
/// Whether there is a next page
63-
pub has_next_page: bool,
62+
// /// Whether there is a next page
63+
// pub has_next_page: bool,
6464

65-
/// Whether there is a previous page
66-
pub has_previous_page: bool,
65+
// /// Whether there is a previous page
66+
// pub has_previous_page: bool,
6767

68-
/// The next page number
69-
pub next_page_number: i64,
68+
// /// The next page number
69+
// pub next_page_number: i64,
7070

71-
/// The previous page number
72-
pub previous_page_number: i64,
73-
}
71+
// /// The previous page number
72+
// pub previous_page_number: i64,
73+
// }
7474

7575
/// `ModelCount` struct
7676
#[derive(Serialize, Debug, Deserialize, Clone, Default)]

src/models/role_model.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use super::{BaseModel, Pagination};
1+
use super::BaseModel;
22
use crate::error::{Error, Result};
33
use prost_types::Timestamp;
44
use serde::{Deserialize, Serialize};
@@ -36,14 +36,14 @@ pub struct RoleModel {
3636
pub permissions: Vec<String>,
3737
}
3838

39-
/// Represents a role option model used in dropdowns or selection lists.
40-
#[derive(Serialize, Debug, Deserialize, Clone, Default)]
41-
pub struct RoleOptionModel {
42-
/// label for the role option
43-
pub label: String,
44-
/// Value associated with the role option, typically the role's identifier
45-
pub value: String,
46-
}
39+
// /// Represents a role option model used in dropdowns or selection lists.
40+
// #[derive(Serialize, Debug, Deserialize, Clone, Default)]
41+
// pub struct RoleOptionModel {
42+
// /// label for the role option
43+
// pub label: String,
44+
// /// Value associated with the role option, typically the role's identifier
45+
// pub value: String,
46+
// }
4747

4848
impl TryFrom<RoleModel> for crate::api::proto::admin_user::RoleModel {
4949
type Error = Error;
@@ -157,12 +157,12 @@ pub struct PutRoleIdentifierModel {
157157
}
158158

159159

160-
/// Represents a paginated response for roles.
161-
#[derive(Serialize, Debug, Deserialize, Clone, Default)]
162-
pub struct RolePagination {
163-
/// List of roles in the current page
164-
pub data: Vec<RoleModel>,
160+
// /// Represents a paginated response for roles.
161+
// #[derive(Serialize, Debug, Deserialize, Clone, Default)]
162+
// pub struct RolePagination {
163+
// /// List of roles in the current page
164+
// pub data: Vec<RoleModel>,
165165

166-
/// Pagination information for the response
167-
pub pagination: Pagination,
168-
}
166+
// /// Pagination information for the response
167+
// pub pagination: Pagination,
168+
// }

src/models/security_alert_model.rs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use super::{BaseModel, Pagination};
1+
use super::BaseModel;
22
use crate::error::{Error, Result};
33
use prost_types::Timestamp;
44
use serde::{Deserialize, Serialize};
@@ -302,26 +302,26 @@ pub struct CreateSecurityAlertModel {
302302
pub metadata: Option<BTreeMap<String, Value>>,
303303
}
304304

305-
/// Represents a model for updating an existing security alert
306-
#[derive(Serialize, Debug, Deserialize, Clone, Default)]
307-
pub struct UpdateSecurityAlertModel {
308-
/// Unique identifier for the security alert
309-
pub resolved: Option<bool>,
310-
/// Optional timestamp when the alert was resolved
311-
pub resolved_by: Option<String>,
312-
/// Optional identifier of the user who resolved the alert
313-
pub metadata: Option<BTreeMap<String, Value>>,
314-
}
315-
316-
/// Represents a paginated response for security alerts
317-
#[derive(Serialize, Debug, Deserialize, Clone, Default)]
318-
pub struct SecurityAlertPaginationModel {
319-
320-
/// List of security alerts in the current page
321-
pub data: Vec<SecurityAlertModel>,
322-
/// Pagination information for the response
323-
pub pagination: Pagination,
324-
}
305+
// /// Represents a model for updating an existing security alert
306+
// #[derive(Serialize, Debug, Deserialize, Clone, Default)]
307+
// pub struct UpdateSecurityAlertModel {
308+
// /// Unique identifier for the security alert
309+
// pub resolved: Option<bool>,
310+
// /// Optional timestamp when the alert was resolved
311+
// pub resolved_by: Option<String>,
312+
// /// Optional identifier of the user who resolved the alert
313+
// pub metadata: Option<BTreeMap<String, Value>>,
314+
// }
315+
316+
// /// Represents a paginated response for security alerts
317+
// #[derive(Serialize, Debug, Deserialize, Clone, Default)]
318+
// pub struct SecurityAlertPaginationModel {
319+
320+
// /// List of security alerts in the current page
321+
// pub data: Vec<SecurityAlertModel>,
322+
// /// Pagination information for the response
323+
// pub pagination: Pagination,
324+
// }
325325

326326
impl TryFrom<Object> for SecurityAlertModel {
327327
type Error = Error;

0 commit comments

Comments
 (0)