-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #427 from Team-Ampersand/426-return-the-current-nu…
…mber-of-likes 좋아요, 좋아요 취소 시 현재 좋아요 수 반환
- Loading branch information
Showing
10 changed files
with
49 additions
and
39 deletions.
There are no files selected for viewing
16 changes: 0 additions & 16 deletions
16
src/main/kotlin/com/dotori/v2/domain/like/repository/LikeRepository.kt
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
14 changes: 14 additions & 0 deletions
14
src/main/kotlin/com/dotori/v2/domain/music/domain/repository/MusicLikeRepository.kt
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.dotori.v2.domain.music.domain.repository | ||
|
||
import com.dotori.v2.domain.music.domain.entity.MusicLike | ||
import feign.Param | ||
import javax.persistence.LockModeType | ||
import org.springframework.data.jpa.repository.JpaRepository | ||
import org.springframework.data.jpa.repository.Lock | ||
import org.springframework.data.jpa.repository.Query | ||
|
||
interface MusicLikeRepository : JpaRepository<MusicLike, Long> { | ||
@Lock(LockModeType.PESSIMISTIC_WRITE) | ||
@Query("select l from MusicLike l where l.memberId = :memberId and l.musicId = :musicId") | ||
fun findByMemberIdAndMusicId(@Param("memberId") memberId: Long, @Param("musicId") musicId: Long): MusicLike? | ||
} |
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
5 changes: 5 additions & 0 deletions
5
src/main/kotlin/com/dotori/v2/domain/music/presentation/data/res/MusicLikeCountResDto.kt
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,5 @@ | ||
package com.dotori.v2.domain.music.presentation.data.res | ||
|
||
data class MusicLikeCountResDto( | ||
private val likeCount: Int | ||
) |
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
4 changes: 3 additions & 1 deletion
4
src/main/kotlin/com/dotori/v2/domain/music/service/ToggleMusicLikeService.kt
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,5 +1,7 @@ | ||
package com.dotori.v2.domain.music.service | ||
|
||
import com.dotori.v2.domain.music.presentation.data.res.MusicLikeCountResDto | ||
|
||
interface ToggleMusicLikeService { | ||
fun execute(musicId: Long) | ||
fun execute(musicId: Long) : MusicLikeCountResDto | ||
} |
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