test #259

Merged
klaus merged 18 commits from test into main 2025-02-18 14:48:10 +00:00
1 changed files with 13 additions and 3 deletions
Showing only changes of commit 03e1ef3271 - Show all commits

View File

@ -20,7 +20,12 @@ class AdminHashTagCurationService(
) { ) {
@Transactional @Transactional
fun createContentHashTagCuration(request: CreateContentHashTagCurationRequest) { fun createContentHashTagCuration(request: CreateContentHashTagCurationRequest) {
val isExists = repository.isExistsTag(tag = request.tag.trim()) var tag = request.tag.trim()
if (!tag.startsWith("#")) {
tag = "#$tag"
}
val isExists = repository.isExistsTag(tag = tag)
if (isExists) { if (isExists) {
throw SodaException("이미 등록된 태그 입니다.") throw SodaException("이미 등록된 태그 입니다.")
@ -28,7 +33,7 @@ class AdminHashTagCurationService(
repository.save( repository.save(
ContentHashTagCuration( ContentHashTagCuration(
tag = request.tag, tag = tag,
isAdult = request.isAdult isAdult = request.isAdult
) )
) )
@ -40,7 +45,12 @@ class AdminHashTagCurationService(
?: throw SodaException("잘못된 요청입니다.") ?: throw SodaException("잘못된 요청입니다.")
if (request.tag != null) { if (request.tag != null) {
hashTagCuration.tag = request.tag var tag = request.tag.trim()
if (!tag.startsWith("#")) {
tag = "#$tag"
}
hashTagCuration.tag = tag
} }
if (request.isAdult != null) { if (request.isAdult != null) {