hezarfen_backend
Clone
https://git.tahinli.com/archive/hezarfen_backend.git
0 watching0 forksRust8.3 MiB6d68754Ahmet Kaan Gümüş2 months ago566 commits
| 1 | //! A file attached to a homework submission. Like a note file, the row carries |
| 2 | //! metadata only (original filename, MIME type, byte size) and the bytes live |
| 3 | //! on disk under [`crate::config::Config::files_path`] — but named by this |
| 4 | //! row's own `file` field (a fresh server-generated UUID per upload, like a |
| 5 | //! question image), never by user input, so nothing a client sends shapes a |
| 6 | //! disk path. Files are immutable: created and deleted, never updated, so the |
| 7 | //! `submission`/`file`/`created_at` columns are only ever set once (READONLY |
| 8 | //! app discipline — single writer). The web layer owns the blob I/O and its |
| 9 | //! ordering (blob before row on upload, row before blob on delete); the rows |
| 10 | //! are written and read by [`crate::db::homework_file`], the upload/attach |
| 11 | //! workflow by [`crate::service::homework_file`]. |
| 12 | |
| 13 | use crateHomeworkSubmissionId; |
| 14 | use cratenext_uuid; |
| 15 | use crate; |
| 16 | use crateTimestamp; |
| 17 | |
| 18 | |
| 19 | |
| 20 | ; |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | /// An attachment row. `file` is the blob's on-disk name (a fresh UUID per |
| 48 | /// upload), independent of the row id and reused as the GC key on cascade. |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 |