Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
xyzwv committed Mar 17, 2024
2 parents 4bb057b + 8defafe commit aba13db
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,13 @@ public String deleteLostItem(@PathVariable("item_id") Long itemId) {
lostItemService.deleteLostItem(writer, itemId);
return "글이 삭제되었습니다.";
}

@Operation(summary = "핀한 정류장 리스트 조회")
@ApiResponse(responseCode = "200", description = "조회 성공")
// 분실물 글 상세 조회
@GetMapping("/{item_id}")
@ResponseStatus(HttpStatus.OK)
public ItemPostResDto getLostItemDetail (@PathVariable("item_id") Long itemId){
return lostItemService.getLostItemDetail(itemId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.List;
import java.util.Objects;

import jakarta.persistence.EntityNotFoundException;
import org.springframework.stereotype.Service;
import org.springframework.web.server.ResponseStatusException;

Expand Down Expand Up @@ -86,4 +87,11 @@ public void deleteLostItem(Member writer, Long itemId) {
throw new ResponseStatusException(ErrorCode.NO_WRITER.getStatus(), ErrorCode.NO_WRITER.getMessage());
lostItemRepository.delete(lostItem);
}

// 분실물 글 상세 조회
public ItemPostResDto getLostItemDetail(Long itemId) {
LostItem lostItem = lostItemRepository.findById(itemId)
.orElseThrow(() -> new EntityNotFoundException("해당 itmeId의 글이 존재하지 않습니다."));
return new ItemPostResDto(lostItem);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,14 @@ public StopTimetable getStopTimetable(Integer stopId){
List<TimeResponseDto> downs = new ArrayList<>();

// 현재 요일 구하기 (월:1, ..., 일:7)
/*
LocalDate today = LocalDate.now();
DayOfWeek dayOfWeek = today.getDayOfWeek();
int dayOfWeekNumber = dayOfWeek.getValue();
*/
int dayOfWeekNumber = 1;

// 주간 상행. 연협행, 한우리행 섞여있고, 시간순으로 정렬해서 조회
// 주간 상행. 연협행, 한우리행 섞여있고, 시간순으로 정렬해서 조회
List<TimeTableDay> dayUps = timeTableDayRepository.findByIsUpboundOrderByDepartureTimeAsc(Boolean.TRUE);

// 주간 하행. 연협행, 한우리행 섞여있고, 시간순으로 정렬해서 조회
Expand Down

0 comments on commit aba13db

Please sign in to comment.