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