Skip to content

Commit

Permalink
ADD :: 리뷰 반영 (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yunyeong-Ko committed Mar 18, 2023
1 parent 0d3aa34 commit 3486136
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void deleteApplication(@PathVariable Long id) {
deleteApplicationService.execute(id);
}

@GetMapping("/{id}/close")
@PutMapping("/{id}/close")
public void closeApplication(@PathVariable Long id) {
closeApplicationService.execute(id);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,20 @@
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;

@Service
@RequiredArgsConstructor
public class CloseApplicationService {

private final UserFacade userFacade;
private final ApplicationFacade applicationFacade;
private final OwnerRepository ownerRepository;
private final UserFacade userFacade;

@Transactional
public void execute(Long id) {
Teacher teacher = userFacade.getCurrentTeacher();
Application application = applicationFacade.findApplicationById(id);
Application application = applicationFacade.getSimpleApplication(id);
application.validateStatus();
application.validatePermission(ownerRepository, teacher.getId());

Expand Down

0 comments on commit 3486136

Please sign in to comment.