hezarfen_backend
Clone
https://git.tahinli.com/archive/hezarfen_backend.git
0 watching0 forksRust8.3 MiBaf331ecAhmet Kaan Gümüş2 months ago451 commits
| 1 | //! Solution funnels: the offer (through the question's existence-move), the |
| 2 | //! question-scoped read and page, the grouped counts, and the unconditional |
| 3 | //! body/image writes of an unmoderated row. The queries live in |
| 4 | //! [`crate::db::solution`]; the pure entity and newtypes in |
| 5 | //! [`crate::domain::solution`]. |
| 6 | |
| 7 | use HashMap; |
| 8 | |
| 9 | use crateDatabase; |
| 10 | use cratesolution; |
| 11 | use crateFileContentType; |
| 12 | use cratePoolQuestionId; |
| 13 | use crate; |
| 14 | use crateAppError; |
| 15 | |
| 16 | /// Offer the solution; `NotFound` = the question is gone, and nothing was |
| 17 | /// written. |
| 18 | pub async |
| 19 | |
| 20 | |
| 21 | |
| 22 | /// Read a solution only if it belongs to `question` — keeps the nested |
| 23 | /// route honest (a solution id under someone else's question 404s). |
| 24 | pub async |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | /// The question's solutions, oldest first. |
| 33 | pub async |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | /// Per-question solution tallies for a page of questions, in one grouped |
| 43 | /// query. |
| 44 | pub async |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | /// Replace the body; `None` only means the row was deleted mid-flight. |
| 52 | pub async |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | /// Point the solution at a freshly written image blob; the *before* row names |
| 61 | /// the replaced blob the caller must remove. |
| 62 | pub async |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | /// Detach the solution's image; the *before* row names the blob the caller |
| 73 | /// must remove. |
| 74 | pub async |
| 75 | |
| 76 | |
| 77 | |
| 78 | pub async |
| 79 | |
| 80 |