Skip to content

Commit

Permalink
feat: Attendee 상세 페이지 API 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
SHEOMM committed Mar 30, 2024
1 parent 930011a commit c414bb6
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,10 @@ public Attendee(Course course, String name, String note){
this.note = note;
}

public void update(String name, String note){
this.name = name;
this.note = note;
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.waruru.areyouhere.attendee.dto.request;

import com.waruru.areyouhere.attendee.service.dto.AttendeeInfo;
import java.util.List;

public class UpdateAttendeesRequestDto {
private Long courseId;
private List<AttendeeInfo> updatedAttendees;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.waruru.areyouhere.attendee.service.dto;


import com.waruru.areyouhere.attendee.domain.entity.Attendee;
import com.waruru.areyouhere.attendee.domain.repository.dto.AttendeeAttendDetailInfo;
import java.util.List;
import lombok.AccessLevel;
Expand All @@ -11,13 +12,21 @@
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class AttendeeDetailDto {
private AttendeeAttendanceInfo attendee;
private AttendeeInfo attendee;
private int attendance;
private int absence;

private List<AttendeeAttendeeDetail> attendanceInfo;

@Builder
public AttendeeDetailDto(AttendeeAttendanceInfo attendee, List<AttendeeAttendDetailInfo> attendanceInfo) {
this.attendee = attendee;
public AttendeeDetailDto(Attendee attendee, int attendance, int absence, List<AttendeeAttendDetailInfo> attendanceInfo) {
this.attendee = AttendeeInfo.builder()
.id(attendee.getId())
.name(attendee.getName())
.note(attendee.getNote())
.build();
this.attendance = attendance;
this.absence = absence;
this.attendanceInfo = attendanceInfo.stream()
.map(attendeeAttendDetailInfo -> new AttendeeAttendeeDetail(
attendeeAttendDetailInfo.getAttendanceId(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ public ResponseEntity<HttpStatus> unauthorized(){
@LoginRequired
@PutMapping
public ResponseEntity<HttpStatus> update(@RequestBody UpdateRequestDto updateRequestDto, @Login Manager manager){

managerService.update(manager.getId(), updateRequestDto.getName(), updateRequestDto.getPassword());
return RESPONSE_OK;
}
Expand Down

0 comments on commit c414bb6

Please sign in to comment.