mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 12:27:13 +02:00
[WIP] rebase on main
This commit is contained in:
parent
c3552cecdf
commit
efca63f9ce
10 changed files with 381 additions and 87 deletions
|
@ -7,18 +7,17 @@ use crate::helpers::Authentication;
|
|||
use crate::Data;
|
||||
|
||||
pub fn services(cfg: &mut web::ServiceConfig) {
|
||||
cfg.service(trigger_dump)
|
||||
cfg.service(create_dump)
|
||||
.service(get_dump_status);
|
||||
}
|
||||
|
||||
#[post("/dumps", wrap = "Authentication::Private")]
|
||||
async fn trigger_dump(
|
||||
async fn create_dump(
|
||||
data: web::Data<Data>,
|
||||
) -> Result<HttpResponse, ResponseError> {
|
||||
eprintln!("dump started");
|
||||
let res = data.dump().await?;
|
||||
let res = data.create_dump().await?;
|
||||
|
||||
Ok(HttpResponse::Ok().body(res))
|
||||
Ok(HttpResponse::Ok().json(res))
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
|
@ -29,13 +28,15 @@ struct DumpStatusResponse {
|
|||
|
||||
#[derive(Deserialize)]
|
||||
struct DumpParam {
|
||||
_dump_uid: String,
|
||||
dump_uid: String,
|
||||
}
|
||||
|
||||
#[get("/dumps/{dump_uid}/status", wrap = "Authentication::Private")]
|
||||
async fn get_dump_status(
|
||||
_data: web::Data<Data>,
|
||||
_path: web::Path<DumpParam>,
|
||||
data: web::Data<Data>,
|
||||
path: web::Path<DumpParam>,
|
||||
) -> Result<HttpResponse, ResponseError> {
|
||||
todo!()
|
||||
let res = data.dump_status(path.dump_uid.clone()).await?;
|
||||
|
||||
Ok(HttpResponse::Ok().json(res))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue