test #322

Merged
klaus merged 6 commits from test into main 2025-06-02 12:41:46 +00:00
2 changed files with 17 additions and 1 deletions
Showing only changes of commit 28427a873a - Show all commits

View File

@ -30,6 +30,8 @@ interface CreatorAdminAudioContentQueryRepository {
fun getAudioContent(memberId: Long, audioContentId: Long): AudioContent?
fun findContentHashTagByContentIdAndIsActive(contentId: Long, isActive: Boolean): List<AudioContentHashTag>
fun findContentIdAndHashTagId(contentId: Long, hashTagId: Int): AudioContentHashTag?
}
class CreatorAdminAudioContentQueryRepositoryImpl(
@ -145,6 +147,19 @@ class CreatorAdminAudioContentQueryRepositoryImpl(
.fetch()
}
override fun findContentIdAndHashTagId(contentId: Long, hashTagId: Int): AudioContentHashTag? {
return queryFactory
.selectFrom(audioContentHashTag)
.innerJoin(audioContentHashTag.audioContent, audioContent)
.innerJoin(audioContentHashTag.hashTag, hashTag)
.where(
audioContent.id.eq(contentId),
hashTag.id.eq(hashTagId)
)
.orderBy(audioContentHashTag.id.asc())
.fetchFirst()
}
private fun formattedDateExpression(
dateTime: DateTimePath<LocalDateTime>,
format: String = "%Y-%m-%d"

View File

@ -184,7 +184,8 @@ class CreatorAdminContentService(
val hashTag = hashTagRepository.findByTag(tag)
?: hashTagRepository.save(HashTag(tag))
val audioContentHashTag = AudioContentHashTag()
val audioContentHashTag = repository.findContentIdAndHashTagId(request.id, hashTag.id!!)
?: AudioContentHashTag()
audioContentHashTag.audioContent = audioContent
audioContentHashTag.hashTag = hashTag