Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion core/src/main/kotlin/common/exception/ErrorType.kt
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ enum class ErrorType(
DUPLICATE_EMAIL(HttpStatus.CONFLICT, 40901, "이미 사용 중인 이메일입니다", "이미 사용 중인 이메일입니다", "회원가입 실패"),
DUPLICATE_FRIEND(HttpStatus.CONFLICT, 40902, "이미 친구 관계이거나 친구 요청을 보냈습니다", "이미 친구 관계이거나 친구 요청을 보냈습니다"),
INVALID_FRIEND(HttpStatus.CONFLICT, 40903, "친구 요청을 보낼 수 없는 유저입니다", "친구 요청을 보낼 수 없는 유저입니다"),
DUPLICATE_THEME_NAME(HttpStatus.CONFLICT, 40904, "중복된 테마 이름입니다", "동일한 테마 이름이 이미 있습니다. 다른 이름을 입력해 주세요", "테마 이름 중복"),

// DUPLICATE_THEME_NAME(HttpStatus.CONFLICT, 40904, "중복된 테마 이름입니다", "동일한 테마 이름이 이미 있습니다. 다른 이름을 입력해 주세요", "테마 이름 중복"),
INVALID_THEME_TYPE(HttpStatus.CONFLICT, 40905, "적절하지 않은 유형의 테마입니다", "적절하지 않은 유형의 테마입니다"),
DUPLICATE_POPUP_KEY(HttpStatus.CONFLICT, 40906, "중복된 팝업 키입니다", "중복된 팝업 키입니다"),
ALREADY_DOWNLOADED_THEME(HttpStatus.CONFLICT, 40907, "이미 다운로드한 테마입니다", "이미 다운로드한 테마입니다"),
Expand Down
2 changes: 0 additions & 2 deletions core/src/main/kotlin/common/exception/SnuttException.kt
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,6 @@ object DuplicateFriendException : SnuttException(ErrorType.DUPLICATE_FRIEND)

object InvalidFriendException : SnuttException(ErrorType.INVALID_FRIEND)

object DuplicateThemeNameException : SnuttException(ErrorType.DUPLICATE_THEME_NAME)

object InvalidThemeTypeException : SnuttException(ErrorType.INVALID_THEME_TYPE)

object DuplicatePopupKeyException : SnuttException(ErrorType.DUPLICATE_POPUP_KEY)
Expand Down
2 changes: 0 additions & 2 deletions core/src/main/kotlin/theme/data/TimetableTheme.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ package com.wafflestudio.snutt.theme.data

import org.springframework.data.annotation.Id
import org.springframework.data.annotation.Transient
import org.springframework.data.mongodb.core.index.CompoundIndex
import org.springframework.data.mongodb.core.index.Indexed
import org.springframework.data.mongodb.core.mapping.Document
import org.springframework.data.mongodb.core.mapping.Field
import org.springframework.data.mongodb.core.mapping.FieldType
import java.time.LocalDateTime

@Document
@CompoundIndex(def = "{ 'userId': 1, 'name': 1 }", unique = true)
data class TimetableTheme(
@Id
var id: String? = null,
Expand Down
3 changes: 0 additions & 3 deletions core/src/main/kotlin/theme/service/TimetableThemeService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.wafflestudio.snutt.theme.service

import com.wafflestudio.snutt.common.enums.BasicThemeType
import com.wafflestudio.snutt.common.exception.AlreadyDownloadedThemeException
import com.wafflestudio.snutt.common.exception.DuplicateThemeNameException
import com.wafflestudio.snutt.common.exception.InvalidThemeColorCountException
import com.wafflestudio.snutt.common.exception.InvalidThemeTypeException
import com.wafflestudio.snutt.common.exception.NotDefaultThemeErrorException
Expand Down Expand Up @@ -150,7 +149,6 @@ class TimetableThemeServiceImpl(
colors: List<ColorSet>,
): TimetableTheme {
if (colors.size !in 1..MAX_COLOR_COUNT) throw InvalidThemeColorCountException
if (timetableThemeRepository.existsByUserIdAndName(userId, name)) throw DuplicateThemeNameException

val theme =
TimetableTheme(
Expand All @@ -171,7 +169,6 @@ class TimetableThemeServiceImpl(
val theme = getCustomTheme(userId, themeId)

name?.let {
if (theme.name != it && timetableThemeRepository.existsByUserIdAndName(userId, it)) throw DuplicateThemeNameException
theme.name = it
}

Expand Down
Loading