From ed73c361d8916d470c9a5a5958f11d9844c7ab2f Mon Sep 17 00:00:00 2001 From: Bellmin <71818636+rlajm1203@users.noreply.github.com> Date: Mon, 25 Nov 2024 10:05:23 +0900 Subject: [PATCH] =?UTF-8?q?[FIX]=20Program,=20Presentation,=20Team=20Initi?= =?UTF-8?q?alizer=EB=A5=BC=20=EC=A0=9C=EA=B1=B0=ED=95=A9=EB=8B=88=EB=8B=A4?= =?UTF-8?q?.=20(#183)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- eeos/build.gradle | 2 +- eeos/logs/2024-04-01/eeos.log | 0 eeos/logs/{2024-03-15 => 2024-11-24}/eeos.log | 0 .../eeos/auth/persistence/AccountEntity.java | 14 ++- .../auth/persistence/OAuthMemberEntity.java | 7 +- .../controller/AuthController.java | 7 +- .../application/model/CommentModel.java | 5 +- .../comment/persistence/CommentEntity.java | 13 ++- .../controller/CommentController.java | 18 +++- .../comment/presentation/docs/CommentApi.java | 11 ++- .../controller/MemberController.java | 18 +++- .../member/presentation/docs/MemberApi.java | 9 +- .../program/application/dto/PageResponse.java | 2 + .../application/dto/UpdateProgramRequest.java | 2 +- .../application/model/ProgramModel.java | 13 ++- .../application/service/ProgramService.java | 10 +- .../application/util/ProgramInitializer.java | 53 ----------- .../api/slack/chat/model/ChatPostModel.java | 5 +- .../converter/ChatPostModelConverter.java | 5 +- .../program/persistence/ProgramEntity.java | 7 +- .../controller/GuestProgramController.java | 9 +- .../controller/ProgramController.java | 28 +++++- .../program/presentation/docs/ProgramApi.java | 9 +- .../target/application/model/AttendModel.java | 7 +- .../application/service/AttendService.java | 7 +- .../util/PresentationInitializer.java | 94 ------------------- .../persistence/PresentationEntity.java | 13 ++- .../controller/AttendController.java | 7 +- .../application/dto/CreateTeamRequest.java | 6 +- .../dto/UpdateTeamStatusRequest.java | 6 +- .../team/application/model/TeamModel.java | 6 +- .../application/util/TeamInitializer.java | 48 ---------- .../eeos/team/persistence/TeamEntity.java | 19 +++- .../eeos/team/persistence/TeamRepository.java | 1 - .../controller/TeamController.java | 9 +- .../application/model/AttendModelTest.java | 6 +- eeos/tasks/formatting-task.gradle | 2 +- 37 files changed, 228 insertions(+), 250 deletions(-) delete mode 100644 eeos/logs/2024-04-01/eeos.log rename eeos/logs/{2024-03-15 => 2024-11-24}/eeos.log (100%) delete mode 100644 eeos/src/main/java/com/blackcompany/eeos/program/application/util/ProgramInitializer.java delete mode 100644 eeos/src/main/java/com/blackcompany/eeos/target/application/util/PresentationInitializer.java delete mode 100644 eeos/src/main/java/com/blackcompany/eeos/team/application/util/TeamInitializer.java diff --git a/eeos/build.gradle b/eeos/build.gradle index 627875f0..cc2da7b9 100644 --- a/eeos/build.gradle +++ b/eeos/build.gradle @@ -4,7 +4,7 @@ projectVersion = '1.0.1' springBootVersion = '2.7.5' dependencyManagementVersion = '1.0.15.RELEASE' - spotlessVersion = '6.8.0' + spotlessVersion = '6.22.0' set('springCloudVersion', "2021.0.4") jsonwebtokenVersion = '0.11.5' diff --git a/eeos/logs/2024-04-01/eeos.log b/eeos/logs/2024-04-01/eeos.log deleted file mode 100644 index e69de29b..00000000 diff --git a/eeos/logs/2024-03-15/eeos.log b/eeos/logs/2024-11-24/eeos.log similarity index 100% rename from eeos/logs/2024-03-15/eeos.log rename to eeos/logs/2024-11-24/eeos.log diff --git a/eeos/src/main/java/com/blackcompany/eeos/auth/persistence/AccountEntity.java b/eeos/src/main/java/com/blackcompany/eeos/auth/persistence/AccountEntity.java index 8eb79e1e..765cca3b 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/auth/persistence/AccountEntity.java +++ b/eeos/src/main/java/com/blackcompany/eeos/auth/persistence/AccountEntity.java @@ -1,8 +1,18 @@ package com.blackcompany.eeos.auth.persistence; import com.blackcompany.eeos.common.persistence.BaseEntity; -import javax.persistence.*; -import lombok.*; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Index; +import javax.persistence.Table; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.ToString; import lombok.experimental.SuperBuilder; @Getter diff --git a/eeos/src/main/java/com/blackcompany/eeos/auth/persistence/OAuthMemberEntity.java b/eeos/src/main/java/com/blackcompany/eeos/auth/persistence/OAuthMemberEntity.java index 0af86e8b..60f535eb 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/auth/persistence/OAuthMemberEntity.java +++ b/eeos/src/main/java/com/blackcompany/eeos/auth/persistence/OAuthMemberEntity.java @@ -7,7 +7,12 @@ import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; -import lombok.*; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.ToString; import lombok.experimental.SuperBuilder; @Getter diff --git a/eeos/src/main/java/com/blackcompany/eeos/auth/presentation/controller/AuthController.java b/eeos/src/main/java/com/blackcompany/eeos/auth/presentation/controller/AuthController.java index 413b9810..0196fdf3 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/auth/presentation/controller/AuthController.java +++ b/eeos/src/main/java/com/blackcompany/eeos/auth/presentation/controller/AuthController.java @@ -23,7 +23,12 @@ import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseCookie; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.PathVariable; +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.RequestParam; +import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("/api/auth") diff --git a/eeos/src/main/java/com/blackcompany/eeos/comment/application/model/CommentModel.java b/eeos/src/main/java/com/blackcompany/eeos/comment/application/model/CommentModel.java index ee14594f..b43fb42e 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/comment/application/model/CommentModel.java +++ b/eeos/src/main/java/com/blackcompany/eeos/comment/application/model/CommentModel.java @@ -6,7 +6,10 @@ import com.blackcompany.eeos.common.support.AbstractModel; import com.blackcompany.eeos.program.application.model.AccessRights; import java.sql.Timestamp; -import lombok.*; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.ToString; @AllArgsConstructor @ToString diff --git a/eeos/src/main/java/com/blackcompany/eeos/comment/persistence/CommentEntity.java b/eeos/src/main/java/com/blackcompany/eeos/comment/persistence/CommentEntity.java index 1b4813bf..4e617fd1 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/comment/persistence/CommentEntity.java +++ b/eeos/src/main/java/com/blackcompany/eeos/comment/persistence/CommentEntity.java @@ -1,8 +1,17 @@ package com.blackcompany.eeos.comment.persistence; import com.blackcompany.eeos.common.persistence.BaseEntity; -import javax.persistence.*; -import lombok.*; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.ToString; import lombok.experimental.SuperBuilder; import org.hibernate.annotations.SQLDelete; import org.hibernate.annotations.Where; diff --git a/eeos/src/main/java/com/blackcompany/eeos/comment/presentation/controller/CommentController.java b/eeos/src/main/java/com/blackcompany/eeos/comment/presentation/controller/CommentController.java index 9e75c60c..37937b4f 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/comment/presentation/controller/CommentController.java +++ b/eeos/src/main/java/com/blackcompany/eeos/comment/presentation/controller/CommentController.java @@ -1,7 +1,11 @@ package com.blackcompany.eeos.comment.presentation.controller; import com.blackcompany.eeos.auth.presentation.support.Member; -import com.blackcompany.eeos.comment.application.dto.*; +import com.blackcompany.eeos.comment.application.dto.CommandCommentResponse; +import com.blackcompany.eeos.comment.application.dto.CreateCommentRequest; +import com.blackcompany.eeos.comment.application.dto.QueryCommentResponse; +import com.blackcompany.eeos.comment.application.dto.QueryCommentsResponse; +import com.blackcompany.eeos.comment.application.dto.UpdateCommentRequest; import com.blackcompany.eeos.comment.application.dto.converter.CommentResponseConverter; import com.blackcompany.eeos.comment.application.model.CommentModel; import com.blackcompany.eeos.comment.application.usecase.CreateCommentUsecase; @@ -10,14 +14,22 @@ import com.blackcompany.eeos.comment.application.usecase.UpdateCommentUsecase; import com.blackcompany.eeos.comment.presentation.docs.CommentApi; import com.blackcompany.eeos.common.presentation.respnose.ApiResponse; -import com.blackcompany.eeos.common.presentation.respnose.ApiResponseBody.*; +import com.blackcompany.eeos.common.presentation.respnose.ApiResponseBody.SuccessBody; import com.blackcompany.eeos.common.presentation.respnose.ApiResponseGenerator; import com.blackcompany.eeos.common.presentation.respnose.MessageCode; import java.util.List; import java.util.stream.Collectors; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("api/comments") diff --git a/eeos/src/main/java/com/blackcompany/eeos/comment/presentation/docs/CommentApi.java b/eeos/src/main/java/com/blackcompany/eeos/comment/presentation/docs/CommentApi.java index f509ad9d..a5cba4e6 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/comment/presentation/docs/CommentApi.java +++ b/eeos/src/main/java/com/blackcompany/eeos/comment/presentation/docs/CommentApi.java @@ -1,12 +1,17 @@ package com.blackcompany.eeos.comment.presentation.docs; -import com.blackcompany.eeos.comment.application.dto.*; +import com.blackcompany.eeos.comment.application.dto.CommandCommentResponse; +import com.blackcompany.eeos.comment.application.dto.CreateCommentRequest; +import com.blackcompany.eeos.comment.application.dto.QueryCommentsResponse; +import com.blackcompany.eeos.comment.application.dto.UpdateCommentRequest; import com.blackcompany.eeos.common.presentation.respnose.ApiResponse; -import com.blackcompany.eeos.common.presentation.respnose.ApiResponseBody.*; +import com.blackcompany.eeos.common.presentation.respnose.ApiResponseBody.SuccessBody; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; @Tag(name = "질문 및 댓글", description = "댓글 및 질문 관련 API") public interface CommentApi { diff --git a/eeos/src/main/java/com/blackcompany/eeos/member/presentation/controller/MemberController.java b/eeos/src/main/java/com/blackcompany/eeos/member/presentation/controller/MemberController.java index b9c267bc..799d2183 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/member/presentation/controller/MemberController.java +++ b/eeos/src/main/java/com/blackcompany/eeos/member/presentation/controller/MemberController.java @@ -5,13 +5,25 @@ import com.blackcompany.eeos.common.presentation.respnose.ApiResponseBody.SuccessBody; import com.blackcompany.eeos.common.presentation.respnose.ApiResponseGenerator; import com.blackcompany.eeos.common.presentation.respnose.MessageCode; -import com.blackcompany.eeos.member.application.dto.*; -import com.blackcompany.eeos.member.application.usecase.*; +import com.blackcompany.eeos.member.application.dto.ChangeActiveStatusRequest; +import com.blackcompany.eeos.member.application.dto.CommandMemberResponse; +import com.blackcompany.eeos.member.application.dto.QueryMemberResponse; +import com.blackcompany.eeos.member.application.dto.QueryMembersResponse; +import com.blackcompany.eeos.member.application.usecase.ChangeActiveStatusUsecase; +import com.blackcompany.eeos.member.application.usecase.GetMemberByActiveStatus; +import com.blackcompany.eeos.member.application.usecase.GetMembersByActiveStatus; import com.blackcompany.eeos.member.presentation.docs.MemberApi; import javax.validation.Valid; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; @RestController @RequiredArgsConstructor diff --git a/eeos/src/main/java/com/blackcompany/eeos/member/presentation/docs/MemberApi.java b/eeos/src/main/java/com/blackcompany/eeos/member/presentation/docs/MemberApi.java index 312bfdb6..2e08f4a8 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/member/presentation/docs/MemberApi.java +++ b/eeos/src/main/java/com/blackcompany/eeos/member/presentation/docs/MemberApi.java @@ -3,11 +3,16 @@ import com.blackcompany.eeos.auth.presentation.support.Member; import com.blackcompany.eeos.common.presentation.respnose.ApiResponse; import com.blackcompany.eeos.common.presentation.respnose.ApiResponseBody.SuccessBody; -import com.blackcompany.eeos.member.application.dto.*; +import com.blackcompany.eeos.member.application.dto.ChangeActiveStatusRequest; +import com.blackcompany.eeos.member.application.dto.CommandMemberResponse; +import com.blackcompany.eeos.member.application.dto.QueryMemberResponse; +import com.blackcompany.eeos.member.application.dto.QueryMembersResponse; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; @Tag(name = "멤버", description = "멤버에 관한 API") public interface MemberApi { diff --git a/eeos/src/main/java/com/blackcompany/eeos/program/application/dto/PageResponse.java b/eeos/src/main/java/com/blackcompany/eeos/program/application/dto/PageResponse.java index ac11660e..df58f070 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/program/application/dto/PageResponse.java +++ b/eeos/src/main/java/com/blackcompany/eeos/program/application/dto/PageResponse.java @@ -16,8 +16,10 @@ public class PageResponse { /** 페이지를 구성하는 일정 수의 크기 */ private int size; + /** 데이터를 가져온 페이지 번호 */ private int page; + /** size 크기에 맞춰 페이징했을 때 나오는 총 페이지 개수 */ private int totalPage; diff --git a/eeos/src/main/java/com/blackcompany/eeos/program/application/dto/UpdateProgramRequest.java b/eeos/src/main/java/com/blackcompany/eeos/program/application/dto/UpdateProgramRequest.java index 1bff9550..2cb2c02e 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/program/application/dto/UpdateProgramRequest.java +++ b/eeos/src/main/java/com/blackcompany/eeos/program/application/dto/UpdateProgramRequest.java @@ -1,6 +1,6 @@ package com.blackcompany.eeos.program.application.dto; -import com.blackcompany.eeos.program.application.dto.CreateProgramRequest.*; +import com.blackcompany.eeos.program.application.dto.CreateProgramRequest.Team; import java.sql.Timestamp; import java.util.List; import javax.validation.constraints.NotNull; diff --git a/eeos/src/main/java/com/blackcompany/eeos/program/application/model/ProgramModel.java b/eeos/src/main/java/com/blackcompany/eeos/program/application/model/ProgramModel.java index d4b1fbdb..6f3cc5a6 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/program/application/model/ProgramModel.java +++ b/eeos/src/main/java/com/blackcompany/eeos/program/application/model/ProgramModel.java @@ -2,7 +2,18 @@ import com.blackcompany.eeos.common.support.AbstractModel; import com.blackcompany.eeos.common.utils.DateConverter; -import com.blackcompany.eeos.program.application.exception.*; +import com.blackcompany.eeos.program.application.exception.AlreadyEndProgramException; +import com.blackcompany.eeos.program.application.exception.DeniedProgramEditException; +import com.blackcompany.eeos.program.application.exception.DeniedProgramNotificationException; +import com.blackcompany.eeos.program.application.exception.IsNotGithubUrlException; +import com.blackcompany.eeos.program.application.exception.NotAllowedAttendStartException; +import com.blackcompany.eeos.program.application.exception.NotAllowedUpdatedProgramAttendException; +import com.blackcompany.eeos.program.application.exception.NotAllowedUpdatedProgramTypeException; +import com.blackcompany.eeos.program.application.exception.NotFoundProgramAttendMode; +import com.blackcompany.eeos.program.application.exception.NotFoundProgramCategoryException; +import com.blackcompany.eeos.program.application.exception.NotWeeklyProgramException; +import com.blackcompany.eeos.program.application.exception.OverDateException; +import com.blackcompany.eeos.program.application.exception.SameModeRequestException; import com.blackcompany.eeos.program.persistence.ProgramCategory; import com.blackcompany.eeos.program.persistence.ProgramType; import java.sql.Timestamp; diff --git a/eeos/src/main/java/com/blackcompany/eeos/program/application/service/ProgramService.java b/eeos/src/main/java/com/blackcompany/eeos/program/application/service/ProgramService.java index 425bc7e6..066b1b29 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/program/application/service/ProgramService.java +++ b/eeos/src/main/java/com/blackcompany/eeos/program/application/service/ProgramService.java @@ -25,7 +25,15 @@ import com.blackcompany.eeos.program.application.model.converter.ProgramEntityConverter; import com.blackcompany.eeos.program.application.model.converter.ProgramRequestConverter; import com.blackcompany.eeos.program.application.support.ProgramStatusServiceComposite; -import com.blackcompany.eeos.program.application.usecase.*; +import com.blackcompany.eeos.program.application.usecase.AttendModeChangeUsecase; +import com.blackcompany.eeos.program.application.usecase.CreateProgramUsecase; +import com.blackcompany.eeos.program.application.usecase.DeleteProgramUsecase; +import com.blackcompany.eeos.program.application.usecase.GetAccessRightUsecase; +import com.blackcompany.eeos.program.application.usecase.GetProgramUsecase; +import com.blackcompany.eeos.program.application.usecase.GetProgramsUsecase; +import com.blackcompany.eeos.program.application.usecase.NotifyProgramUsecase; +import com.blackcompany.eeos.program.application.usecase.ProgramQuitUsecase; +import com.blackcompany.eeos.program.application.usecase.UpdateProgramUsecase; import com.blackcompany.eeos.program.infra.api.slack.chat.service.ProgramNotifyServiceComposite; import com.blackcompany.eeos.program.persistence.ProgramCategory; import com.blackcompany.eeos.program.persistence.ProgramEntity; diff --git a/eeos/src/main/java/com/blackcompany/eeos/program/application/util/ProgramInitializer.java b/eeos/src/main/java/com/blackcompany/eeos/program/application/util/ProgramInitializer.java deleted file mode 100644 index fbdef24b..00000000 --- a/eeos/src/main/java/com/blackcompany/eeos/program/application/util/ProgramInitializer.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.blackcompany.eeos.program.application.util; - -import com.blackcompany.eeos.program.application.model.ProgramAttendMode; -import com.blackcompany.eeos.program.persistence.ProgramEntity; -import com.blackcompany.eeos.program.persistence.ProgramRepository; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.boot.ApplicationArguments; -import org.springframework.boot.ApplicationRunner; -import org.springframework.stereotype.Component; - -import java.util.List; -import java.util.stream.Collectors; - -@Component -@RequiredArgsConstructor -@Slf4j -public class ProgramInitializer implements ApplicationRunner { - - private final ProgramRepository programRepository; - private final String defaultUrl = "https://github.com/JNU-econovation/weekly_presentation/tree/2024-1/2024-1/A_team/1st"; - - @Override - public void run(ApplicationArguments args) throws Exception { - System.out.println("------------Program Initializer----------"); - List programs = getPrograms(); - - if(programs.isEmpty()) return; - - programs = programs.stream() - .map(program -> { - if(program.getGithubUrl()==null){ - return program.toBuilder().githubUrl(defaultUrl).build(); - } - return program; - }) - .map(program -> { - if(program.getAttendMode()==null){ - return program.toBuilder().attendMode(ProgramAttendMode.END).build(); - } - - return program; - }) - .collect(Collectors.toList()); - - programRepository.saveAll(programs); - System.out.println("----------------------------------------------"); - } - - private List getPrograms(){ - return programRepository.findAll(); - } -} diff --git a/eeos/src/main/java/com/blackcompany/eeos/program/infra/api/slack/chat/model/ChatPostModel.java b/eeos/src/main/java/com/blackcompany/eeos/program/infra/api/slack/chat/model/ChatPostModel.java index 341197d7..6d868aa9 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/program/infra/api/slack/chat/model/ChatPostModel.java +++ b/eeos/src/main/java/com/blackcompany/eeos/program/infra/api/slack/chat/model/ChatPostModel.java @@ -2,7 +2,10 @@ import com.blackcompany.eeos.program.infra.api.slack.chat.model.ChatPostModel.Block; import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.*; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; @Getter @Builder diff --git a/eeos/src/main/java/com/blackcompany/eeos/program/infra/api/slack/chat/model/converter/ChatPostModelConverter.java b/eeos/src/main/java/com/blackcompany/eeos/program/infra/api/slack/chat/model/converter/ChatPostModelConverter.java index aef0ce2b..c5726f43 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/program/infra/api/slack/chat/model/converter/ChatPostModelConverter.java +++ b/eeos/src/main/java/com/blackcompany/eeos/program/infra/api/slack/chat/model/converter/ChatPostModelConverter.java @@ -3,9 +3,12 @@ import com.blackcompany.eeos.member.application.exception.NotFoundMemberException; import com.blackcompany.eeos.member.persistence.MemberRepository; import com.blackcompany.eeos.program.application.model.ProgramNotificationModel; -import com.blackcompany.eeos.program.infra.api.slack.chat.model.*; +import com.blackcompany.eeos.program.infra.api.slack.chat.model.BlockTypes; +import com.blackcompany.eeos.program.infra.api.slack.chat.model.ChatPostModel; import com.blackcompany.eeos.program.infra.api.slack.chat.model.ChatPostModel.Block; import com.blackcompany.eeos.program.infra.api.slack.chat.model.ChatPostModel.Text; +import com.blackcompany.eeos.program.infra.api.slack.chat.model.ProgramMessageAnnouncements; +import com.blackcompany.eeos.program.infra.api.slack.chat.model.TextTypes; import java.time.format.DateTimeFormatter; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; diff --git a/eeos/src/main/java/com/blackcompany/eeos/program/persistence/ProgramEntity.java b/eeos/src/main/java/com/blackcompany/eeos/program/persistence/ProgramEntity.java index 3c59fd06..5ac74ecb 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/program/persistence/ProgramEntity.java +++ b/eeos/src/main/java/com/blackcompany/eeos/program/persistence/ProgramEntity.java @@ -12,7 +12,12 @@ import javax.persistence.Id; import javax.persistence.Index; import javax.persistence.Table; -import lombok.*; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.ToString; import lombok.experimental.SuperBuilder; import org.hibernate.annotations.SQLDelete; import org.hibernate.annotations.Where; diff --git a/eeos/src/main/java/com/blackcompany/eeos/program/presentation/controller/GuestProgramController.java b/eeos/src/main/java/com/blackcompany/eeos/program/presentation/controller/GuestProgramController.java index a8a0d1d0..e845884a 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/program/presentation/controller/GuestProgramController.java +++ b/eeos/src/main/java/com/blackcompany/eeos/program/presentation/controller/GuestProgramController.java @@ -7,11 +7,16 @@ import com.blackcompany.eeos.program.application.dto.PageResponse; import com.blackcompany.eeos.program.application.dto.QueryProgramResponse; import com.blackcompany.eeos.program.application.dto.QueryProgramsResponse; -import com.blackcompany.eeos.program.application.usecase.*; +import com.blackcompany.eeos.program.application.usecase.GetProgramUsecase; +import com.blackcompany.eeos.program.application.usecase.GetProgramsUsecase; import com.blackcompany.eeos.program.presentation.docs.GuestProgramApi; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; @RestController @RequiredArgsConstructor diff --git a/eeos/src/main/java/com/blackcompany/eeos/program/presentation/controller/ProgramController.java b/eeos/src/main/java/com/blackcompany/eeos/program/presentation/controller/ProgramController.java index 9787ece9..a8829a1a 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/program/presentation/controller/ProgramController.java +++ b/eeos/src/main/java/com/blackcompany/eeos/program/presentation/controller/ProgramController.java @@ -5,13 +5,35 @@ import com.blackcompany.eeos.common.presentation.respnose.ApiResponseBody.SuccessBody; import com.blackcompany.eeos.common.presentation.respnose.ApiResponseGenerator; import com.blackcompany.eeos.common.presentation.respnose.MessageCode; -import com.blackcompany.eeos.program.application.dto.*; -import com.blackcompany.eeos.program.application.usecase.*; +import com.blackcompany.eeos.program.application.dto.CommandProgramResponse; +import com.blackcompany.eeos.program.application.dto.CreateProgramRequest; +import com.blackcompany.eeos.program.application.dto.PageResponse; +import com.blackcompany.eeos.program.application.dto.ProgramSlackNotificationRequest; +import com.blackcompany.eeos.program.application.dto.QueryAccessRightResponse; +import com.blackcompany.eeos.program.application.dto.QueryProgramResponse; +import com.blackcompany.eeos.program.application.dto.QueryProgramsResponse; +import com.blackcompany.eeos.program.application.dto.UpdateProgramRequest; +import com.blackcompany.eeos.program.application.usecase.AttendModeChangeUsecase; +import com.blackcompany.eeos.program.application.usecase.CreateProgramUsecase; +import com.blackcompany.eeos.program.application.usecase.DeleteProgramUsecase; +import com.blackcompany.eeos.program.application.usecase.GetAccessRightUsecase; +import com.blackcompany.eeos.program.application.usecase.GetProgramUsecase; +import com.blackcompany.eeos.program.application.usecase.GetProgramsUsecase; +import com.blackcompany.eeos.program.application.usecase.NotifyProgramUsecase; +import com.blackcompany.eeos.program.application.usecase.UpdateProgramUsecase; import com.blackcompany.eeos.program.presentation.docs.ProgramApi; import javax.validation.Valid; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PatchMapping; +import org.springframework.web.bind.annotation.PathVariable; +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.RequestParam; +import org.springframework.web.bind.annotation.RestController; @RestController @RequiredArgsConstructor diff --git a/eeos/src/main/java/com/blackcompany/eeos/program/presentation/docs/ProgramApi.java b/eeos/src/main/java/com/blackcompany/eeos/program/presentation/docs/ProgramApi.java index a600dbca..30164556 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/program/presentation/docs/ProgramApi.java +++ b/eeos/src/main/java/com/blackcompany/eeos/program/presentation/docs/ProgramApi.java @@ -2,7 +2,14 @@ import com.blackcompany.eeos.common.presentation.respnose.ApiResponse; import com.blackcompany.eeos.common.presentation.respnose.ApiResponseBody.SuccessBody; -import com.blackcompany.eeos.program.application.dto.*; +import com.blackcompany.eeos.program.application.dto.CommandProgramResponse; +import com.blackcompany.eeos.program.application.dto.CreateProgramRequest; +import com.blackcompany.eeos.program.application.dto.PageResponse; +import com.blackcompany.eeos.program.application.dto.ProgramSlackNotificationRequest; +import com.blackcompany.eeos.program.application.dto.QueryAccessRightResponse; +import com.blackcompany.eeos.program.application.dto.QueryProgramResponse; +import com.blackcompany.eeos.program.application.dto.QueryProgramsResponse; +import com.blackcompany.eeos.program.application.dto.UpdateProgramRequest; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; diff --git a/eeos/src/main/java/com/blackcompany/eeos/target/application/model/AttendModel.java b/eeos/src/main/java/com/blackcompany/eeos/target/application/model/AttendModel.java index b45dc640..1c947aeb 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/target/application/model/AttendModel.java +++ b/eeos/src/main/java/com/blackcompany/eeos/target/application/model/AttendModel.java @@ -2,8 +2,6 @@ import com.blackcompany.eeos.common.application.model.MemberIdModel; import com.blackcompany.eeos.common.support.AbstractModel; -import com.blackcompany.eeos.target.application.exception.DeniedChangeAttendException; -import com.blackcompany.eeos.target.application.exception.DeniedSaveAttendException; import com.blackcompany.eeos.target.application.exception.NotSameBeforeAttendStatusException; import java.util.List; import java.util.stream.Collectors; @@ -35,8 +33,9 @@ public String getStatus() { return status.getStatus(); } - public boolean isAttended(){ - return (!this.status.equals(AttendStatus.NONRESPONSE) && !this.status.equals(AttendStatus.NONRELATED)); + public boolean isAttended() { + return (!this.status.equals(AttendStatus.NONRESPONSE) + && !this.status.equals(AttendStatus.NONRELATED)); } public boolean isRelated() { diff --git a/eeos/src/main/java/com/blackcompany/eeos/target/application/service/AttendService.java b/eeos/src/main/java/com/blackcompany/eeos/target/application/service/AttendService.java index 6dda6829..771a5e93 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/target/application/service/AttendService.java +++ b/eeos/src/main/java/com/blackcompany/eeos/target/application/service/AttendService.java @@ -130,9 +130,10 @@ public QueryAttendActiveStatusResponse getAttendInfo(Long programId, String acti } private void validateAttend(ProgramModel programModel, AttendModel attendModel) { - if (programModel.getAttendMode().equals(ProgramAttendMode.END)) throw new NotStartAttendException(); - if(attendModel.isAttended()) throw new DeniedChangeAttendException(); - if(!attendModel.isRelated()) throw new DeniedSaveAttendException(); + if (programModel.getAttendMode().equals(ProgramAttendMode.END)) + throw new NotStartAttendException(); + if (attendModel.isAttended()) throw new DeniedChangeAttendException(); + if (!attendModel.isRelated()) throw new DeniedSaveAttendException(); } private ProgramModel findProgram(final Long programId) { diff --git a/eeos/src/main/java/com/blackcompany/eeos/target/application/util/PresentationInitializer.java b/eeos/src/main/java/com/blackcompany/eeos/target/application/util/PresentationInitializer.java deleted file mode 100644 index 3591e857..00000000 --- a/eeos/src/main/java/com/blackcompany/eeos/target/application/util/PresentationInitializer.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.blackcompany.eeos.target.application.util; - -import com.blackcompany.eeos.program.persistence.ProgramEntity; -import com.blackcompany.eeos.program.persistence.ProgramRepository; -import com.blackcompany.eeos.target.persistence.PresentationEntity; -import com.blackcompany.eeos.target.persistence.PresentationRepository; -import com.blackcompany.eeos.team.application.exception.NotFoundTeamException; -import com.blackcompany.eeos.team.persistence.TeamEntity; -import com.blackcompany.eeos.team.persistence.TeamRepository; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.ApplicationArguments; -import org.springframework.boot.ApplicationRunner; -import org.springframework.stereotype.Component; - -import java.util.Arrays; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - -// 기존에 저장된 Program과 Team을 매핑하는 구조 -@Component -@RequiredArgsConstructor -@Slf4j -public class PresentationInitializer implements ApplicationRunner { - - private final PresentationRepository presentationRepository; - private final ProgramRepository programRepository; - private final TeamRepository teamRepository; - - @Value("${eeos.team.list}") - private String teamList; - - @Override - public void run(ApplicationArguments args) throws Exception { - System.out.println("------------Presentation Initializer----------"); - Set programs = getPrograms().stream().map(ProgramEntity::getId).collect(Collectors.toSet()); - - if(programs.isEmpty()) return; - - Set presentations = getPresentations().stream() - .map(PresentationEntity::getProgramId) - .collect(Collectors.toSet()); - - Set target = programs.stream() - .filter(programId -> !presentations.contains(programId)) - .collect(Collectors.toSet()); - - List teams= getTeams(); - teams.forEach(team->log.info(team.getName())); - - target.forEach(targetId -> - { - Set entities = - teams.stream() - .map(TeamEntity::getId) - .map(teamId -> PresentationEntity.builder() - .teamId(teamId) - .programId(targetId) - .build()) - .collect(Collectors.toSet()); - presentationRepository.saveAll(entities); - }); - - System.out.println("----------------------------------------------"); - } - - private List getTeamList(){ - return Arrays.stream(teamList.split(",")).toList(); - } - - private List getPrograms(){ - return programRepository.findAll(); - } - - private List getTeams(){ - List teams = getTeamList(); - try { - return teamRepository.findAllTeams().stream().filter(team -> teams.contains(team.getName())).toList(); - } catch (NotFoundTeamException e){ - return createTeams(); - } - } - - private List createTeams(){ - Set teams = getTeamList().stream().map(team -> TeamEntity.builder().name(team).status(false).build()).collect(Collectors.toSet()); - return teamRepository.saveAll(teams); - } - - private List getPresentations(){ - return presentationRepository.findAll(); - } -} diff --git a/eeos/src/main/java/com/blackcompany/eeos/target/persistence/PresentationEntity.java b/eeos/src/main/java/com/blackcompany/eeos/target/persistence/PresentationEntity.java index f589ae3e..f7ea5c5a 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/target/persistence/PresentationEntity.java +++ b/eeos/src/main/java/com/blackcompany/eeos/target/persistence/PresentationEntity.java @@ -1,8 +1,17 @@ package com.blackcompany.eeos.target.persistence; import com.blackcompany.eeos.common.persistence.BaseEntity; -import javax.persistence.*; -import lombok.*; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.ToString; import lombok.experimental.SuperBuilder; import org.hibernate.annotations.SQLDelete; import org.hibernate.annotations.Where; diff --git a/eeos/src/main/java/com/blackcompany/eeos/target/presentation/controller/AttendController.java b/eeos/src/main/java/com/blackcompany/eeos/target/presentation/controller/AttendController.java index 13482e08..f1091386 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/target/presentation/controller/AttendController.java +++ b/eeos/src/main/java/com/blackcompany/eeos/target/presentation/controller/AttendController.java @@ -17,7 +17,12 @@ import java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; @RestController @RequiredArgsConstructor diff --git a/eeos/src/main/java/com/blackcompany/eeos/team/application/dto/CreateTeamRequest.java b/eeos/src/main/java/com/blackcompany/eeos/team/application/dto/CreateTeamRequest.java index ba704567..8ef340f8 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/team/application/dto/CreateTeamRequest.java +++ b/eeos/src/main/java/com/blackcompany/eeos/team/application/dto/CreateTeamRequest.java @@ -2,7 +2,11 @@ import com.blackcompany.eeos.common.support.dto.AbstractRequestDto; import javax.validation.constraints.NotNull; -import lombok.*; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; @Getter @Setter diff --git a/eeos/src/main/java/com/blackcompany/eeos/team/application/dto/UpdateTeamStatusRequest.java b/eeos/src/main/java/com/blackcompany/eeos/team/application/dto/UpdateTeamStatusRequest.java index bd824326..4685084f 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/team/application/dto/UpdateTeamStatusRequest.java +++ b/eeos/src/main/java/com/blackcompany/eeos/team/application/dto/UpdateTeamStatusRequest.java @@ -1,7 +1,11 @@ package com.blackcompany.eeos.team.application.dto; import javax.validation.constraints.NotNull; -import lombok.*; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; @Getter @Setter diff --git a/eeos/src/main/java/com/blackcompany/eeos/team/application/model/TeamModel.java b/eeos/src/main/java/com/blackcompany/eeos/team/application/model/TeamModel.java index e38047ae..e89d4d13 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/team/application/model/TeamModel.java +++ b/eeos/src/main/java/com/blackcompany/eeos/team/application/model/TeamModel.java @@ -1,7 +1,11 @@ package com.blackcompany.eeos.team.application.model; import com.blackcompany.eeos.common.support.AbstractModel; -import lombok.*; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; @Getter @Setter diff --git a/eeos/src/main/java/com/blackcompany/eeos/team/application/util/TeamInitializer.java b/eeos/src/main/java/com/blackcompany/eeos/team/application/util/TeamInitializer.java deleted file mode 100644 index f905c19e..00000000 --- a/eeos/src/main/java/com/blackcompany/eeos/team/application/util/TeamInitializer.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.blackcompany.eeos.team.application.util; - -import com.blackcompany.eeos.team.persistence.TeamEntity; -import com.blackcompany.eeos.team.persistence.TeamRepository; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.ApplicationArguments; -import org.springframework.boot.ApplicationRunner; -import org.springframework.stereotype.Component; - -import java.util.Arrays; -import java.util.Set; -import java.util.stream.Collectors; - - -// 기존 데이터베이스와의 데이터 정합성을 위한 클래스 -@RequiredArgsConstructor -@Slf4j -@Component -public class TeamInitializer implements ApplicationRunner { - - private final TeamRepository teamRepository; - - @Value("${eeos.team.list}") - private String teamList; - - @Override - public void run(ApplicationArguments args) throws Exception { - System.out.println("-----------Team Initializer-----------"); - Arrays.stream(teamList.split(",")).forEach(log::info); - try { - Set newTeams = Arrays.stream(teamList.split(",")) - .map(teamName -> TeamEntity.builder().name(teamName).status(false).build()) - .collect(Collectors.toSet()); - teamRepository.saveAll(newTeams); - log.info("임시 팀이 생성되었습니다."); - } catch (Exception e){ - log.error("임시 팀이 생성되지 않았습니다."); - } - System.out.println("---------------------------------------"); - - } - - private boolean isEmptyTable(){ - return teamRepository.findAllTeams().isEmpty(); - } -} diff --git a/eeos/src/main/java/com/blackcompany/eeos/team/persistence/TeamEntity.java b/eeos/src/main/java/com/blackcompany/eeos/team/persistence/TeamEntity.java index 4004494d..8d30ff95 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/team/persistence/TeamEntity.java +++ b/eeos/src/main/java/com/blackcompany/eeos/team/persistence/TeamEntity.java @@ -1,8 +1,19 @@ package com.blackcompany.eeos.team.persistence; import com.blackcompany.eeos.common.persistence.BaseEntity; -import javax.persistence.*; -import lombok.*; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Index; +import javax.persistence.Table; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.ToString; import lombok.experimental.SuperBuilder; @Getter @@ -30,9 +41,7 @@ public class TeamEntity extends BaseEntity { @Column(unique = true, name = ENTITY_PREFIX + "_name", nullable = false) private String name; - @Column( - name = ENTITY_PREFIX + "_status", - nullable = false) + @Column(name = ENTITY_PREFIX + "_status", nullable = false) @Builder.Default private boolean status = true; // 현학기 활동팀 1, 아니면 0 diff --git a/eeos/src/main/java/com/blackcompany/eeos/team/persistence/TeamRepository.java b/eeos/src/main/java/com/blackcompany/eeos/team/persistence/TeamRepository.java index 0d4aba3c..167d141d 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/team/persistence/TeamRepository.java +++ b/eeos/src/main/java/com/blackcompany/eeos/team/persistence/TeamRepository.java @@ -20,7 +20,6 @@ public interface TeamRepository extends JpaRepository { @Query("SELECT T FROM TeamEntity T WHERE T.status = true order by T.name") List findAllActiveTeams(); - @Query("SELECT T FROM TeamEntity T ORDER BY T.name") List findAllTeams(); } diff --git a/eeos/src/main/java/com/blackcompany/eeos/team/presetation/controller/TeamController.java b/eeos/src/main/java/com/blackcompany/eeos/team/presetation/controller/TeamController.java index c5bce8d3..9667a9ee 100644 --- a/eeos/src/main/java/com/blackcompany/eeos/team/presetation/controller/TeamController.java +++ b/eeos/src/main/java/com/blackcompany/eeos/team/presetation/controller/TeamController.java @@ -15,7 +15,14 @@ import javax.validation.Valid; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +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.RequestParam; +import org.springframework.web.bind.annotation.RestController; @RestController @RequiredArgsConstructor diff --git a/eeos/src/test/java/com/blackcompany/eeos/target/application/model/AttendModelTest.java b/eeos/src/test/java/com/blackcompany/eeos/target/application/model/AttendModelTest.java index 812e7441..8f142f8a 100644 --- a/eeos/src/test/java/com/blackcompany/eeos/target/application/model/AttendModelTest.java +++ b/eeos/src/test/java/com/blackcompany/eeos/target/application/model/AttendModelTest.java @@ -2,7 +2,7 @@ import static org.junit.jupiter.api.Assertions.*; -import com.blackcompany.eeos.target.application.exception.DeniedSaveAttendException; +import com.blackcompany.eeos.target.application.exception.NotSameBeforeAttendStatusException; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -22,12 +22,12 @@ void success_change_status() { } @Test - @DisplayName("이전 참석 정보가 참석 대상자가 아니라면 참석 상태를 변경하지 못 한다.") + @DisplayName("이전 참석 정보와 똑같은 참석 정보의 요청이 들어오면 에러가 발생한다.") void fail_change_status_when_noRelated() { // given AttendModel model = AttendModel.builder().status(AttendStatus.NONRELATED).build(); // when & then - assertThrows(DeniedSaveAttendException.class, () -> model.changeStatus("attend")); + assertThrows(NotSameBeforeAttendStatusException.class, () -> model.changeStatus("nonRelated")); } } diff --git a/eeos/tasks/formatting-task.gradle b/eeos/tasks/formatting-task.gradle index aba4c8ba..72e37257 100644 --- a/eeos/tasks/formatting-task.gradle +++ b/eeos/tasks/formatting-task.gradle @@ -3,7 +3,7 @@ spotless { importOrder() removeUnusedImports() trimTrailingWhitespace() - googleJavaFormat('1.15.0') + googleJavaFormat('1.17.0') indentWithTabs(2) endWithNewline() target 'src/*/java/**/*.java'