Skip to content

Commit

Permalink
[fix]
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyeon330 committed Sep 6, 2023
1 parent c1d39f5 commit 33e3425
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 29 deletions.
7 changes: 0 additions & 7 deletions src/main/java/check_in42/backend/BackendApplication.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
package check_in42.backend;

import check_in42.backend.equipments.utils.EquipmentType;
import check_in42.backend.presentation.utils.PresentationStatus;
import check_in42.backend.presentation.utils.PresentationTime;
import check_in42.backend.presentation.utils.PresentationType;
import check_in42.backend.visitors.Visitors;
import check_in42.backend.visitors.visitUtils.PriorApproval;
import check_in42.backend.visitors.visitUtils.VisitPlace;
import check_in42.backend.visitors.visitUtils.VisitPurpose;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public Long updateDenyCheckDay(LocalDate formDate) {
return conferenceCheckDay.getId();
}

@Transactional
public Long updateAllowCheckDay(ConferenceRoom conferenceRoom) {
long year, month, day;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public List<VisitorsDTO> userVisitorsList(final String intraId) {
}

public List<ConferenceRoomDTO> userConferenceRoomList(final String intraId) {
final List<ConferenceRoomDTO> conferenceRoomDTOS = userService.findConferenceList(intraId);
final List<ConferenceRoomDTO> conferenceRoomDTOS = userService.findConferenceByAfterNowList(intraId);
return conferenceRoomDTOS;
}
}
17 changes: 0 additions & 17 deletions src/main/java/check_in42/backend/tablet/TabletController.java
Original file line number Diff line number Diff line change
@@ -1,30 +1,19 @@
package check_in42.backend.tablet;

import check_in42.backend.auth.argumentresolver.UserId;
import check_in42.backend.auth.argumentresolver.UserInfo;
import check_in42.backend.conferenceRoom.ConferenceCheckDay.ConferenceCheckDayService;
import check_in42.backend.conferenceRoom.ConferenceCheckOut.ConferenceCheckOutService;
import check_in42.backend.conferenceRoom.ConferenceEnum.PlaceInfoBit;
import check_in42.backend.conferenceRoom.ConferenceRoom.ConferenceRoom;
import check_in42.backend.conferenceRoom.ConferenceRoom.ConferenceRoomDTO;
import check_in42.backend.conferenceRoom.ConferenceRoom.ConferenceRoomService;
import check_in42.backend.conferenceRoom.ConferenceUtil;
import check_in42.backend.user.UserService;
import lombok.RequiredArgsConstructor;
import lombok.extern.java.Log;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.view.RedirectView;

import java.time.LocalDate;
import java.util.List;

@RestController
@RequiredArgsConstructor
@RequestMapping("/tablet/")
@Slf4j
public class TabletController {

private final ConferenceCheckOutService conferenceCheckOutService;
Expand Down Expand Up @@ -56,10 +45,4 @@ public ResponseEntity deleteForm(@RequestBody ConferenceRoomDTO conferenceRoomDT
conferenceRoomService.deleteForm(conferenceRoomDTO);
return ResponseEntity.ok(HttpStatus.OK);
}

UserService userService;
@GetMapping("test")
public ResponseEntity<List<ConferenceRoomDTO>> test(@UserId UserInfo userInfo) {
return ResponseEntity.ok(userService.findConferenceList(userInfo.getIntraId()));
}
}
5 changes: 3 additions & 2 deletions src/main/java/check_in42/backend/tablet/TabletService.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package check_in42.backend.tablet;

import check_in42.backend.conferenceRoom.ConferenceCheckOut.ConferenceCheckOutRepository;
import check_in42.backend.conferenceRoom.ConferenceRoom.ConferenceRoom;
import check_in42.backend.conferenceRoom.ConferenceRoom.ConferenceRoomDTO;
import check_in42.backend.conferenceRoom.ConferenceRoom.ConferenceRoomRepository;
import check_in42.backend.conferenceRoom.ConferenceRoom.ConferenceRoomService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
Expand All @@ -17,6 +17,7 @@
@Transactional(readOnly = true)
public class TabletService {
private final ConferenceRoomRepository conferenceRoomRepository;
private final ConferenceRoomService conferenceRoomService;

public List<ConferenceRoomDTO> findAllByPlaceAndNowOver(LocalDate date, Long placeInfo, Long timeBit) {
List<ConferenceRoomDTO> result = new ArrayList<>();
Expand All @@ -27,6 +28,6 @@ public List<ConferenceRoomDTO> findAllByPlaceAndNowOver(LocalDate date, Long pla

@Transactional
public void updateState(Long formId) {
conferenceRoomRepository.findById(formId).get().setCheckInState(true);
conferenceRoomService.findOne(formId).setCheckInState(true);
}
}
2 changes: 1 addition & 1 deletion src/main/java/check_in42/backend/user/UserService.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public Optional<User> findByRefreshToken(String refreshToken) {
return userRepository.findByRefreshToken(refreshToken);
}

public List<ConferenceRoomDTO> findConferenceList (String intraId) {
public List<ConferenceRoomDTO> findConferenceByAfterNowList (String intraId) {
final User user = this.findByName(intraId)
.orElseThrow(UserRunTimeException.NoUserException::new);
final List<ConferenceRoom> conferenceRoomList = user.getConferenceRooms();
Expand Down

0 comments on commit 33e3425

Please sign in to comment.