Skip to content

Commit

Permalink
#111 refactor: cs Domain response package 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
chaerlo127 committed Aug 17, 2023
1 parent 433dc23 commit 7db61d7
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions src/main/kotlin/com/psr/psr/cs/controller/CsController.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.psr.psr.cs.controller

import com.psr.psr.cs.dto.FaqListRes
import com.psr.psr.cs.dto.FaqRes
import com.psr.psr.cs.dto.NoticeListRes
import com.psr.psr.cs.dto.NoticeRes
import com.psr.psr.cs.dto.response.FaqListRes
import com.psr.psr.cs.dto.response.FaqRes
import com.psr.psr.cs.dto.response.NoticeListRes
import com.psr.psr.cs.dto.response.NoticeRes
import com.psr.psr.cs.service.CsService
import com.psr.psr.global.dto.BaseResponse
import org.springframework.web.bind.annotation.*
Expand Down
8 changes: 4 additions & 4 deletions src/main/kotlin/com/psr/psr/cs/dto/assembler/CsAssembler.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.psr.psr.cs.dto.assembler

import com.psr.psr.cs.dto.FaqListRes
import com.psr.psr.cs.dto.FaqRes
import com.psr.psr.cs.dto.NoticeListRes
import com.psr.psr.cs.dto.NoticeRes
import com.psr.psr.cs.dto.response.FaqListRes
import com.psr.psr.cs.dto.response.FaqRes
import com.psr.psr.cs.dto.response.NoticeListRes
import com.psr.psr.cs.dto.response.NoticeRes
import com.psr.psr.cs.entity.Faq
import com.psr.psr.cs.entity.Notice
import org.springframework.stereotype.Component
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.psr.psr.cs.dto
package com.psr.psr.cs.dto.response

data class FaqListRes (
val faqLists: List<FaqRes>?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.psr.psr.cs.dto
package com.psr.psr.cs.dto.response

import com.fasterxml.jackson.annotation.JsonInclude

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.psr.psr.cs.dto
package com.psr.psr.cs.dto.response

data class NoticeListRes (
val noticeLists: List<NoticeRes>?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.psr.psr.cs.dto
package com.psr.psr.cs.dto.response

import com.fasterxml.jackson.annotation.JsonFormat
import com.fasterxml.jackson.annotation.JsonInclude
Expand Down
12 changes: 6 additions & 6 deletions src/main/kotlin/com/psr/psr/cs/service/CsService.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.psr.psr.cs.service

import com.psr.psr.cs.dto.FaqListRes
import com.psr.psr.cs.dto.FaqRes
import com.psr.psr.cs.dto.NoticeListRes
import com.psr.psr.cs.dto.NoticeRes
import com.psr.psr.cs.dto.response.FaqListRes
import com.psr.psr.cs.dto.response.FaqRes
import com.psr.psr.cs.dto.response.NoticeListRes
import com.psr.psr.cs.dto.response.NoticeRes
import com.psr.psr.cs.dto.assembler.CsAssembler
import com.psr.psr.cs.entity.FaqType
import com.psr.psr.cs.repository.FaqRepository
Expand All @@ -21,12 +21,12 @@ class CsService(

) {
// 공지사항 메인
fun getNotices() : NoticeListRes{
fun getNotices() : NoticeListRes {
return csAssembler.toNoticeListRes(noticeRepository.findByStatusOrderByCreatedAtDesc(ACTIVE_STATUS))
}

// 공지사항 상세
fun getNotice(noticeId: Long) : NoticeRes{
fun getNotice(noticeId: Long) : NoticeRes {
val notice = noticeRepository.findByIdAndStatus(noticeId, ACTIVE_STATUS) ?: throw BaseException(BaseResponseCode.NOT_FOUND_NOTICE)
return csAssembler.toNoticeRes(notice)
}
Expand Down

0 comments on commit 7db61d7

Please sign in to comment.