1
0
mirror of https://github.com/actix/examples synced 2025-03-15 17:23:05 +01:00

33 lines
830 B
Rust
Raw Normal View History

2019-04-14 10:34:41 -07:00
use actix_multipart::{Field, Multipart, MultipartError};
use actix_web::{error, web, Error, HttpResponse};
use futures::{
future::{err as fut_err, ok as fut_ok, Either},
Future, Stream,
};
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
}