Skip to content

Commit

Permalink
[fix]
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyeon330 committed Sep 14, 2023
1 parent 023e264 commit 360de48
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,13 @@ public static int getTimeIdx(LocalDateTime time) {
}

public static int getTimeIdx() {
return getTimeIdx(LocalDateTime.now().withHour(18).withMinute(30));
return getTimeIdx(LocalDateTime.now());
}

public static Long getAfterTimeBit(int nowTimeIdx) {
public static Long getAfterTimeBit(int timeIdx) {
long timeBit = 0;
for (int i = 0; i < nowTimeIdx; i++) {

for (int i = 0; i < timeIdx; i++) {
timeBit = (timeBit << 1) | 1;
}
return PlaceInfoBit.TIME.getValue() & ~timeBit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.springframework.web.bind.annotation.*;

import java.time.LocalDate;
import java.time.LocalDateTime;

@RestController
@RequiredArgsConstructor
Expand All @@ -23,7 +24,7 @@ public class TabletController {
@GetMapping("reservations/{place}")
public ResponseEntity<TabletDTO> reservations(@PathVariable(name = "place") final String roomName) {
TabletDTO tabletDTO = new TabletDTO(tabletService
.findAllByPlaceAndNowOver(LocalDate.now(), Rooms.valueOf(roomName).getRoomBit(), ConferenceUtil.getAfterTimeBit()));
.findAllByPlaceAndNowOver(LocalDate.now(), Rooms.valueOf(roomName).getRoomBit(), ConferenceUtil.getAfterTimeBit(ConferenceUtil.getTimeIdx(LocalDateTime.now().withDayOfMonth(15).withHour(10).withMinute(30)))));
return ResponseEntity.ok(tabletDTO);
}

Expand Down

0 comments on commit 360de48

Please sign in to comment.