From 40748b68857fb8dc950aee106d8cda9f588b401b Mon Sep 17 00:00:00 2001 From: K0nnyaku Date: Wed, 4 Dec 2024 22:20:26 +0800 Subject: [PATCH] chore: add contest to problem_model --- Cargo.lock | 2 +- src/models/problem.rs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 13552c9..e68e43c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -71,7 +71,7 @@ dependencies = [ [[package]] name = "algohub-server" -version = "0.1.10" +version = "0.1.11" dependencies = [ "anyhow", "chrono", diff --git a/src/models/problem.rs b/src/models/problem.rs index b788b00..21d7379 100644 --- a/src/models/problem.rs +++ b/src/models/problem.rs @@ -53,6 +53,8 @@ pub struct Problem { pub categories: Vec, pub tags: Vec, + pub contest: Option, + pub visibility: ProblemVisibility, pub created_at: chrono::NaiveDateTime, @@ -89,6 +91,8 @@ pub struct CreateProblem<'r> { pub categories: Vec, pub tags: Vec, + pub contest: Option, + pub visibility: ProblemVisibility, } @@ -110,6 +114,7 @@ impl From> for Problem { categories: val.categories, tags: val.tags, visibility: val.visibility, + contest: None, created_at: chrono::Local::now().naive_local(), updated_at: chrono::Local::now().naive_local(), }