2020-12-12 13:32:06 +01:00
|
|
|
use std::collections::BTreeMap;
|
|
|
|
|
|
|
|
use actix_web::{delete, get, post};
|
2021-03-15 18:11:10 +01:00
|
|
|
use actix_web::{web, HttpResponse};
|
2020-12-12 13:32:06 +01:00
|
|
|
|
2020-12-22 14:02:41 +01:00
|
|
|
use crate::error::ResponseError;
|
2020-12-12 13:32:06 +01:00
|
|
|
use crate::helpers::Authentication;
|
2020-12-22 14:02:41 +01:00
|
|
|
use crate::routes::IndexParam;
|
2020-12-12 13:32:06 +01:00
|
|
|
use crate::Data;
|
|
|
|
|
|
|
|
pub fn services(cfg: &mut web::ServiceConfig) {
|
|
|
|
cfg.service(get).service(update).service(delete);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[get(
|
|
|
|
"/indexes/{index_uid}/settings/synonyms",
|
|
|
|
wrap = "Authentication::Private"
|
|
|
|
)]
|
|
|
|
async fn get(
|
2020-12-22 14:02:41 +01:00
|
|
|
_data: web::Data<Data>,
|
|
|
|
_path: web::Path<IndexParam>,
|
2020-12-12 13:32:06 +01:00
|
|
|
) -> Result<HttpResponse, ResponseError> {
|
2020-12-12 16:04:37 +01:00
|
|
|
todo!()
|
2020-12-12 13:32:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#[post(
|
|
|
|
"/indexes/{index_uid}/settings/synonyms",
|
|
|
|
wrap = "Authentication::Private"
|
|
|
|
)]
|
|
|
|
async fn update(
|
2020-12-22 14:02:41 +01:00
|
|
|
_data: web::Data<Data>,
|
|
|
|
_path: web::Path<IndexParam>,
|
|
|
|
_body: web::Json<BTreeMap<String, Vec<String>>>,
|
2020-12-12 13:32:06 +01:00
|
|
|
) -> Result<HttpResponse, ResponseError> {
|
2020-12-12 16:04:37 +01:00
|
|
|
todo!()
|
2020-12-12 13:32:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#[delete(
|
|
|
|
"/indexes/{index_uid}/settings/synonyms",
|
|
|
|
wrap = "Authentication::Private"
|
|
|
|
)]
|
|
|
|
async fn delete(
|
2020-12-22 14:02:41 +01:00
|
|
|
_data: web::Data<Data>,
|
|
|
|
_path: web::Path<IndexParam>,
|
2020-12-12 13:32:06 +01:00
|
|
|
) -> Result<HttpResponse, ResponseError> {
|
2020-12-12 16:04:37 +01:00
|
|
|
todo!()
|
2020-12-12 13:32:06 +01:00
|
|
|
}
|