升级依赖版本

This commit is contained in:
李运家 2025-03-09 10:57:10 +08:00
parent fe5dd45cfd
commit be5c596a1d
9 changed files with 364 additions and 497 deletions

817
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -18,11 +18,11 @@ i18n = { path = "i18n" }
[workspace.dependencies] [workspace.dependencies]
tokio = "1.43" tokio = "1.43"
axum = "0.7.9" axum = "0.8.1"
tracing = "0.1" tracing = "0.1"
tower-http = "0.6.2" tower-http = "0.6.2"
validator = "0.18.1" validator = "0.20.0"
axum-extra = "0.9" axum-extra = "0.10.0"
serde = "1.0" serde = "1.0"
sqlx = "0.8" sqlx = "0.8"
sqlx-postgres = "0.8" sqlx-postgres = "0.8"
@ -31,7 +31,7 @@ once_cell = "1.20"
tracing-appender = "0.2" tracing-appender = "0.2"
tracing-subscriber = "0.3" tracing-subscriber = "0.3"
chrono = "0.4" chrono = "0.4"
thiserror = "1.0" thiserror = "2.0.12"
ulid = "1.1" ulid = "1.1"
serde_json = "1.0" serde_json = "1.0"
http = "1.2" http = "1.2"
@ -48,18 +48,18 @@ mimalloc = "0.1.43"
tokio-cron-scheduler = "0.13.0" tokio-cron-scheduler = "0.13.0"
hmac = "0.12.1" hmac = "0.12.1"
sha2 = "0.10.8" sha2 = "0.10.8"
hex-literal = "0.4.1" hex-literal = "1.0.0"
proc-macro2 = "1.0.92" proc-macro2 = "1.0.92"
syn = "2.0.96" syn = "2.0.96"
quote = "1.0.38" quote = "1.0.38"
hyper = "1.5.2" hyper = "1.5.2"
tower = "0.5.2" tower = "0.5.2"
csv = "1.3.1" csv = "1.3.1"
strum = "0.26.3" strum = "0.27.1"
strum_macros = "0.26.4" strum_macros = "0.27.1"
hex = "0.4.3" hex = "0.4.3"
redis = "0.27.6" redis = "0.29.1"
deadpool-redis = "0.18.0" deadpool-redis = "0.20.0"
chrono-tz = "0.10.0" chrono-tz = "0.10.0"
inventory = "0.3.17" inventory = "0.3.17"
oauth2 = "5.0.0" oauth2 = "5.0.0"

View File

@ -20,8 +20,8 @@ expires = 1800
refresh_expires = 3600 refresh_expires = 3600
[redis] [redis]
#url = "47.95.198.7:33000" url = "47.95.198.7:33000"
url = "127.0.0.1:33001" # url = "127.0.0.1:33001"
password = "3aB7kRt9pDf1nQzW" password = "3aB7kRt9pDf1nQzW"
db = 0 db = 0

View File

@ -1,9 +1,6 @@
use axum::{ use axum::extract::{
async_trait,
extract::{
rejection::{FormRejection, JsonRejection}, rejection::{FormRejection, JsonRejection},
FromRequest, Request, FromRequest, Request,
},
}; };
use http::header::CONTENT_TYPE; use http::header::CONTENT_TYPE;
use i18n::{message, message_ids::MessageId}; use i18n::{message, message_ids::MessageId};
@ -13,7 +10,6 @@ use crate::{context::Context, model::response::ResErr};
pub struct JsonBody<T>(pub T); pub struct JsonBody<T>(pub T);
#[async_trait]
impl<S, T> FromRequest<S> for JsonBody<T> impl<S, T> FromRequest<S> for JsonBody<T>
where where
axum::Json<T>: FromRequest<S, Rejection = JsonRejection>, axum::Json<T>: FromRequest<S, Rejection = JsonRejection>,

View File

@ -1,9 +1,8 @@
use axum::{async_trait, extract::FromRequestParts}; use axum::extract::FromRequestParts;
use http::request::Parts; use http::request::Parts;
use crate::{context::Context, model::response::ResErr}; use crate::{context::Context, model::response::ResErr};
#[async_trait]
impl<S> FromRequestParts<S> for Context impl<S> FromRequestParts<S> for Context
where where
S: Send + Sync, S: Send + Sync,

View File

@ -1,7 +1,4 @@
use axum::{ use axum::extract::{path::ErrorKind, rejection::PathRejection, FromRequestParts};
async_trait,
extract::{path::ErrorKind, rejection::PathRejection, FromRequestParts},
};
use http::request::Parts; use http::request::Parts;
use i18n::{message, message_ids::MessageId}; use i18n::{message, message_ids::MessageId};
use serde::de::DeserializeOwned; use serde::de::DeserializeOwned;
@ -10,7 +7,6 @@ use crate::{context::Context, model::response::ResErr};
pub struct PathVar<T>(pub T); pub struct PathVar<T>(pub T);
#[async_trait]
impl<S, T> FromRequestParts<S> for PathVar<T> impl<S, T> FromRequestParts<S> for PathVar<T>
where where
T: DeserializeOwned + Send, T: DeserializeOwned + Send,

View File

@ -1,5 +1,4 @@
use axum::{ use axum::{
async_trait,
body::Body, body::Body,
extract::{FromRequest, FromRequestParts, Query}, extract::{FromRequest, FromRequestParts, Query},
}; };
@ -11,7 +10,6 @@ use crate::{context::Context, model::response::ResErr};
pub struct QueryParams<T>(pub T); pub struct QueryParams<T>(pub T);
#[async_trait]
impl<S, T> FromRequest<S> for QueryParams<T> impl<S, T> FromRequest<S> for QueryParams<T>
where where
S: Send + Sync, S: Send + Sync,

View File

@ -32,7 +32,7 @@ pub async fn get_feedback_list_by_page(
.await .await
} }
#[route("/feedback/:page/:pageSize", method = ["get", "post"])] #[route("/feedback/{page}/{pageSize}", method = ["get", "post"])]
pub async fn get_feedback_list( pub async fn get_feedback_list(
context: Context, context: Context,
PathVar(page_params): PathVar<PageParams>, PathVar(page_params): PathVar<PageParams>,

View File

@ -67,5 +67,6 @@ fn init() -> Router {
} }
pub async fn hello(context: Context) -> String { pub async fn hello(context: Context) -> String {
tracing::info!("hello");
message!(context.get_lang_tag(), MessageId::Hello, "川岳").to_string() message!(context.get_lang_tag(), MessageId::Hello, "川岳").to_string()
} }