Skip to content

Commit

Permalink
hotfix: 작동 안되는 코드 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
ori0o0p committed Aug 20, 2024
1 parent 23ea265 commit 7c30059
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
package com.example.whopper.domain.library.application.impl;

import com.example.whopper.domain.library.application.component.FindLibraryByIdComponent;
import com.example.whopper.domain.library.application.usecase.FindLibraryIndexUseCase;
import com.example.whopper.domain.library.dao.LibraryMongoRepository;
import com.example.whopper.domain.library.domain.LibraryEntity;
import com.example.whopper.domain.library.dto.response.LibraryIndexResponse;
import com.example.whopper.domain.library.exception.LibraryNotFoundException;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class FindLibraryIndexService implements FindLibraryIndexUseCase {

private final FindLibraryByIdComponent findLibraryByIdComponent;
private final LibraryMongoRepository libraryMongoRepository;

public LibraryIndexResponse findLibraryIndex(String libraryId) {
LibraryEntity library = findLibraryByIdComponent.findLibraryById(libraryId);
LibraryEntity library = libraryMongoRepository.findById(libraryId)
.orElseThrow(() -> LibraryNotFoundException.EXCEPTION);

return new LibraryIndexResponse(library.getIndex());
}
Expand Down

0 comments on commit 7c30059

Please sign in to comment.