2020-10-20 00:36:53 +02:00
|
|
|
use actix_web::{post, web};
|
2020-01-12 14:04:02 +01:00
|
|
|
use serde::{Deserialize, Serialize};
|
2018-04-13 03:18:42 +02:00
|
|
|
|
2018-05-08 20:08:43 +02:00
|
|
|
#[derive(Deserialize, Serialize, Debug)]
|
2018-04-13 10:03:58 +02:00
|
|
|
pub struct Info {
|
2018-04-13 03:18:42 +02:00
|
|
|
username: String,
|
|
|
|
email: String,
|
|
|
|
password: String,
|
|
|
|
confirm_password: String,
|
|
|
|
}
|
|
|
|
|
2020-10-20 00:36:53 +02:00
|
|
|
#[post("/user/info")]
|
2019-12-16 08:09:54 +01:00
|
|
|
pub async fn info(info: web::Json<Info>) -> web::Json<Info> {
|
2022-06-08 04:53:38 +02:00
|
|
|
println!("=========={info:?}=========");
|
2019-03-29 21:43:03 +01:00
|
|
|
web::Json(Info {
|
2018-05-08 20:08:43 +02:00
|
|
|
username: info.username.clone(),
|
|
|
|
email: info.email.clone(),
|
|
|
|
password: info.password.clone(),
|
|
|
|
confirm_password: info.confirm_password.clone(),
|
2019-03-29 21:43:03 +01:00
|
|
|
})
|
2018-04-13 03:18:42 +02:00
|
|
|
}
|