15 lines
413 B
Rust
15 lines
413 B
Rust
|
use rocket::{http::ContentType, serde::json::Json, Response};
|
||
|
|
||
|
use crate::model::person::Person;
|
||
|
|
||
|
#[get("/person/<dni>")]
|
||
|
pub async fn get_by_dni(dni: i32) -> Json<Person> {
|
||
|
Json(Person {
|
||
|
person_id: 1,
|
||
|
person_dni: format!("{}", dni),
|
||
|
person_names: "Juan".to_string(),
|
||
|
person_paternal_surname: "Perez".to_string(),
|
||
|
person_maternal_surname: "Gomez".to_string(),
|
||
|
})
|
||
|
}
|