Skip to content

Commit

Permalink
feat: InfoController 작성
Browse files Browse the repository at this point in the history
- AuthMember와 InfoWriteRequest를 이용한 컨트롤러 메서드 작성
  • Loading branch information
devholic22 committed Feb 20, 2024
1 parent cff42e8 commit 8e6fb6f
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/main/java/com/atwoz/member/ui/info/InfoController.java
Original file line number Diff line number Diff line change
@@ -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<Void> writeInfo(@AuthMember final Long memberId,
@Valid @RequestBody final InfoWriteRequest request) {
infoService.writeProfile(memberId, request);
return ResponseEntity.ok()
.build();
}

}

0 comments on commit 8e6fb6f

Please sign in to comment.