Reformat code

This commit is contained in:
Tobias Reisinger 2023-11-21 14:58:01 +01:00
parent 271b24b70d
commit a17a9868fa
8 changed files with 40 additions and 33 deletions

View file

@ -1,4 +1,3 @@
use crate::db::models::Periods;
use chrono::{NaiveTime, Timelike};
use serde::{Deserialize, Serialize};
use sqlx::database::HasArguments;
@ -7,6 +6,8 @@ use sqlx::error::BoxDynError;
use sqlx::sqlite::{SqliteTypeInfo, SqliteValueRef};
use sqlx::{Decode, Encode, Sqlite, Type};
use crate::db::models::Periods;
#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
pub struct Period {
#[serde(with = "period_format")]

View file

@ -1,6 +1,6 @@
use crate::db::model_utils::Period;
use serde::{Deserialize, Serialize};
use crate::db::model_utils::Period;
use crate::types::EmgauwaUid;
#[derive(Debug, Serialize)]

View file

@ -1,8 +1,10 @@
use crate::db::errors::DatabaseError;
use crate::db::models::*;
use std::ops::DerefMut;
use sqlx::pool::PoolConnection;
use sqlx::Sqlite;
use std::ops::DerefMut;
use crate::db::errors::DatabaseError;
use crate::db::models::*;
pub async fn create_tag(
conn: &mut PoolConnection<Sqlite>,

View file

@ -1,11 +1,12 @@
use crate::db::errors::DatabaseError;
use std::borrow::Borrow;
use std::convert::TryFrom;
use actix_web::{delete, get, post, put, web, HttpResponse, Responder};
use serde::{Deserialize, Serialize};
use sqlx::pool::PoolConnection;
use sqlx::{Pool, Sqlite};
use std::borrow::Borrow;
use std::convert::TryFrom;
use crate::db::errors::DatabaseError;
use crate::db::models::{Periods, Schedule};
use crate::db::schedules::*;
use crate::db::tag::get_tag;

View file

@ -1,10 +1,11 @@
extern crate dotenv;
use std::str::FromStr;
use actix_web::middleware::TrailingSlash;
use actix_web::{middleware, web, App, HttpServer};
use log::{trace, LevelFilter};
use simple_logger::SimpleLogger;
use std::str::FromStr;
mod db;
mod handlers;

View file

@ -1,7 +1,8 @@
use std::sync::RwLock;
use config::Config;
use lazy_static::lazy_static;
use serde_derive::Deserialize;
use std::sync::RwLock;
#[derive(Clone, Debug, Deserialize)]
#[serde(default)]

View file

@ -2,7 +2,6 @@ use std::convert::TryFrom;
use std::fmt::{Debug, Formatter};
use std::str::FromStr;
use crate::types::EmgauwaUid;
use serde::{Serialize, Serializer};
use sqlx::database::HasArguments;
use sqlx::encode::IsNull;
@ -11,6 +10,8 @@ use sqlx::sqlite::{SqliteTypeInfo, SqliteValueRef};
use sqlx::{Decode, Encode, Sqlite, Type};
use uuid::Uuid;
use crate::types::EmgauwaUid;
impl EmgauwaUid {
const OFF_STR: &'static str = "off";
const ON_STR: &'static str = "on";