summaryrefslogtreecommitdiffstats
path: root/service-person/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'service-person/src/main.rs')
-rw-r--r--service-person/src/main.rs22
1 files changed, 2 insertions, 20 deletions
diff --git a/service-person/src/main.rs b/service-person/src/main.rs
index 81be674..759050d 100644
--- a/service-person/src/main.rs
+++ b/service-person/src/main.rs
@@ -2,28 +2,10 @@ use std::str::FromStr;
use anyhow::Context;
use actix_web::{web, App, HttpServer, HttpResponse, Result};
-use serde::Deserialize;
-#[derive(Debug, Deserialize)]
-struct Name(String);
+mod model;
-#[derive(Debug, Deserialize)]
-struct Age(usize);
-
-#[derive(Debug, Deserialize)]
-struct Address {
- street: String,
- number: String,
- city: String,
- country: String,
-}
-
-#[derive(Debug, Deserialize)]
-struct Person {
- name: Name,
- age: Age,
- addr: Address,
-}
+use model::*;
async fn create_person(person: web::Json<Person>) -> Result<HttpResponse> {
log::debug!("Creating person = {:?}", person);