diff --git a/Dockerfile b/Dockerfile index 0e3b70a..3e4c5e1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,8 +17,6 @@ COPY . /app # Gradle 빌드를 실행하여 JAR 파일 생성 ENV JWT_SECRET 12341234 ENV REDIS_HOST redis -ENV MAIL_USERNAME mail -ENV MAIL_PASSWORD 12341234 RUN gradle clean build --no-daemon FROM --platform=linux/arm64/v8 eclipse-temurin:17.0.10_7-jre diff --git a/src/main/java/dynamicquad/agilehub/project/controller/ProjectInviteController.java b/src/main/java/dynamicquad/agilehub/project/controller/ProjectInviteController.java index 17c8db0..279e3c4 100644 --- a/src/main/java/dynamicquad/agilehub/project/controller/ProjectInviteController.java +++ b/src/main/java/dynamicquad/agilehub/project/controller/ProjectInviteController.java @@ -6,25 +6,28 @@ import dynamicquad.agilehub.project.controller.request.ProjectInviteRequestDto; import dynamicquad.agilehub.project.service.ProjectInviteService; import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.servlet.RequestToViewNameTranslator; @Tag(name = "프로젝트 초대", description = "프로젝트에 이메일주소를 통해 초대합니다.") @RestController @RequiredArgsConstructor +@RequestMapping("/projects/invite") public class ProjectInviteController { private final ProjectInviteService projectInviteService; - private final RequestToViewNameTranslator viewNameTranslator; @Operation(summary = "프로젝트 초대", description = "이메일로 프로젝트 초대 코드를 발송합니다.") - @PostMapping("/projects/invite") + @ApiResponses({ + @ApiResponse(responseCode = "EMAIL_5001", description = "이메일이 정상적으로 송신되지 않았습니다.") + }) + @PostMapping("/send") public CommonResponse sendInviteEmail(@Auth AuthMember authMember, @RequestBody ProjectInviteRequestDto.SendInviteMail sendInviteMail) { projectInviteService.sendInviteEmail(authMember, sendInviteMail); @@ -32,9 +35,12 @@ public CommonResponse sendInviteEmail(@Auth AuthMember authMember, } @Operation(summary = "프로젝트 초대 수락", description = "초대 코드 확인 후 멤버를 프로젝트에 Editor로 추가합니다.") - @GetMapping("/projects/invite") + @ApiResponses({ + @ApiResponse(responseCode = "EMAIL_4001", description = "초대 코드를 찾을 수 없습니다.") + }) + @PostMapping("/receive") public CommonResponse receiveInviteEmail(@Auth AuthMember authMember, - @RequestParam String inviteCode) { + @RequestBody String inviteCode) { projectInviteService.receiveInviteEmail(authMember, inviteCode); return CommonResponse.onSuccess(null); } diff --git a/src/main/java/dynamicquad/agilehub/project/controller/request/ProjectInviteRequestDto.java b/src/main/java/dynamicquad/agilehub/project/controller/request/ProjectInviteRequestDto.java index f44aa29..63e79a9 100644 --- a/src/main/java/dynamicquad/agilehub/project/controller/request/ProjectInviteRequestDto.java +++ b/src/main/java/dynamicquad/agilehub/project/controller/request/ProjectInviteRequestDto.java @@ -1,6 +1,8 @@ package dynamicquad.agilehub.project.controller.request; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; import lombok.Builder; import lombok.Getter; @@ -9,11 +11,25 @@ public class ProjectInviteRequestDto { private ProjectInviteRequestDto() { } + @Schema(description = "초대 메일 송신") @Getter @Builder - @Schema public static class SendInviteMail { + @Schema(description = "초대할 사람의 이메일 주소", example = "example@agilehub.com") + @NotBlank String email; + + @Schema(description = "초대할 프로젝트 id", example = "1") + @NotNull long projectId; } + + @Schema(description = "초대 메일 수신") + @Getter + @Builder + public static class ReceiveInviteMail { + @Schema(description = "메일로부터 온 인증번호") + @NotBlank + String inviteCode; + } }