Mod Creation (#34)

* Inital creation stuff

* File Reader

* Upload bodies

* Major rework:

* Finish Multiple Files

* Proper Error Handling

* Switch to database models

* Run formatter

* Make dependencies dependent on Versions over mods

* Fixes

* Fix clippy

* Run lint one last time

* Update src/models/mods.rs

Co-authored-by: AppleTheGolden <scotsbox@protonmail.com>

Co-authored-by: AppleTheGolden <scotsbox@protonmail.com>
This commit is contained in:
Geometrically
2020-07-16 10:16:35 -07:00
committed by GitHub
parent b1d3e258bd
commit 39b1435725
17 changed files with 567 additions and 27 deletions

View File

@@ -1,3 +1,4 @@
use crate::database::models::team_item::Team;
use crate::database::models::Item;
use crate::database::Result;
use bson::{Bson, Document};
@@ -5,15 +6,23 @@ use serde::{Deserialize, Serialize};
#[derive(Deserialize, Serialize)]
pub struct Mod {
/// The ID for the mod, must be serializable to base62
pub id: i32,
//Todo: Move to own table
/// The team that owns the mod
pub team: Team,
pub title: String,
pub description: String,
pub body_url: String,
pub published: String,
pub author: String,
pub downloads: i32,
pub categories: Vec<String>,
pub body_path: String,
pub icon_path: String,
///A vector of Version IDs specifying the mod version of a dependency
pub version_ids: Vec<i32>,
pub icon_url: Option<String>,
pub issues_url: Option<String>,
pub source_url: Option<String>,
pub wiki_url: Option<String>,
}
impl Item for Mod {
fn get_collection() -> &'static str {