2020-08-27 00:11:50 +02:00
|
|
|
use super::schema::files;
|
2020-08-27 01:29:44 +02:00
|
|
|
use serde::Serialize;
|
2020-08-27 00:11:50 +02:00
|
|
|
|
2020-08-27 01:29:44 +02:00
|
|
|
#[derive(Queryable, Serialize)]
|
2020-08-27 00:11:50 +02:00
|
|
|
pub struct File {
|
|
|
|
pub id: i32,
|
|
|
|
pub hash: String,
|
|
|
|
pub path: String,
|
|
|
|
pub size: i64,
|
|
|
|
pub valid: bool,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Insertable, Debug)]
|
|
|
|
#[table_name = "files"]
|
|
|
|
pub struct NewFile {
|
|
|
|
pub hash: String,
|
|
|
|
pub path: String,
|
|
|
|
pub size: i64,
|
|
|
|
}
|