Skip to content

Commit 01b5329

Browse files
committed
feat: add UpdateFileByFilter struct
1 parent 7053f68 commit 01b5329

1 file changed

Lines changed: 26 additions & 12 deletions

File tree

file_classification_core/src/model/models.rs

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,6 @@ pub struct CreateFileDTO<'a, 'b> {
2626
pub group_id: i32,
2727
}
2828

29-
// NOTE: you may find File is like SearchFile
30-
// it is bcs IDK how to unify them
31-
#[derive(serde::Deserialize)]
32-
pub struct FileFilter {
33-
pub id: Option<i32>,
34-
pub type_: Option<String>,
35-
pub path: Option<String>,
36-
pub reference_count: Option<i32>,
37-
pub group_id: Option<i32>,
38-
}
39-
4029
#[derive(serde::Deserialize, Clone)]
4130
pub enum FileCondition {
4231
Id(i32),
@@ -89,6 +78,30 @@ pub struct UpdateFileDTO {
8978
pub group_id: Option<i32>,
9079
}
9180

81+
// NOTE: you may find File is like SearchFile
82+
// it is bcs IDK how to unify them,
83+
// and it was used to select or update or delete
84+
#[derive(serde::Deserialize)]
85+
pub struct FileFilter {
86+
pub id: Option<i32>,
87+
pub type_: Option<String>,
88+
pub path: Option<String>,
89+
pub reference_count: Option<i32>,
90+
pub group_id: Option<i32>,
91+
}
92+
93+
pub struct FileSet {
94+
pub path: Option<String>,
95+
pub type_: Option<String>,
96+
pub reference_count: Option<i32>,
97+
pub group_id: Option<i32>,
98+
}
99+
100+
pub struct UpdateFile {
101+
pub set: FileSet,
102+
pub filter: FileFilter,
103+
}
104+
92105
/** Group Related
93106
*/
94107

@@ -187,7 +200,8 @@ pub struct UpdateGroupDTO {
187200
}
188201

189202
// NOTE: you may find File is like SearchFile
190-
// it is bcs IDK how to unify them
203+
// it is bcs IDK how to unify them,
204+
// and it was used to select or update or delete
191205
#[derive(Deserialize)]
192206
pub struct GroupFilter {
193207
pub id: Option<i32>,

0 commit comments

Comments
 (0)