Skip to content

Commit

Permalink
#190 docs: 홈 화면 조회 - 공지사항 스웨거 설명
Browse files Browse the repository at this point in the history
  • Loading branch information
sojungpp committed Nov 10, 2023
1 parent 8478db6 commit 23580d6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/kotlin/com/psr/psr/cs/controller/CsController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ 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 io.swagger.v3.oas.annotations.Operation
import io.swagger.v3.oas.annotations.responses.ApiResponse
import io.swagger.v3.oas.annotations.responses.ApiResponses
import io.swagger.v3.oas.annotations.security.SecurityRequirement
import io.swagger.v3.oas.annotations.tags.Tag
import org.springframework.web.bind.annotation.*
Expand Down Expand Up @@ -52,6 +55,11 @@ class CsController(
/**
* 홈 화면 조회 - 공지사항
*/
@Operation(summary = "홈 화면 조회 - 공지사항(박소정)", description = "홈 화면의 공지사항을 조회한다.")
@ApiResponses(
value = [
ApiResponse(responseCode = "200", description = "요청에 성공했습니다.")]
)
@GetMapping("/notices/home")
fun getHomePage(): BaseResponse<NoticeListRes> {
return BaseResponse(csService.getHomePage())
Expand Down
2 changes: 2 additions & 0 deletions src/main/kotlin/com/psr/psr/cs/dto/response/NoticeListRes.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ package com.psr.psr.cs.dto.response

import com.psr.psr.cs.dto.response.NoticeRes.Companion.toNoticeResHome
import com.psr.psr.cs.entity.Notice
import io.swagger.v3.oas.annotations.media.Schema
import java.util.stream.Collectors

data class NoticeListRes (
@Schema(description = "공지사항 리스트")
val noticeLists: List<NoticeRes>?
){
companion object{
Expand Down
3 changes: 3 additions & 0 deletions src/main/kotlin/com/psr/psr/cs/dto/response/NoticeRes.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ package com.psr.psr.cs.dto.response
import com.fasterxml.jackson.annotation.JsonFormat
import com.fasterxml.jackson.annotation.JsonInclude
import com.psr.psr.cs.entity.Notice
import io.swagger.v3.oas.annotations.media.Schema
import java.time.LocalDateTime

data class NoticeRes (
@Schema(description = "공지사항 id", example = "1")
val noticeId: Long,
@Schema(description = "상품 제목", example = "2024 새해 복 많이 받으세요 ^_^")
val title: String,
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
@JsonInclude(JsonInclude.Include.NON_NULL)
Expand Down

0 comments on commit 23580d6

Please sign in to comment.