-
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.
Merge pull request #19 from TeamTroublePainter/feature/DRAW-443
DRAW-443 탈퇴 시 소셜 플랫폼 정보 제거 로직 추가
- Loading branch information
Showing
2 changed files
with
17 additions
and
4 deletions.
There are no files selected for viewing
17 changes: 13 additions & 4 deletions
17
adapter/rdb/src/main/kotlin/com/xorker/draw/auth/AuthUserJpaRepository.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,17 +1,26 @@ | ||
package com.xorker.draw.auth | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository | ||
import org.springframework.data.jpa.repository.Modifying | ||
import org.springframework.data.jpa.repository.Query | ||
import org.springframework.data.repository.query.Param | ||
|
||
internal interface AuthUserJpaRepository : JpaRepository<AuthUserJpaEntity, Long> { | ||
|
||
@Query( | ||
"SELECT au FROM AuthUserJpaEntity au " + | ||
"JOIN FETCH au.user " + | ||
"WHERE au.platformUserId = :platformUserId " + | ||
"select au from AuthUserJpaEntity au " + | ||
"join fetch au.user " + | ||
"where au.platformUserId = :platformUserId " + | ||
"and au.platform=:platform ", | ||
) | ||
fun find(platform: AuthPlatform, platformUserId: String): AuthUserJpaEntity? | ||
|
||
fun findByUserId(userId: Long): AuthUserJpaEntity? | ||
fun findByUserId(userId: Long): AuthUserJpaEntity | ||
|
||
@Modifying | ||
@Query( | ||
"delete from AuthUserJpaEntity au " + | ||
"where au.user.id = :userId", | ||
) | ||
fun deleteAllByUserId(@Param(value = "userId") userId: Long) | ||
} |
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