From f0034679090d6de69bd3551607b5a7c66e9e92fd Mon Sep 17 00:00:00 2001 From: liyunjia Date: Sun, 6 Oct 2024 16:39:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=B8=9A=E5=8A=A1=E7=BB=86?= =?UTF-8?q?=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- domain/src/entities/account.rs | 6 +++--- server/src/controller/mod.rs | 9 ++------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/domain/src/entities/account.rs b/domain/src/entities/account.rs index 32f1d99..5c5277a 100644 --- a/domain/src/entities/account.rs +++ b/domain/src/entities/account.rs @@ -97,7 +97,7 @@ impl Account { return Ok(Some(account)); } Err(Error::RowNotFound) => { - return Err(Error::RowNotFound); + return Ok(None); } Err(e) => { tracing::error!("find_by_apple_id error: {:?}", e); @@ -122,7 +122,7 @@ impl Account { return Ok(Some(account)); } Err(Error::RowNotFound) => { - return Err(Error::RowNotFound); + return Ok(None); } Err(e) => { tracing::error!("find_by_custom_id error: {:?}", e); @@ -147,7 +147,7 @@ impl Account { return Ok(Some(account)); } Err(Error::RowNotFound) => { - return Err(Error::RowNotFound); + return Ok(None); } Err(e) => { tracing::error!("find_by_facebook_id error: {:?}", e); diff --git a/server/src/controller/mod.rs b/server/src/controller/mod.rs index 63ccd36..87770fa 100644 --- a/server/src/controller/mod.rs +++ b/server/src/controller/mod.rs @@ -5,7 +5,7 @@ pub mod account_controller; pub mod feedback_controller; pub fn init() -> Router { - let mut app = Router::new() + Router::new() // 用户登录、用户管理相关路由 .typed_route(account_controller::authenticate_google) .typed_route(account_controller::authenticate_with_password) @@ -13,10 +13,5 @@ pub fn init() -> Router { // 反馈相关路由 .typed_route(feedback_controller::add_feedback) .typed_route(feedback_controller::get_feedback_list_by_page) - // .typed_route(feedback_controller::get_feedback_list) - ; - for (path, method_router) in feedback_controller::get_feedback_list() { - app = app.route(path, method_router); - } - app + .typed_route(feedback_controller::get_feedback_list) }