2019-09-05 00:04:57 +09:00
|
|
|
use actix_web::{web, Error, HttpResponse};
|
|
|
|
use futures::{future::ok as fut_ok, Future};
|
2019-04-09 14:12:07 -04:00
|
|
|
|
|
|
|
use crate::common::{Part, Product};
|
|
|
|
|
2019-04-14 10:34:41 -07:00
|
|
|
pub fn get_parts(
|
|
|
|
query: web::Query<Option<Part>>,
|
|
|
|
) -> impl Future<Item = HttpResponse, Error = Error> {
|
2019-04-09 14:12:07 -04:00
|
|
|
fut_ok(HttpResponse::Ok().finish())
|
|
|
|
}
|
|
|
|
|
2019-04-14 10:34:41 -07:00
|
|
|
pub fn add_part(
|
|
|
|
new_part: web::Json<Product>,
|
|
|
|
) -> impl Future<Item = HttpResponse, Error = Error> {
|
2019-04-09 14:12:07 -04:00
|
|
|
fut_ok(HttpResponse::Ok().finish())
|
|
|
|
}
|
|
|
|
|
2019-04-14 10:34:41 -07:00
|
|
|
pub fn get_part_detail(
|
|
|
|
id: web::Path<String>,
|
|
|
|
) -> impl Future<Item = HttpResponse, Error = Error> {
|
2019-04-09 14:12:07 -04:00
|
|
|
fut_ok(HttpResponse::Ok().finish())
|
|
|
|
}
|
|
|
|
|
2019-04-14 10:34:41 -07:00
|
|
|
pub fn remove_part(
|
|
|
|
id: web::Path<String>,
|
|
|
|
) -> impl Future<Item = HttpResponse, Error = Error> {
|
2019-04-09 14:12:07 -04:00
|
|
|
fut_ok(HttpResponse::Ok().finish())
|
2019-04-14 10:34:41 -07:00
|
|
|
}
|