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
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package hs.kr.entrydsm.feed.domain.attachFile.adapter.`in`.web

import hs.kr.entrydsm.feed.domain.attachFile.application.service.CreateAttachFileService
import hs.kr.entrydsm.feed.global.document.attachFile.AttachFileApiDocument
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestPart
Expand All @@ -19,7 +20,7 @@ import org.springframework.web.multipart.MultipartFile
@RequestMapping("/attach-file")
class AttachFileWebAdapter(
private val createAttachFileUseCase: CreateAttachFileService,
) {
) : AttachFileApiDocument {
/**
* ํ•˜๋‚˜ ์ด์ƒ์˜ ์ฒจ๋ถ€ ํŒŒ์ผ์„ ์—…๋กœ๋“œํ•˜๊ณ , ์—…๋กœ๋“œ๋œ ํŒŒ์ผ ์ •๋ณด๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.
*
Expand All @@ -36,7 +37,7 @@ class AttachFileWebAdapter(
* @see CreateAttachFileService.execute
*/
@PostMapping
fun createAttachFile(
override fun createAttachFile(
@RequestPart(value = "attach_file") attachFile: List<MultipartFile>,
) = createAttachFileUseCase.execute(attachFile)
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import hs.kr.entrydsm.feed.domain.faq.application.port.`in`.QueryFaqListUseCase
import hs.kr.entrydsm.feed.domain.faq.application.port.`in`.QueryTopFaqUseCase
import hs.kr.entrydsm.feed.domain.faq.application.port.`in`.UpdateFaqUseCase
import hs.kr.entrydsm.feed.domain.faq.model.type.FaqType
import hs.kr.entrydsm.feed.global.document.faq.FaqApiDocument
import org.springframework.http.HttpStatus
import org.springframework.validation.annotation.Validated
import org.springframework.web.bind.annotation.DeleteMapping
Expand Down Expand Up @@ -50,10 +51,11 @@ class FaqWebAdapter(
private val queryFaqListUseCase: QueryFaqListUseCase,
private val queryTopFaqUseCase: QueryTopFaqUseCase,
private val updateFaqUseCase: UpdateFaqUseCase,
) {
) : FaqApiDocument {

@ResponseStatus(HttpStatus.CREATED)
@PostMapping
fun createFaq(
override fun createFaq(
@RequestBody @Validated
createFaqRequest: CreateFaqRequest,
) = createFaqUseCase.execute(createFaqRequest)
Expand All @@ -65,7 +67,7 @@ class FaqWebAdapter(
* @return FAQ ์ƒ์„ธ ์ •๋ณด๊ฐ€ ํฌํ•จ๋œ ์‘๋‹ต ๊ฐ์ฒด
*/
@GetMapping("/{faq-id}")
fun queryFaqDetails(
override fun queryFaqDetails(
@PathVariable("faq-id") faqId: UUID,
): FaqDetailsResponse = queryFaqDetailsUseCase.execute(faqId)

Expand All @@ -76,7 +78,7 @@ class FaqWebAdapter(
* @return ํ•ด๋‹น ์œ ํ˜•์˜ FAQ ๋ชฉ๋ก์ด ํฌํ•จ๋œ ์‘๋‹ต ๊ฐ์ฒด
*/
@GetMapping
fun queryFaqListByType(
override fun queryFaqListByType(
@RequestParam("type") faqType: FaqType,
): FaqListResponse = queryFaqListByTypeUseCase.execute(faqType)

Expand All @@ -86,15 +88,15 @@ class FaqWebAdapter(
* @return ๋ชจ๋“  FAQ ๋ชฉ๋ก์ด ํฌํ•จ๋œ ์‘๋‹ต ๊ฐ์ฒด
*/
@GetMapping("/all")
fun queryFaqList(): FaqListResponse = queryFaqListUseCase.execute()
override fun queryFaqList(): FaqListResponse = queryFaqListUseCase.execute()

/**
* ์ตœ๊ทผ์— ๋“ฑ๋ก๋œ FAQ ๋ชฉ๋ก์„ ์กฐํšŒํ•ฉ๋‹ˆ๋‹ค.
*
* @return ์ตœ๊ทผ FAQ ๋ชฉ๋ก์ด ํฌํ•จ๋œ ์‘๋‹ต ๊ฐ์ฒด
*/
@GetMapping("/recently")
fun queryTopFaq() = queryTopFaqUseCase.execute()
override fun queryTopFaq() = queryTopFaqUseCase.execute()

/**
* ๊ธฐ์กด FAQ๋ฅผ ์ˆ˜์ •ํ•ฉ๋‹ˆ๋‹ค.
Expand All @@ -103,7 +105,7 @@ class FaqWebAdapter(
* @param updateFaqRequest FAQ ์ˆ˜์ • ์š”์ฒญ ๋ฐ์ดํ„ฐ
*/
@PatchMapping("/{faq-id}")
fun updateFaq(
override fun updateFaq(
@PathVariable("faq-id") faqId: UUID,
@RequestBody @Validated
updateFaqRequest: UpdateFaqRequest,
Expand All @@ -115,7 +117,7 @@ class FaqWebAdapter(
* @param faqId ์‚ญ์ œํ•  FAQ์˜ ๊ณ ์œ  ์‹๋ณ„์ž
*/
@DeleteMapping("/{faq-id}")
fun deleteFaq(
override fun deleteFaq(
@PathVariable("faq-id") faqId: UUID,
) = deleteFaqUseCase.execute(faqId)
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import hs.kr.entrydsm.feed.domain.notice.application.port.`in`.QueryNoticeTitleU
import hs.kr.entrydsm.feed.domain.notice.application.port.`in`.UpdateNoticeUseCase
import hs.kr.entrydsm.feed.domain.notice.application.port.`in`.UploadNoticeImageUseCase
import hs.kr.entrydsm.feed.domain.notice.model.type.NoticeType
import hs.kr.entrydsm.feed.global.document.notice.NoticeApiDocument
import jakarta.validation.Valid
import org.springframework.http.HttpStatus
import org.springframework.http.ResponseEntity
Expand Down Expand Up @@ -45,15 +46,15 @@ class NoticeWebAdapter(
private val queryNoticeTitleUseCase: QueryNoticeTitleUseCase,
private val uploadNoticeImageUseCase: UploadNoticeImageUseCase,
private val queryListNoticeListByTypeUseCase: QueryNoticeListByTypeUseCase,
) {
) : NoticeApiDocument {
/**
* ์ƒˆ๋กœ์šด ๊ณต์ง€์‚ฌํ•ญ์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
*
* @param createNoticeRequest ๊ณต์ง€์‚ฌํ•ญ ์ƒ์„ฑ ์š”์ฒญ ๋ฐ์ดํ„ฐ
*/
@ResponseStatus(value = HttpStatus.CREATED)
@PostMapping
fun createNotice(
override fun createNotice(
@RequestBody @Valid
createNoticeRequest: CreateNoticeRequest,
) {
Expand All @@ -68,7 +69,7 @@ class NoticeWebAdapter(
* @return ์ˆ˜์ • ๊ฒฐ๊ณผ์— ๋Œ€ํ•œ ์‘๋‹ต ์—”ํ‹ฐํ‹ฐ
*/
@PatchMapping("/{notice-id}")
fun updateNotice(
override fun updateNotice(
@PathVariable(name = "notice-id") id: UUID,
@RequestBody updateNoticeRequest: UpdateNoticeRequest,
): ResponseEntity<String> = updateNoticeUseCase.execute(id, updateNoticeRequest)
Expand All @@ -80,7 +81,7 @@ class NoticeWebAdapter(
* @return ์—…๋กœ๋“œ๋œ ์ด๋ฏธ์ง€ ์ •๋ณด๊ฐ€ ํฌํ•จ๋œ ์‘๋‹ต ๊ฐ์ฒด
*/
@PostMapping("/image")
fun uploadImage(
override fun uploadImage(
@RequestPart(name = "photo") image: MultipartFile,
): UploadNoticeImageResponse = uploadNoticeImageUseCase.execute(image)

Expand All @@ -90,7 +91,7 @@ class NoticeWebAdapter(
* @return ๊ณต์ง€์‚ฌํ•ญ ์ œ๋ชฉ ๋ชฉ๋ก์ด ํฌํ•จ๋œ ์‘๋‹ต ๊ฐ์ฒด ๋ฆฌ์ŠคํŠธ
*/
@GetMapping("/title")
fun queryNoticeTitle(): List<QueryNoticeTitleResponse> = queryNoticeTitleUseCase.execute()
override fun queryNoticeTitle(): List<QueryNoticeTitleResponse> = queryNoticeTitleUseCase.execute()

/**
* ํŠน์ • ๊ณต์ง€์‚ฌํ•ญ์˜ ์ƒ์„ธ ์ •๋ณด๋ฅผ ์กฐํšŒํ•ฉ๋‹ˆ๋‹ค.
Expand All @@ -99,7 +100,7 @@ class NoticeWebAdapter(
* @return ๊ณต์ง€์‚ฌํ•ญ ์ƒ์„ธ ์ •๋ณด๊ฐ€ ํฌํ•จ๋œ ์‘๋‹ต ๊ฐ์ฒด
*/
@GetMapping("/{notice-id}")
fun queryDetailsNotice(
override fun queryDetailsNotice(
@PathVariable(name = "notice-id", required = true)
noticeId: UUID,
): QueryDetailsNoticeResponse = queryDetailsNoticeUseCase.execute(noticeId)
Expand All @@ -111,7 +112,7 @@ class NoticeWebAdapter(
* @return ํ•ด๋‹น ์œ ํ˜•์˜ ๊ณต์ง€์‚ฌํ•ญ ๋ชฉ๋ก์ด ํฌํ•จ๋œ ์‘๋‹ต ๊ฐ์ฒด
*/
@GetMapping
fun queryNoticeListByType(
override fun queryNoticeListByType(
@RequestParam("type") noticeType: NoticeType?,
): QueryListNoticeResponse = queryListNoticeListByTypeUseCase.execute(noticeType)

Expand All @@ -122,7 +123,7 @@ class NoticeWebAdapter(
*/
@ResponseStatus(value = HttpStatus.NO_CONTENT)
@DeleteMapping("/{notice-id}")
fun deleteNotice(
override fun deleteNotice(
@PathVariable(name = "notice-id")id: UUID,
) = deleteNoticeUseCase.execute(id)
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package hs.kr.entrydsm.feed.domain.reserve.adapter.`in`.web

import hs.kr.entrydsm.feed.domain.reserve.application.port.`in`.GetReserveUseCase
import hs.kr.entrydsm.feed.global.document.reserve.ReserveApiDocument
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController
Expand All @@ -17,12 +18,12 @@ import org.springframework.web.bind.annotation.RestController
@RequestMapping("/reserve")
class ReserveWebAdapter(
private val getReserveUseCase: GetReserveUseCase,
) {
) : ReserveApiDocument {
/**
* ์˜ˆ์•ฝ ํŽ˜์ด์ง€ ๋งํฌ๋ฅผ ์กฐํšŒํ•ฉ๋‹ˆ๋‹ค.
*
* @return ์˜ˆ์•ฝ ํŽ˜์ด์ง€ URL ๋ฌธ์ž์—ด
*/
@GetMapping
fun reserveLink(): String = getReserveUseCase.execute()
override fun reserveLink(): String = getReserveUseCase.execute()
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import hs.kr.entrydsm.feed.domain.screen.adatper.`in`.web.dto.response.ScreenRes
import hs.kr.entrydsm.feed.domain.screen.application.port.`in`.CreateScreenUseCase
import hs.kr.entrydsm.feed.domain.screen.application.port.`in`.QueryScreenUseCase
import hs.kr.entrydsm.feed.domain.screen.application.port.`in`.UpdateScreenUseCase
import hs.kr.entrydsm.feed.global.document.screen.ScreenApiDocument
import org.springframework.http.HttpStatus
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PatchMapping
Expand Down Expand Up @@ -33,7 +34,7 @@ class ScreenWebAdapter(
private val createScreenUseCase: CreateScreenUseCase,
private val updateScreenUseCase: UpdateScreenUseCase,
private val queryScreenUseCase: QueryScreenUseCase,
) {
) : ScreenApiDocument {
/**
* ์ƒˆ๋กœ์šด ํ™”๋ฉด ์ด๋ฏธ์ง€๋ฅผ ์—…๋กœ๋“œํ•˜๊ณ  ์ €์žฅํ•ฉ๋‹ˆ๋‹ค.
*
Expand All @@ -42,7 +43,7 @@ class ScreenWebAdapter(
*/
@ResponseStatus(value = HttpStatus.CREATED)
@PostMapping
suspend fun createScreen(
override suspend fun createScreen(
@RequestPart(name = "image") image: MultipartFile,
): ScreenResponse = createScreenUseCase.execute(image)

Expand All @@ -54,7 +55,7 @@ class ScreenWebAdapter(
* @return ์—…๋ฐ์ดํŠธ๋œ ํ™”๋ฉด ์ด๋ฏธ์ง€ ์ •๋ณด๊ฐ€ ํฌํ•จ๋œ ์‘๋‹ต ๊ฐ์ฒด
*/
@PatchMapping("/{screen-id}")
fun updateScreen(
override fun updateScreen(
@PathVariable(name = "screen-id") id: UUID,
@RequestPart(name = "image") image: MultipartFile,
): ScreenResponse = updateScreenUseCase.execute(id, image)
Expand All @@ -65,5 +66,5 @@ class ScreenWebAdapter(
* @return ํ™”๋ฉด ์ด๋ฏธ์ง€ ๋ชฉ๋ก์ด ํฌํ•จ๋œ ์‘๋‹ต ๊ฐ์ฒด ๋ฆฌ์ŠคํŠธ
*/
@GetMapping
fun queryScreen(): List<QueryScreenResponse> = queryScreenUseCase.execute()
override fun queryScreen(): List<QueryScreenResponse> = queryScreenUseCase.execute()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package hs.kr.entrydsm.feed.global.document.attachFile

import hs.kr.entrydsm.feed.domain.attachFile.adapter.`in`.web.dto.response.CreateAttachFileResponse
import io.swagger.v3.oas.annotations.tags.Tag
import io.swagger.v3.oas.annotations.Operation
import io.swagger.v3.oas.annotations.media.Content
import io.swagger.v3.oas.annotations.responses.ApiResponse
import io.swagger.v3.oas.annotations.responses.ApiResponses
import org.springframework.web.bind.annotation.RequestPart
import org.springframework.web.multipart.MultipartFile

/**
* AttachFile API ๋ฌธ์„œํ™”๋ฅผ ์œ„ํ•œ ์ธํ„ฐํŽ˜์ด์Šค์ž…๋‹ˆ๋‹ค.
*/
@Tag(name = "AttachFile", description = "์ฒจ๋ถ€ ํŒŒ์ผ API")
interface AttachFileApiDocument {

@Operation(
summary = "์ฒจ๋ถ€ ํŒŒ์ผ ์—…๋กœ๋“œ",
description =
"1. ์ด๋ฏธ ๋™์ผํ•œ ์ด๋ฆ„์˜ ํŒŒ์ผ์ด ์กด์žฌํ•˜๋ฉด ์‚ญ์ œํ•ฉ๋‹ˆ๋‹ค.\n" +
"2. ํŒŒ์ผ์„ S3์— ์—…๋กœ๋“œํ•ฉ๋‹ˆ๋‹ค.\n" +
"3. ์—…๋กœ๋“œ๋œ ํŒŒ์ผ ์ •๋ณด๋ฅผ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์— ์ €์žฅํ•ฉ๋‹ˆ๋‹ค.\n" +
"4. ์—…๋กœ๋“œ๋œ ํŒŒ์ผ์— ์ ‘๊ทผํ•  ์ˆ˜ ์žˆ๋Š” URL์„ ์ƒ์„ฑํ•˜์—ฌ ์‘๋‹ต์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค."
)
@ApiResponses(
ApiResponse(
responseCode = "200",
description = "ํŒŒ์ผ ์—…๋กœ๋“œ ์„ฑ๊ณต",
content = arrayOf(Content())
)
)
fun createAttachFile(
@RequestPart(value = "attach_file") attachFile: List<MultipartFile>,
): List<CreateAttachFileResponse>
}
Loading
Loading