Move request models

This commit is contained in:
Tobias Reisinger 2023-12-05 01:51:06 +01:00
parent b3228ea6b5
commit 2a82cf79c4
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
7 changed files with 48 additions and 32 deletions
emgauwa-core/src/handlers/v1

View file

@ -2,15 +2,9 @@ use actix_web::{delete, get, put, web, HttpResponse};
use emgauwa_lib::db::DbController;
use emgauwa_lib::errors::{DatabaseError, EmgauwaError};
use emgauwa_lib::models::{convert_db_list, Controller, FromDbModel};
use emgauwa_lib::types::ControllerUid;
use serde_derive::{Deserialize, Serialize};
use emgauwa_lib::types::{ControllerUid, RequestController};
use sqlx::{Pool, Sqlite};
#[derive(Debug, Serialize, Deserialize)]
pub struct RequestController {
name: String,
}
#[get("/api/v1/controllers")]
pub async fn index(pool: web::Data<Pool<Sqlite>>) -> Result<HttpResponse, EmgauwaError> {
let mut pool_conn = pool.acquire().await?;