add /api in docs, fix #238

This commit is contained in:
jb-alvarado 2022-11-16 15:57:32 +01:00
parent bb1bc1a1a2
commit 8f84b70205
2 changed files with 7 additions and 7 deletions

View File

@ -343,18 +343,18 @@ Examples:
* get program from current day * get program from current day
```BASH ```BASH
curl -X GET http://127.0.0.1:8787/program/1/ -H 'Authorization: Bearer <TOKEN>' curl -X GET http://127.0.0.1:8787/api/program/1/ -H 'Authorization: Bearer <TOKEN>'
``` ```
* get a program range between two dates * get a program range between two dates
```BASH ```BASH
curl -X GET http://127.0.0.1:8787/program/1/?start_after=2022-11-13T12:00:00&start_before=2022-11-20T11:59:59 \ curl -X GET http://127.0.0.1:8787/api/program/1/?start_after=2022-11-13T12:00:00&start_before=2022-11-20T11:59:59 \
-H 'Authorization: Bearer <TOKEN>' -H 'Authorization: Bearer <TOKEN>'
``` ```
* get program from give day * get program from give day
```BASH ```BASH
curl -X GET http://127.0.0.1:8787/program/1/?start_after=2022-11-13T10:00:00 \ curl -X GET http://127.0.0.1:8787/api/program/1/?start_after=2022-11-13T10:00:00 \
-H 'Authorization: Bearer <TOKEN>' -H 'Authorization: Bearer <TOKEN>'
``` ```

View File

@ -856,18 +856,18 @@ async fn import_playlist(
/// ///
/// * get program from current day /// * get program from current day
/// ```BASH /// ```BASH
/// curl -X GET http://127.0.0.1:8787/program/1/ -H 'Authorization: Bearer <TOKEN>' /// curl -X GET http://127.0.0.1:8787/api/program/1/ -H 'Authorization: Bearer <TOKEN>'
/// ``` /// ```
/// ///
/// * get a program range between two dates /// * get a program range between two dates
/// ```BASH /// ```BASH
/// curl -X GET http://127.0.0.1:8787/program/1/?start_after=2022-11-13T12:00:00&start_before=2022-11-20T11:59:59 \ /// curl -X GET http://127.0.0.1:8787/api/program/1/?start_after=2022-11-13T12:00:00&start_before=2022-11-20T11:59:59 \
/// -H 'Authorization: Bearer <TOKEN>' /// -H 'Authorization: Bearer <TOKEN>'
/// ``` /// ```
/// ///
/// * get program from give day /// * get program from give day
/// ```BASH /// ```BASH
/// curl -X GET http://127.0.0.1:8787/program/1/?start_after=2022-11-13T10:00:00 \ /// curl -X GET http://127.0.0.1:8787/api/program/1/?start_after=2022-11-13T10:00:00 \
/// -H 'Authorization: Bearer <TOKEN>' /// -H 'Authorization: Bearer <TOKEN>'
/// ``` /// ```
#[get("/program/{id}/")] #[get("/program/{id}/")]
@ -876,7 +876,7 @@ async fn get_program(
id: web::Path<i32>, id: web::Path<i32>,
obj: web::Query<ProgramObj>, obj: web::Query<ProgramObj>,
) -> Result<impl Responder, ServiceError> { ) -> Result<impl Responder, ServiceError> {
let (config, _) = playout_config(&*id).await?; let (config, _) = playout_config(&id).await?;
let start_sec = config.playlist.start_sec.unwrap(); let start_sec = config.playlist.start_sec.unwrap();
let mut days = 0; let mut days = 0;
let mut program = vec![]; let mut program = vec![];