diff --git a/api/src/controller/account.rs b/api/src/controller/account.rs index b7ed55f..dd6edf8 100644 --- a/api/src/controller/account.rs +++ b/api/src/controller/account.rs @@ -1,21 +1,18 @@ use axum::Json; -use axum_extra::extract::WithRejection; use domain::dto::account::{AuthenticateGooleAccountReq, AuthenticateWithPassword}; -use library::resp::{rejection::IRejection, response::{ ResData, ResResult}}; +use library::resp::response::{ ResData, ResResult}; use validator::Validate; pub async fn authenticate_google( - WithRejection(Json(req), _): IRejection> -) -> ResResult> { + Json(req): Json +) -> ResResult> { req.validate()?; - service::account::authenticate_google(req).await?; - - Ok(ResData::none()) + service::account::authenticate_google(req).await } pub async fn authenticate_with_password( - WithRejection(Json(req), _): IRejection> + Json(req): Json ) -> ResResult> { req.validate()?; diff --git a/api/src/controller/feedback.rs b/api/src/controller/feedback.rs index 2addda4..d5ada84 100644 --- a/api/src/controller/feedback.rs +++ b/api/src/controller/feedback.rs @@ -1,21 +1,17 @@ use axum::extract::Query; use axum::Json; -use axum_extra::extract::WithRejection; use validator::Validate; use domain::dto::feedback::FeedbackAdd; use domain::dto::pageable::PageParams; use domain::entities::feedback::Feedback; use library::resp::pageable::Pageable; -use library::resp::rejection::IRejection; -use library::resp::response::{ResErr, ResData, ResResult}; +use library::resp::response::{ResData, ResResult}; /// 添加反馈信息 pub async fn add_feedback( - WithRejection(Json(req), _): IRejection> + Json(req): Json ) -> ResResult> { - if let Err(err) = req.validate() { - return Err(ResErr::ErrParams(Some(err.to_string()))); - } + req.validate()?; service::feedback::add_feedback(req).await } diff --git a/library/src/social/apple.rs b/library/src/social/apple.rs index 28daba5..46f5478 100644 --- a/library/src/social/apple.rs +++ b/library/src/social/apple.rs @@ -110,7 +110,9 @@ struct ApplePublicKey { n: String, kty: String, #[serde(rename = "use")] + #[allow(unused)] use_: String, + #[allow(unused)] alg: String, kid: String, } diff --git a/library/src/social/google.rs b/library/src/social/google.rs index 9293862..29b184f 100644 --- a/library/src/social/google.rs +++ b/library/src/social/google.rs @@ -110,7 +110,9 @@ struct GooglePublicKey { n: String, kty: String, #[serde(rename = "use")] + #[allow(unused)] use_: String, + #[allow(unused)] alg: String, kid: String, }