Add AppState to Controller and split up models

This commit is contained in:
Tobias Reisinger 2023-12-07 01:32:20 +01:00
parent 8dc9072fe8
commit 83c1f033d5
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
11 changed files with 261 additions and 150 deletions
emgauwa-controller/src

View file

@ -0,0 +1,9 @@
use actix::Addr;
use emgauwa_lib::errors::EmgauwaError;
use emgauwa_lib::models::Controller;
use crate::app_state::{AppState, GetThis};
pub async fn get_this(app_state: &Addr<AppState>) -> Result<Controller, EmgauwaError> {
app_state.send(GetThis {}).await.map_err(EmgauwaError::from)
}