(gateway_id: &EUI64)
| 417 | } |
| 418 | |
| 419 | pub async fn get_meta(gateway_id: &EUI64) -> Result<GatewayMeta, Error> { |
| 420 | let meta = gateway::dsl::gateway |
| 421 | .inner_join(tenant::table) |
| 422 | .select(( |
| 423 | gateway::gateway_id, |
| 424 | gateway::tenant_id, |
| 425 | gateway::latitude, |
| 426 | gateway::longitude, |
| 427 | gateway::altitude, |
| 428 | tenant::private_gateways_up, |
| 429 | tenant::private_gateways_down, |
| 430 | gateway::downlink_priority, |
| 431 | )) |
| 432 | .filter(gateway::dsl::gateway_id.eq(&gateway_id)) |
| 433 | .first(&mut get_async_db_conn().await?) |
| 434 | .await |
| 435 | .map_err(|e| Error::from_diesel(e, gateway_id.to_string()))?; |
| 436 | Ok(meta) |
| 437 | } |
| 438 | |
| 439 | #[cfg(feature = "postgres")] |
| 440 | pub async fn get_counts_by_state(tenant_id: &Option<Uuid>) -> Result<GatewayCountsByState, Error> { |
no test coverage detected