移除无用代码

This commit is contained in:
李运家 2024-06-06 14:53:22 +08:00
parent b1b64558fe
commit 0a40e7ebbc
4 changed files with 12 additions and 15 deletions

View File

@ -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<Json<AuthenticateGooleAccountReq>>
) -> ResResult<ResData<()>> {
Json(req): Json<AuthenticateGooleAccountReq>
) -> ResResult<ResData<(String, String)>> {
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<AuthenticateWithPassword>>
Json(req): Json<AuthenticateWithPassword>
) -> ResResult<ResData<(String, String)>> {
req.validate()?;

View File

@ -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<FeedbackAdd>>
Json(req): Json<FeedbackAdd>
) -> ResResult<ResData<()>> {
if let Err(err) = req.validate() {
return Err(ResErr::ErrParams(Some(err.to_string())));
}
req.validate()?;
service::feedback::add_feedback(req).await
}

View File

@ -110,7 +110,9 @@ struct ApplePublicKey {
n: String,
kty: String,
#[serde(rename = "use")]
#[allow(unused)]
use_: String,
#[allow(unused)]
alg: String,
kid: String,
}

View File

@ -110,7 +110,9 @@ struct GooglePublicKey {
n: String,
kty: String,
#[serde(rename = "use")]
#[allow(unused)]
use_: String,
#[allow(unused)]
alg: String,
kid: String,
}