From 25411f70f44e312bc211ebccb99797ed240a8e5e Mon Sep 17 00:00:00 2001 From: Starlight258 Date: Tue, 6 Feb 2024 13:36:03 +0900 Subject: [PATCH 1/5] [#15] refactor: Update project name --- settings.gradle | 2 +- .../exception/GlobalExceptionHandler.java | 137 ------------------ .../TimeetApplication.java} | 6 +- .../common/domain/AuditableEntity.java | 3 +- .../common/domain/BaseEntity.java | 2 +- .../common/exception/ApiException.java | 4 +- .../common/exception/BadGatewayError.java | 2 +- .../common/exception/BadRequestError.java | 2 +- .../exception/CustomErrorAttributes.java | 2 +- .../common/exception/ForbiddenError.java | 2 +- .../exception/GlobalValidationHandler.java | 2 +- .../common/exception/InternalServerError.java | 2 +- .../common/exception/NotFoundError.java | 2 +- .../common/exception/UnAuthorizedError.java | 2 +- .../CustomAuthenticationEntryPoint.java | 4 +- .../common/security/CustomUserDetails.java | 4 +- .../security/CustomUserDetailsService.java | 6 +- .../common/security/JWTProvider.java | 4 +- .../security/JwtAuthenticationFilter.java | 21 ++- .../common/utils/ApiUtils.java | 2 +- .../common/utils/FilterResponseUtils.java | 6 +- .../config/SecurityConfig.java | 12 +- .../config/SwaggerConfig.java | 4 +- .../timer/application/TimerService.java | 12 +- .../timer/controller/TimerController.java | 10 +- .../timer/domain/Duration.java | 2 +- .../timer/domain/Timer.java | 4 +- .../timer/domain/TimerRepository.java | 2 +- .../timer/domain/TimerStatus.java | 2 +- .../timer/dto/TimerCreateRequest.java | 8 +- .../timer/dto/TimerInfoResponse.java | 6 +- .../user/application/UserFindService.java | 8 +- .../user/application/UserService.java | 22 +-- .../user/controller/UserController.java | 20 +-- .../user/domain/User.java | 4 +- .../user/domain/UserRepository.java | 2 +- .../user/domain/UserRole.java | 2 +- .../user/dto/EmailCheckRequest.java | 2 +- .../user/dto/UpdatePasswordRequest.java | 2 +- .../user/dto/UserInfoResponse.java | 6 +- .../user/dto/UserLoginRequest.java | 2 +- .../user/dto/UserLoginResponse.java | 2 +- .../user/dto/UserRegisterRequest.java | 6 +- .../TimeetApplicationTests.java} | 4 +- 44 files changed, 111 insertions(+), 250 deletions(-) delete mode 100644 src/main/java/org/dnd/modutimer/common/exception/GlobalExceptionHandler.java rename src/main/java/org/dnd/{modutimer/ModutimerApplication.java => timeet/TimeetApplication.java} (69%) rename src/main/java/org/dnd/{modutimer => timeet}/common/domain/AuditableEntity.java (82%) rename src/main/java/org/dnd/{modutimer => timeet}/common/domain/BaseEntity.java (96%) rename src/main/java/org/dnd/{modutimer => timeet}/common/exception/ApiException.java (90%) rename src/main/java/org/dnd/{modutimer => timeet}/common/exception/BadGatewayError.java (95%) rename src/main/java/org/dnd/{modutimer => timeet}/common/exception/BadRequestError.java (96%) rename src/main/java/org/dnd/{modutimer => timeet}/common/exception/CustomErrorAttributes.java (97%) rename src/main/java/org/dnd/{modutimer => timeet}/common/exception/ForbiddenError.java (95%) rename src/main/java/org/dnd/{modutimer => timeet}/common/exception/GlobalValidationHandler.java (97%) rename src/main/java/org/dnd/{modutimer => timeet}/common/exception/InternalServerError.java (95%) rename src/main/java/org/dnd/{modutimer => timeet}/common/exception/NotFoundError.java (95%) rename src/main/java/org/dnd/{modutimer => timeet}/common/exception/UnAuthorizedError.java (95%) rename src/main/java/org/dnd/{modutimer => timeet}/common/security/CustomAuthenticationEntryPoint.java (91%) rename src/main/java/org/dnd/{modutimer => timeet}/common/security/CustomUserDetails.java (93%) rename src/main/java/org/dnd/{modutimer => timeet}/common/security/CustomUserDetailsService.java (89%) rename src/main/java/org/dnd/{modutimer => timeet}/common/security/JWTProvider.java (93%) rename src/main/java/org/dnd/{modutimer => timeet}/common/security/JwtAuthenticationFilter.java (87%) rename src/main/java/org/dnd/{modutimer => timeet}/common/utils/ApiUtils.java (97%) rename src/main/java/org/dnd/{modutimer => timeet}/common/utils/FilterResponseUtils.java (91%) rename src/main/java/org/dnd/{modutimer => timeet}/config/SecurityConfig.java (95%) rename src/main/java/org/dnd/{modutimer => timeet}/config/SwaggerConfig.java (91%) rename src/main/java/org/dnd/{modutimer => timeet}/timer/application/TimerService.java (86%) rename src/main/java/org/dnd/{modutimer => timeet}/timer/controller/TimerController.java (92%) rename src/main/java/org/dnd/{modutimer => timeet}/timer/domain/Duration.java (97%) rename src/main/java/org/dnd/{modutimer => timeet}/timer/domain/Timer.java (95%) rename src/main/java/org/dnd/{modutimer => timeet}/timer/domain/TimerRepository.java (81%) rename src/main/java/org/dnd/{modutimer => timeet}/timer/domain/TimerStatus.java (55%) rename src/main/java/org/dnd/{modutimer => timeet}/timer/dto/TimerCreateRequest.java (88%) rename src/main/java/org/dnd/{modutimer => timeet}/timer/dto/TimerInfoResponse.java (90%) rename src/main/java/org/dnd/{modutimer => timeet}/user/application/UserFindService.java (76%) rename src/main/java/org/dnd/{modutimer => timeet}/user/application/UserService.java (81%) rename src/main/java/org/dnd/{modutimer => timeet}/user/controller/UserController.java (84%) rename src/main/java/org/dnd/{modutimer => timeet}/user/domain/User.java (93%) rename src/main/java/org/dnd/{modutimer => timeet}/user/domain/UserRepository.java (84%) rename src/main/java/org/dnd/{modutimer => timeet}/user/domain/UserRole.java (61%) rename src/main/java/org/dnd/{modutimer => timeet}/user/dto/EmailCheckRequest.java (93%) rename src/main/java/org/dnd/{modutimer => timeet}/user/dto/UpdatePasswordRequest.java (95%) rename src/main/java/org/dnd/{modutimer => timeet}/user/dto/UserInfoResponse.java (88%) rename src/main/java/org/dnd/{modutimer => timeet}/user/dto/UserLoginRequest.java (96%) rename src/main/java/org/dnd/{modutimer => timeet}/user/dto/UserLoginResponse.java (89%) rename src/main/java/org/dnd/{modutimer => timeet}/user/dto/UserRegisterRequest.java (92%) rename src/test/java/org/dnd/{modutimer/ModutimerApplicationTests.java => timeet/TimeetApplicationTests.java} (83%) diff --git a/settings.gradle b/settings.gradle index 2c10bbe..393c2a8 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -rootProject.name = 'modutimer' +rootProject.name = 'timeet' diff --git a/src/main/java/org/dnd/modutimer/common/exception/GlobalExceptionHandler.java b/src/main/java/org/dnd/modutimer/common/exception/GlobalExceptionHandler.java deleted file mode 100644 index 7300767..0000000 --- a/src/main/java/org/dnd/modutimer/common/exception/GlobalExceptionHandler.java +++ /dev/null @@ -1,137 +0,0 @@ -package org.dnd.modutimer.common.exception; - - -import org.dnd.modutimer.common.utils.ApiUtils; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.http.converter.HttpMessageNotReadableException; -import org.springframework.web.bind.MethodArgumentNotValidException; -import org.springframework.web.bind.MissingServletRequestParameterException; -import org.springframework.web.bind.annotation.ControllerAdvice; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException; -import org.springframework.web.multipart.support.MissingServletRequestPartException; - -import java.util.HashMap; -import java.util.Map; - -@ControllerAdvice -public class GlobalExceptionHandler { - - @ExceptionHandler(ApiException.class) - public ResponseEntity> handleApiException(ApiException e) { - - return new ResponseEntity<>(e.body(), e.getStatus()); - } - - @ExceptionHandler(IllegalArgumentException.class) - public ResponseEntity> handleIllegalArgumentException(IllegalArgumentException e) { - Map message = new HashMap<>(); - message.put("error", e.getMessage()); - - BadRequestError.ErrorCode errorCode = BadRequestError.ErrorCode.WRONG_REQUEST_TRANSMISSION; - ApiUtils.ApiResult errorResult = ApiUtils.error( - String.valueOf(HttpStatus.BAD_REQUEST.value()), - String.valueOf(errorCode.getCode()), - message - ); - - return new ResponseEntity<>(errorResult, HttpStatus.BAD_REQUEST); - } - - @ExceptionHandler(MethodArgumentTypeMismatchException.class) - public ResponseEntity> handleTypeMismatch(MethodArgumentTypeMismatchException e) { - Map message = new HashMap<>(); // 맵으로 변경 - String errorMessage = String.format("The parameter '%s' of value '%s' could not be converted to type '%s'", - e.getName(), e.getValue(), e.getRequiredType().getSimpleName()); - message.put("error", errorMessage); - - BadRequestError.ErrorCode errorCode = BadRequestError.ErrorCode.WRONG_REQUEST_TRANSMISSION; - ApiUtils.ApiResult errorResult = ApiUtils.error( - String.valueOf(HttpStatus.BAD_REQUEST.value()), - String.valueOf(errorCode.getCode()), - message - ); - - return new ResponseEntity<>(errorResult, HttpStatus.BAD_REQUEST); - } - - @ExceptionHandler(MethodArgumentNotValidException.class) - public ResponseEntity> handleValidationExceptions(MethodArgumentNotValidException ex) { - Map messages = new HashMap<>(); - ex.getBindingResult().getFieldErrors().forEach(error -> - messages.put(error.getField(), error.getDefaultMessage())); - - BadRequestError.ErrorCode errorCode = BadRequestError.ErrorCode.VALIDATION_FAILED; - ApiUtils.ApiResult errorResult = ApiUtils.error( - String.valueOf(HttpStatus.BAD_REQUEST.value()), - String.valueOf(errorCode.getCode()), - messages - ); - - return new ResponseEntity<>(errorResult, HttpStatus.BAD_REQUEST); - } - - @ExceptionHandler(MissingServletRequestParameterException.class) - public ResponseEntity> handleMissingParams(MissingServletRequestParameterException ex) { - Map message = new HashMap<>(); - message.put("error", String.format("The required parameter '%s' of type '%s' is missing", ex.getParameterName(), - ex.getParameterType())); - - BadRequestError.ErrorCode errorCode = BadRequestError.ErrorCode.MISSING_PART; - ApiUtils.ApiResult errorResult = ApiUtils.error( - String.valueOf(HttpStatus.BAD_REQUEST.value()), - String.valueOf(errorCode.getCode()), - message - ); - - return new ResponseEntity<>(errorResult, HttpStatus.BAD_REQUEST); - } - - @ExceptionHandler(MissingServletRequestPartException.class) - public ResponseEntity> handleMissingServletRequestPartException( - MissingServletRequestPartException e) { - Map message = new HashMap<>(); - message.put("error", e.getMessage()); - - BadRequestError.ErrorCode errorCode = BadRequestError.ErrorCode.MISSING_PART; - ApiUtils.ApiResult errorResult = ApiUtils.error( - String.valueOf(HttpStatus.BAD_REQUEST.value()), - String.valueOf(errorCode.getCode()), - message - ); - - return new ResponseEntity<>(errorResult, HttpStatus.BAD_REQUEST); - } - - @ExceptionHandler(Exception.class) - public ResponseEntity> unknownServerError(Exception e) { - Map message = new HashMap<>(); - message.put("error", e.getMessage()); - - InternalServerError.ErrorCode errorCode = InternalServerError.ErrorCode.INTERNAL_SERVER_ERROR; - ApiUtils.ApiResult errorResult = ApiUtils.error( - String.valueOf(HttpStatus.INTERNAL_SERVER_ERROR.value()), - String.valueOf(errorCode.getCode()), - message - ); - - return new ResponseEntity<>(errorResult, HttpStatus.INTERNAL_SERVER_ERROR); - } - - @ExceptionHandler(HttpMessageNotReadableException.class) - public ResponseEntity> handleHttpMessageNotReadable(HttpMessageNotReadableException e) { - Map message = new HashMap<>(); - message.put("error", "The request body is not readable or has an invalid format."); - - BadRequestError.ErrorCode errorCode = BadRequestError.ErrorCode.WRONG_REQUEST_TRANSMISSION; - ApiUtils.ApiResult errorResult = ApiUtils.error( - String.valueOf(HttpStatus.BAD_REQUEST.value()), - String.valueOf(errorCode.getCode()), - message - ); - - return new ResponseEntity<>(errorResult, HttpStatus.BAD_REQUEST); - } - -} diff --git a/src/main/java/org/dnd/modutimer/ModutimerApplication.java b/src/main/java/org/dnd/timeet/TimeetApplication.java similarity index 69% rename from src/main/java/org/dnd/modutimer/ModutimerApplication.java rename to src/main/java/org/dnd/timeet/TimeetApplication.java index 6e614bd..f05c8a6 100644 --- a/src/main/java/org/dnd/modutimer/ModutimerApplication.java +++ b/src/main/java/org/dnd/timeet/TimeetApplication.java @@ -1,4 +1,4 @@ -package org.dnd.modutimer; +package org.dnd.timeet; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -7,10 +7,10 @@ @SpringBootApplication @EnableJpaAuditing -public class ModutimerApplication { +public class TimeetApplication { public static void main(String[] args) { - SpringApplication.run(ModutimerApplication.class, args); + SpringApplication.run(TimeetApplication.class, args); } } diff --git a/src/main/java/org/dnd/modutimer/common/domain/AuditableEntity.java b/src/main/java/org/dnd/timeet/common/domain/AuditableEntity.java similarity index 82% rename from src/main/java/org/dnd/modutimer/common/domain/AuditableEntity.java rename to src/main/java/org/dnd/timeet/common/domain/AuditableEntity.java index 52742f7..d55f4fa 100644 --- a/src/main/java/org/dnd/modutimer/common/domain/AuditableEntity.java +++ b/src/main/java/org/dnd/timeet/common/domain/AuditableEntity.java @@ -1,4 +1,4 @@ -package org.dnd.modutimer.common.domain; +package org.dnd.timeet.common.domain; import jakarta.persistence.*; import lombok.EqualsAndHashCode; @@ -9,7 +9,6 @@ @MappedSuperclass @EntityListeners(AuditingEntityListener.class) -@EqualsAndHashCode(of = "id", callSuper = false) // Equals()와 Hashcode() 만들어줌 @Getter public class AuditableEntity extends BaseEntity { diff --git a/src/main/java/org/dnd/modutimer/common/domain/BaseEntity.java b/src/main/java/org/dnd/timeet/common/domain/BaseEntity.java similarity index 96% rename from src/main/java/org/dnd/modutimer/common/domain/BaseEntity.java rename to src/main/java/org/dnd/timeet/common/domain/BaseEntity.java index bf0f9ed..b68a002 100644 --- a/src/main/java/org/dnd/modutimer/common/domain/BaseEntity.java +++ b/src/main/java/org/dnd/timeet/common/domain/BaseEntity.java @@ -1,4 +1,4 @@ -package org.dnd.modutimer.common.domain; +package org.dnd.timeet.common.domain; import jakarta.persistence.Column; import jakarta.persistence.EntityListeners; diff --git a/src/main/java/org/dnd/modutimer/common/exception/ApiException.java b/src/main/java/org/dnd/timeet/common/exception/ApiException.java similarity index 90% rename from src/main/java/org/dnd/modutimer/common/exception/ApiException.java rename to src/main/java/org/dnd/timeet/common/exception/ApiException.java index c0fe88b..70d7e50 100644 --- a/src/main/java/org/dnd/modutimer/common/exception/ApiException.java +++ b/src/main/java/org/dnd/timeet/common/exception/ApiException.java @@ -1,7 +1,7 @@ -package org.dnd.modutimer.common.exception; +package org.dnd.timeet.common.exception; import lombok.Getter; -import org.dnd.modutimer.common.utils.ApiUtils; +import org.dnd.timeet.common.utils.ApiUtils; import org.springframework.http.HttpStatus; import java.util.Map; diff --git a/src/main/java/org/dnd/modutimer/common/exception/BadGatewayError.java b/src/main/java/org/dnd/timeet/common/exception/BadGatewayError.java similarity index 95% rename from src/main/java/org/dnd/modutimer/common/exception/BadGatewayError.java rename to src/main/java/org/dnd/timeet/common/exception/BadGatewayError.java index dee874f..4f00f0d 100644 --- a/src/main/java/org/dnd/modutimer/common/exception/BadGatewayError.java +++ b/src/main/java/org/dnd/timeet/common/exception/BadGatewayError.java @@ -1,4 +1,4 @@ -package org.dnd.modutimer.common.exception; +package org.dnd.timeet.common.exception; import lombok.Getter; import org.springframework.http.HttpStatus; diff --git a/src/main/java/org/dnd/modutimer/common/exception/BadRequestError.java b/src/main/java/org/dnd/timeet/common/exception/BadRequestError.java similarity index 96% rename from src/main/java/org/dnd/modutimer/common/exception/BadRequestError.java rename to src/main/java/org/dnd/timeet/common/exception/BadRequestError.java index 8b0f773..1bfbc16 100644 --- a/src/main/java/org/dnd/modutimer/common/exception/BadRequestError.java +++ b/src/main/java/org/dnd/timeet/common/exception/BadRequestError.java @@ -1,4 +1,4 @@ -package org.dnd.modutimer.common.exception; +package org.dnd.timeet.common.exception; import lombok.Getter; import org.springframework.http.HttpStatus; diff --git a/src/main/java/org/dnd/modutimer/common/exception/CustomErrorAttributes.java b/src/main/java/org/dnd/timeet/common/exception/CustomErrorAttributes.java similarity index 97% rename from src/main/java/org/dnd/modutimer/common/exception/CustomErrorAttributes.java rename to src/main/java/org/dnd/timeet/common/exception/CustomErrorAttributes.java index 11fd56c..82ab896 100644 --- a/src/main/java/org/dnd/modutimer/common/exception/CustomErrorAttributes.java +++ b/src/main/java/org/dnd/timeet/common/exception/CustomErrorAttributes.java @@ -1,4 +1,4 @@ -package org.dnd.modutimer.common.exception; +package org.dnd.timeet.common.exception; import org.springframework.boot.web.error.ErrorAttributeOptions; import org.springframework.boot.web.servlet.error.DefaultErrorAttributes; diff --git a/src/main/java/org/dnd/modutimer/common/exception/ForbiddenError.java b/src/main/java/org/dnd/timeet/common/exception/ForbiddenError.java similarity index 95% rename from src/main/java/org/dnd/modutimer/common/exception/ForbiddenError.java rename to src/main/java/org/dnd/timeet/common/exception/ForbiddenError.java index 67f3e71..db8a3a4 100644 --- a/src/main/java/org/dnd/modutimer/common/exception/ForbiddenError.java +++ b/src/main/java/org/dnd/timeet/common/exception/ForbiddenError.java @@ -1,4 +1,4 @@ -package org.dnd.modutimer.common.exception; +package org.dnd.timeet.common.exception; import lombok.Getter; diff --git a/src/main/java/org/dnd/modutimer/common/exception/GlobalValidationHandler.java b/src/main/java/org/dnd/timeet/common/exception/GlobalValidationHandler.java similarity index 97% rename from src/main/java/org/dnd/modutimer/common/exception/GlobalValidationHandler.java rename to src/main/java/org/dnd/timeet/common/exception/GlobalValidationHandler.java index 33f0e4b..700ddda 100644 --- a/src/main/java/org/dnd/modutimer/common/exception/GlobalValidationHandler.java +++ b/src/main/java/org/dnd/timeet/common/exception/GlobalValidationHandler.java @@ -1,4 +1,4 @@ -package org.dnd.modutimer.common.exception; +package org.dnd.timeet.common.exception; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.Aspect; diff --git a/src/main/java/org/dnd/modutimer/common/exception/InternalServerError.java b/src/main/java/org/dnd/timeet/common/exception/InternalServerError.java similarity index 95% rename from src/main/java/org/dnd/modutimer/common/exception/InternalServerError.java rename to src/main/java/org/dnd/timeet/common/exception/InternalServerError.java index f663487..c91cd51 100644 --- a/src/main/java/org/dnd/modutimer/common/exception/InternalServerError.java +++ b/src/main/java/org/dnd/timeet/common/exception/InternalServerError.java @@ -1,4 +1,4 @@ -package org.dnd.modutimer.common.exception; +package org.dnd.timeet.common.exception; import lombok.Getter; diff --git a/src/main/java/org/dnd/modutimer/common/exception/NotFoundError.java b/src/main/java/org/dnd/timeet/common/exception/NotFoundError.java similarity index 95% rename from src/main/java/org/dnd/modutimer/common/exception/NotFoundError.java rename to src/main/java/org/dnd/timeet/common/exception/NotFoundError.java index 464cd24..432a132 100644 --- a/src/main/java/org/dnd/modutimer/common/exception/NotFoundError.java +++ b/src/main/java/org/dnd/timeet/common/exception/NotFoundError.java @@ -1,4 +1,4 @@ -package org.dnd.modutimer.common.exception; +package org.dnd.timeet.common.exception; import lombok.Getter; diff --git a/src/main/java/org/dnd/modutimer/common/exception/UnAuthorizedError.java b/src/main/java/org/dnd/timeet/common/exception/UnAuthorizedError.java similarity index 95% rename from src/main/java/org/dnd/modutimer/common/exception/UnAuthorizedError.java rename to src/main/java/org/dnd/timeet/common/exception/UnAuthorizedError.java index 10670c9..c9c8d59 100644 --- a/src/main/java/org/dnd/modutimer/common/exception/UnAuthorizedError.java +++ b/src/main/java/org/dnd/timeet/common/exception/UnAuthorizedError.java @@ -1,4 +1,4 @@ -package org.dnd.modutimer.common.exception; +package org.dnd.timeet.common.exception; import lombok.Getter; diff --git a/src/main/java/org/dnd/modutimer/common/security/CustomAuthenticationEntryPoint.java b/src/main/java/org/dnd/timeet/common/security/CustomAuthenticationEntryPoint.java similarity index 91% rename from src/main/java/org/dnd/modutimer/common/security/CustomAuthenticationEntryPoint.java rename to src/main/java/org/dnd/timeet/common/security/CustomAuthenticationEntryPoint.java index 1309024..35f692d 100644 --- a/src/main/java/org/dnd/modutimer/common/security/CustomAuthenticationEntryPoint.java +++ b/src/main/java/org/dnd/timeet/common/security/CustomAuthenticationEntryPoint.java @@ -1,9 +1,9 @@ -package org.dnd.modutimer.common.security; +package org.dnd.timeet.common.security; import com.fasterxml.jackson.databind.ObjectMapper; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; -import org.dnd.modutimer.common.exception.UnAuthorizedError; +import org.dnd.timeet.common.exception.UnAuthorizedError; import org.springframework.http.MediaType; import org.springframework.security.core.AuthenticationException; import org.springframework.security.web.AuthenticationEntryPoint; diff --git a/src/main/java/org/dnd/modutimer/common/security/CustomUserDetails.java b/src/main/java/org/dnd/timeet/common/security/CustomUserDetails.java similarity index 93% rename from src/main/java/org/dnd/modutimer/common/security/CustomUserDetails.java rename to src/main/java/org/dnd/timeet/common/security/CustomUserDetails.java index bdbe8f0..392513a 100644 --- a/src/main/java/org/dnd/modutimer/common/security/CustomUserDetails.java +++ b/src/main/java/org/dnd/timeet/common/security/CustomUserDetails.java @@ -1,9 +1,9 @@ -package org.dnd.modutimer.common.security; +package org.dnd.timeet.common.security; import lombok.Getter; import lombok.RequiredArgsConstructor; -import org.dnd.modutimer.user.domain.User; +import org.dnd.timeet.user.domain.User; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; diff --git a/src/main/java/org/dnd/modutimer/common/security/CustomUserDetailsService.java b/src/main/java/org/dnd/timeet/common/security/CustomUserDetailsService.java similarity index 89% rename from src/main/java/org/dnd/modutimer/common/security/CustomUserDetailsService.java rename to src/main/java/org/dnd/timeet/common/security/CustomUserDetailsService.java index 61a0f45..fb5a574 100644 --- a/src/main/java/org/dnd/modutimer/common/security/CustomUserDetailsService.java +++ b/src/main/java/org/dnd/timeet/common/security/CustomUserDetailsService.java @@ -1,9 +1,9 @@ -package org.dnd.modutimer.common.security; +package org.dnd.timeet.common.security; import lombok.RequiredArgsConstructor; -import org.dnd.modutimer.user.domain.User; -import org.dnd.modutimer.user.domain.UserRepository; +import org.dnd.timeet.user.domain.User; +import org.dnd.timeet.user.domain.UserRepository; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; diff --git a/src/main/java/org/dnd/modutimer/common/security/JWTProvider.java b/src/main/java/org/dnd/timeet/common/security/JWTProvider.java similarity index 93% rename from src/main/java/org/dnd/modutimer/common/security/JWTProvider.java rename to src/main/java/org/dnd/timeet/common/security/JWTProvider.java index 0f703af..a59e3bd 100644 --- a/src/main/java/org/dnd/modutimer/common/security/JWTProvider.java +++ b/src/main/java/org/dnd/timeet/common/security/JWTProvider.java @@ -1,4 +1,4 @@ -package org.dnd.modutimer.common.security; +package org.dnd.timeet.common.security; import com.auth0.jwt.JWT; @@ -6,7 +6,7 @@ import com.auth0.jwt.exceptions.SignatureVerificationException; import com.auth0.jwt.exceptions.TokenExpiredException; import com.auth0.jwt.interfaces.DecodedJWT; -import org.dnd.modutimer.user.domain.User; +import org.dnd.timeet.user.domain.User; import org.springframework.stereotype.Component; import java.util.Date; diff --git a/src/main/java/org/dnd/modutimer/common/security/JwtAuthenticationFilter.java b/src/main/java/org/dnd/timeet/common/security/JwtAuthenticationFilter.java similarity index 87% rename from src/main/java/org/dnd/modutimer/common/security/JwtAuthenticationFilter.java rename to src/main/java/org/dnd/timeet/common/security/JwtAuthenticationFilter.java index 39208a0..3e34f7b 100644 --- a/src/main/java/org/dnd/modutimer/common/security/JwtAuthenticationFilter.java +++ b/src/main/java/org/dnd/timeet/common/security/JwtAuthenticationFilter.java @@ -1,4 +1,4 @@ -package org.dnd.modutimer.common.security; +package org.dnd.timeet.common.security; import com.auth0.jwt.exceptions.SignatureVerificationException; @@ -9,13 +9,14 @@ import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import lombok.extern.slf4j.Slf4j; -import org.dnd.modutimer.common.exception.ApiException; -import org.dnd.modutimer.common.exception.BadRequestError; -import org.dnd.modutimer.common.exception.InternalServerError; -import org.dnd.modutimer.common.exception.UnAuthorizedError; -import org.dnd.modutimer.user.domain.User; -import org.dnd.modutimer.common.utils.ApiUtils; -import org.dnd.modutimer.user.application.UserFindService; +import org.dnd.timeet.common.exception.ApiException; +import org.dnd.timeet.common.exception.BadRequestError; +import org.dnd.timeet.common.exception.InternalServerError; +import org.dnd.timeet.common.exception.UnAuthorizedError; +import org.dnd.timeet.config.SecurityConfig; +import org.dnd.timeet.user.domain.User; +import org.dnd.timeet.common.utils.ApiUtils; +import org.dnd.timeet.user.application.UserFindService; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.Authentication; @@ -26,8 +27,6 @@ import java.io.IOException; import java.util.Collections; -import static org.dnd.modutimer.config.SecurityConfig.PUBLIC_URLS; - @Slf4j public class JwtAuthenticationFilter extends BasicAuthenticationFilter { @@ -78,7 +77,7 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse // 인증이 필요하지 않는 url private boolean isNonProtectedUrl(HttpServletRequest request) { - for (String urlPattern : PUBLIC_URLS) { + for (String urlPattern : SecurityConfig.PUBLIC_URLS) { AntPathRequestMatcher matcher = new AntPathRequestMatcher(urlPattern); if (matcher.matches(request)) { return true; diff --git a/src/main/java/org/dnd/modutimer/common/utils/ApiUtils.java b/src/main/java/org/dnd/timeet/common/utils/ApiUtils.java similarity index 97% rename from src/main/java/org/dnd/modutimer/common/utils/ApiUtils.java rename to src/main/java/org/dnd/timeet/common/utils/ApiUtils.java index 12b5b07..038a1e6 100644 --- a/src/main/java/org/dnd/modutimer/common/utils/ApiUtils.java +++ b/src/main/java/org/dnd/timeet/common/utils/ApiUtils.java @@ -1,4 +1,4 @@ -package org.dnd.modutimer.common.utils; +package org.dnd.timeet.common.utils; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/main/java/org/dnd/modutimer/common/utils/FilterResponseUtils.java b/src/main/java/org/dnd/timeet/common/utils/FilterResponseUtils.java similarity index 91% rename from src/main/java/org/dnd/modutimer/common/utils/FilterResponseUtils.java rename to src/main/java/org/dnd/timeet/common/utils/FilterResponseUtils.java index f0f616b..5cc521f 100644 --- a/src/main/java/org/dnd/modutimer/common/utils/FilterResponseUtils.java +++ b/src/main/java/org/dnd/timeet/common/utils/FilterResponseUtils.java @@ -1,10 +1,10 @@ -package org.dnd.modutimer.common.utils; +package org.dnd.timeet.common.utils; import com.fasterxml.jackson.databind.ObjectMapper; import jakarta.servlet.http.HttpServletResponse; -import org.dnd.modutimer.common.exception.ForbiddenError; -import org.dnd.modutimer.common.exception.UnAuthorizedError; +import org.dnd.timeet.common.exception.ForbiddenError; +import org.dnd.timeet.common.exception.UnAuthorizedError; import org.springframework.http.HttpStatus; import java.io.IOException; diff --git a/src/main/java/org/dnd/modutimer/config/SecurityConfig.java b/src/main/java/org/dnd/timeet/config/SecurityConfig.java similarity index 95% rename from src/main/java/org/dnd/modutimer/config/SecurityConfig.java rename to src/main/java/org/dnd/timeet/config/SecurityConfig.java index c34b646..e63f374 100644 --- a/src/main/java/org/dnd/modutimer/config/SecurityConfig.java +++ b/src/main/java/org/dnd/timeet/config/SecurityConfig.java @@ -1,12 +1,12 @@ -package org.dnd.modutimer.config; +package org.dnd.timeet.config; import java.util.Collections; -import org.dnd.modutimer.common.exception.ForbiddenError; -import org.dnd.modutimer.common.security.CustomAuthenticationEntryPoint; -import org.dnd.modutimer.common.security.JwtAuthenticationFilter; -import org.dnd.modutimer.user.application.UserFindService; -import org.dnd.modutimer.common.utils.FilterResponseUtils; +import org.dnd.timeet.common.exception.ForbiddenError; +import org.dnd.timeet.common.security.CustomAuthenticationEntryPoint; +import org.dnd.timeet.common.security.JwtAuthenticationFilter; +import org.dnd.timeet.user.application.UserFindService; +import org.dnd.timeet.common.utils.FilterResponseUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; diff --git a/src/main/java/org/dnd/modutimer/config/SwaggerConfig.java b/src/main/java/org/dnd/timeet/config/SwaggerConfig.java similarity index 91% rename from src/main/java/org/dnd/modutimer/config/SwaggerConfig.java rename to src/main/java/org/dnd/timeet/config/SwaggerConfig.java index 13d6907..8117bd5 100644 --- a/src/main/java/org/dnd/modutimer/config/SwaggerConfig.java +++ b/src/main/java/org/dnd/timeet/config/SwaggerConfig.java @@ -1,4 +1,4 @@ -package org.dnd.modutimer.config; +package org.dnd.timeet.config; import io.swagger.v3.oas.annotations.OpenAPIDefinition; import io.swagger.v3.oas.models.Components; @@ -10,7 +10,7 @@ import org.springframework.context.annotation.Configuration; @OpenAPIDefinition( - info = @io.swagger.v3.oas.annotations.info.Info(title = "ModuTimer API 명세서", + info = @io.swagger.v3.oas.annotations.info.Info(title = "Timeet API 명세서", description = "모두의 타이머 API 명세서", version = "v1")) @Configuration diff --git a/src/main/java/org/dnd/modutimer/timer/application/TimerService.java b/src/main/java/org/dnd/timeet/timer/application/TimerService.java similarity index 86% rename from src/main/java/org/dnd/modutimer/timer/application/TimerService.java rename to src/main/java/org/dnd/timeet/timer/application/TimerService.java index f2ee668..33140f1 100644 --- a/src/main/java/org/dnd/modutimer/timer/application/TimerService.java +++ b/src/main/java/org/dnd/timeet/timer/application/TimerService.java @@ -1,13 +1,13 @@ -package org.dnd.modutimer.timer.application; +package org.dnd.timeet.timer.application; import java.util.Collections; import java.util.List; import lombok.RequiredArgsConstructor; -import org.dnd.modutimer.common.exception.NotFoundError; -import org.dnd.modutimer.timer.domain.Duration; -import org.dnd.modutimer.timer.domain.Timer; -import org.dnd.modutimer.timer.domain.TimerRepository; -import org.dnd.modutimer.timer.dto.TimerCreateRequest; +import org.dnd.timeet.common.exception.NotFoundError; +import org.dnd.timeet.timer.domain.Duration; +import org.dnd.timeet.timer.domain.Timer; +import org.dnd.timeet.timer.domain.TimerRepository; +import org.dnd.timeet.timer.dto.TimerCreateRequest; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; diff --git a/src/main/java/org/dnd/modutimer/timer/controller/TimerController.java b/src/main/java/org/dnd/timeet/timer/controller/TimerController.java similarity index 92% rename from src/main/java/org/dnd/modutimer/timer/controller/TimerController.java rename to src/main/java/org/dnd/timeet/timer/controller/TimerController.java index 58329f2..6351cff 100644 --- a/src/main/java/org/dnd/modutimer/timer/controller/TimerController.java +++ b/src/main/java/org/dnd/timeet/timer/controller/TimerController.java @@ -1,4 +1,4 @@ -package org.dnd.modutimer.timer.controller; +package org.dnd.timeet.timer.controller; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; @@ -7,10 +7,10 @@ import java.util.List; import java.util.stream.Collectors; import lombok.RequiredArgsConstructor; -import org.dnd.modutimer.timer.application.TimerService; -import org.dnd.modutimer.timer.domain.Timer; -import org.dnd.modutimer.timer.dto.TimerCreateRequest; -import org.dnd.modutimer.timer.dto.TimerInfoResponse; +import org.dnd.timeet.timer.application.TimerService; +import org.dnd.timeet.timer.domain.Timer; +import org.dnd.timeet.timer.dto.TimerCreateRequest; +import org.dnd.timeet.timer.dto.TimerInfoResponse; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; diff --git a/src/main/java/org/dnd/modutimer/timer/domain/Duration.java b/src/main/java/org/dnd/timeet/timer/domain/Duration.java similarity index 97% rename from src/main/java/org/dnd/modutimer/timer/domain/Duration.java rename to src/main/java/org/dnd/timeet/timer/domain/Duration.java index f6351ed..08168c4 100644 --- a/src/main/java/org/dnd/modutimer/timer/domain/Duration.java +++ b/src/main/java/org/dnd/timeet/timer/domain/Duration.java @@ -1,4 +1,4 @@ -package org.dnd.modutimer.timer.domain; +package org.dnd.timeet.timer.domain; import jakarta.persistence.Embeddable; import lombok.AccessLevel; diff --git a/src/main/java/org/dnd/modutimer/timer/domain/Timer.java b/src/main/java/org/dnd/timeet/timer/domain/Timer.java similarity index 95% rename from src/main/java/org/dnd/modutimer/timer/domain/Timer.java rename to src/main/java/org/dnd/timeet/timer/domain/Timer.java index 95d3ec1..10dce21 100644 --- a/src/main/java/org/dnd/modutimer/timer/domain/Timer.java +++ b/src/main/java/org/dnd/timeet/timer/domain/Timer.java @@ -1,4 +1,4 @@ -package org.dnd.modutimer.timer.domain; +package org.dnd.timeet.timer.domain; import jakarta.persistence.AttributeOverride; @@ -12,7 +12,7 @@ import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; -import org.dnd.modutimer.common.domain.AuditableEntity; +import org.dnd.timeet.common.domain.AuditableEntity; import org.hibernate.annotations.Where; @Entity diff --git a/src/main/java/org/dnd/modutimer/timer/domain/TimerRepository.java b/src/main/java/org/dnd/timeet/timer/domain/TimerRepository.java similarity index 81% rename from src/main/java/org/dnd/modutimer/timer/domain/TimerRepository.java rename to src/main/java/org/dnd/timeet/timer/domain/TimerRepository.java index ad5414f..d2ba1bd 100644 --- a/src/main/java/org/dnd/modutimer/timer/domain/TimerRepository.java +++ b/src/main/java/org/dnd/timeet/timer/domain/TimerRepository.java @@ -1,4 +1,4 @@ -package org.dnd.modutimer.timer.domain; +package org.dnd.timeet.timer.domain; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/src/main/java/org/dnd/modutimer/timer/domain/TimerStatus.java b/src/main/java/org/dnd/timeet/timer/domain/TimerStatus.java similarity index 55% rename from src/main/java/org/dnd/modutimer/timer/domain/TimerStatus.java rename to src/main/java/org/dnd/timeet/timer/domain/TimerStatus.java index 896d8bf..765bdb9 100644 --- a/src/main/java/org/dnd/modutimer/timer/domain/TimerStatus.java +++ b/src/main/java/org/dnd/timeet/timer/domain/TimerStatus.java @@ -1,4 +1,4 @@ -package org.dnd.modutimer.timer.domain; +package org.dnd.timeet.timer.domain; public enum TimerStatus { RUNNING, STOPPED diff --git a/src/main/java/org/dnd/modutimer/timer/dto/TimerCreateRequest.java b/src/main/java/org/dnd/timeet/timer/dto/TimerCreateRequest.java similarity index 88% rename from src/main/java/org/dnd/modutimer/timer/dto/TimerCreateRequest.java rename to src/main/java/org/dnd/timeet/timer/dto/TimerCreateRequest.java index 315533e..c897c91 100644 --- a/src/main/java/org/dnd/modutimer/timer/dto/TimerCreateRequest.java +++ b/src/main/java/org/dnd/timeet/timer/dto/TimerCreateRequest.java @@ -1,13 +1,13 @@ -package org.dnd.modutimer.timer.dto; +package org.dnd.timeet.timer.dto; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; -import org.dnd.modutimer.timer.domain.Duration; -import org.dnd.modutimer.timer.domain.Timer; -import org.dnd.modutimer.timer.domain.TimerStatus; +import org.dnd.timeet.timer.domain.Duration; +import org.dnd.timeet.timer.domain.Timer; +import org.dnd.timeet.timer.domain.TimerStatus; import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; diff --git a/src/main/java/org/dnd/modutimer/timer/dto/TimerInfoResponse.java b/src/main/java/org/dnd/timeet/timer/dto/TimerInfoResponse.java similarity index 90% rename from src/main/java/org/dnd/modutimer/timer/dto/TimerInfoResponse.java rename to src/main/java/org/dnd/timeet/timer/dto/TimerInfoResponse.java index db911dd..3fbdd19 100644 --- a/src/main/java/org/dnd/modutimer/timer/dto/TimerInfoResponse.java +++ b/src/main/java/org/dnd/timeet/timer/dto/TimerInfoResponse.java @@ -1,11 +1,11 @@ -package org.dnd.modutimer.timer.dto; +package org.dnd.timeet.timer.dto; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Builder; import lombok.Getter; import lombok.Setter; -import org.dnd.modutimer.timer.domain.Timer; -import org.dnd.modutimer.timer.domain.TimerStatus; +import org.dnd.timeet.timer.domain.Timer; +import org.dnd.timeet.timer.domain.TimerStatus; @Getter @Setter diff --git a/src/main/java/org/dnd/modutimer/user/application/UserFindService.java b/src/main/java/org/dnd/timeet/user/application/UserFindService.java similarity index 76% rename from src/main/java/org/dnd/modutimer/user/application/UserFindService.java rename to src/main/java/org/dnd/timeet/user/application/UserFindService.java index 18571ad..4269e7a 100644 --- a/src/main/java/org/dnd/modutimer/user/application/UserFindService.java +++ b/src/main/java/org/dnd/timeet/user/application/UserFindService.java @@ -1,8 +1,8 @@ -package org.dnd.modutimer.user.application; +package org.dnd.timeet.user.application; -import org.dnd.modutimer.common.exception.NotFoundError; -import org.dnd.modutimer.user.domain.User; -import org.dnd.modutimer.user.domain.UserRepository; +import org.dnd.timeet.common.exception.NotFoundError; +import org.dnd.timeet.user.domain.User; +import org.dnd.timeet.user.domain.UserRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/src/main/java/org/dnd/modutimer/user/application/UserService.java b/src/main/java/org/dnd/timeet/user/application/UserService.java similarity index 81% rename from src/main/java/org/dnd/modutimer/user/application/UserService.java rename to src/main/java/org/dnd/timeet/user/application/UserService.java index 60c1348..a8e352a 100644 --- a/src/main/java/org/dnd/modutimer/user/application/UserService.java +++ b/src/main/java/org/dnd/timeet/user/application/UserService.java @@ -1,17 +1,17 @@ -package org.dnd.modutimer.user.application; +package org.dnd.timeet.user.application; import lombok.RequiredArgsConstructor; -import org.dnd.modutimer.common.exception.BadRequestError; -import org.dnd.modutimer.common.exception.InternalServerError; -import org.dnd.modutimer.common.exception.NotFoundError; -import org.dnd.modutimer.common.exception.UnAuthorizedError; -import org.dnd.modutimer.common.security.JWTProvider; -import org.dnd.modutimer.user.domain.User; -import org.dnd.modutimer.user.domain.UserRepository; -import org.dnd.modutimer.user.dto.UserLoginRequest; -import org.dnd.modutimer.user.dto.UserLoginResponse; -import org.dnd.modutimer.user.dto.UserRegisterRequest; +import org.dnd.timeet.common.exception.BadRequestError; +import org.dnd.timeet.common.exception.InternalServerError; +import org.dnd.timeet.common.exception.NotFoundError; +import org.dnd.timeet.common.exception.UnAuthorizedError; +import org.dnd.timeet.common.security.JWTProvider; +import org.dnd.timeet.user.domain.User; +import org.dnd.timeet.user.domain.UserRepository; +import org.dnd.timeet.user.dto.UserLoginRequest; +import org.dnd.timeet.user.dto.UserLoginResponse; +import org.dnd.timeet.user.dto.UserRegisterRequest; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; diff --git a/src/main/java/org/dnd/modutimer/user/controller/UserController.java b/src/main/java/org/dnd/timeet/user/controller/UserController.java similarity index 84% rename from src/main/java/org/dnd/modutimer/user/controller/UserController.java rename to src/main/java/org/dnd/timeet/user/controller/UserController.java index 866771e..846491b 100644 --- a/src/main/java/org/dnd/modutimer/user/controller/UserController.java +++ b/src/main/java/org/dnd/timeet/user/controller/UserController.java @@ -1,4 +1,4 @@ -package org.dnd.modutimer.user.controller; +package org.dnd.timeet.user.controller; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.media.Content; @@ -8,15 +8,15 @@ import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; -import org.dnd.modutimer.common.exception.BadRequestError; -import org.dnd.modutimer.common.exception.InternalServerError; -import org.dnd.modutimer.common.security.JWTProvider; -import org.dnd.modutimer.user.application.UserService; -import org.dnd.modutimer.user.dto.EmailCheckRequest; -import org.dnd.modutimer.user.dto.UserLoginRequest; -import org.dnd.modutimer.user.dto.UserLoginResponse; -import org.dnd.modutimer.user.dto.UserRegisterRequest; -import org.dnd.modutimer.common.utils.ApiUtils; +import org.dnd.timeet.common.exception.BadRequestError; +import org.dnd.timeet.common.exception.InternalServerError; +import org.dnd.timeet.common.security.JWTProvider; +import org.dnd.timeet.user.application.UserService; +import org.dnd.timeet.user.dto.EmailCheckRequest; +import org.dnd.timeet.user.dto.UserLoginRequest; +import org.dnd.timeet.user.dto.UserLoginResponse; +import org.dnd.timeet.user.dto.UserRegisterRequest; +import org.dnd.timeet.common.utils.ApiUtils; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; diff --git a/src/main/java/org/dnd/modutimer/user/domain/User.java b/src/main/java/org/dnd/timeet/user/domain/User.java similarity index 93% rename from src/main/java/org/dnd/modutimer/user/domain/User.java rename to src/main/java/org/dnd/timeet/user/domain/User.java index efbcbe7..9c0e856 100644 --- a/src/main/java/org/dnd/modutimer/user/domain/User.java +++ b/src/main/java/org/dnd/timeet/user/domain/User.java @@ -1,4 +1,4 @@ -package org.dnd.modutimer.user.domain; +package org.dnd.timeet.user.domain; import jakarta.persistence.AttributeOverride; import jakarta.persistence.Column; @@ -10,7 +10,7 @@ import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; -import org.dnd.modutimer.common.domain.BaseEntity; +import org.dnd.timeet.common.domain.BaseEntity; import org.hibernate.annotations.Where; @NoArgsConstructor(access = AccessLevel.PROTECTED) diff --git a/src/main/java/org/dnd/modutimer/user/domain/UserRepository.java b/src/main/java/org/dnd/timeet/user/domain/UserRepository.java similarity index 84% rename from src/main/java/org/dnd/modutimer/user/domain/UserRepository.java rename to src/main/java/org/dnd/timeet/user/domain/UserRepository.java index 3a0d263..3e9a949 100644 --- a/src/main/java/org/dnd/modutimer/user/domain/UserRepository.java +++ b/src/main/java/org/dnd/timeet/user/domain/UserRepository.java @@ -1,4 +1,4 @@ -package org.dnd.modutimer.user.domain; +package org.dnd.timeet.user.domain; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/src/main/java/org/dnd/modutimer/user/domain/UserRole.java b/src/main/java/org/dnd/timeet/user/domain/UserRole.java similarity index 61% rename from src/main/java/org/dnd/modutimer/user/domain/UserRole.java rename to src/main/java/org/dnd/timeet/user/domain/UserRole.java index 5a8a121..610dc42 100644 --- a/src/main/java/org/dnd/modutimer/user/domain/UserRole.java +++ b/src/main/java/org/dnd/timeet/user/domain/UserRole.java @@ -1,4 +1,4 @@ -package org.dnd.modutimer.user.domain; +package org.dnd.timeet.user.domain; public enum UserRole { ROLE_USER, ROLE_OWNER, ROLE_ADMIN diff --git a/src/main/java/org/dnd/modutimer/user/dto/EmailCheckRequest.java b/src/main/java/org/dnd/timeet/user/dto/EmailCheckRequest.java similarity index 93% rename from src/main/java/org/dnd/modutimer/user/dto/EmailCheckRequest.java rename to src/main/java/org/dnd/timeet/user/dto/EmailCheckRequest.java index d3cab5a..7a412df 100644 --- a/src/main/java/org/dnd/modutimer/user/dto/EmailCheckRequest.java +++ b/src/main/java/org/dnd/timeet/user/dto/EmailCheckRequest.java @@ -1,4 +1,4 @@ -package org.dnd.modutimer.user.dto; +package org.dnd.timeet.user.dto; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; diff --git a/src/main/java/org/dnd/modutimer/user/dto/UpdatePasswordRequest.java b/src/main/java/org/dnd/timeet/user/dto/UpdatePasswordRequest.java similarity index 95% rename from src/main/java/org/dnd/modutimer/user/dto/UpdatePasswordRequest.java rename to src/main/java/org/dnd/timeet/user/dto/UpdatePasswordRequest.java index f455cc1..5e1136d 100644 --- a/src/main/java/org/dnd/modutimer/user/dto/UpdatePasswordRequest.java +++ b/src/main/java/org/dnd/timeet/user/dto/UpdatePasswordRequest.java @@ -1,4 +1,4 @@ -package org.dnd.modutimer.user.dto; +package org.dnd.timeet.user.dto; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; diff --git a/src/main/java/org/dnd/modutimer/user/dto/UserInfoResponse.java b/src/main/java/org/dnd/timeet/user/dto/UserInfoResponse.java similarity index 88% rename from src/main/java/org/dnd/modutimer/user/dto/UserInfoResponse.java rename to src/main/java/org/dnd/timeet/user/dto/UserInfoResponse.java index 9d01f94..6ff1e2f 100644 --- a/src/main/java/org/dnd/modutimer/user/dto/UserInfoResponse.java +++ b/src/main/java/org/dnd/timeet/user/dto/UserInfoResponse.java @@ -1,10 +1,10 @@ -package org.dnd.modutimer.user.dto; +package org.dnd.timeet.user.dto; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Getter; import lombok.Setter; -import org.dnd.modutimer.user.domain.User; -import org.dnd.modutimer.user.domain.UserRole; +import org.dnd.timeet.user.domain.User; +import org.dnd.timeet.user.domain.UserRole; @Getter @Setter diff --git a/src/main/java/org/dnd/modutimer/user/dto/UserLoginRequest.java b/src/main/java/org/dnd/timeet/user/dto/UserLoginRequest.java similarity index 96% rename from src/main/java/org/dnd/modutimer/user/dto/UserLoginRequest.java rename to src/main/java/org/dnd/timeet/user/dto/UserLoginRequest.java index db5872d..32d0b3c 100644 --- a/src/main/java/org/dnd/modutimer/user/dto/UserLoginRequest.java +++ b/src/main/java/org/dnd/timeet/user/dto/UserLoginRequest.java @@ -1,4 +1,4 @@ -package org.dnd.modutimer.user.dto; +package org.dnd.timeet.user.dto; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; diff --git a/src/main/java/org/dnd/modutimer/user/dto/UserLoginResponse.java b/src/main/java/org/dnd/timeet/user/dto/UserLoginResponse.java similarity index 89% rename from src/main/java/org/dnd/modutimer/user/dto/UserLoginResponse.java rename to src/main/java/org/dnd/timeet/user/dto/UserLoginResponse.java index 6867b55..917c7b1 100644 --- a/src/main/java/org/dnd/modutimer/user/dto/UserLoginResponse.java +++ b/src/main/java/org/dnd/timeet/user/dto/UserLoginResponse.java @@ -1,4 +1,4 @@ -package org.dnd.modutimer.user.dto; +package org.dnd.timeet.user.dto; import lombok.Getter; import lombok.Setter; diff --git a/src/main/java/org/dnd/modutimer/user/dto/UserRegisterRequest.java b/src/main/java/org/dnd/timeet/user/dto/UserRegisterRequest.java similarity index 92% rename from src/main/java/org/dnd/modutimer/user/dto/UserRegisterRequest.java rename to src/main/java/org/dnd/timeet/user/dto/UserRegisterRequest.java index a948a64..d489b08 100644 --- a/src/main/java/org/dnd/modutimer/user/dto/UserRegisterRequest.java +++ b/src/main/java/org/dnd/timeet/user/dto/UserRegisterRequest.java @@ -1,4 +1,4 @@ -package org.dnd.modutimer.user.dto; +package org.dnd.timeet.user.dto; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; @@ -6,8 +6,8 @@ import jakarta.validation.constraints.Size; import lombok.Getter; import lombok.Setter; -import org.dnd.modutimer.user.domain.User; -import org.dnd.modutimer.user.domain.UserRole; +import org.dnd.timeet.user.domain.User; +import org.dnd.timeet.user.domain.UserRole; @Getter @Setter diff --git a/src/test/java/org/dnd/modutimer/ModutimerApplicationTests.java b/src/test/java/org/dnd/timeet/TimeetApplicationTests.java similarity index 83% rename from src/test/java/org/dnd/modutimer/ModutimerApplicationTests.java rename to src/test/java/org/dnd/timeet/TimeetApplicationTests.java index 598a922..eaa3d23 100644 --- a/src/test/java/org/dnd/modutimer/ModutimerApplicationTests.java +++ b/src/test/java/org/dnd/timeet/TimeetApplicationTests.java @@ -1,4 +1,4 @@ -package org.dnd.modutimer; +package org.dnd.timeet; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @@ -6,7 +6,7 @@ @SpringBootTest @TestPropertySource(properties = {"spring.config.location = classpath:application-test.yml"}) -class ModutimerApplicationTests { +class TimeetApplicationTests { @Test void contextLoads() { From 8d6556709586817104ce20dea1c86c67e9f3c0e5 Mon Sep 17 00:00:00 2001 From: Starlight258 Date: Tue, 6 Feb 2024 14:05:47 +0900 Subject: [PATCH 2/5] [#15] refactor: Eliminate unnecessary imports --- .../java/org/dnd/timeet/common/domain/AuditableEntity.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/dnd/timeet/common/domain/AuditableEntity.java b/src/main/java/org/dnd/timeet/common/domain/AuditableEntity.java index d55f4fa..0b29e3b 100644 --- a/src/main/java/org/dnd/timeet/common/domain/AuditableEntity.java +++ b/src/main/java/org/dnd/timeet/common/domain/AuditableEntity.java @@ -1,7 +1,8 @@ package org.dnd.timeet.common.domain; -import jakarta.persistence.*; -import lombok.EqualsAndHashCode; +import jakarta.persistence.Column; +import jakarta.persistence.EntityListeners; +import jakarta.persistence.MappedSuperclass; import lombok.Getter; import org.springframework.data.annotation.CreatedBy; import org.springframework.data.annotation.LastModifiedBy; From 13d9380c37e8701792845a161ccd45d00ca03e0c Mon Sep 17 00:00:00 2001 From: Starlight258 Date: Tue, 6 Feb 2024 14:48:10 +0900 Subject: [PATCH 3/5] [#15] refactor: Integrate Checkstyle in build.yml, exclude Javadox checks --- .../pull_request_template.md | 0 .github/workflows/build.yml | 2 + build.gradle | 6 + config/checkstyle-config.xml | 382 +++++++++++ config/formatter-config.xml | 598 ++++++++++++++++++ 5 files changed, 988 insertions(+) rename .github/{ => PR_TEMPLATE}/pull_request_template.md (100%) create mode 100644 config/checkstyle-config.xml create mode 100644 config/formatter-config.xml diff --git a/.github/pull_request_template.md b/.github/PR_TEMPLATE/pull_request_template.md similarity index 100% rename from .github/pull_request_template.md rename to .github/PR_TEMPLATE/pull_request_template.md diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cf02042..dcdb8a3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,6 +15,8 @@ jobs: uses: actions/setup-java@v1 with: java-version: 17 + - name: Run Checkstyle + run: ./gradlew checkstyleMain checkstyleTest - name: Make application-prod.yml run: | touch src/main/resources/application-prod.yml diff --git a/build.gradle b/build.gradle index 4b9a275..c6a4cd9 100644 --- a/build.gradle +++ b/build.gradle @@ -3,6 +3,7 @@ plugins { id 'org.springframework.boot' version '3.2.1' id 'io.spring.dependency-management' version '1.1.4' id "org.sonarqube" version "4.0.0.2929" + id 'checkstyle' } group = 'org.dnd' @@ -56,4 +57,9 @@ sonar { properties { property "sonar.projectKey", "dnd-10th-2-backend" } +} + +checkstyle { + toolVersion '8.45' + configFile file("${project.rootDir}/config/checkstyle-config.xml") } \ No newline at end of file diff --git a/config/checkstyle-config.xml b/config/checkstyle-config.xml new file mode 100644 index 0000000..cccde2e --- /dev/null +++ b/config/checkstyle-config.xml @@ -0,0 +1,382 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/formatter-config.xml b/config/formatter-config.xml new file mode 100644 index 0000000..98f81e9 --- /dev/null +++ b/config/formatter-config.xml @@ -0,0 +1,598 @@ + + + + + + From 5ae2736529cfa82144fdd41d5813ba9d9de41895 Mon Sep 17 00:00:00 2001 From: Starlight258 Date: Tue, 6 Feb 2024 16:15:36 +0900 Subject: [PATCH 4/5] [#-] feat: Add checkstyle plugin and configuration for build process --- .github/workflows/build.yml | 4 ++-- build.gradle | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dcdb8a3..31dec9a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,8 +15,8 @@ jobs: uses: actions/setup-java@v1 with: java-version: 17 - - name: Run Checkstyle - run: ./gradlew checkstyleMain checkstyleTest +# - name: Run Checkstyle +# run: ./gradlew checkstyleMain checkstyleTest - name: Make application-prod.yml run: | touch src/main/resources/application-prod.yml diff --git a/build.gradle b/build.gradle index c6a4cd9..50c4589 100644 --- a/build.gradle +++ b/build.gradle @@ -60,6 +60,6 @@ sonar { } checkstyle { - toolVersion '8.45' - configFile file("${project.rootDir}/config/checkstyle-config.xml") + toolVersion '8.1' + configFile = file('config/checkstyle-config.xml') // Path to your config file } \ No newline at end of file From 0f09e4a02091a580e1db337bb1a68d6584db47d4 Mon Sep 17 00:00:00 2001 From: Starlight258 Date: Tue, 6 Feb 2024 17:34:40 +0900 Subject: [PATCH 5/5] [#17] chore: temporarily disable SonarQube plugin --- build.gradle | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 50c4589..b7bc85a 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ plugins { id 'org.springframework.boot' version '3.2.1' id 'io.spring.dependency-management' version '1.1.4' id "org.sonarqube" version "4.0.0.2929" - id 'checkstyle' +// id 'checkstyle' } group = 'org.dnd' @@ -59,7 +59,7 @@ sonar { } } -checkstyle { - toolVersion '8.1' - configFile = file('config/checkstyle-config.xml') // Path to your config file -} \ No newline at end of file +//checkstyle { +// toolVersion '8.1' +// configFile = file('config/checkstyle-config.xml') // Path to your config file +//} \ No newline at end of file