docs: partially document codebase
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
Should make it easier for frontend to figure out what stuff actually does, more will be added as the project goes on
This commit is contained in:
parent
1aa38631b8
commit
16ccf94631
10 changed files with 226 additions and 18 deletions
|
@ -1,3 +1,5 @@
|
|||
//! `/api/v1/users/{uuid}` Specific user endpoints
|
||||
|
||||
use actix_web::{HttpRequest, HttpResponse, get, web};
|
||||
use uuid::Uuid;
|
||||
|
||||
|
@ -5,8 +7,24 @@ use crate::{
|
|||
Data, api::v1::auth::check_access_token, error::Error, structs::User, utils::get_auth_header,
|
||||
};
|
||||
|
||||
/// `GET /api/v1/users/{uuid}` Returns user with the given UUID
|
||||
///
|
||||
/// requires auth: yes
|
||||
///
|
||||
/// requires relation: yes
|
||||
///
|
||||
/// ### Response Example
|
||||
/// ```
|
||||
/// json!({
|
||||
/// "uuid": "155d2291-fb23-46bd-a656-ae7c5d8218e6",
|
||||
/// "username": "user1",
|
||||
/// "display_name": "Nullable Name",
|
||||
/// "avatar": "https://nullable-url.com/path/to/image.png"
|
||||
/// });
|
||||
/// ```
|
||||
/// NOTE: UUIDs in this response are made using `uuidgen`, UUIDs made by the actual backend will be UUIDv7 and have extractable timestamps
|
||||
#[get("/{uuid}")]
|
||||
pub async fn res(
|
||||
pub async fn get(
|
||||
req: HttpRequest,
|
||||
path: web::Path<(Uuid,)>,
|
||||
data: web::Data<Data>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue