stablizing ApiResponse inside lootalot_db crate

This commit is contained in:
2019-10-16 22:29:38 +02:00
parent 8af7790d17
commit 8cfa21eccf
4 changed files with 170 additions and 189 deletions

View File

@@ -3,7 +3,7 @@ use crate::{DbConnection, QueryResult};
use diesel::prelude::*;
/// Representation of a player in database
#[derive(Debug, Queryable, Serialize)]
#[derive(Queryable, Serialize, Deserialize, Debug)]
pub struct Player {
/// DB Identitier
pub id: i32,
@@ -91,7 +91,7 @@ fn unpack_gold_value(gold: f32) -> (i32, i32, i32, i32) {
///
/// Values are held as individual pieces counts.
/// Allows conversion from and to a floating amount of gold pieces.
#[derive(Queryable, AsChangeset, Debug)]
#[derive(Queryable, AsChangeset, Serialize, Deserialize, Debug)]
#[table_name = "players"]
pub struct Wealth {
pub cp: i32,