Skip to content

Commit

Permalink
feat : 태그 삭제 로직 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
youngjijang committed Jul 4, 2024
1 parent f778aee commit 25a3319
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ import org.springframework.data.jpa.repository.JpaRepository

interface PoseTagRepository : JpaRepository<PoseTag, Long> {
fun findByTag(tag: Tag): List<PoseTag>
fun deleteAllByTag_TagId(tagId: Long)
}
6 changes: 6 additions & 0 deletions src/main/kotlin/com/poseplz/server/domain/tag/TagService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ interface TagService {
fun findByTagIds(tagIds: List<Long>): List<Tag>
fun getById(tagId: Long): Tag
fun merge(sourceTagId: Long, targetTagId: Long): Tag
fun delete(tagId: Long)
}

@Service
Expand Down Expand Up @@ -79,4 +80,9 @@ class TagServiceImpl(
tagRepository.delete(targetTag)
return sourceTag
}

override fun delete(tagId: Long) {
poseTagRepository.deleteAllByTag_TagId(tagId)
tagRepository.deleteById(tagId)
}
}

0 comments on commit 25a3319

Please sign in to comment.