update
This commit is contained in:
2
src/db/mod.rs
Normal file
2
src/db/mod.rs
Normal file
@@ -0,0 +1,2 @@
|
||||
pub mod models;
|
||||
pub use models::*;
|
||||
@@ -2,11 +2,13 @@
|
||||
|
||||
#![allow(unused)]
|
||||
#![allow(clippy::all)]
|
||||
use diesel::{
|
||||
prelude::Queryable,
|
||||
sql_types::{Json, Uuid},
|
||||
};
|
||||
|
||||
|
||||
use uuid::Uuid;
|
||||
#[derive(Queryable, Debug)]
|
||||
pub struct Icon {
|
||||
pub struct RowIcon {
|
||||
pub id: Uuid,
|
||||
pub name: String,
|
||||
pub content_type: Option<String>,
|
||||
@@ -17,7 +19,7 @@ pub struct Icon {
|
||||
}
|
||||
|
||||
#[derive(Queryable, Debug)]
|
||||
pub struct Ingredient {
|
||||
pub struct RowIngredient {
|
||||
pub id: Uuid,
|
||||
pub resource: Uuid,
|
||||
pub quantity: i32,
|
||||
@@ -26,7 +28,7 @@ pub struct Ingredient {
|
||||
}
|
||||
|
||||
#[derive(Queryable, Debug)]
|
||||
pub struct Recipe {
|
||||
pub struct RowRecipe {
|
||||
pub id: Uuid,
|
||||
pub resource: Uuid,
|
||||
pub recipe_type: String,
|
||||
@@ -35,7 +37,7 @@ pub struct Recipe {
|
||||
}
|
||||
|
||||
#[derive(Queryable, Debug)]
|
||||
pub struct Resource {
|
||||
pub struct RowResource {
|
||||
pub id: Uuid,
|
||||
pub name: String,
|
||||
pub title: String,
|
||||
@@ -43,4 +45,3 @@ pub struct Resource {
|
||||
pub icon: Option<Uuid>,
|
||||
pub state: Option<Json>,
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
mod db;
|
||||
mod parse;
|
||||
mod types;
|
||||
|
||||
use std::{fs::File, io::Read};
|
||||
|
||||
use parse::parse;
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use crate::types::{Duration, Icon, Ingredient, Recipe, RecipeType, Resource, ResourceState};
|
||||
use regex::Regex;
|
||||
use select::{
|
||||
document::Document,
|
||||
node::Node,
|
||||
predicate::{Attr, Name, Or},
|
||||
};
|
||||
|
||||
use crate::types::{Duration, Icon, Ingredient, Recipe, RecipeType, Resource, ResourceState};
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
enum ParseType {
|
||||
|
||||
Reference in New Issue
Block a user