this repo has no description
1use crate::state::AppState;
2use axum::{
3 Json,
4 extract::{Query, State},
5 http::StatusCode,
6 response::{IntoResponse, Response},
7};
8use serde::Deserialize;
9use serde_json::json;
10use tracing::info;
11
12#[derive(Deserialize)]
13pub struct NotifyOfUpdateParams {
14 pub hostname: String,
15}
16
17pub async fn notify_of_update(
18 State(_state): State<AppState>,
19 Query(params): Query<NotifyOfUpdateParams>,
20) -> Response {
21 info!("Received notifyOfUpdate from hostname: {}", params.hostname);
22 info!("TODO: Queue job for notifyOfUpdate (not implemented)");
23
24 (StatusCode::OK, Json(json!({}))).into_response()
25}
26
27#[derive(Deserialize)]
28pub struct RequestCrawlInput {
29 pub hostname: String,
30}
31
32pub async fn request_crawl(
33 State(_state): State<AppState>,
34 Json(input): Json<RequestCrawlInput>,
35) -> Response {
36 info!("Received requestCrawl for hostname: {}", input.hostname);
37 info!("TODO: Queue job for requestCrawl (not implemented)");
38
39 (StatusCode::OK, Json(json!({}))).into_response()
40}