fix: add utoipa annotations to iCal export/import handlers

This commit is contained in:
2026-07-12 15:30:45 +02:00
parent 25ff9d2779
commit abd6bf4bc4
2 changed files with 32 additions and 0 deletions

View File

@@ -171,6 +171,20 @@ pub async fn list_schedule_history(
))
}
#[utoipa::path(
get,
path = "/api/v1/channels/{id}/export.ics",
tag = "schedule",
security(("bearer" = [])),
params(
("id" = uuid::Uuid, Path, description = "Channel ID"),
),
responses(
(status = 200, description = "iCalendar file", content_type = "text/calendar"),
(status = 401, body = api_types::ErrorResponse),
(status = 404, body = api_types::ErrorResponse),
)
)]
pub async fn export_ical(
State(state): State<AppState>,
CurrentUser(_user): CurrentUser,
@@ -202,6 +216,22 @@ pub async fn export_ical(
}
}
#[utoipa::path(
post,
path = "/api/v1/channels/{id}/import",
tag = "schedule",
security(("bearer" = [])),
params(
("id" = uuid::Uuid, Path, description = "Channel ID"),
),
request_body(content = String, content_type = "text/calendar"),
responses(
(status = 200, body = api_types::ChannelResponse),
(status = 400, body = api_types::ErrorResponse),
(status = 401, body = api_types::ErrorResponse),
(status = 404, body = api_types::ErrorResponse),
)
)]
pub async fn import_ical(
State(state): State<AppState>,
CurrentUser(user): CurrentUser,

View File

@@ -50,6 +50,8 @@ impl Modify for BearerAuth {
crate::handlers::schedule::get_epg,
crate::handlers::schedule::get_stream,
crate::handlers::schedule::list_schedule_history,
crate::handlers::schedule::export_ical,
crate::handlers::schedule::import_ical,
crate::handlers::admin::get_settings,
crate::handlers::admin::update_settings,
crate::handlers::admin::get_activity_log,