Skip to content

Commit 53fe54d

Browse files
committed
snapshot
1 parent 211e05f commit 53fe54d

27 files changed

Lines changed: 380 additions & 44 deletions

Cargo.lock

Lines changed: 9 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ panic = "abort"
1010
strip = true
1111

1212
[workspace.dependencies]
13+
#pq-sys = { version = "0.6", features = ["bundled"] }
14+
#openssl-sys = { version = "0.9.100", features = ["vendored"] }
15+
#libsqlite3-sys = { version = "0.30", features = ["bundled"] }
16+
#mysqlclient-sys = { version = "0.4", features = ["bundled"] }
1317
diesel = { version = "2.2.0", features = [
1418
"sqlite",
15-
# "mysql",
16-
# "postgres",
19+
# "mysql",
20+
# "postgres",
1721
"chrono",
1822
"returning_clauses_for_sqlite_3_35",
1923
] }

file_classification_cli/Cargo.toml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,3 @@ doc = false
5050
name = "create_file_group"
5151
doc = false
5252

53-
[[bin]]
54-
name = "webapi"
55-
doc = false
56-
57-
[[bin]]
58-
name = "webui"
59-
doc = false

file_classification_cli/src/bin/webapi.rs

Lines changed: 0 additions & 1 deletion
This file was deleted.

file_classification_cli/src/bin/webui.rs

Lines changed: 0 additions & 1 deletion
This file was deleted.

file_classification_core/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ edition = "2024"
77
diesel = { workspace = true }
88
dotenvy = { workspace = true }
99
chrono = { workspace = true }
10+
#mysqlclient-sys = { workspace = true }
11+
#libsqlite3-sys = { workspace = true }
12+
#openssl-sys = { workspace = true }
13+
#pq-sys = { workspace = true }

file_classification_core/src/file_group.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ use diesel::SqliteConnection;
22

33
use crate::errors::AppError;
44
use crate::internal::file_group as file_groups;
5-
use crate::internal::models::FileGroup;
5+
use crate::internal::models::FileGroupDTO;
66

77
pub fn create_file_group(
88
conn: &mut SqliteConnection,
99
file_id: i32,
1010
group_id: i32,
11-
) -> Result<FileGroup, AppError> {
11+
) -> Result<FileGroupDTO, AppError> {
1212
file_groups::create_file_group(conn, file_id, group_id)
1313
}

file_classification_core/src/files.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ use crate::{
44
file_group::create_file_group,
55
groups::create_group,
66
internal::{
7-
files,
8-
groups::{find_group_by_name, mark_group_as_primary},
9-
models::{File, Group, NewFile},
7+
files,
8+
groups::{find_group_by_name, mark_group_as_primary},
9+
models::{File, Group, CreateFileDTO},
1010
},
1111
models::FileFilter,
1212
};
@@ -17,7 +17,7 @@ pub fn raw_create_file(
1717
path_: &str,
1818
group_id: i32,
1919
) -> Result<File, AppError> {
20-
let new_file = NewFile { type_, path: path_, group_id };
20+
let new_file = CreateFileDTO { type_, path: path_, group_id };
2121
files::create_file(conn, &new_file)
2222
}
2323
pub fn create_file(

file_classification_core/src/group_tag.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ use diesel::SqliteConnection;
22

33
use crate::errors::AppError;
44
use crate::internal::group_tag as group_tags;
5-
use crate::internal::models::GroupTag;
5+
use crate::internal::models::GroupTagDTO;
66
pub fn create_group_tag(
77
conn: &mut SqliteConnection,
88
group_id: i32,
99
tag_id: i32,
10-
) -> Result<GroupTag, AppError> {
10+
) -> Result<GroupTagDTO, AppError> {
1111
group_tags::create_group_tag(conn, group_id, tag_id)
1212
}

file_classification_core/src/internal/file_group.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ use crate::{
88
use diesel::prelude::*;
99
use std::fmt::{Debug, Formatter, Result as fmtResult};
1010

11-
use super::{models::FileGroup, schema::file_groups};
11+
use super::{models::FileGroupDTO, schema::file_groups};
1212

1313
pub fn create_file_group(
1414
conn: &mut SqliteConnection,
1515
file_id: i32,
1616
group_id: i32,
17-
) -> Result<FileGroup, AppError> {
17+
) -> Result<FileGroupDTO, AppError> {
1818
let group = find_group_by_id(conn, group_id)?.ok_or(AppError::GroupNotFound)?;
1919

2020
if group.is_primary {
2121
return Err(AppError::CannotAssociateWithPrimary);
2222
}
2323

24-
let new_file_group = FileGroup { file_id, group_id };
24+
let new_file_group = FileGroupDTO { file_id, group_id };
2525
let result = conn.transaction::<_, AppError, _>(|conn| {
2626
increase_file_reference_count(conn, file_id)?;
2727
increase_group_reference_count(conn, group_id)?;
@@ -30,7 +30,7 @@ pub fn create_file_group(
3030
let _ = result?;
3131
Ok(new_file_group)
3232
}
33-
impl Debug for FileGroup {
33+
impl Debug for FileGroupDTO {
3434
fn fmt(&self, f: &mut Formatter<'_>) -> fmtResult {
3535
write!(f, "FileGroup {{ file_id: {}, group_id: {} }}", self.file_id, self.group_id)
3636
}

0 commit comments

Comments
 (0)