cleanup
This commit is contained in:
parent
962b8feae7
commit
645416a04c
|
@ -1,7 +1,7 @@
|
||||||
use darling::FromDeriveInput;
|
use darling::FromDeriveInput;
|
||||||
use proc_macro::{self, TokenStream};
|
use proc_macro::{self, TokenStream};
|
||||||
use quote::quote;
|
use quote::quote;
|
||||||
use syn::{Data, DeriveInput, Expr, Fields, Type, parse_macro_input};
|
use syn::{Data, Expr, Fields, Type, parse_macro_input};
|
||||||
|
|
||||||
#[derive(FromDeriveInput, Default)]
|
#[derive(FromDeriveInput, Default)]
|
||||||
#[darling(default, attributes(meta))]
|
#[darling(default, attributes(meta))]
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
use axum::{
|
use axum::{
|
||||||
body::{Body, Bytes},
|
extract::State,
|
||||||
extract::{Path, State},
|
http::StatusCode,
|
||||||
http::{HeaderMap, HeaderValue, StatusCode},
|
|
||||||
response::{IntoResponse, Response},
|
response::{IntoResponse, Response},
|
||||||
};
|
};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
@ -14,7 +13,7 @@ pub struct Data {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[axum::debug_handler]
|
#[axum::debug_handler]
|
||||||
pub async fn route(State(db): State<Database>) -> impl IntoResponse {
|
pub async fn route(State(_db): State<Database>) -> impl IntoResponse {
|
||||||
if false {
|
if false {
|
||||||
return Response::builder()
|
return Response::builder()
|
||||||
.status(StatusCode::NOT_FOUND)
|
.status(StatusCode::NOT_FOUND)
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
use axum::{
|
use axum::{
|
||||||
body::{Body, Bytes},
|
extract::State,
|
||||||
extract::{Path, State},
|
http::StatusCode,
|
||||||
http::{HeaderMap, HeaderValue, StatusCode},
|
|
||||||
response::{IntoResponse, Response},
|
response::{IntoResponse, Response},
|
||||||
};
|
};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
@ -27,4 +26,3 @@ pub async fn route(State(db): State<Database>) -> impl IntoResponse {
|
||||||
.body(String::new())
|
.body(String::new())
|
||||||
.unwrap()
|
.unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
use axum::{
|
use axum::{
|
||||||
body::{Body, Bytes},
|
extract::State,
|
||||||
extract::{Path, State},
|
http::StatusCode,
|
||||||
http::{HeaderMap, HeaderValue, StatusCode},
|
|
||||||
response::{IntoResponse, Response},
|
response::{IntoResponse, Response},
|
||||||
};
|
};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
@ -27,4 +26,3 @@ pub async fn route(State(db): State<Database>) -> impl IntoResponse {
|
||||||
.body(String::new())
|
.body(String::new())
|
||||||
.unwrap()
|
.unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
use axum::{
|
use axum::{
|
||||||
body::{Body, Bytes},
|
extract::State,
|
||||||
extract::{Path, State},
|
http::StatusCode,
|
||||||
http::{HeaderMap, HeaderValue, StatusCode},
|
|
||||||
response::{IntoResponse, Response},
|
response::{IntoResponse, Response},
|
||||||
};
|
};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
@ -27,4 +26,3 @@ pub async fn route(State(db): State<Database>) -> impl IntoResponse {
|
||||||
.body(String::new())
|
.body(String::new())
|
||||||
.unwrap()
|
.unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
use axum::{
|
use axum::{
|
||||||
body::{Body, Bytes},
|
extract::State,
|
||||||
extract::{Path, State},
|
http::StatusCode,
|
||||||
http::{HeaderMap, HeaderValue, StatusCode},
|
|
||||||
response::{IntoResponse, Response},
|
response::{IntoResponse, Response},
|
||||||
};
|
};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
@ -27,4 +26,3 @@ pub async fn route(State(db): State<Database>) -> impl IntoResponse {
|
||||||
.body(String::new())
|
.body(String::new())
|
||||||
.unwrap()
|
.unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ use axum::{Router, extract::State, http::StatusCode, routing::get};
|
||||||
pub mod files;
|
pub mod files;
|
||||||
pub mod user;
|
pub mod user;
|
||||||
|
|
||||||
async fn root(State(state): State<Database>) -> (StatusCode, &'static str) {
|
async fn root(State(_state): State<Database>) -> (StatusCode, &'static str) {
|
||||||
(StatusCode::OK, "We Good twin :3c")
|
(StatusCode::OK, "We Good twin :3c")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,4 @@
|
||||||
use axum::{
|
use axum::{body::Body, extract::State, http::StatusCode, response::Response};
|
||||||
body::Body,
|
|
||||||
extract::State,
|
|
||||||
http::{HeaderMap, HeaderValue, StatusCode},
|
|
||||||
response::{IntoResponse, Response},
|
|
||||||
};
|
|
||||||
|
|
||||||
use crate::db::Database;
|
use crate::db::Database;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
use axum::{
|
use axum::{Router, routing::post};
|
||||||
Router,
|
|
||||||
routing::{get, post},
|
|
||||||
};
|
|
||||||
|
|
||||||
use crate::db::Database;
|
use crate::db::Database;
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,6 @@ pub struct Mission {
|
||||||
pub created_at: i64,
|
pub created_at: i64,
|
||||||
pub modified_at: i64,
|
pub modified_at: i64,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Mission {
|
impl Mission {
|
||||||
pub async fn insert_new(&self, pool: &CurrPool) -> Result<Self> {
|
pub async fn insert_new(&self, pool: &CurrPool) -> Result<Self> {
|
||||||
let session = sqlx::query_as!(
|
let session = sqlx::query_as!(
|
||||||
|
|
|
@ -4,7 +4,7 @@ use sqlx::prelude::FromRow;
|
||||||
|
|
||||||
use crate::db::{
|
use crate::db::{
|
||||||
CurrPool,
|
CurrPool,
|
||||||
tables::{ForeignKey, TableMeta, assignables::missions::Mission, user::User},
|
tables::{ForeignKey, TableMeta, user::User},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, Default, Clone, FromRow, TableMeta)]
|
#[derive(Debug, Default, Clone, FromRow, TableMeta)]
|
||||||
|
|
|
@ -4,7 +4,7 @@ use std::{
|
||||||
ops::{Deref, DerefMut},
|
ops::{Deref, DerefMut},
|
||||||
};
|
};
|
||||||
|
|
||||||
use sqlx::{Decode, Encode, QueryBuilder, Type, postgres::PgRow};
|
use sqlx::{Decode, QueryBuilder, Type, postgres::PgRow};
|
||||||
|
|
||||||
pub mod assignables;
|
pub mod assignables;
|
||||||
pub mod attendance;
|
pub mod attendance;
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
use anyhow::bail;
|
|
||||||
use persmgr_derive::TableMeta;
|
use persmgr_derive::TableMeta;
|
||||||
use sqlx::prelude::FromRow;
|
use sqlx::prelude::FromRow;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user