Добавил еще немного
This commit is contained in:
@@ -56,8 +56,12 @@ public class TestController {
|
|||||||
@GetMapping
|
@GetMapping
|
||||||
public List<LessonResponse> getAllLessons() {
|
public List<LessonResponse> getAllLessons() {
|
||||||
return lessonRepository.findAll().stream()
|
return lessonRepository.findAll().stream()
|
||||||
.map(l -> new LessonResponse(l.getTeacherId(), l.getLessonId(), l.getDay(), l.getWeek(), l.getTime()))
|
.map(l -> new LessonResponse(l.getId(), l.getTeacherId(), l.getLessonId(), l.getDay(), l.getWeek(), l.getTime()))
|
||||||
.toList();
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/ping")
|
||||||
|
public String ping() {
|
||||||
|
return "pong";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,7 @@ package com.magistr.app.dto;
|
|||||||
|
|
||||||
public class LessonResponse {
|
public class LessonResponse {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
private Long teacherId;
|
private Long teacherId;
|
||||||
private Long groupId;
|
private Long groupId;
|
||||||
private Long lessonId;
|
private Long lessonId;
|
||||||
@@ -19,7 +20,8 @@ public class LessonResponse {
|
|||||||
this.time = time;
|
this.time = time;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LessonResponse(Long teacherId, Long lessonId, String day, String week, String time) {
|
public LessonResponse(Long id, Long teacherId, Long lessonId, String day, String week, String time) {
|
||||||
|
this.id = id;
|
||||||
this.teacherId = teacherId;
|
this.teacherId = teacherId;
|
||||||
this.lessonId = lessonId;
|
this.lessonId = lessonId;
|
||||||
this.day = day;
|
this.day = day;
|
||||||
@@ -27,6 +29,14 @@ public class LessonResponse {
|
|||||||
this.time = time;
|
this.time = time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
public Long getTeacherId() {
|
public Long getTeacherId() {
|
||||||
return teacherId;
|
return teacherId;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user