Commit 17ce4407 authored by Grzegorz Pietrusza's avatar Grzegorz Pietrusza

add timestamp field to solution

parent 9bef56cd
...@@ -2,6 +2,7 @@ package com.telephoners.krakyournet.ctf.beans; ...@@ -2,6 +2,7 @@ package com.telephoners.krakyournet.ctf.beans;
import com.telephoners.krakyournet.ctf.beans.tasks.Task; import com.telephoners.krakyournet.ctf.beans.tasks.Task;
import org.bson.types.ObjectId; import org.bson.types.ObjectId;
import org.joda.time.Instant;
import org.mongodb.morphia.annotations.Entity; import org.mongodb.morphia.annotations.Entity;
import org.mongodb.morphia.annotations.Id; import org.mongodb.morphia.annotations.Id;
...@@ -15,12 +16,14 @@ public class Solution ...@@ -15,12 +16,14 @@ public class Solution
private Task task; private Task task;
private Team team; private Team team;
private Flag flag; private Flag flag;
private Instant submitionTime;
public Solution(Team team, Task task, Flag flag) public Solution(Team team, Task task, Flag flag)
{ {
this.team = checkNotNull(team); this.team = checkNotNull(team);
this.task = checkNotNull(task); this.task = checkNotNull(task);
this.flag = checkNotNull(flag); this.flag = checkNotNull(flag);
this.submitionTime = Instant.now();
} }
public Solution() public Solution()
...@@ -56,4 +59,14 @@ public class Solution ...@@ -56,4 +59,14 @@ public class Solution
{ {
this.flag = flag; this.flag = flag;
} }
public Instant getSubmitionTime()
{
return submitionTime;
}
public void setSubmitionTime(Instant submitionTime)
{
this.submitionTime = submitionTime;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment