(feat) added handler
This commit is contained in:
parent
5b3c2d4ec7
commit
de7c0f7110
8 changed files with 203 additions and 32 deletions
|
|
@ -38,3 +38,15 @@ pub async fn health_handler(
|
|||
).into_response(),
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn test_token_handler(
|
||||
State(state): State<AppState>,
|
||||
) -> impl IntoResponse {
|
||||
match state.banking_clients.vbank.get_token().await {
|
||||
Ok(token) => (StatusCode::OK, Json(json!({ "vbank_token": token }))),
|
||||
Err(e) => (
|
||||
StatusCode::INTERNAL_SERVER_ERROR,
|
||||
Json(json!({ "error": e.to_string() })),
|
||||
),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue