Добавил еще немного

This commit is contained in:
ProstoDenya01
2026-02-25 14:35:20 +03:00
parent c3d5246874
commit e44ac04cac
2 changed files with 16 additions and 2 deletions

View File

@@ -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";
}
}

View File

@@ -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;
}