-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
76 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 0 additions & 14 deletions
14
src/main/java/com/eodya/api/bookmark/repository/BookMarkRepository.java
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
src/main/java/com/eodya/api/bookmark/repository/BookmarkRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.eodya.api.bookmark.repository; | ||
|
||
import com.eodya.api.bookmark.domain.Bookmark; | ||
import com.eodya.api.bookmark.exception.BookmarkException; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import static com.eodya.api.bookmark.exception.BookmarkExceptionCode.*; | ||
|
||
public interface BookmarkRepository extends JpaRepository<Bookmark, Long> { | ||
|
||
default Bookmark getBookMarkById(Long bookMarkId) { | ||
return findById(bookMarkId).orElseThrow(() -> new BookmarkException(BOOKMARK_STATUS_NOT_FOUND, bookMarkId)); | ||
} | ||
} |
8 changes: 4 additions & 4 deletions
8
src/main/java/com/eodya/api/bookmark/service/BookmarkService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
package com.eodya.api.bookmark.service; | ||
|
||
import com.eodya.api.bookmark.domain.BookMark; | ||
import com.eodya.api.bookmark.domain.Bookmark; | ||
import com.eodya.api.bookmark.dto.request.BookMarkChangeStatusRequest; | ||
import com.eodya.api.bookmark.repository.BookMarkRepository; | ||
import com.eodya.api.bookmark.repository.BookmarkRepository; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
public class BookmarkService { | ||
|
||
private final BookMarkRepository bookmarkRepository; | ||
private final BookmarkRepository bookmarkRepository; | ||
|
||
public void updateBookmarkStatus( | ||
Long placeId, | ||
BookMarkChangeStatusRequest changeStatusRequest | ||
) { | ||
BookMark bookMark = bookmarkRepository.getBookMarkById(placeId); | ||
Bookmark bookMark = bookmarkRepository.getBookMarkById(placeId); | ||
} | ||
} |
19 changes: 0 additions & 19 deletions
19
src/main/java/com/eodya/api/bookmark/util/BookMarkStatusConverter.java
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
src/main/java/com/eodya/api/bookmark/util/BookmarkStatusConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.eodya.api.bookmark.util; | ||
|
||
import com.eodya.api.bookmark.domain.BookmarkStatus; | ||
import jakarta.persistence.AttributeConverter; | ||
import jakarta.persistence.Converter; | ||
|
||
@Converter | ||
public class BookmarkStatusConverter implements AttributeConverter<BookmarkStatus, String> { | ||
|
||
@Override | ||
public String convertToDatabaseColumn(BookmarkStatus bookMarkStatus) { | ||
return bookMarkStatus.getDescription(); | ||
} | ||
|
||
@Override | ||
public BookmarkStatus convertToEntityAttribute(String status) { | ||
return BookmarkStatus.from(status); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters