Commit fa81f84c authored by Grzegorz Pietrusza's avatar Grzegorz Pietrusza

fix tasks description

parent ff3d7712
configuration.prod.yml
\ No newline at end of file
package com.telephoners.krakyournet.ctf.beans.tasks;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.telephoners.krakyournet.ctf.beans.Flag;
import com.telephoners.krakyournet.ctf.beans.User;
import com.telephoners.krakyournet.ctf.helpers.PublicProperty;
import com.telephoners.krakyournet.ctf.beans.Flag;
import org.bson.types.ObjectId;
import org.mongodb.morphia.annotations.Entity;
import org.mongodb.morphia.annotations.Id;
......@@ -25,10 +25,11 @@ public abstract class Task
private int level;
private List<Flag> flags;
public Task(String name, int level, List<Flag> flags)
public Task(String name, int level, String description, List<Flag> flags)
{
this.name = name;
this.level = level;
this.description = description;
this.flags = flags;
}
......
......@@ -13,9 +13,9 @@ public class TextTask extends Task
{
private String text;
public TextTask(String name, int level, List<Flag> flags, String text)
public TextTask(String name, int level, String description, List<Flag> flags, String text)
{
super(name, level, flags);
super(name, level, description, flags);
this.text = text;
}
......
......@@ -23,9 +23,9 @@ public class WebTask extends Task
private String url;
private static final Joiner URL_JOINER = Joiner.on("/");
public WebTask(String name, int level, List<Flag> flags, String url)
public WebTask(String name, int level, String description, List<Flag> flags, String url)
{
super(name, level, flags);
super(name, level, description, flags);
this.url = url;
}
......
......@@ -33,9 +33,10 @@ public class TasksRepository extends Repository<Task>
public List<Task> getAllPublic()
{
return datastore.createQuery(Task.class)
List<Task> level = datastore.createQuery(Task.class)
.order("level")
.retrievedFields(true, DBObjectUtils.getPublicFields(Task.class))
.asList();
return level;
}
}
\ No newline at end of file
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