summaryrefslogtreecommitdiffstats
path: root/service-person
diff options
context:
space:
mode:
Diffstat (limited to 'service-person')
-rw-r--r--service-person/Cargo.toml3
-rw-r--r--service-person/src/main.rs17
2 files changed, 4 insertions, 16 deletions
diff --git a/service-person/Cargo.toml b/service-person/Cargo.toml
index 833bdd2..9740298 100644
--- a/service-person/Cargo.toml
+++ b/service-person/Cargo.toml
@@ -12,3 +12,6 @@ serde = "1"
diesel = { version = "1.4.4", features = ["postgres", "r2d2"] }
diesel_migrations = "1.4"
getset = "0.1"
+
+person-api-types = { path = "./../person-api-types" }
+
diff --git a/service-person/src/main.rs b/service-person/src/main.rs
index 31050e0..75964b0 100644
--- a/service-person/src/main.rs
+++ b/service-person/src/main.rs
@@ -13,25 +13,10 @@ mod model;
mod schema;
use crate::db::DbPool;
+use person_api_types::v1::person::*;
embed_migrations!("migrations");
-#[derive(Debug, serde::Deserialize)]
-pub struct PersonCreateRequestData {
- name: String,
- age: i32,
-
- country: String,
- city: String,
- street: String,
- number: i32,
-}
-
-#[derive(Debug, serde::Serialize)]
-pub struct PersonCreateResponse {
- id: i32
-}
-
async fn create_person(db: web::Data<DbPool>, person: web::Json<PersonCreateRequestData>) -> impl Responder {
log::debug!("Creating person = {:?}", person);