diff --git a/.env b/.env index e1ce95c..de90950 100644 --- a/.env +++ b/.env @@ -6,4 +6,4 @@ JWT_SECRET="your_super_secret_key" SSL_KEY_PATH=/etc/ssl/private/private.key SSL_CERT_PATH=/etc/ssl/certs/full_chain.pem RUST_LOG=info -APP_VERSION="0.1.9" \ No newline at end of file +APP_VERSION="0.2.0" \ No newline at end of file diff --git a/.gitignore b/.gitignore index ea8c4bf..0f84cc9 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /target +/.vscode \ No newline at end of file diff --git a/src/db.rs b/src/db.rs index 2fcfca6..9cde540 100644 --- a/src/db.rs +++ b/src/db.rs @@ -32,10 +32,10 @@ pub async fn insert_weather_data(pool: &PgPool, weather_data: &WeatherData) -> R atmosphericstability, suitabilitydegree, winddirection, averagewinddirection, winddirectionstandarddeviation, windspeed, averagewindspeed, windspeedsuitability, winddirectionsuitability, overallsuitability, inspectiontype, assignmentnumber, - calculatedwindspeed, hasspotcheckwindspeed + calculatedwindspeed, hasspotcheckwindspeed, version ) VALUES ( $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, - $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, $31, $32, $33, $34, $35 + $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, $31, $32, $33, $34, $35, $36 ) RETURNING id "#; @@ -82,6 +82,7 @@ pub async fn insert_weather_data(pool: &PgPool, weather_data: &WeatherData) -> R .bind(&weather_data.assignment_number) .bind(weather_data.calculated_wind_speed) // 这个本来就是 Option,无需修改 .bind(weather_data.has_spot_check_wind_speed) + .bind(&weather_data.version) .fetch_one(pool) .await { @@ -116,8 +117,6 @@ pub async fn create_pool() -> Result> { Ok(pool) } -// 在db.rs中添加以下函数 - // 获取天气数据详情 pub async fn get_weather_details(pool: &PgPool, weather_id: i32) -> Result { let query = r#" @@ -133,7 +132,7 @@ pub async fn get_weather_details(pool: &PgPool, weather_id: i32) -> Result
- + ` - const filename = `${data.id}-${version}.pdf` + const filename = `${data.id}-${data.version || 'unknown'}.pdf` var opt = { margin: 10, filename: filename, image: { type: 'jpeg', - quality: 0.98 + quality: 0.99 }, html2canvas: { scale: 2