diff --git a/src/main/java/com/smunity/petition/domain/account/controller/AccountsController.java b/src/main/java/com/smunity/petition/domain/account/controller/AccountsController.java new file mode 100644 index 0000000..34e8577 --- /dev/null +++ b/src/main/java/com/smunity/petition/domain/account/controller/AccountsController.java @@ -0,0 +1,33 @@ +package com.smunity.petition.domain.account.controller; + +import com.smunity.petition.domain.account.dto.UserLoginRequestDto; +import com.smunity.petition.domain.account.dto.UserLoginResponseDto; +import com.smunity.petition.domain.account.dto.UserSignupRequestDto; +import com.smunity.petition.domain.account.dto.UserSignupResponseDto; +import com.smunity.petition.domain.account.service.AccountsService; +import com.smunity.petition.global.common.ApiResponse; +import jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +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; + +@Slf4j +@RequiredArgsConstructor +@RestController +@RequestMapping("/api/v1/accounts") +public class AccountsController { + private final AccountsService accountsService; + + @PostMapping("/login") + public ApiResponse login(@Valid @RequestBody UserLoginRequestDto requestDto) { + return ApiResponse.onSuccess(accountsService.login(requestDto)); + } + + @PostMapping("/signup") + public ApiResponse signup(@Valid @RequestBody UserSignupRequestDto requestDto) { + return ApiResponse.onSuccess(accountsService.signup(requestDto)); + } +}