Add start & end dates in chapter element
This commit is contained in:
parent
c60dee21b4
commit
94abf83731
2 changed files with 3 additions and 1 deletions
|
@ -35,6 +35,8 @@ public class ChapterElement implements Response {
|
||||||
chapterJSON.set("name", chapter.getName());
|
chapterJSON.set("name", chapter.getName());
|
||||||
boolean show = chapter.hasStarted();
|
boolean show = chapter.hasStarted();
|
||||||
chapterJSON.set("show", show);
|
chapterJSON.set("show", show);
|
||||||
|
if(chapter.getStartDate() != null) chapterJSON.set("start", chapter.getStartDate().toString());
|
||||||
|
if(chapter.getEndDate() != null) chapterJSON.set("end", chapter.getEndDate().toString());
|
||||||
PeerAtUser user = context.getUser();
|
PeerAtUser user = context.getUser();
|
||||||
if(show){
|
if(show){
|
||||||
JsonArray puzzles = new JsonArray();
|
JsonArray puzzles = new JsonArray();
|
||||||
|
|
|
@ -25,7 +25,7 @@ public class ChapterList implements Response {
|
||||||
@RouteDoc(path = "/chapters", responseCode = 200, responseDescription = "JSON contenant les informations des chapitres")
|
@RouteDoc(path = "/chapters", responseCode = 200, responseDescription = "JSON contenant les informations des chapitres")
|
||||||
@RouteDoc(responseCode = 400, responseDescription = "Aucun chapitre trouver")
|
@RouteDoc(responseCode = 400, responseDescription = "Aucun chapitre trouver")
|
||||||
|
|
||||||
@Route(path = "^\\/chapters$")
|
@Route(path = "^\\/chapters$", needLogin = true)
|
||||||
public void exec(Matcher matcher, Context context, HttpReader reader, HttpWriter writer) throws Exception {
|
public void exec(Matcher matcher, Context context, HttpReader reader, HttpWriter writer) throws Exception {
|
||||||
List<Chapter> allChapters = databaseRepo.getAllChapters();
|
List<Chapter> allChapters = databaseRepo.getAllChapters();
|
||||||
if (allChapters != null) {
|
if (allChapters != null) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue