-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
8 changed files
with
92 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.psr.psr.cs.dto | ||
|
||
data class FaqListRes ( | ||
val faqLists: List<FaqRes>? | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.psr.psr.cs.dto | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude | ||
|
||
data class FaqRes ( | ||
val faqId: Long, | ||
val type: String, | ||
val title: String, | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
val content: String?= null, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,17 @@ | ||
package com.psr.psr.cs.entity | ||
|
||
import com.psr.psr.global.exception.BaseException | ||
import com.psr.psr.global.exception.BaseResponseCode | ||
|
||
enum class FaqType(val value: String) { | ||
ACCOUNT_MANAGEMENT("계정관리"), | ||
CONSULTING("컨설팅"), | ||
PRODUCT("상품") | ||
PRODUCT("상품"); | ||
|
||
companion object { | ||
fun getTypeByName(name: String): FaqType { | ||
return enumValues<FaqType>().find { it.value == name } | ||
?: throw BaseException(BaseResponseCode.INVALID_FAQ_TYPE_NAME) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
package com.psr.psr.cs.repository | ||
|
||
import com.psr.psr.cs.entity.Faq | ||
import com.psr.psr.cs.entity.FaqType | ||
import org.springframework.data.jpa.repository.JpaRepository | ||
import org.springframework.stereotype.Repository | ||
|
||
@Repository | ||
interface FaqRepository: JpaRepository<Faq, Long> { | ||
fun findByOrderByCreatedAtDesc(): List<Faq> | ||
fun findByTypeOrderByCreatedAtDesc(type: FaqType): List<Faq> | ||
fun findByIdAndStatus(id: Long, status: String) : Faq? | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters