Skip to content

Commit

Permalink
Feat: Add sort order type for content search (notice, news, seminar)
Browse files Browse the repository at this point in the history
  • Loading branch information
huGgW committed Apr 6, 2024
1 parent daca982 commit ce55c0d
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.wafflestudio.csereal.common.enums

import com.wafflestudio.csereal.common.CserealException

enum class ContentSearchSortType {
DATE,
RELEVANCE;

companion object {
fun fromJsonValue(field: String) =
try {
field.replace('-', '_')
.uppercase()
.let { ContentSearchSortType.valueOf(it) }
} catch (e: IllegalArgumentException) {
throw CserealException.Csereal400("잘못된 Sort Type이 주어졌습니다.")
}
}
}

0 comments on commit ce55c0d

Please sign in to comment.