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