Refactor SQL queries into centralized module
- Moved various SQL query strings from individual worker files into a new `sql.rs` module for better organization and reusability. - Updated `events.rs`, `underground.rs`, and `weather.rs` to use the centralized SQL queries. - Removed redundant query definitions from `events.rs`, `underground.rs`, and `weather.rs`.
This commit is contained in:
@@ -11,6 +11,7 @@ use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
|
||||
use super::base::{BaseWorker, Worker, WorkerState};
|
||||
use crate::worker::sql::QUERY_UPDATE_MONEY;
|
||||
|
||||
pub struct UndergroundWorker {
|
||||
base: BaseWorker,
|
||||
@@ -118,10 +119,7 @@ const Q_SELECT_FALUKANT_USER: &str = r#"
|
||||
LIMIT 1;
|
||||
"#;
|
||||
|
||||
// Query für Geldänderungen (lokale Variante von BaseWorker::change_falukant_user_money)
|
||||
const QUERY_UPDATE_MONEY: &str = r#"
|
||||
SELECT falukant_data.update_money($1, $2, $3);
|
||||
"#;
|
||||
// Use centralized QUERY_UPDATE_MONEY from src/worker/sql.rs
|
||||
|
||||
impl UndergroundWorker {
|
||||
pub fn new(pool: ConnectionPool, broker: MessageBroker) -> Self {
|
||||
|
||||
Reference in New Issue
Block a user