1051e83da3
This commit introduces a new API endpoint `/api/upload` for handling audio file uploads. It supports multipart form data, extracts `case_id`, `recorded_at`, and `audio` fields. The audio data is saved to a filesystem path determined by the user and case ID, within either the `open/` or `done/` directories. New features include: - Integration with `axum`'s `Multipart` extractor for parsing form data. - Validation of `case_id` as a UUID. - Creation of case directories if they do not exist. - Handling of late uploads to already closed cases by placing files in the `done/` directory and removing any `.remove` marker. - Logging of received recordings. - Definition of `AckResponse` and `AckStatus` models for API responses. - Addition of comprehensive unit tests for various upload scenarios, including new case creation, invalid inputs, authentication, and late uploads.
26 lines
734 B
TOML
26 lines
734 B
TOML
[package]
|
|
name = "doctate-server"
|
|
version = "0.1.0"
|
|
edition = "2024"
|
|
|
|
[dependencies]
|
|
axum = { version = "0.8", features = ["multipart"] }
|
|
tokio = { version = "1", features = ["full"] }
|
|
reqwest = { version = "0.12", features = ["json", "multipart"] }
|
|
askama = "0.12"
|
|
tracing = "0.1"
|
|
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
|
tracing-appender = "0.2"
|
|
dotenvy = "0.15"
|
|
uuid = { version = "1", features = ["v4"] }
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
toml = "0.8"
|
|
tower-http = { version = "0.6", features = ["limit", "trace"] }
|
|
rand = "0.8"
|
|
bcrypt = "0.15"
|
|
axum-extra = { version = "0.12", features = ["cookie"] }
|
|
|
|
[dev-dependencies]
|
|
tower = { version = "0.5", features = ["util"] }
|