Fixed getting timestamp.
This commit is contained in:
parent
40e8974d6b
commit
7717e98ae9
|
@ -8,4 +8,5 @@ edition = "2021"
|
|||
[dependencies]
|
||||
rocket = { version = "0.5.0-rc.2", features = ["json"] }
|
||||
mysql = "22.2.0"
|
||||
mysql_common = { version = "0.28.2", features = ["chrono"] }
|
||||
dotenv = "0.15.0"
|
|
@ -3,6 +3,7 @@ use std::result::Result;
|
|||
use std::error::Error;
|
||||
use mysql::*;
|
||||
use mysql::prelude::*;
|
||||
|
||||
use crate::types;
|
||||
|
||||
pub fn get_maps() -> Result<Vec<types::Map>, Box<dyn Error>> {
|
||||
|
@ -37,7 +38,7 @@ pub fn get_map_by_name(name: &str) -> Result<Option<types::Map>, Box<dyn Error>>
|
|||
|
||||
|
||||
|
||||
pub fn create_pool() -> Result<Pool, Box<dyn Error>> {
|
||||
fn create_pool() -> Result<Pool, Box<dyn Error>> {
|
||||
let url = env::var("DB_URI")?;
|
||||
let pool = Pool::new(url.as_str())?;
|
||||
Ok(pool)
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
use mysql_common::chrono::NaiveDateTime;
|
||||
use rocket::serde::{Serialize, Deserialize};
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
|
@ -8,5 +9,5 @@ pub struct Map {
|
|||
pub points: i8,
|
||||
pub stars: i8,
|
||||
pub mapper: String,
|
||||
pub timestamp: String,
|
||||
pub timestamp: NaiveDateTime,
|
||||
}
|
Loading…
Reference in New Issue
Block a user