|
3 | 3 | use serde::{Deserialize, Serialize}; |
4 | 4 | use chrono::{NaiveDateTime, serde::ts_seconds_option}; |
5 | 5 |
|
6 | | -// File 相关 DTO |
7 | | -#[derive(Debug, Serialize, Deserialize)] |
8 | | -pub struct CreateFileDTO { |
9 | | - pub type_: String, |
10 | | - pub path: String, |
11 | | - pub group_id: i32, |
12 | | -} |
13 | | - |
14 | | -#[derive(Debug, Serialize, Deserialize)] |
15 | | -pub struct UpdateFileDTO { |
16 | | - pub path: Option<String>, |
17 | | - pub type_: Option<String>, |
18 | | - pub reference_count: Option<i32>, |
19 | | - pub group_id: Option<i32>, |
20 | | -} |
21 | | - |
22 | | -#[derive(Debug, Serialize, Deserialize)] |
23 | | -pub struct FileFilter { |
24 | | - pub id: Option<i32>, |
25 | | - pub type_: Option<String>, |
26 | | - pub path: Option<String>, |
27 | | - pub reference_count: Option<i32>, |
28 | | - pub group_id: Option<i32>, |
29 | | -} |
30 | | - |
31 | | -// Group 相关 DTO |
32 | | -#[derive(Debug, Serialize, Deserialize)] |
33 | | -pub struct CreateGroupDTO { |
34 | | - pub name: String, |
35 | | -} |
36 | | - |
37 | | -#[derive(Debug, Serialize, Deserialize)] |
38 | | -pub struct UpdateGroupDTO { |
39 | | - pub name: Option<String>, |
40 | | - pub reference_count: Option<i32>, |
41 | | - pub is_primary: Option<bool>, |
42 | | - pub click_count: Option<i32>, |
43 | | - pub share_count: Option<i32>, |
44 | | - pub create_time: Option<NaiveDateTime>, |
45 | | - pub modify_time: Option<NaiveDateTime>, |
46 | | -} |
47 | | - |
48 | | -#[derive(Debug, Serialize, Deserialize)] |
49 | | -pub struct GroupFilter { |
50 | | - pub id: Option<i32>, |
51 | | - pub name: Option<String>, |
52 | | - pub reference_count: Option<i32>, |
53 | | - pub is_primary: Option<bool>, |
54 | | - pub click_count: Option<i32>, |
55 | | - pub share_count: Option<i32>, |
56 | | - pub create_time: Option<NaiveDateTime>, |
57 | | - pub modify_time: Option<NaiveDateTime>, |
58 | | -} |
59 | | - |
60 | | -// Tag 相关 DTO |
61 | | -#[derive(Debug, Serialize, Deserialize)] |
62 | | -pub struct CreateTagDTO { |
63 | | - pub name: String, |
64 | | -} |
65 | | - |
66 | | -#[derive(Debug, Serialize, Deserialize)] |
67 | | -pub struct UpdateTagDTO { |
68 | | - pub name: Option<String>, |
69 | | - pub reference_count: Option<i32>, |
70 | | -} |
71 | | - |
72 | | -#[derive(Debug, Serialize, Deserialize)] |
73 | | -pub struct TagFilter { |
74 | | - pub id: Option<i32>, |
75 | | - pub name: Option<String>, |
76 | | - pub reference_count: Option<i32>, |
77 | | -} |
78 | | - |
79 | | -// FileGroup 相关 DTO |
80 | | -#[derive(Debug, Serialize, Deserialize)] |
81 | | -pub struct CreateFileGroupDTO { |
82 | | - pub file_id: i32, |
83 | | - pub group_id: i32, |
84 | | -} |
85 | | - |
86 | | -// GroupTag 相关 DTO |
87 | | -#[derive(Debug, Serialize, Deserialize)] |
88 | | -pub struct CreateGroupTagDTO { |
89 | | - pub group_id: i32, |
90 | | - pub tag_id: i32, |
91 | | -} |
92 | 6 |
|
93 | 7 | // 通用响应结构 |
94 | 8 | #[derive(Debug, Serialize)] |
|
0 commit comments