Compare commits

..

2 Commits

Author SHA1 Message Date
klaus 8aa79c4a9c Merge pull request '콘텐츠 등록 - 태그 등록' (#116) from test into main
Reviewed-on: #116
2024-01-16 15:19:59 +00:00
Klaus 71a3c357e7 콘텐츠 등록 - 태그 등록
AS-IS : 태그 분리시 빈 칸을 기준으로만 split하여 #A#B와 같이 태그가 저장되는 경우 있음
TO-BE : replace함수를 사용하여 # 앞에 빈 칸을 추가하여 #A#B로 저장되는 태그를 #A, #B와 같이 따로 저장되도록 수정
2024-01-15 11:10:01 +09:00
1 changed files with 2 additions and 1 deletions

View File

@ -198,10 +198,11 @@ class AudioContentService(
// 태그 분리, #추가, 등록 // 태그 분리, #추가, 등록
if (request.tags.isNotBlank()) { if (request.tags.isNotBlank()) {
val tags = request.tags val tags = request.tags
.replace("#", " #")
.split(" ") .split(" ")
.asSequence() .asSequence()
.map { it.trim() } .map { it.trim() }
.filter { it.isNotEmpty() } .filter { it.isNotBlank() }
.map { .map {
val tag = if (!it.startsWith("#")) { val tag = if (!it.startsWith("#")) {
"#$it" "#$it"