clean code, and fix errors

This commit is contained in:
mpostma
2020-12-22 14:02:41 +01:00
parent 29b1f55bb0
commit 7c9eaaeadb
20 changed files with 3723 additions and 474 deletions

View File

@ -1,23 +1,20 @@
use std::collections::{BTreeSet, HashSet};
use actix_web::{delete, get, post, put};
use actix_web::{web, HttpResponse};
use indexmap::IndexMap;
use meilisearch_core::{update, MainReader};
use serde_json::Value;
use serde::Deserialize;
use crate::Data;
use crate::error::{Error, ResponseError};
use crate::error::ResponseError;
use crate::helpers::Authentication;
use crate::routes::{IndexParam, IndexUpdateResponse};
use crate::routes::IndexParam;
type Document = IndexMap<String, Value>;
#[derive(Deserialize)]
struct DocumentParam {
index_uid: String,
document_id: String,
_index_uid: String,
_document_id: String,
}
pub fn services(cfg: &mut web::ServiceConfig) {
@ -35,8 +32,8 @@ pub fn services(cfg: &mut web::ServiceConfig) {
wrap = "Authentication::Public"
)]
async fn get_document(
data: web::Data<Data>,
path: web::Path<DocumentParam>,
_data: web::Data<Data>,
_path: web::Path<DocumentParam>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
@ -46,8 +43,8 @@ async fn get_document(
wrap = "Authentication::Private"
)]
async fn delete_document(
data: web::Data<Data>,
path: web::Path<DocumentParam>,
_data: web::Data<Data>,
_path: web::Path<DocumentParam>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
@ -55,62 +52,51 @@ async fn delete_document(
#[derive(Deserialize)]
#[serde(rename_all = "camelCase", deny_unknown_fields)]
struct BrowseQuery {
offset: Option<usize>,
limit: Option<usize>,
attributes_to_retrieve: Option<String>,
}
pub fn get_all_documents_sync(
data: &web::Data<Data>,
reader: &MainReader,
index_uid: &str,
offset: usize,
limit: usize,
attributes_to_retrieve: Option<&String>
) -> Result<Vec<Document>, Error> {
todo!()
_offset: Option<usize>,
_limit: Option<usize>,
_attributes_to_retrieve: Option<String>,
}
#[get("/indexes/{index_uid}/documents", wrap = "Authentication::Public")]
async fn get_all_documents(
data: web::Data<Data>,
path: web::Path<IndexParam>,
params: web::Query<BrowseQuery>,
_data: web::Data<Data>,
_path: web::Path<IndexParam>,
_params: web::Query<BrowseQuery>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
fn find_primary_key(document: &IndexMap<String, Value>) -> Option<String> {
for key in document.keys() {
if key.to_lowercase().contains("id") {
return Some(key.to_string());
}
}
None
}
//fn find_primary_key(document: &IndexMap<String, Value>) -> Option<String> {
//for key in document.keys() {
//if key.to_lowercase().contains("id") {
//return Some(key.to_string());
//}
//}
//None
//}
#[derive(Deserialize)]
#[serde(rename_all = "camelCase", deny_unknown_fields)]
struct UpdateDocumentsQuery {
primary_key: Option<String>,
_primary_key: Option<String>,
}
async fn update_multiple_documents(
data: web::Data<Data>,
path: web::Path<IndexParam>,
params: web::Query<UpdateDocumentsQuery>,
body: web::Json<Vec<Document>>,
is_partial: bool,
_data: web::Data<Data>,
_path: web::Path<IndexParam>,
_params: web::Query<UpdateDocumentsQuery>,
_body: web::Json<Vec<Document>>,
_is_partial: bool,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
#[post("/indexes/{index_uid}/documents", wrap = "Authentication::Private")]
async fn add_documents(
data: web::Data<Data>,
path: web::Path<IndexParam>,
params: web::Query<UpdateDocumentsQuery>,
body: web::Json<Vec<Document>>,
_data: web::Data<Data>,
_path: web::Path<IndexParam>,
_params: web::Query<UpdateDocumentsQuery>,
_body: web::Json<Vec<Document>>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
@ -130,17 +116,17 @@ async fn update_documents(
wrap = "Authentication::Private"
)]
async fn delete_documents(
data: web::Data<Data>,
path: web::Path<IndexParam>,
body: web::Json<Vec<Value>>,
_data: web::Data<Data>,
_path: web::Path<IndexParam>,
_body: web::Json<Vec<Value>>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
#[delete("/indexes/{index_uid}/documents", wrap = "Authentication::Private")]
async fn clear_all_documents(
data: web::Data<Data>,
path: web::Path<IndexParam>,
_data: web::Data<Data>,
_path: web::Path<IndexParam>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}

View File

@ -1,14 +1,10 @@
use actix_web::{delete, get, post, put};
use actix_web::{web, HttpResponse};
use chrono::{DateTime, Utc};
use log::error;
use meilisearch_core::{Database, MainReader, UpdateReader};
use meilisearch_core::update::UpdateStatus;
use rand::seq::SliceRandom;
use serde::{Deserialize, Serialize};
use crate::Data;
use crate::error::{Error, ResponseError};
use crate::error::ResponseError;
use crate::helpers::Authentication;
use crate::routes::IndexParam;
@ -22,10 +18,6 @@ pub fn services(cfg: &mut web::ServiceConfig) {
.service(get_all_updates_status);
}
fn generate_uid() -> String {
todo!()
}
#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct IndexResponse {
@ -36,22 +28,15 @@ pub struct IndexResponse {
pub primary_key: Option<String>,
}
pub fn list_indexes_sync(data: &web::Data<Data>, reader: &MainReader) -> Result<Vec<IndexResponse>, ResponseError> {
todo!()
}
#[get("/indexes", wrap = "Authentication::Private")]
async fn list_indexes(data: web::Data<Data>) -> Result<HttpResponse, ResponseError> {
let reader = data.db.main_read_txn()?;
let indexes = list_indexes_sync(&data, &reader)?;
Ok(HttpResponse::Ok().json(indexes))
async fn list_indexes(_data: web::Data<Data>) -> Result<HttpResponse, ResponseError> {
todo!()
}
#[get("/indexes/{index_uid}", wrap = "Authentication::Private")]
async fn get_index(
data: web::Data<Data>,
path: web::Path<IndexParam>,
_data: web::Data<Data>,
_path: web::Path<IndexParam>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
@ -64,20 +49,10 @@ struct IndexCreateRequest {
primary_key: Option<String>,
}
pub fn create_index_sync(
database: &std::sync::Arc<Database>,
uid: String,
name: String,
primary_key: Option<String>,
) -> Result<IndexResponse, Error> {
todo!()
}
#[post("/indexes", wrap = "Authentication::Private")]
async fn create_index(
data: web::Data<Data>,
body: web::Json<IndexCreateRequest>,
_data: web::Data<Data>,
_body: web::Json<IndexCreateRequest>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
@ -101,25 +76,25 @@ struct UpdateIndexResponse {
#[put("/indexes/{index_uid}", wrap = "Authentication::Private")]
async fn update_index(
data: web::Data<Data>,
path: web::Path<IndexParam>,
body: web::Json<IndexCreateRequest>,
_data: web::Data<Data>,
_path: web::Path<IndexParam>,
_body: web::Json<IndexCreateRequest>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
#[delete("/indexes/{index_uid}", wrap = "Authentication::Private")]
async fn delete_index(
data: web::Data<Data>,
path: web::Path<IndexParam>,
_data: web::Data<Data>,
_path: web::Path<IndexParam>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
#[derive(Deserialize)]
struct UpdateParam {
index_uid: String,
update_id: u64,
_index_uid: String,
_update_id: u64,
}
#[get(
@ -127,23 +102,16 @@ struct UpdateParam {
wrap = "Authentication::Private"
)]
async fn get_update_status(
data: web::Data<Data>,
path: web::Path<UpdateParam>,
_data: web::Data<Data>,
_path: web::Path<UpdateParam>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
pub fn get_all_updates_status_sync(
data: &web::Data<Data>,
reader: &UpdateReader,
index_uid: &str,
) -> Result<Vec<UpdateStatus>, Error> {
todo!()
}
#[get("/indexes/{index_uid}/updates", wrap = "Authentication::Private")]
async fn get_all_updates_status(
data: web::Data<Data>,
path: web::Path<IndexParam>,
_data: web::Data<Data>,
_path: web::Path<IndexParam>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}

View File

@ -17,6 +17,6 @@ struct KeysResponse {
}
#[get("/keys", wrap = "Authentication::Admin")]
async fn list(data: web::Data<Data>) -> HttpResponse {
async fn list(_data: web::Data<Data>) -> HttpResponse {
todo!()
}

View File

@ -10,11 +10,11 @@ pub mod setting;
pub mod stats;
pub mod stop_words;
pub mod synonym;
pub mod dump;
//pub mod dump;
#[derive(Deserialize)]
pub struct IndexParam {
index_uid: String,
_index_uid: String,
}
#[derive(Serialize)]

View File

@ -1,19 +1,12 @@
use std::collections::{HashMap, HashSet};
use actix_web::{get, post, web, HttpResponse};
use log::warn;
use serde::{Deserialize, Serialize};
use serde_json::Value;
use crate::error::{Error, FacetCountError, ResponseError};
use crate::helpers::meilisearch::{IndexSearchExt, SearchResult};
use crate::error::ResponseError;
use crate::helpers::Authentication;
use crate::routes::IndexParam;
use crate::Data;
use meilisearch_core::facets::FacetFilter;
use meilisearch_schema::{FieldId, Schema};
pub fn services(cfg: &mut web::ServiceConfig) {
cfg.service(search_with_post).service(search_with_url_query);
}
@ -36,9 +29,9 @@ pub struct SearchQuery {
#[get("/indexes/{index_uid}/search", wrap = "Authentication::Public")]
async fn search_with_url_query(
data: web::Data<Data>,
path: web::Path<IndexParam>,
params: web::Query<SearchQuery>,
_data: web::Data<Data>,
_path: web::Path<IndexParam>,
_params: web::Query<SearchQuery>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
@ -46,53 +39,24 @@ async fn search_with_url_query(
#[derive(Deserialize)]
#[serde(rename_all = "camelCase", deny_unknown_fields)]
pub struct SearchQueryPost {
q: Option<String>,
offset: Option<usize>,
limit: Option<usize>,
attributes_to_retrieve: Option<Vec<String>>,
attributes_to_crop: Option<Vec<String>>,
crop_length: Option<usize>,
attributes_to_highlight: Option<Vec<String>>,
filters: Option<String>,
matches: Option<bool>,
facet_filters: Option<Value>,
facets_distribution: Option<Vec<String>>,
}
impl From<SearchQueryPost> for SearchQuery {
fn from(other: SearchQueryPost) -> SearchQuery {
SearchQuery {
q: other.q,
offset: other.offset,
limit: other.limit,
attributes_to_retrieve: other.attributes_to_retrieve.map(|attrs| attrs.join(",")),
attributes_to_crop: other.attributes_to_crop.map(|attrs| attrs.join(",")),
crop_length: other.crop_length,
attributes_to_highlight: other.attributes_to_highlight.map(|attrs| attrs.join(",")),
filters: other.filters,
matches: other.matches,
facet_filters: other.facet_filters.map(|f| f.to_string()),
facets_distribution: other.facets_distribution.map(|f| format!("{:?}", f)),
}
}
_q: Option<String>,
_offset: Option<usize>,
_limit: Option<usize>,
_attributes_to_retrieve: Option<Vec<String>>,
_attributes_to_crop: Option<Vec<String>>,
_crop_length: Option<usize>,
_attributes_to_highlight: Option<Vec<String>>,
_filters: Option<String>,
_matches: Option<bool>,
_facet_filters: Option<Value>,
_facets_distribution: Option<Vec<String>>,
}
#[post("/indexes/{index_uid}/search", wrap = "Authentication::Public")]
async fn search_with_post(
data: web::Data<Data>,
path: web::Path<IndexParam>,
params: web::Json<SearchQueryPost>,
_data: web::Data<Data>,
_path: web::Path<IndexParam>,
_params: web::Json<SearchQueryPost>,
) -> Result<HttpResponse, ResponseError> {
let query: SearchQuery = params.0.into();
let search_result = query.search(&path.index_uid, data)?;
Ok(HttpResponse::Ok().json(search_result))
}
impl SearchQuery {
fn search(
&self,
index_uid: &str,
data: web::Data<Data>,
) -> Result<SearchResult, ResponseError> {
todo!()
}

View File

@ -1,15 +1,12 @@
use std::collections::{BTreeMap, BTreeSet};
use std::collections::BTreeSet;
use actix_web::{delete, get, post};
use actix_web::{web, HttpResponse};
use meilisearch_core::{MainReader, UpdateWriter};
use meilisearch_core::settings::{Settings, SettingsUpdate, UpdateState, DEFAULT_RANKING_RULES};
use meilisearch_schema::Schema;
use crate::Data;
use crate::error::{Error, ResponseError};
use crate::error::ResponseError;
use crate::helpers::Authentication;
use crate::routes::{IndexParam, IndexUpdateResponse};
use crate::updates::Settings;
pub fn services(cfg: &mut web::ServiceConfig) {
cfg.service(update_all)
@ -32,27 +29,28 @@ pub fn services(cfg: &mut web::ServiceConfig) {
.service(update_attributes_for_faceting);
}
#[post("/indexes/{index_uid}/settings", wrap = "Authentication::Private")]
async fn update_all(
data: web::Data<Data>,
path: web::Path<IndexParam>,
body: web::Json<Settings>,
_data: web::Data<Data>,
_path: web::Path<String>,
_body: web::Json<Settings>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
#[get("/indexes/{index_uid}/settings", wrap = "Authentication::Private")]
async fn get_all(
data: web::Data<Data>,
path: web::Path<IndexParam>,
_data: web::Data<Data>,
_path: web::Path<String>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
#[delete("/indexes/{index_uid}/settings", wrap = "Authentication::Private")]
async fn delete_all(
data: web::Data<Data>,
path: web::Path<IndexParam>,
_data: web::Data<Data>,
_path: web::Path<String>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
@ -62,8 +60,8 @@ async fn delete_all(
wrap = "Authentication::Private"
)]
async fn get_rules(
data: web::Data<Data>,
path: web::Path<IndexParam>,
_data: web::Data<Data>,
_path: web::Path<String>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
@ -73,9 +71,9 @@ async fn get_rules(
wrap = "Authentication::Private"
)]
async fn update_rules(
data: web::Data<Data>,
path: web::Path<IndexParam>,
body: web::Json<Option<Vec<String>>>,
_data: web::Data<Data>,
_path: web::Path<String>,
_body: web::Json<Option<Vec<String>>>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
@ -85,8 +83,8 @@ async fn update_rules(
wrap = "Authentication::Private"
)]
async fn delete_rules(
data: web::Data<Data>,
path: web::Path<IndexParam>,
_data: web::Data<Data>,
_path: web::Path<String>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
@ -96,8 +94,8 @@ async fn delete_rules(
wrap = "Authentication::Private"
)]
async fn get_distinct(
data: web::Data<Data>,
path: web::Path<IndexParam>,
_data: web::Data<Data>,
_path: web::Path<String>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
@ -107,9 +105,9 @@ async fn get_distinct(
wrap = "Authentication::Private"
)]
async fn update_distinct(
data: web::Data<Data>,
path: web::Path<IndexParam>,
body: web::Json<Option<String>>,
_data: web::Data<Data>,
_path: web::Path<String>,
_body: web::Json<Option<String>>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
@ -119,8 +117,8 @@ async fn update_distinct(
wrap = "Authentication::Private"
)]
async fn delete_distinct(
data: web::Data<Data>,
path: web::Path<IndexParam>,
_data: web::Data<Data>,
_path: web::Path<String>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
@ -130,8 +128,8 @@ async fn delete_distinct(
wrap = "Authentication::Private"
)]
async fn get_searchable(
data: web::Data<Data>,
path: web::Path<IndexParam>,
_data: web::Data<Data>,
_path: web::Path<String>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
@ -141,9 +139,9 @@ async fn get_searchable(
wrap = "Authentication::Private"
)]
async fn update_searchable(
data: web::Data<Data>,
path: web::Path<IndexParam>,
body: web::Json<Option<Vec<String>>>,
_data: web::Data<Data>,
_path: web::Path<String>,
_body: web::Json<Option<Vec<String>>>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
@ -153,8 +151,8 @@ async fn update_searchable(
wrap = "Authentication::Private"
)]
async fn delete_searchable(
data: web::Data<Data>,
path: web::Path<IndexParam>,
_data: web::Data<Data>,
_path: web::Path<String>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
@ -164,8 +162,8 @@ async fn delete_searchable(
wrap = "Authentication::Private"
)]
async fn get_displayed(
data: web::Data<Data>,
path: web::Path<IndexParam>,
_data: web::Data<Data>,
_path: web::Path<String>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
@ -175,9 +173,9 @@ async fn get_displayed(
wrap = "Authentication::Private"
)]
async fn update_displayed(
data: web::Data<Data>,
path: web::Path<IndexParam>,
body: web::Json<Option<BTreeSet<String>>>,
_data: web::Data<Data>,
_path: web::Path<String>,
_body: web::Json<Option<BTreeSet<String>>>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
@ -187,8 +185,8 @@ async fn update_displayed(
wrap = "Authentication::Private"
)]
async fn delete_displayed(
data: web::Data<Data>,
path: web::Path<IndexParam>,
_data: web::Data<Data>,
_path: web::Path<String>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
@ -198,8 +196,8 @@ async fn delete_displayed(
wrap = "Authentication::Private"
)]
async fn get_attributes_for_faceting(
data: web::Data<Data>,
path: web::Path<IndexParam>,
_data: web::Data<Data>,
_path: web::Path<String>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
@ -209,9 +207,9 @@ async fn get_attributes_for_faceting(
wrap = "Authentication::Private"
)]
async fn update_attributes_for_faceting(
data: web::Data<Data>,
path: web::Path<IndexParam>,
body: web::Json<Option<Vec<String>>>,
_data: web::Data<Data>,
_path: web::Path<String>,
_body: web::Json<Option<Vec<String>>>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
@ -221,8 +219,8 @@ async fn update_attributes_for_faceting(
wrap = "Authentication::Private"
)]
async fn delete_attributes_for_faceting(
data: web::Data<Data>,
path: web::Path<IndexParam>,
_data: web::Data<Data>,
_path: web::Path<String>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}

View File

@ -4,11 +4,9 @@ use actix_web::web;
use actix_web::HttpResponse;
use actix_web::get;
use chrono::{DateTime, Utc};
use log::error;
use serde::Serialize;
use walkdir::WalkDir;
use crate::error::{Error, ResponseError};
use crate::error::ResponseError;
use crate::helpers::Authentication;
use crate::routes::IndexParam;
use crate::Data;
@ -29,8 +27,8 @@ struct IndexStatsResponse {
#[get("/indexes/{index_uid}/stats", wrap = "Authentication::Private")]
async fn index_stats(
data: web::Data<Data>,
path: web::Path<IndexParam>,
_data: web::Data<Data>,
_path: web::Path<IndexParam>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
@ -44,7 +42,7 @@ struct StatsResult {
}
#[get("/stats", wrap = "Authentication::Private")]
async fn get_stats(data: web::Data<Data>) -> Result<HttpResponse, ResponseError> {
async fn get_stats(_data: web::Data<Data>) -> Result<HttpResponse, ResponseError> {
todo!()
}

View File

@ -1,11 +1,10 @@
use actix_web::{web, HttpResponse};
use actix_web::{delete, get, post};
use meilisearch_core::settings::{SettingsUpdate, UpdateState};
use std::collections::BTreeSet;
use crate::error::{Error, ResponseError};
use crate::error::ResponseError;
use crate::helpers::Authentication;
use crate::routes::{IndexParam, IndexUpdateResponse};
use crate::routes::IndexParam;
use crate::Data;
pub fn services(cfg: &mut web::ServiceConfig) {
@ -17,8 +16,8 @@ pub fn services(cfg: &mut web::ServiceConfig) {
wrap = "Authentication::Private"
)]
async fn get(
data: web::Data<Data>,
path: web::Path<IndexParam>,
_data: web::Data<Data>,
_path: web::Path<IndexParam>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
@ -28,9 +27,9 @@ async fn get(
wrap = "Authentication::Private"
)]
async fn update(
data: web::Data<Data>,
path: web::Path<IndexParam>,
body: web::Json<BTreeSet<String>>,
_data: web::Data<Data>,
_path: web::Path<IndexParam>,
_body: web::Json<BTreeSet<String>>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
@ -40,8 +39,8 @@ async fn update(
wrap = "Authentication::Private"
)]
async fn delete(
data: web::Data<Data>,
path: web::Path<IndexParam>,
_data: web::Data<Data>,
_path: web::Path<IndexParam>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}

View File

@ -2,12 +2,10 @@ use std::collections::BTreeMap;
use actix_web::{web, HttpResponse};
use actix_web::{delete, get, post};
use indexmap::IndexMap;
use meilisearch_core::settings::{SettingsUpdate, UpdateState};
use crate::error::{Error, ResponseError};
use crate::error::ResponseError;
use crate::helpers::Authentication;
use crate::routes::{IndexParam, IndexUpdateResponse};
use crate::routes::IndexParam;
use crate::Data;
pub fn services(cfg: &mut web::ServiceConfig) {
@ -19,8 +17,8 @@ pub fn services(cfg: &mut web::ServiceConfig) {
wrap = "Authentication::Private"
)]
async fn get(
data: web::Data<Data>,
path: web::Path<IndexParam>,
_data: web::Data<Data>,
_path: web::Path<IndexParam>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
@ -30,9 +28,9 @@ async fn get(
wrap = "Authentication::Private"
)]
async fn update(
data: web::Data<Data>,
path: web::Path<IndexParam>,
body: web::Json<BTreeMap<String, Vec<String>>>,
_data: web::Data<Data>,
_path: web::Path<IndexParam>,
_body: web::Json<BTreeMap<String, Vec<String>>>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}
@ -42,8 +40,8 @@ async fn update(
wrap = "Authentication::Private"
)]
async fn delete(
data: web::Data<Data>,
path: web::Path<IndexParam>,
_data: web::Data<Data>,
_path: web::Path<IndexParam>,
) -> Result<HttpResponse, ResponseError> {
todo!()
}