Skip to content

Commit

Permalink
[FIX] 테스트 및 이슈 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
thguss committed Oct 25, 2023
1 parent 0e6fb74 commit 52221b4
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ public ResponseEntity<ApiResponse> createAlarm(@RequestBody AlarmRequestDTO requ
@ApiOperation("알림 리스트 조회")
@GetMapping
public ResponseEntity<ApiResponse> getAlarms(
@RequestParam Integer generation,
@RequestParam Part part,
@RequestParam Status status,
@RequestParam(required = false) Integer generation,
@RequestParam(required = false) Part part,
@RequestParam(required = false) Status status,
Pageable pageable
) {
val response = alarmService.getAlarms(generation, part, status, pageable);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ public record AlarmRequestDTO(
String link,
Boolean isActive,
Part part,
List<Long> targetList,
Status status
List<Long> targetList
) {
public Alarm toEntity() {
return new Alarm(this);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.sopt.makers.operation.dto.alarm;

import static java.util.Objects.*;

import org.sopt.makers.operation.entity.alarm.Alarm;

import lombok.Builder;
Expand All @@ -24,7 +26,7 @@ public static AlarmResponseDTO of(Alarm alarm) {
.content(alarm.getContent())
.link(alarm.getLink())
.createdAt(alarm.getCreatedDate().toString())
.sendAt(alarm.getSendAt().toString())
.sendAt(nonNull(alarm.getSendAt()) ? alarm.getSendAt().toString() : null)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ record AlarmVO(
static AlarmVO of(Alarm alarm) {
return AlarmVO.builder()
.alarmId(alarm.getId())
.part(alarm.getPart().getName())
.part(nonNull(alarm.getPart()) ? alarm.getPart().getName() : null)
.attribute(alarm.getAttribute().getName())
.title(alarm.getTitle())
.content(alarm.getContent())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,6 @@ public Alarm(AlarmRequestDTO requestDTO) {
if (nonNull(requestDTO.targetList())) {
this.targetList = requestDTO.targetList();
}
this.status = Status.BEFORE;
}
}

0 comments on commit 52221b4

Please sign in to comment.