Skip to content

Commit

Permalink
!hotfix: Noti compareTo 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
daeun084 committed Jul 31, 2024
1 parent 79f20df commit 301635d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
12 changes: 2 additions & 10 deletions src/main/java/makar/dev/converter/UserConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,17 @@
import makar.dev.dto.response.NotiResponse;
import makar.dev.dto.response.UserResponse;

import java.util.Collections;
import java.util.List;

public class UserConverter {

public static UserResponse.HomeDto toRouteSetHomeDto(NotiResponse.NotiListDto notiListDto, Route route){
List<NotiResponse.NotiDto> makarNotiDtoList = notiListDto.getMakarNotiDtoList();
List<NotiResponse.NotiDto> getOffNotiList = notiListDto.getGetoffNotiDtoList();
Collections.reverse(makarNotiDtoList);
Collections.reverse(getOffNotiList);

return UserResponse.HomeDto.builder()
.isRouteSet(true)
.sourceStationName(route.getSourceStation().getStationName())
.destinationStationName(route.getDestinationStation().getStationName())
.makarTime(route.getSchedule().getSourceTime())
.getOffTime(route.getSchedule().getDestinationTime())
.makarNotiList(makarNotiDtoList)
.getOffNotiList(getOffNotiList)
.makarNotiList(notiListDto.getMakarNotiDtoList())
.getOffNotiList(notiListDto.getGetoffNotiDtoList())
.build();
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/makar/dev/domain/Noti.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ public class Noti implements Comparable<Noti>{
@Override
public int compareTo(Noti noti) {
if (noti.getNoti_minute() < noti_minute)
return 1;
else if (noti.getNoti_minute() > noti_minute)
return -1;
else if (noti.getNoti_minute() > noti_minute)
return 1;
return 0;
}
}

0 comments on commit 301635d

Please sign in to comment.