Skip to content

Commit

Permalink
Merge pull request #41 from 9oormthonUniv-seoultech/SCRUM-35--classro…
Browse files Browse the repository at this point in the history
…om-filtering-api

Refactor: 강의실 현황 필터링 수정
  • Loading branch information
orieasy1 authored Nov 8, 2024
2 parents 212ec40 + 8c303fa commit 6a2814f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,16 @@ static class BuildingResponse {
@Schema(description = "건물 이름", example = "미래관")
private String buildingName;

@Schema(description = "건물 번호", example = "60")
private String buildingNumber;

@Schema(description = "필터링 강의실 리스트")
private List<ClassroomResponse> classrooms;

@Builder
public BuildingResponse(String buildingName, List<ClassroomResponse> classrooms) {
public BuildingResponse(String buildingName, String buildingNumber, List<ClassroomResponse> classrooms) {
this.buildingName = buildingName;
this.buildingNumber = buildingNumber;
this.classrooms = classrooms;
}

Expand All @@ -63,28 +67,38 @@ static class ClassroomResponse {
@Schema(description = "층", example = "1")
private Long floor;

@Schema(description = "강의실 ID", example = "1")
private Long classroomId;

@Schema(description = "강의실 번호", example = "101")
private String classroomNumber;

@Schema(description = "강의실 이름")
private String classroomName;

@Schema(description = "시간 정보 리스트")
private List<ReservationTime> time;

@Schema(description = "인원 수")
private Integer headcount;

@Builder
public ClassroomResponse(Long floor, String classroomNumber, List<ReservationTime> time,
public ClassroomResponse(Long floor, Long classroomId, String classroomNumber, String classroomName, List<ReservationTime> time,
Integer headcount) {
this.floor = floor;
this.classroomId = classroomId;
this.classroomNumber = classroomNumber;
this.classroomName = classroomName;
this.time = time;
this.headcount = headcount;
}

public static ClassroomResponse from(Classroom classroom, List<Reservation> reservations) {
return ClassroomResponse.builder()
.floor(classroom.getFloor())
.classroomId(classroom.getId())
.classroomNumber(classroom.getNumber())
.classroomName(classroom.getName())
.time(reservations.stream()
.map(ReservationTime::from)
.collect(Collectors.toList()))
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ springdoc:
path: /
disable-swagger-default-url: true
display-request-duration: true
operations-sorter: alpha
operations-sorter: alpha

0 comments on commit 6a2814f

Please sign in to comment.