Rename ControllerUid to a more general EmgauwaUid (for macros)
This commit is contained in:
parent
07d3322c5a
commit
51aa0d3c99
11 changed files with 55 additions and 57 deletions
emgauwa-core/src/handlers/v1
|
@ -3,9 +3,7 @@ use actix_web::{get, post, put, web, HttpResponse};
|
|||
use emgauwa_lib::db::{DbController, DbJunctionRelaySchedule, DbRelay, DbTag};
|
||||
use emgauwa_lib::errors::{DatabaseError, EmgauwaError};
|
||||
use emgauwa_lib::models::{convert_db_list, FromDbModel, Relay};
|
||||
use emgauwa_lib::types::{
|
||||
ControllerUid, ControllerWsAction, RequestRelayPulse, RequestRelayUpdate,
|
||||
};
|
||||
use emgauwa_lib::types::{ControllerWsAction, EmgauwaUid, RequestRelayPulse, RequestRelayUpdate};
|
||||
use emgauwa_lib::utils;
|
||||
use sqlx::{Pool, Sqlite};
|
||||
|
||||
|
@ -49,7 +47,7 @@ pub async fn index_for_controller(
|
|||
let mut pool_conn = pool.acquire().await?;
|
||||
|
||||
let (controller_uid,) = path.into_inner();
|
||||
let uid = ControllerUid::try_from(controller_uid.as_str())?;
|
||||
let uid = EmgauwaUid::try_from(controller_uid.as_str())?;
|
||||
|
||||
let controller = DbController::get_by_uid(&mut pool_conn, &uid)
|
||||
.await?
|
||||
|
@ -69,7 +67,7 @@ pub async fn show_for_controller(
|
|||
let mut pool_conn = pool.acquire().await?;
|
||||
|
||||
let (controller_uid, relay_num) = path.into_inner();
|
||||
let uid = ControllerUid::try_from(controller_uid.as_str())?;
|
||||
let uid = EmgauwaUid::try_from(controller_uid.as_str())?;
|
||||
|
||||
let controller = DbController::get_by_uid(&mut pool_conn, &uid)
|
||||
.await?
|
||||
|
@ -93,7 +91,7 @@ pub async fn update_for_controller(
|
|||
let mut pool_conn = pool.acquire().await?;
|
||||
|
||||
let (controller_uid, relay_num) = path.into_inner();
|
||||
let uid = ControllerUid::try_from(controller_uid.as_str())?;
|
||||
let uid = EmgauwaUid::try_from(controller_uid.as_str())?;
|
||||
|
||||
let controller = DbController::get_by_uid(&mut pool_conn, &uid)
|
||||
.await?
|
||||
|
@ -162,7 +160,7 @@ pub async fn pulse(
|
|||
let mut pool_conn = pool.acquire().await?;
|
||||
|
||||
let (controller_uid, relay_num) = path.into_inner();
|
||||
let uid = ControllerUid::try_from(controller_uid.as_str())?;
|
||||
let uid = EmgauwaUid::try_from(controller_uid.as_str())?;
|
||||
|
||||
let controller = DbController::get_by_uid(&mut pool_conn, &uid)
|
||||
.await?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue