
With this we can start work on the api code itself which at this point should be fill in as we go
36 lines
819 B
Rust
36 lines
819 B
Rust
use rocket_contrib::json::Json;
|
|
use rocket_contrib::json::JsonValue;
|
|
use dblib::{DB, request::ApiKey};
|
|
use dblib::KeyStore;
|
|
use serde::Serialize;
|
|
|
|
#[derive(Serialize)]
|
|
pub struct GenericResponse<'m> {
|
|
msg: Option<&'m str>,
|
|
err: bool
|
|
}
|
|
|
|
#[get("/by-id")]
|
|
pub fn get_vid_by_id(id: String) -> JsonValue {
|
|
todo!()
|
|
}
|
|
|
|
#[get("/by-name")]
|
|
pub fn get_vid_by_name(name: String) -> JsonValue {
|
|
todo!()
|
|
}
|
|
|
|
#[update("/description?<id>&<new>")]
|
|
pub fn update_description<'m>(key: ApiKey, id: String, desc: String) -> Json<GenericResponse<'m>> {
|
|
todo!()
|
|
}
|
|
|
|
#[delete("/video?<id>")]
|
|
pub fn delete_video(key: ApiKey, id: String) -> Json<GenericResponse<'m>> {
|
|
todo!()
|
|
}
|
|
|
|
#[update("/name?<id>&<dest>")]
|
|
pub fn update_vid_name<'m>(key: ApiKey, id: String, dest: String) -> Json<GenericResponse<'m>> {
|
|
todo!()
|
|
} |