From 8e6fb6f5b4fbbc0085bffc43f717042d830599cd Mon Sep 17 00:00:00 2001 From: devholic22 Date: Tue, 20 Feb 2024 12:58:17 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20InfoController=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - AuthMember와 InfoWriteRequest를 이용한 컨트롤러 메서드 작성 --- .../atwoz/member/ui/info/InfoController.java | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/main/java/com/atwoz/member/ui/info/InfoController.java diff --git a/src/main/java/com/atwoz/member/ui/info/InfoController.java b/src/main/java/com/atwoz/member/ui/info/InfoController.java new file mode 100644 index 00000000..921f0b1d --- /dev/null +++ b/src/main/java/com/atwoz/member/ui/info/InfoController.java @@ -0,0 +1,29 @@ +package com.atwoz.member.ui.info; + +import com.atwoz.member.application.info.InfoService; +import com.atwoz.member.application.info.dto.InfoWriteRequest; +import com.atwoz.member.ui.auth.support.auth.AuthMember; +import jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RequiredArgsConstructor +@RequestMapping("/api/info") +@RestController +public class InfoController { + + private final InfoService infoService; + + @PostMapping + public ResponseEntity writeInfo(@AuthMember final Long memberId, + @Valid @RequestBody final InfoWriteRequest request) { + infoService.writeProfile(memberId, request); + return ResponseEntity.ok() + .build(); + } + +}