-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
π [DOCS] MemoController Swagger λ¬Έμν
- Loading branch information
Showing
1 changed file
with
43 additions
and
2 deletions.
There are no files selected for viewing
45 changes: 43 additions & 2 deletions
45
src/main/java/com/carely/backend/controller/docs/MemoAPI.java
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,22 +1,63 @@ | ||
package com.carely.backend.controller.docs; | ||
|
||
import com.carely.backend.dto.memo.CreateMemoDTO; | ||
import com.carely.backend.dto.response.ErrorResponseDTO; | ||
import com.carely.backend.dto.response.ResponseDTO; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.media.Content; | ||
import io.swagger.v3.oas.annotations.media.ExampleObject; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponse; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponses; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
|
||
public interface MemoAPI { | ||
@Operation(summary = "λ°©λͺ λ‘ μμ±νκΈ°(λ©λͺ¨)", description = "λ°©λͺ λ‘μ μμ±ν©λλ€. μμ±ν λ°©λͺ λ‘μ aiκ° μμ½ν©λλ€.") | ||
@ApiResponses(value = { | ||
@ApiResponse(responseCode = "200", description = "μ±κ³΅μ μΌλ‘ λ©λͺ¨λ₯Ό μμ±ν κ²½μ°", | ||
content = @Content(mediaType = "application/json", | ||
schema = @Schema(implementation = ResponseDTO.class), | ||
examples = @ExampleObject(value = | ||
"{ \"status\": 200, \"code\": \"SUCCESS_CREATE_MEMO\", \"message\": \"λ©λͺ¨λ₯Ό μ±κ³΅μ μΌλ‘ μμ±νμ΅λλ€.\", \"data\": { \"memoId\": 33, \"content\": \"μ€λ μ€μ 9μμ 체μ¨μ μΈ‘μ νμΌλ©°, 37.2λλ‘ μ½κ°μ μ΄μ΄ μμ΅λλ€. νμκ° μμ¬λ₯Ό μ λ° μ λλ§ λμ ¨κ³ , νμλ³΄λ€ μμμ΄ λ¨μ΄μ§ λͺ¨μ΅μ 보μμ΅λλ€. μ½λ¬Ό 볡μ©μ μ€μ 8μ μ μμ μλ£λμμΌλ©°, λΆμμ©μ μμ΅λλ€. λ°°λ³μ ν루 λ λ²μΌλ‘ μ μμ μΈ μνλ₯Ό 보μμ§λ§, μ½κ°μ λ³λΉ μ¦μμ΄ μμ΅λλ€. μ€λ 물리μΉλ£ μ€ κ±Έμκ±Έμ΄κ° μ΄μ λ³΄λ€ μ‘°κΈ λ μμ μ μ΄μμ΅λλ€. μλ(보νΈμ)μ΄ μ€ν 3μμ λ°©λ¬Ένμ¬ νμμ μ½ 1μκ° λμ λνλ₯Ό λλ΄μ΅λλ€. νμκ° μ€λ₯Έμͺ½ λ¬΄λ¦ ν΅μ¦μ νΈμνμ¬ λ³΄νΈμμκ² λ³΄κ³ ν μΆκ° κ²μ¬ νμμ±μ μ λ¬νμ΅λλ€. κ΅λ μ, νμκ° λ°€μ¬μ΄μ λΆμκ°μ λκ»΄ μ μ μ λλ‘ λͺ» μ€λ€λ μ μ λ€μ κ°λ³μΈμκ² μλ Έμ΅λλ€. μ€μ λͺ©μμ μ§ννμΌλ©°, λμμκ° μμΎνλ€λ λ°μμ 보μμ΅λλ€. νμκ° 'μμκ° λ³΄κ³ μΆλ€'λΌκ³ λ§μνμ μ 보νΈμμ μμν΅νλ₯Ό λμλλ Έμ΅λλ€.\", \"writerName\": \"κΉμμ\", \"all\": \"νμμ 체μ¨μ 37.2λλ‘ μ½κ°μ μ΄μ΄ μμ΅λλ€. λ³λΉ μ¦μμ΄ μμΌλ λ°°λ³μ μ μ λ²μλ₯Ό μ μ§νκ³ μμ΅λλ€. μμ¬λμ νμμ λΉμ·ν©λλ€. μ½λ¬Ό 볡μ©μ μ μμ μΌλ‘ μ΄λ£¨μ΄μ‘μΌλ©° λΆμμ©μ μμ΅λλ€. 물리μΉλ£λ₯Ό ν΅ν΄ κ±Έμκ±Έμ΄κ° μμ μ μΌλ‘ κ°μ λμμ΅λλ€. μλ©΄μ μ΄λ €μμ κ²ͺκ³ μμ΅λλ€. μ€λ₯Έμͺ½ 무λ¦μ ν΅μ¦μ΄ μμ΄ μΆκ° κ²μ¬κ° νμν©λλ€. λ°°λ¨λ ν루μ μΈ λ²μΌλ‘ μ μμ λλ€.\", \"healthy\": \"νμμ 체μ¨μ 37.2λμ λλ€.\", \"eat\": \"νμλ μμ¬λμ νμμ λΉμ·νκ² μ μ§νκ³ μμ΅λλ€. μ½λ¬Ό 볡μ©μ μ μμ μΌλ‘ μ΄λ£¨μ΄μ‘μΌλ©° λΆμμ©μ μμ΅λλ€.\", \"additionalHealth\": \"μ€λ₯Έμͺ½ 무λ¦μ ν΅μ¦μ΄ μμ΄ μΆκ° κ²μ¬κ° νμν©λλ€.\", \"social\": \"νμλ μμμμ μμν΅νλ₯Ό ν΅ν΄ λνλ₯Ό λλμμ΅λλ€.\", \"voiding\": \"λ°°λ³μ΄ μ μμ μΌλ‘ μ΄λ£¨μ΄μ‘μ΅λλ€.\" } }"))), | ||
|
||
@ApiResponse(responseCode = "400", description = "μλͺ»λ μμ² λ°μ΄ν°λ‘ λ©λͺ¨ μμ± μ€ν¨", | ||
content = @Content(mediaType = "application/json", | ||
schema = @Schema(implementation = ErrorResponseDTO.class), | ||
examples = @ExampleObject(value = | ||
"{ \"status\": 400, \"code\": \"INVALID_REQUEST\", \"message\": \"μμ² λ°μ΄ν°κ° μλͺ»λμμ΅λλ€.\", \"data\": null }"))) | ||
}) | ||
@Operation(summary = "λ°©λͺ λ‘ μμ±νκΈ°(λ©λͺ¨)", description = "λ°©λͺ λ‘μ μμ±ν©λλ€. μμ±ν λ°©λͺ λ‘μ AIκ° μμ½ν©λλ€.") | ||
ResponseEntity<ResponseDTO> createMemo(@RequestBody CreateMemoDTO createMemoDTO); | ||
|
||
// @Operation(summary = "λ°©λͺ λ‘ μ‘°ννκΈ°", description = "λ€λ₯Έ μ μ κ° μμ±ν λ°©λͺ λ‘μ μ‘°νν©λλ€.") | ||
// public ResponseEntity<ResponseDTO> getMemoList(@PathVariable("userId") Long userId); | ||
|
||
@ApiResponses(value = { | ||
@ApiResponse(responseCode = "200", description = "μ±κ³΅μ μΌλ‘ μμλ΄μ¬ μμ² μμΈ μ 보λ₯Ό μ‘°νν κ²½μ°", | ||
content = @Content(mediaType = "application/json", | ||
schema = @Schema(implementation = ResponseDTO.class), | ||
examples = @ExampleObject(value = | ||
"{ \"status\": 200, \"code\": \"SUCCESS_RETRIEVE_VOLUNTEER\", \"message\": \"μμλ΄μ¬ μμ²μ μ±κ³΅μ μΌλ‘ μ‘°ννμ΅λλ€.\", \"data\": { \"id\": 5, \"volunteerId\": 51, \"volunteerName\": \"κΉμμ\", \"volunteerAge\": 0, \"phoneNum\": \"string\", \"address\": \"λ·κ³¨ 1λ‘ 42\", \"startTime\": \"2024-11-17T04:33:06.36\", \"endTime\": \"2024-11-17T04:33:06.36\", \"durationHours\": 4, \"salary\": 0, \"location\": \"κ²½κΈ°λ μ©μΈμ μμ§κ΅¬ μ΄λκ°\", \"mainTask\": \"μ€κ±°μ§\", \"volunteerType\": \"VOLUNTEER_REQUEST\", \"roomId\": \"c0babffb-a39b-45e5-b326-a964b49e9409\" } }"))), | ||
|
||
}) | ||
@Operation(summary = "λ©λͺ¨λ₯Ό μμ±νμ§ μμ μ½μ μ‘°ννκΈ°", description = "λ©λͺ¨λ₯Ό μμ±νμ§ μμ μ½μ μ‘°ννκΈ°") | ||
ResponseEntity<ResponseDTO> getNotWrittenVolunteer(); | ||
|
||
@Operation(summary = "μ μ μ μμ½λ λ©λͺ¨ μ‘°ννκΈ°", description = "μ μ μ μμ½λ λ©λͺ¨ μ‘°ννκΈ°") | ||
@ApiResponses(value = { | ||
@ApiResponse(responseCode = "200", description = "μ±κ³΅μ μΌλ‘ λ©λͺ¨λ₯Ό μ‘°νν κ²½μ°", | ||
content = @Content(mediaType = "application/json", | ||
schema = @Schema(implementation = ResponseDTO.class), | ||
examples = @ExampleObject(value = | ||
"{ \"status\": 200, \"code\": \"SUCCESS_RETRIEVE_MEMO\", \"message\": \"μ±κ³΅μ μΌλ‘ λ©λͺ¨λ₯Ό μ‘°ννμ΅λλ€.\", \"data\": [ { \"memoId\": 32, \"content\": \"μ€λ μ€μ 9μμ 체μ¨μ μΈ‘μ νμΌλ©°, 37.2λλ‘ μ½κ°μ μ΄μ΄ μμ΅λλ€. νμκ° μμ¬λ₯Ό μ λ° μ λλ§ λμ ¨κ³ , νμλ³΄λ€ μμμ΄ λ¨μ΄μ§ λͺ¨μ΅μ 보μμ΅λλ€...\", \"writerName\": \"κΉμμ\", \"all\": \"νμμ 체μ¨μ 37.2λλ‘ μ½κ°μ μ΄μ΄ μμ΅λλ€...\", \"healthy\": \"νμμ 체μ¨μ 37.2λλ‘ μ½κ°μ μ΄μ΄ μμ΅λλ€.\", \"eat\": \"μμμ κ°μνμμΌλ μμ¬λμ νμμ λΉμ·νλ©°, μμ 보좩μ λ μμ·¨νμμ΅λλ€...\", \"additionalHealth\": \"λ³λΉ μ¦μμ΄ μμΌλ λ°°λ³μ μ μ λ²μλ₯Ό μ μ§νκ³ μμ΅λλ€.\", \"social\": \"μλ©΄μ μ΄λ €μμ κ²ͺκ³ μμΌλ©° μ€λ₯Έμͺ½ λ¬΄λ¦ ν΅μ¦μΌλ‘ μΆκ° κ²μ¬κ° νμν©λλ€...\", \"voiding\": null } ] }"))), | ||
|
||
@ApiResponse(responseCode = "404", description = "ν΄λΉ userIdλ₯Ό μ°Ύμ μ μλ κ²½μ°", | ||
content = @Content(mediaType = "application/json", | ||
schema = @Schema(implementation = ErrorResponseDTO.class), | ||
examples = @ExampleObject(value = | ||
"{ \"status\": 404, \"code\": \"USER_NOT_FOUND\", \"message\": \"ν΄λΉ μ μ λ₯Ό μ°Ύμ μ μμ΅λλ€.\", \"data\": null }"))), | ||
}) | ||
@Operation(summary = "μ μ μ μμ½λ λ©λͺ¨ μ‘°ννκΈ°", description = "μ μ μ μμ½λ λ©λͺ¨ μ‘°νν©λλ€.") | ||
ResponseEntity<ResponseDTO> getRecentMemo(@PathVariable("userId") Long userId); | ||
|
||
} |