diff --git a/src/main/java/com/book/backend/domain/user/controller/UserController.java b/src/main/java/com/book/backend/domain/user/controller/UserController.java index 63f5ee29..3031f8a1 100644 --- a/src/main/java/com/book/backend/domain/user/controller/UserController.java +++ b/src/main/java/com/book/backend/domain/user/controller/UserController.java @@ -6,6 +6,10 @@ import com.book.backend.domain.user.mapper.UserMapper; import com.book.backend.domain.user.service.UserService; import com.book.backend.global.ResponseTemplate; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -22,6 +26,9 @@ public class UserController { private final ResponseTemplate responseTemplate; private final UserMapper userMapper; + @Operation(summary = "유저 정보 불러오기", description = "유저 정보를 불러옵니다.", + responses = {@ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = UserDto.class)), + description = UserDto.description)}) @GetMapping("/info") public ResponseEntity getUserInfo() { log.trace("UserController > getUserInfo()"); @@ -32,6 +39,9 @@ public ResponseEntity getUserInfo() { return responseTemplate.success(userDto, HttpStatus.OK); } + @Operation(summary = "유저 정보 수정", description = "유저의 변경 가능한 정보를 수정합니다.", + responses = {@ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = UserInfoDto.class)), + description = UserInfoDto.description)}) @PutMapping("/info/edit") public ResponseEntity editUserInfo(@Valid @RequestBody UserInfoDto requestDto) { log.trace("UserController > editUserInfo()"); diff --git a/src/main/java/com/book/backend/domain/user/dto/UserInfoDto.java b/src/main/java/com/book/backend/domain/user/dto/UserInfoDto.java index d5ddaf7d..f2cde7aa 100644 --- a/src/main/java/com/book/backend/domain/user/dto/UserInfoDto.java +++ b/src/main/java/com/book/backend/domain/user/dto/UserInfoDto.java @@ -22,4 +22,9 @@ public class UserInfoDto { @Past(message = "현재 날짜보다 이전 날짜여야 합니다.") private LocalDate birthDate; + + public static final String description = + "nickname : 닉네임 | " + + "gender : 성별 | " + + "birthDate : 생일"; }