diff --git a/src/main/java/space/space_spring/dao/PostLikeDao.java b/src/main/java/space/space_spring/dao/PostLikeDao.java deleted file mode 100644 index f0a1e36c..00000000 --- a/src/main/java/space/space_spring/dao/PostLikeDao.java +++ /dev/null @@ -1,11 +0,0 @@ -package space.space_spring.dao; - -import org.springframework.data.jpa.repository.JpaRepository; -import space.space_spring.domain.user.model.entity.User; -import space.space_spring.entity.*; - -import java.util.Optional; - -public interface PostLikeDao extends JpaRepository { - Optional findByUserAndPost(User user, Post post); -} diff --git a/src/main/java/space/space_spring/domain/authorization/auth/controller/AuthController.java b/src/main/java/space/space_spring/domain/authorization/auth/controller/AuthController.java index c2b86e10..fa9b5654 100644 --- a/src/main/java/space/space_spring/domain/authorization/auth/controller/AuthController.java +++ b/src/main/java/space/space_spring/domain/authorization/auth/controller/AuthController.java @@ -10,11 +10,11 @@ import org.springframework.web.bind.annotation.RestController; import space.space_spring.domain.authorization.auth.service.AuthService; import space.space_spring.domain.user.model.PostLoginDto; -import space.space_spring.exception.CustomException; -import space.space_spring.response.BaseResponse; +import space.space_spring.global.exception.CustomException; +import space.space_spring.global.common.response.BaseResponse; -import static space.space_spring.response.status.BaseExceptionResponseStatus.INVALID_USER_LOGIN; -import static space.space_spring.util.bindingResult.BindingResultUtils.getErrorMessage; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.INVALID_USER_LOGIN; +import static space.space_spring.global.util.bindingResult.BindingResultUtils.getErrorMessage; @RestController @RequiredArgsConstructor diff --git a/src/main/java/space/space_spring/domain/authorization/auth/service/AuthService.java b/src/main/java/space/space_spring/domain/authorization/auth/service/AuthService.java index f42c8c45..fc7cfb39 100644 --- a/src/main/java/space/space_spring/domain/authorization/auth/service/AuthService.java +++ b/src/main/java/space/space_spring/domain/authorization/auth/service/AuthService.java @@ -11,12 +11,12 @@ import space.space_spring.domain.user.model.PostLoginDto; import space.space_spring.domain.authorization.jwt.model.entity.RefreshTokenStorage; import space.space_spring.domain.user.model.entity.User; -import space.space_spring.exception.CustomException; +import space.space_spring.global.exception.CustomException; import space.space_spring.domain.authorization.jwt.model.JwtLoginProvider; -import space.space_spring.util.user.UserUtils; +import space.space_spring.global.util.user.UserUtils; -import static space.space_spring.entity.enumStatus.UserSignupType.LOCAL; -import static space.space_spring.response.status.BaseExceptionResponseStatus.PASSWORD_NO_MATCH; +import static space.space_spring.global.common.enumStatus.UserSignupType.LOCAL; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.PASSWORD_NO_MATCH; @Service @RequiredArgsConstructor diff --git a/src/main/java/space/space_spring/domain/authorization/jwt/controller/JwtController.java b/src/main/java/space/space_spring/domain/authorization/jwt/controller/JwtController.java index b20630d9..22b7aca8 100644 --- a/src/main/java/space/space_spring/domain/authorization/jwt/controller/JwtController.java +++ b/src/main/java/space/space_spring/domain/authorization/jwt/controller/JwtController.java @@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.RestController; import space.space_spring.domain.authorization.jwt.service.JwtService; import space.space_spring.domain.authorization.jwt.model.TokenPairDTO; -import space.space_spring.response.BaseResponse; +import space.space_spring.global.common.response.BaseResponse; import java.io.IOException; diff --git a/src/main/java/space/space_spring/domain/authorization/jwt/model/JwtLoginProvider.java b/src/main/java/space/space_spring/domain/authorization/jwt/model/JwtLoginProvider.java index 81b6c7ce..403957f8 100644 --- a/src/main/java/space/space_spring/domain/authorization/jwt/model/JwtLoginProvider.java +++ b/src/main/java/space/space_spring/domain/authorization/jwt/model/JwtLoginProvider.java @@ -4,19 +4,17 @@ import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; -import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; -import space.space_spring.exception.CustomException; -import space.space_spring.exception.jwt.bad_request.JwtUnsupportedTokenException; -import space.space_spring.exception.jwt.unauthorized.JwtInvalidTokenException; -import space.space_spring.exception.jwt.unauthorized.JwtMalformedTokenException; +import space.space_spring.global.exception.CustomException; +import space.space_spring.global.exception.jwt.bad_request.JwtUnsupportedTokenException; +import space.space_spring.global.exception.jwt.unauthorized.JwtInvalidTokenException; +import space.space_spring.global.exception.jwt.unauthorized.JwtMalformedTokenException; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.*; import java.util.Date; -import static space.space_spring.response.status.BaseExceptionResponseStatus.*; - @Slf4j @Component @NoArgsConstructor(access = AccessLevel.PROTECTED) diff --git a/src/main/java/space/space_spring/domain/authorization/jwt/model/JwtLoginTokenResolver.java b/src/main/java/space/space_spring/domain/authorization/jwt/model/JwtLoginTokenResolver.java index 56381bc5..9964d535 100644 --- a/src/main/java/space/space_spring/domain/authorization/jwt/model/JwtLoginTokenResolver.java +++ b/src/main/java/space/space_spring/domain/authorization/jwt/model/JwtLoginTokenResolver.java @@ -5,11 +5,11 @@ import lombok.NoArgsConstructor; import org.springframework.http.HttpHeaders; import org.springframework.stereotype.Component; -import space.space_spring.exception.jwt.bad_request.JwtNoTokenException; -import space.space_spring.exception.jwt.bad_request.JwtUnsupportedTokenException; +import space.space_spring.global.exception.jwt.bad_request.JwtNoTokenException; +import space.space_spring.global.exception.jwt.bad_request.JwtUnsupportedTokenException; -import static space.space_spring.response.status.BaseExceptionResponseStatus.TOKEN_NOT_FOUND; -import static space.space_spring.response.status.BaseExceptionResponseStatus.UNSUPPORTED_TOKEN_TYPE; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.TOKEN_NOT_FOUND; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.UNSUPPORTED_TOKEN_TYPE; @Component @NoArgsConstructor(access = AccessLevel.PROTECTED) diff --git a/src/main/java/space/space_spring/domain/authorization/jwt/service/JwtService.java b/src/main/java/space/space_spring/domain/authorization/jwt/service/JwtService.java index b9c170a2..f90cedeb 100644 --- a/src/main/java/space/space_spring/domain/authorization/jwt/service/JwtService.java +++ b/src/main/java/space/space_spring/domain/authorization/jwt/service/JwtService.java @@ -10,11 +10,10 @@ import space.space_spring.domain.user.repository.UserRepository; import space.space_spring.domain.authorization.jwt.model.entity.RefreshTokenStorage; import space.space_spring.domain.user.model.entity.User; -import space.space_spring.exception.CustomException; -import space.space_spring.exception.jwt.unauthorized.JwtExpiredTokenException; -import space.space_spring.exception.jwt.unauthorized.JwtUnauthorizedTokenException; - -import static space.space_spring.response.status.BaseExceptionResponseStatus.*; +import space.space_spring.global.exception.CustomException; +import space.space_spring.global.exception.jwt.unauthorized.JwtExpiredTokenException; +import space.space_spring.global.exception.jwt.unauthorized.JwtUnauthorizedTokenException; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.*; @Service @RequiredArgsConstructor diff --git a/src/main/java/space/space_spring/domain/authorization/OAuth/controller/OAuthController.java b/src/main/java/space/space_spring/domain/authorization/oauth/controller/OAuthController.java similarity index 94% rename from src/main/java/space/space_spring/domain/authorization/OAuth/controller/OAuthController.java rename to src/main/java/space/space_spring/domain/authorization/oauth/controller/OAuthController.java index 2ab7c4fa..3507072a 100644 --- a/src/main/java/space/space_spring/domain/authorization/OAuth/controller/OAuthController.java +++ b/src/main/java/space/space_spring/domain/authorization/oauth/controller/OAuthController.java @@ -1,4 +1,4 @@ -package space.space_spring.domain.authorization.OAuth.controller; +package space.space_spring.domain.authorization.oauth.controller; import com.fasterxml.jackson.core.JsonProcessingException; import jakarta.servlet.http.HttpServletResponse; @@ -8,9 +8,9 @@ import org.springframework.web.bind.annotation.*; import space.space_spring.domain.authorization.jwt.service.JwtService; import space.space_spring.domain.authorization.jwt.model.TokenPairDTO; -import space.space_spring.dto.oAuth.KakaoInfo; +import space.space_spring.domain.authorization.oauth.dto.KakaoInfo; import space.space_spring.domain.user.model.entity.User; -import space.space_spring.domain.authorization.OAuth.service.OAuthService; +import space.space_spring.domain.authorization.oauth.service.OAuthService; import java.io.IOException; diff --git a/src/main/java/space/space_spring/dto/oAuth/KakaoInfo.java b/src/main/java/space/space_spring/domain/authorization/oauth/dto/KakaoInfo.java similarity index 79% rename from src/main/java/space/space_spring/dto/oAuth/KakaoInfo.java rename to src/main/java/space/space_spring/domain/authorization/oauth/dto/KakaoInfo.java index 51b2166d..2c14effc 100644 --- a/src/main/java/space/space_spring/dto/oAuth/KakaoInfo.java +++ b/src/main/java/space/space_spring/domain/authorization/oauth/dto/KakaoInfo.java @@ -1,4 +1,4 @@ -package space.space_spring.dto.oAuth; +package space.space_spring.domain.authorization.oauth.dto; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/src/main/java/space/space_spring/domain/authorization/OAuth/service/OAuthService.java b/src/main/java/space/space_spring/domain/authorization/oauth/service/OAuthService.java similarity index 94% rename from src/main/java/space/space_spring/domain/authorization/OAuth/service/OAuthService.java rename to src/main/java/space/space_spring/domain/authorization/oauth/service/OAuthService.java index f32d1cdf..1504177a 100644 --- a/src/main/java/space/space_spring/domain/authorization/OAuth/service/OAuthService.java +++ b/src/main/java/space/space_spring/domain/authorization/oauth/service/OAuthService.java @@ -1,4 +1,4 @@ -package space.space_spring.domain.authorization.OAuth.service; +package space.space_spring.domain.authorization.oauth.service; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; @@ -14,11 +14,11 @@ import org.springframework.util.MultiValueMap; import org.springframework.web.client.RestTemplate; import space.space_spring.domain.user.repository.UserDao; -import space.space_spring.dto.oAuth.KakaoInfo; +import space.space_spring.domain.authorization.oauth.dto.KakaoInfo; import space.space_spring.domain.user.model.entity.User; -import space.space_spring.util.user.UserUtils; +import space.space_spring.global.util.user.UserUtils; -import static space.space_spring.entity.enumStatus.UserSignupType.KAKAO; +import static space.space_spring.global.common.enumStatus.UserSignupType.KAKAO; @Service @RequiredArgsConstructor diff --git a/src/main/java/space/space_spring/controller/CommentController.java b/src/main/java/space/space_spring/domain/board/controller/CommentController.java similarity index 76% rename from src/main/java/space/space_spring/controller/CommentController.java rename to src/main/java/space/space_spring/domain/board/controller/CommentController.java index 0a023d98..a50cf3ac 100644 --- a/src/main/java/space/space_spring/controller/CommentController.java +++ b/src/main/java/space/space_spring/domain/board/controller/CommentController.java @@ -1,15 +1,15 @@ -package space.space_spring.controller; +package space.space_spring.domain.board.controller; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.*; -import space.space_spring.argumentResolver.jwtLogin.JwtLoginAuth; -import space.space_spring.argumentResolver.userSpace.CheckUserSpace; -import space.space_spring.dto.comment.request.CreateCommentRequest; -import space.space_spring.dto.comment.response.ReadCommentsResponse; -import space.space_spring.response.BaseResponse; -import space.space_spring.service.CommentService; +import space.space_spring.global.argumentResolver.jwtLogin.JwtLoginAuth; +import space.space_spring.global.argumentResolver.userSpace.CheckUserSpace; +import space.space_spring.domain.board.model.request.CreateCommentRequest; +import space.space_spring.domain.board.model.response.ReadCommentsResponse; +import space.space_spring.global.common.response.BaseResponse; +import space.space_spring.domain.board.service.CommentService; import java.util.List; diff --git a/src/main/java/space/space_spring/controller/LikeController.java b/src/main/java/space/space_spring/domain/board/controller/LikeController.java similarity index 90% rename from src/main/java/space/space_spring/controller/LikeController.java rename to src/main/java/space/space_spring/domain/board/controller/LikeController.java index 1ec6e36d..78c88f93 100644 --- a/src/main/java/space/space_spring/controller/LikeController.java +++ b/src/main/java/space/space_spring/domain/board/controller/LikeController.java @@ -1,12 +1,12 @@ -package space.space_spring.controller; +package space.space_spring.domain.board.controller; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.*; -import space.space_spring.argumentResolver.jwtLogin.JwtLoginAuth; -import space.space_spring.argumentResolver.userSpace.CheckUserSpace; -import space.space_spring.response.BaseResponse; -import space.space_spring.service.LikeService; +import space.space_spring.global.argumentResolver.jwtLogin.JwtLoginAuth; +import space.space_spring.global.argumentResolver.userSpace.CheckUserSpace; +import space.space_spring.global.common.response.BaseResponse; +import space.space_spring.domain.board.service.LikeService; @RestController @RequiredArgsConstructor diff --git a/src/main/java/space/space_spring/controller/PostController.java b/src/main/java/space/space_spring/domain/board/controller/PostController.java similarity index 86% rename from src/main/java/space/space_spring/controller/PostController.java rename to src/main/java/space/space_spring/domain/board/controller/PostController.java index 56f7540b..edcbc220 100644 --- a/src/main/java/space/space_spring/controller/PostController.java +++ b/src/main/java/space/space_spring/domain/board/controller/PostController.java @@ -1,4 +1,4 @@ -package space.space_spring.controller; +package space.space_spring.domain.board.controller; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -6,22 +6,22 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import space.space_spring.argumentResolver.jwtLogin.JwtLoginAuth; +import space.space_spring.global.argumentResolver.jwtLogin.JwtLoginAuth; -import space.space_spring.argumentResolver.userSpace.CheckUserSpace; -import space.space_spring.dto.post.request.CreatePostRequest; -import space.space_spring.dto.post.response.ReadPostDetailResponse; -import space.space_spring.dto.post.response.ReadPostsResponse; +import space.space_spring.global.argumentResolver.userSpace.CheckUserSpace; +import space.space_spring.domain.board.model.request.CreatePostRequest; +import space.space_spring.domain.board.model.response.ReadPostDetailResponse; +import space.space_spring.domain.board.model.response.ReadPostsResponse; import space.space_spring.domain.userSpace.model.entity.UserSpace; -import space.space_spring.exception.CustomException; -import space.space_spring.response.BaseResponse; -import space.space_spring.service.PostService; -import space.space_spring.util.userSpace.UserSpaceUtils; +import space.space_spring.global.exception.CustomException; +import space.space_spring.global.common.response.BaseResponse; +import space.space_spring.domain.board.service.PostService; +import space.space_spring.global.util.userSpace.UserSpaceUtils; import java.util.List; import java.util.Optional; -import static space.space_spring.response.status.BaseExceptionResponseStatus.INVALID_POST_CREATE; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.INVALID_POST_CREATE; @RestController @RequiredArgsConstructor diff --git a/src/main/java/space/space_spring/entity/Comment.java b/src/main/java/space/space_spring/domain/board/model/entity/Comment.java similarity index 87% rename from src/main/java/space/space_spring/entity/Comment.java rename to src/main/java/space/space_spring/domain/board/model/entity/Comment.java index 26a9ebda..b3c53581 100644 --- a/src/main/java/space/space_spring/entity/Comment.java +++ b/src/main/java/space/space_spring/domain/board/model/entity/Comment.java @@ -1,16 +1,17 @@ -package space.space_spring.entity; +package space.space_spring.domain.board.model.entity; import jakarta.persistence.*; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; import space.space_spring.domain.user.model.entity.User; +import space.space_spring.global.common.entity.BaseEntity; @Entity @Table(name = "Post_Comment") @Getter @NoArgsConstructor -public class Comment extends BaseEntity{ +public class Comment extends BaseEntity { @Id @GeneratedValue @Column(name = "comment_id") diff --git a/src/main/java/space/space_spring/entity/CommentLike.java b/src/main/java/space/space_spring/domain/board/model/entity/CommentLike.java similarity index 82% rename from src/main/java/space/space_spring/entity/CommentLike.java rename to src/main/java/space/space_spring/domain/board/model/entity/CommentLike.java index becb8b40..1779eda5 100644 --- a/src/main/java/space/space_spring/entity/CommentLike.java +++ b/src/main/java/space/space_spring/domain/board/model/entity/CommentLike.java @@ -1,17 +1,18 @@ -package space.space_spring.entity; +package space.space_spring.domain.board.model.entity; import jakarta.persistence.*; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; import space.space_spring.domain.user.model.entity.User; +import space.space_spring.global.common.entity.BaseEntity; @Entity @Table(name = "Comment_Like", uniqueConstraints = {@UniqueConstraint(columnNames = {"user_id", "post_comment_id"})}) @Getter @NoArgsConstructor -public class CommentLike extends BaseEntity{ +public class CommentLike extends BaseEntity { @Id @GeneratedValue @Column(name = "comment_like_id") diff --git a/src/main/java/space/space_spring/entity/Post.java b/src/main/java/space/space_spring/domain/board/model/entity/Post.java similarity index 94% rename from src/main/java/space/space_spring/entity/Post.java rename to src/main/java/space/space_spring/domain/board/model/entity/Post.java index a8ff5ea6..c5276e58 100644 --- a/src/main/java/space/space_spring/entity/Post.java +++ b/src/main/java/space/space_spring/domain/board/model/entity/Post.java @@ -1,4 +1,4 @@ -package space.space_spring.entity; +package space.space_spring.domain.board.model.entity; import jakarta.persistence.*; import lombok.Builder; @@ -8,6 +8,7 @@ import space.space_spring.domain.user.model.entity.User; import java.util.List; +import space.space_spring.global.common.entity.BaseEntity; @Entity @Table(name = "Posts") diff --git a/src/main/java/space/space_spring/entity/PostImage.java b/src/main/java/space/space_spring/domain/board/model/entity/PostImage.java similarity index 78% rename from src/main/java/space/space_spring/entity/PostImage.java rename to src/main/java/space/space_spring/domain/board/model/entity/PostImage.java index b7129dec..d1066dcc 100644 --- a/src/main/java/space/space_spring/entity/PostImage.java +++ b/src/main/java/space/space_spring/domain/board/model/entity/PostImage.java @@ -1,16 +1,17 @@ -package space.space_spring.entity; +package space.space_spring.domain.board.model.entity; import jakarta.persistence.*; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; +import space.space_spring.global.common.entity.BaseEntity; @Entity @Table(name = "Post_Image") @Getter @NoArgsConstructor -public class PostImage extends BaseEntity{ +public class PostImage extends BaseEntity { @Id @GeneratedValue @Column(name = "post_image_id") diff --git a/src/main/java/space/space_spring/entity/PostLike.java b/src/main/java/space/space_spring/domain/board/model/entity/PostLike.java similarity index 80% rename from src/main/java/space/space_spring/entity/PostLike.java rename to src/main/java/space/space_spring/domain/board/model/entity/PostLike.java index 188ae585..494ee495 100644 --- a/src/main/java/space/space_spring/entity/PostLike.java +++ b/src/main/java/space/space_spring/domain/board/model/entity/PostLike.java @@ -1,16 +1,17 @@ -package space.space_spring.entity; +package space.space_spring.domain.board.model.entity; import jakarta.persistence.*; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; import space.space_spring.domain.user.model.entity.User; +import space.space_spring.global.common.entity.BaseEntity; @Entity @Table(name = "Post_Like") @Getter @NoArgsConstructor -public class PostLike extends BaseEntity{ +public class PostLike extends BaseEntity { @Id @GeneratedValue @Column(name = "post_like_id") diff --git a/src/main/java/space/space_spring/dto/comment/request/CreateCommentRequest.java b/src/main/java/space/space_spring/domain/board/model/request/CreateCommentRequest.java similarity index 83% rename from src/main/java/space/space_spring/dto/comment/request/CreateCommentRequest.java rename to src/main/java/space/space_spring/domain/board/model/request/CreateCommentRequest.java index ad02dde1..70f6741d 100644 --- a/src/main/java/space/space_spring/dto/comment/request/CreateCommentRequest.java +++ b/src/main/java/space/space_spring/domain/board/model/request/CreateCommentRequest.java @@ -1,9 +1,9 @@ -package space.space_spring.dto.comment.request; +package space.space_spring.domain.board.model.request; import jakarta.validation.constraints.NotBlank; import lombok.*; -import space.space_spring.entity.Comment; -import space.space_spring.entity.Post; +import space.space_spring.domain.board.model.entity.Comment; +import space.space_spring.domain.board.model.entity.Post; import space.space_spring.domain.user.model.entity.User; diff --git a/src/main/java/space/space_spring/dto/post/request/CreatePostRequest.java b/src/main/java/space/space_spring/domain/board/model/request/CreatePostRequest.java similarity index 83% rename from src/main/java/space/space_spring/dto/post/request/CreatePostRequest.java rename to src/main/java/space/space_spring/domain/board/model/request/CreatePostRequest.java index f6c83812..b8c77741 100644 --- a/src/main/java/space/space_spring/dto/post/request/CreatePostRequest.java +++ b/src/main/java/space/space_spring/domain/board/model/request/CreatePostRequest.java @@ -1,10 +1,10 @@ -package space.space_spring.dto.post.request; +package space.space_spring.domain.board.model.request; import jakarta.validation.constraints.NotBlank; import lombok.*; import org.springframework.web.multipart.MultipartFile; -import space.space_spring.entity.Post; -import space.space_spring.entity.PostImage; +import space.space_spring.domain.board.model.entity.Post; +import space.space_spring.domain.board.model.entity.PostImage; import space.space_spring.domain.space.model.entity.Space; import space.space_spring.domain.user.model.entity.User; diff --git a/src/main/java/space/space_spring/dto/comment/response/ReadCommentsResponse.java b/src/main/java/space/space_spring/domain/board/model/response/ReadCommentsResponse.java similarity index 86% rename from src/main/java/space/space_spring/dto/comment/response/ReadCommentsResponse.java rename to src/main/java/space/space_spring/domain/board/model/response/ReadCommentsResponse.java index 21de9916..672314e0 100644 --- a/src/main/java/space/space_spring/dto/comment/response/ReadCommentsResponse.java +++ b/src/main/java/space/space_spring/domain/board/model/response/ReadCommentsResponse.java @@ -1,9 +1,9 @@ -package space.space_spring.dto.comment.response; +package space.space_spring.domain.board.model.response; import lombok.*; -import space.space_spring.entity.Comment; +import space.space_spring.domain.board.model.entity.Comment; import space.space_spring.domain.userSpace.model.entity.UserSpace; -import space.space_spring.util.post.ConvertCreatedDate; +import space.space_spring.global.util.post.ConvertCreatedDate; @Builder @Getter diff --git a/src/main/java/space/space_spring/dto/post/response/ReadPostDetailResponse.java b/src/main/java/space/space_spring/domain/board/model/response/ReadPostDetailResponse.java similarity index 87% rename from src/main/java/space/space_spring/dto/post/response/ReadPostDetailResponse.java rename to src/main/java/space/space_spring/domain/board/model/response/ReadPostDetailResponse.java index c37462e8..014cafc4 100644 --- a/src/main/java/space/space_spring/dto/post/response/ReadPostDetailResponse.java +++ b/src/main/java/space/space_spring/domain/board/model/response/ReadPostDetailResponse.java @@ -1,11 +1,10 @@ -package space.space_spring.dto.post.response; +package space.space_spring.domain.board.model.response; import lombok.*; -import space.space_spring.dto.comment.response.ReadCommentsResponse; -import space.space_spring.entity.Post; -import space.space_spring.entity.PostImage; +import space.space_spring.domain.board.model.entity.Post; +import space.space_spring.domain.board.model.entity.PostImage; import space.space_spring.domain.userSpace.model.entity.UserSpace; -import space.space_spring.util.post.ConvertCreatedDate; +import space.space_spring.global.util.post.ConvertCreatedDate; import java.util.List; diff --git a/src/main/java/space/space_spring/dto/post/response/ReadPostsResponse.java b/src/main/java/space/space_spring/domain/board/model/response/ReadPostsResponse.java similarity index 88% rename from src/main/java/space/space_spring/dto/post/response/ReadPostsResponse.java rename to src/main/java/space/space_spring/domain/board/model/response/ReadPostsResponse.java index 0ff1bf76..c4672245 100644 --- a/src/main/java/space/space_spring/dto/post/response/ReadPostsResponse.java +++ b/src/main/java/space/space_spring/domain/board/model/response/ReadPostsResponse.java @@ -1,10 +1,10 @@ -package space.space_spring.dto.post.response; +package space.space_spring.domain.board.model.response; import lombok.*; -import space.space_spring.entity.Post; -import space.space_spring.entity.PostImage; +import space.space_spring.domain.board.model.entity.Post; +import space.space_spring.domain.board.model.entity.PostImage; import space.space_spring.domain.userSpace.model.entity.UserSpace; -import space.space_spring.util.post.ConvertCreatedDate; +import space.space_spring.global.util.post.ConvertCreatedDate; import java.util.List; diff --git a/src/main/java/space/space_spring/dao/CommentLikeDao.java b/src/main/java/space/space_spring/domain/board/repository/CommentLikeRepository.java similarity index 52% rename from src/main/java/space/space_spring/dao/CommentLikeDao.java rename to src/main/java/space/space_spring/domain/board/repository/CommentLikeRepository.java index a8bfce9d..81359520 100644 --- a/src/main/java/space/space_spring/dao/CommentLikeDao.java +++ b/src/main/java/space/space_spring/domain/board/repository/CommentLikeRepository.java @@ -1,14 +1,14 @@ -package space.space_spring.dao; +package space.space_spring.domain.board.repository; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; -import space.space_spring.entity.Comment; -import space.space_spring.entity.CommentLike; +import space.space_spring.domain.board.model.entity.Comment; +import space.space_spring.domain.board.model.entity.CommentLike; import space.space_spring.domain.user.model.entity.User; import java.util.Optional; @Repository -public interface CommentLikeDao extends JpaRepository { +public interface CommentLikeRepository extends JpaRepository { Optional findByUserAndComment(User user, Comment comment); } diff --git a/src/main/java/space/space_spring/dao/CommentDao.java b/src/main/java/space/space_spring/domain/board/repository/CommentRepository.java similarity index 76% rename from src/main/java/space/space_spring/dao/CommentDao.java rename to src/main/java/space/space_spring/domain/board/repository/CommentRepository.java index c4c95e84..2e194b00 100644 --- a/src/main/java/space/space_spring/dao/CommentDao.java +++ b/src/main/java/space/space_spring/domain/board/repository/CommentRepository.java @@ -1,16 +1,16 @@ -package space.space_spring.dao; +package space.space_spring.domain.board.repository; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; -import space.space_spring.entity.Comment; -import space.space_spring.entity.Post; +import space.space_spring.domain.board.model.entity.Comment; +import space.space_spring.domain.board.model.entity.Post; import java.util.List; @Repository -public interface CommentDao extends JpaRepository { +public interface CommentRepository extends JpaRepository { // 특정 게시글의 댓글을 가져오는 메서드 List findByPost(Post post); diff --git a/src/main/java/space/space_spring/domain/board/repository/PostLikeRepository.java b/src/main/java/space/space_spring/domain/board/repository/PostLikeRepository.java new file mode 100644 index 00000000..fffcdb92 --- /dev/null +++ b/src/main/java/space/space_spring/domain/board/repository/PostLikeRepository.java @@ -0,0 +1,12 @@ +package space.space_spring.domain.board.repository; + +import org.springframework.data.jpa.repository.JpaRepository; +import space.space_spring.domain.board.model.entity.Post; +import space.space_spring.domain.board.model.entity.PostLike; +import space.space_spring.domain.user.model.entity.User; + +import java.util.Optional; + +public interface PostLikeRepository extends JpaRepository { + Optional findByUserAndPost(User user, Post post); +} diff --git a/src/main/java/space/space_spring/dao/PostDao.java b/src/main/java/space/space_spring/domain/board/repository/PostRepository.java similarity index 87% rename from src/main/java/space/space_spring/dao/PostDao.java rename to src/main/java/space/space_spring/domain/board/repository/PostRepository.java index 474a0301..ef9b2bfd 100644 --- a/src/main/java/space/space_spring/dao/PostDao.java +++ b/src/main/java/space/space_spring/domain/board/repository/PostRepository.java @@ -1,17 +1,17 @@ -package space.space_spring.dao; +package space.space_spring.domain.board.repository; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; -import space.space_spring.entity.Post; +import space.space_spring.domain.board.model.entity.Post; import space.space_spring.domain.space.model.entity.Space; import java.util.List; @Repository -public interface PostDao extends JpaRepository { +public interface PostRepository extends JpaRepository { @Query("SELECT p FROM Post p WHERE p.space = :space AND p.status = 'ACTIVE' ORDER BY p.createdAt DESC") List findBySpace(Space space); diff --git a/src/main/java/space/space_spring/service/CommentService.java b/src/main/java/space/space_spring/domain/board/service/CommentService.java similarity index 64% rename from src/main/java/space/space_spring/service/CommentService.java rename to src/main/java/space/space_spring/domain/board/service/CommentService.java index eba3b079..9a57cf21 100644 --- a/src/main/java/space/space_spring/service/CommentService.java +++ b/src/main/java/space/space_spring/domain/board/service/CommentService.java @@ -1,34 +1,33 @@ -package space.space_spring.service; +package space.space_spring.domain.board.service; import jakarta.transaction.Transactional; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; -import space.space_spring.dao.CommentDao; -import space.space_spring.dao.PostDao; +import space.space_spring.domain.board.repository.CommentRepository; +import space.space_spring.domain.board.repository.PostRepository; import space.space_spring.domain.userSpace.repository.UserSpaceDao; -import space.space_spring.dto.comment.request.CreateCommentRequest; -import space.space_spring.dto.comment.response.ReadCommentsResponse; -import space.space_spring.entity.Post; -import space.space_spring.entity.Comment; +import space.space_spring.domain.board.model.request.CreateCommentRequest; +import space.space_spring.domain.board.model.response.ReadCommentsResponse; +import space.space_spring.domain.board.model.entity.Post; +import space.space_spring.domain.board.model.entity.Comment; import space.space_spring.domain.user.model.entity.User; import space.space_spring.domain.userSpace.model.entity.UserSpace; -import space.space_spring.exception.CustomException; -import space.space_spring.util.user.UserUtils; -import space.space_spring.util.userSpace.UserSpaceUtils; +import space.space_spring.global.exception.CustomException; +import space.space_spring.global.util.user.UserUtils; +import space.space_spring.global.util.userSpace.UserSpaceUtils; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.*; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; -import static space.space_spring.response.status.BaseExceptionResponseStatus.*; - @Service @Slf4j @RequiredArgsConstructor public class CommentService { - private final PostDao postDao; - private final CommentDao commentDao; + private final PostRepository postRepository; + private final CommentRepository commentRepository; private final UserSpaceDao userSpaceDao; private final UserUtils userUtils; private final UserSpaceUtils userSpaceUtils; @@ -36,7 +35,7 @@ public class CommentService { // TODO 1: 댓글 유효성 검사 public void validateCommentRequest(CreateCommentRequest.Request request, Long postId) { if (request.getTargetId() != null) { - Comment targetComment = commentDao.findById(request.getTargetId()) + Comment targetComment = commentRepository.findById(request.getTargetId()) .orElseThrow(() -> new CustomException(COMMENT_NOT_EXIST)); if(!targetComment.getPost().getPostId().equals(postId)) { @@ -48,17 +47,17 @@ public void validateCommentRequest(CreateCommentRequest.Request request, Long po @Transactional public List getCommentsByPost(Long postId, Long userId) { // TODO 1: postId에 해당하는 post find - Post post = postDao.findById(postId) + Post post = postRepository.findById(postId) .orElseThrow(() -> new CustomException(POST_NOT_EXIST)); // TODO 2: 해당 게시글의 모든 댓글 조회 - List comments = commentDao.findByPost(post); + List comments = commentRepository.findByPost(post); // TODO 3: CommentResponse 리스트로 변환 return comments.stream() .map(comment -> { - int commentCount = commentDao.countByTargetId(comment.getCommentId()); - boolean isLike = commentDao.isUserLikedComment(comment.getCommentId(), userId); + int commentCount = commentRepository.countByTargetId(comment.getCommentId()); + boolean isLike = commentRepository.isUserLikedComment(comment.getCommentId(), userId); Optional userSpace = userSpaceDao.findUserSpaceByUserAndSpace(comment.getUser(), post.getSpace()); return ReadCommentsResponse.of(comment, userSpace.orElse(null), isLike, commentCount); @@ -75,12 +74,12 @@ public Long createComment(Long userId, Long postId, CreateCommentRequest.Request User user = userUtils.findUserByUserId(userId); // TODO 2: postId에 해당하는 post find - Post post = postDao.findById(postId) + Post post = postRepository.findById(postId) .orElseThrow(() -> new CustomException(POST_NOT_EXIST)); // TODO 3: 댓글 또는 대댓글 생성 Comment comment = createCommentRequest.toEntity(user, post); - commentDao.save(comment); + commentRepository.save(comment); return comment.getCommentId(); } diff --git a/src/main/java/space/space_spring/service/LikeService.java b/src/main/java/space/space_spring/domain/board/service/LikeService.java similarity index 62% rename from src/main/java/space/space_spring/service/LikeService.java rename to src/main/java/space/space_spring/domain/board/service/LikeService.java index e173e7e4..f51f21aa 100644 --- a/src/main/java/space/space_spring/service/LikeService.java +++ b/src/main/java/space/space_spring/domain/board/service/LikeService.java @@ -1,40 +1,42 @@ -package space.space_spring.service; +package space.space_spring.domain.board.service; import jakarta.transaction.Transactional; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; -import space.space_spring.dao.CommentDao; -import space.space_spring.dao.CommentLikeDao; -import space.space_spring.dao.PostLikeDao; -import space.space_spring.dao.PostDao; +import space.space_spring.domain.board.model.entity.Comment; +import space.space_spring.domain.board.model.entity.CommentLike; +import space.space_spring.domain.board.model.entity.Post; +import space.space_spring.domain.board.model.entity.PostLike; +import space.space_spring.domain.board.repository.CommentRepository; +import space.space_spring.domain.board.repository.CommentLikeRepository; +import space.space_spring.domain.board.repository.PostLikeRepository; +import space.space_spring.domain.board.repository.PostRepository; import space.space_spring.domain.user.model.entity.User; -import space.space_spring.entity.*; -import space.space_spring.exception.CustomException; -import space.space_spring.util.user.UserUtils; -import space.space_spring.util.userSpace.UserSpaceUtils; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.*; import java.util.Optional; - -import static space.space_spring.response.status.BaseExceptionResponseStatus.*; +import space.space_spring.global.exception.CustomException; +import space.space_spring.global.util.user.UserUtils; +import space.space_spring.global.util.userSpace.UserSpaceUtils; @Service @Slf4j @RequiredArgsConstructor public class LikeService { - private final PostLikeDao postLikeDao; - private final CommentLikeDao commentLikeDao; - private final PostDao postDao; - private final CommentDao commentDao; + private final PostLikeRepository postLikeRepository; + private final CommentLikeRepository commentLikeRepository; + private final PostRepository postRepository; + private final CommentRepository commentRepository; private final UserUtils userUtils; private final UserSpaceUtils userSpaceUtils; // TODO 1: 댓글이 해당 게시글에 속하는지 검증 public void validateCommentInPost(Long postId, Long commentId) { - Post post = postDao.findById(postId) + Post post = postRepository.findById(postId) .orElseThrow(() -> new CustomException(POST_NOT_EXIST)); - Comment comment = commentDao.findById(commentId) + Comment comment = commentRepository.findById(commentId) .orElseThrow(() -> new CustomException(COMMENT_NOT_EXIST)); if(!comment.getPost().getPostId().equals(postId)) { @@ -45,10 +47,10 @@ public void validateCommentInPost(Long postId, Long commentId) { // TODO 2: 유저가 해당 게시글에 좋아요를 눌렀는지 검증 (좋아요 중복 방지) public void validateAlreadyLikedPost(Long userId, Long postId) { User user = userUtils.findUserByUserId(userId); - Post post = postDao.findById(postId) + Post post = postRepository.findById(postId) .orElseThrow(() -> new CustomException(POST_NOT_EXIST)); - Optional existingLike = postLikeDao.findByUserAndPost(user, post); + Optional existingLike = postLikeRepository.findByUserAndPost(user, post); if(existingLike.isPresent()) { throw new CustomException(ALREADY_LIKED_THE_POST); @@ -58,10 +60,10 @@ public void validateAlreadyLikedPost(Long userId, Long postId) { // TODO 3: 유저가 해당 게시글에 좋아요를 눌렀는지 검증 (취소 중복 방지) public void validateNotLikedPost(Long userId, Long postId) { User user = userUtils.findUserByUserId(userId); - Post post = postDao.findById(postId) + Post post = postRepository.findById(postId) .orElseThrow(() -> new CustomException(POST_NOT_EXIST)); - Optional existingLike = postLikeDao.findByUserAndPost(user, post); + Optional existingLike = postLikeRepository.findByUserAndPost(user, post); if(existingLike.isEmpty()) { throw new CustomException(NOT_LIKED_THE_POST_YET); @@ -71,10 +73,10 @@ public void validateNotLikedPost(Long userId, Long postId) { // TODO 4: 유저가 해당 댓글에 좋아요를 눌렀는지 검증 (좋아요 중복 방지) public void validateAlreadyLikedComment(Long userId, Long commentId) { User user = userUtils.findUserByUserId(userId); - Comment comment = commentDao.findById(commentId) + Comment comment = commentRepository.findById(commentId) .orElseThrow(() -> new CustomException(COMMENT_NOT_EXIST)); - Optional existingLike = commentLikeDao.findByUserAndComment(user, comment); + Optional existingLike = commentLikeRepository.findByUserAndComment(user, comment); if(existingLike.isPresent()) { throw new CustomException(ALREADY_LIKED_THE_COMMENT); @@ -84,10 +86,10 @@ public void validateAlreadyLikedComment(Long userId, Long commentId) { // TODO 5: 유저가 해당 댓글에 좋아요를 눌렀는지 검증 (취소 중복 방지) public void validateNotLikedComment(Long userId, Long commentId) { User user = userUtils.findUserByUserId(userId); - Comment comment = commentDao.findById(commentId) + Comment comment = commentRepository.findById(commentId) .orElseThrow(() -> new CustomException(COMMENT_NOT_EXIST)); - Optional existingLike = commentLikeDao.findByUserAndComment(user, comment); + Optional existingLike = commentLikeRepository.findByUserAndComment(user, comment); if(existingLike.isEmpty()) { throw new CustomException(NOT_LIKED_THE_COMMENT_YET); @@ -98,12 +100,12 @@ public void validateNotLikedComment(Long userId, Long commentId) { public void likePost(Long userId, Long postId) { // 유저와 게시글 조회 User user = userUtils.findUserByUserId(userId); - Post post = postDao.findById(postId) + Post post = postRepository.findById(postId) .orElseThrow(() -> new CustomException(POST_NOT_EXIST)); // 새 좋아요 생성 및 저장 PostLike postLike = new PostLike(user, post); - postLikeDao.save(postLike); + postLikeRepository.save(postLike); // 게시글의 좋아요 수 증가 post.increaseLikeCount(); @@ -113,12 +115,12 @@ public void likePost(Long userId, Long postId) { public void unlikePost(Long userId, Long postId) { // 유저와 게시글 조회 User user = userUtils.findUserByUserId(userId); - Post post = postDao.findById(postId) + Post post = postRepository.findById(postId) .orElseThrow(() -> new CustomException(POST_NOT_EXIST)); // 좋아요 취소 및 삭제 - Optional existingLike = postLikeDao.findByUserAndPost(user, post); - postLikeDao.delete(existingLike.get()); + Optional existingLike = postLikeRepository.findByUserAndPost(user, post); + postLikeRepository.delete(existingLike.get()); // 게시글의 좋아요 수 감소 post.decreaseLikeCount(); @@ -128,12 +130,12 @@ public void unlikePost(Long userId, Long postId) { public void likeComment(Long userId, Long commentId) { // 유저와 댓글 조회 User user = userUtils.findUserByUserId(userId); - Comment comment = commentDao.findById(commentId) + Comment comment = commentRepository.findById(commentId) .orElseThrow(() -> new CustomException(COMMENT_NOT_EXIST)); // 좋아요 생성 및 저장 CommentLike commentLike = new CommentLike(user, comment); - commentLikeDao.save(commentLike); + commentLikeRepository.save(commentLike); // 게시글의 좋아요 수 증가 comment.increaseLikeCount(); @@ -143,12 +145,12 @@ public void likeComment(Long userId, Long commentId) { public void unlikeComment(Long userId, Long commentId) { // 유저와 게시글 조회 User user = userUtils.findUserByUserId(userId); - Comment comment = commentDao.findById(commentId) + Comment comment = commentRepository.findById(commentId) .orElseThrow(() -> new CustomException(COMMENT_NOT_EXIST)); // 좋아요 취소 및 삭제 - Optional existingLike = commentLikeDao.findByUserAndComment(user, comment); - commentLikeDao.delete(existingLike.get()); + Optional existingLike = commentLikeRepository.findByUserAndComment(user, comment); + commentLikeRepository.delete(existingLike.get()); // 게시글의 좋아요 수 감소 comment.decreaseLikeCount(); diff --git a/src/main/java/space/space_spring/service/PostService.java b/src/main/java/space/space_spring/domain/board/service/PostService.java similarity index 74% rename from src/main/java/space/space_spring/service/PostService.java rename to src/main/java/space/space_spring/domain/board/service/PostService.java index 3f062c21..8ef6a10f 100644 --- a/src/main/java/space/space_spring/service/PostService.java +++ b/src/main/java/space/space_spring/domain/board/service/PostService.java @@ -1,26 +1,28 @@ -package space.space_spring.service; +package space.space_spring.domain.board.service; import jakarta.transaction.Transactional; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; -import space.space_spring.dao.CommentDao; -import space.space_spring.dao.PostDao; +import space.space_spring.domain.board.model.entity.Post; +import space.space_spring.domain.board.model.entity.PostImage; +import space.space_spring.domain.board.repository.CommentRepository; +import space.space_spring.domain.board.repository.PostRepository; import space.space_spring.domain.userSpace.model.entity.UserSpace; import space.space_spring.domain.userSpace.repository.UserSpaceDao; import space.space_spring.domain.space.model.entity.Space; import space.space_spring.domain.user.model.entity.User; -import space.space_spring.dto.comment.response.ReadCommentsResponse; -import space.space_spring.dto.post.request.CreatePostRequest; -import space.space_spring.dto.post.response.ReadPostDetailResponse; -import space.space_spring.dto.post.response.ReadPostsResponse; +import space.space_spring.domain.board.model.response.ReadCommentsResponse; +import space.space_spring.domain.board.model.request.CreatePostRequest; +import space.space_spring.domain.board.model.response.ReadPostDetailResponse; +import space.space_spring.domain.board.model.response.ReadPostsResponse; import space.space_spring.domain.space.model.dto.GetSpaceHomeDto; -import space.space_spring.entity.*; -import space.space_spring.exception.CustomException; -import space.space_spring.util.space.SpaceUtils; -import space.space_spring.util.user.UserUtils; -import space.space_spring.util.userSpace.UserSpaceUtils; +import space.space_spring.global.exception.CustomException; +import space.space_spring.global.util.S3Uploader; +import space.space_spring.global.util.space.SpaceUtils; +import space.space_spring.global.util.user.UserUtils; +import space.space_spring.global.util.userSpace.UserSpaceUtils; import java.io.IOException; import java.util.ArrayList; @@ -29,8 +31,8 @@ import java.util.Optional; import java.util.stream.Collectors; -import static space.space_spring.response.status.BaseExceptionResponseStatus.POST_IS_NOT_IN_SPACE; -import static space.space_spring.response.status.BaseExceptionResponseStatus.POST_NOT_EXIST; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.POST_IS_NOT_IN_SPACE; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.POST_NOT_EXIST; @Service @Slf4j @@ -40,9 +42,9 @@ public class PostService { private final UserUtils userUtils; private final SpaceUtils spaceUtils; private final UserSpaceUtils userSpaceUtils; - private final PostDao postDao; + private final PostRepository postRepository; private final UserSpaceDao userSpaceDao; - private final CommentDao commentDao; + private final CommentRepository commentRepository; private final S3Uploader s3Uploader; @Transactional @@ -54,12 +56,12 @@ public List getAllPosts(Long spaceId, String filter, Long use // TODO 2: 필터에 따라 해당 user의 해당 space 내의 게시판 게시글 리스트 return List posts; if("notice".equalsIgnoreCase(filter)) { - posts = postDao.findBySpaceAndType(spaceBySpaceId, "notice"); + posts = postRepository.findBySpaceAndType(spaceBySpaceId, "notice"); } else if ("general".equalsIgnoreCase(filter)){ - posts = postDao.findBySpaceAndType(spaceBySpaceId, "general"); + posts = postRepository.findBySpaceAndType(spaceBySpaceId, "general"); } else { // filter = "all" 일 경우 전체 게시글 조회 - posts = postDao.findBySpace(spaceBySpaceId); + posts = postRepository.findBySpace(spaceBySpaceId); } int postCount = posts.size(); @@ -67,7 +69,7 @@ public List getAllPosts(Long spaceId, String filter, Long use return posts.stream() .map(post ->{ Optional userSpace = userSpaceDao.findUserSpaceByUserAndSpace(post.getUser(), post.getSpace()); - boolean isLike = postDao.isUserLikedPost(post.getPostId(), userId); + boolean isLike = postRepository.isUserLikedPost(post.getPostId(), userId); return ReadPostsResponse.of(post, postCount, userSpace.orElse(null), isLike); }) .collect(Collectors.toList()); @@ -103,7 +105,7 @@ public Long save(Long userId, Long spaceId, CreatePostRequest createPostRequest) // TODO 5: 각 PostImage에 해당 Post를 설정 postImages.forEach(postImage -> postImage.setPost(post)); - return postDao.save(post).getPostId(); + return postRepository.save(post).getPostId(); } @Transactional @@ -112,7 +114,7 @@ public ReadPostDetailResponse getPostDetail(Long userId, Long spaceId, Long post Space space = spaceUtils.findSpaceBySpaceId(spaceId); // TODO 2: postId에 해당하는 post find - Post post = postDao.findById(postId).orElseThrow(() -> new CustomException(POST_NOT_EXIST)); + Post post = postRepository.findById(postId).orElseThrow(() -> new CustomException(POST_NOT_EXIST)); // TODO 3: 게시글이 해당 스페이스에 속하는지 검증 if (!post.getSpace().getSpaceId().equals(spaceId)) { @@ -123,13 +125,13 @@ public ReadPostDetailResponse getPostDetail(Long userId, Long spaceId, Long post Optional userSpace = userSpaceUtils.isUserInSpace(post.getUser().getUserId(), spaceId); // TODO 5: 유저가 해당 게시글에 좋아요를 눌렀는지 여부 확인 - boolean isLike = postDao.isUserLikedPost(post.getPostId(), userId); + boolean isLike = postRepository.isUserLikedPost(post.getPostId(), userId); // TODO 6: 댓글 리스트를 ReadCommentsResponse로 변환 List comments = post.getComments().stream() .map(comment -> { - int commentCount = commentDao.countByTargetId(comment.getCommentId()); - boolean isCommentLiked = commentDao.isUserLikedComment(comment.getCommentId(), userId); + int commentCount = commentRepository.countByTargetId(comment.getCommentId()); + boolean isCommentLiked = commentRepository.isUserLikedComment(comment.getCommentId(), userId); Optional userSpaceOpt = userSpaceDao.findUserSpaceByUserAndSpace(comment.getUser(), post.getSpace()); return ReadCommentsResponse.of(comment, userSpaceOpt.orElse(null), isCommentLiked, commentCount); @@ -147,7 +149,7 @@ public List getNoticeInfoForHome(Long spaceId) // TODO 2. Space에 해당하는 notice 게시글 get // 공지사항 중 3개만 return - List noticeList = postDao.findBySpaceAndTypeSortedByNewest(spaceBySpaceId, "notice", Pageable.ofSize(3)); + List noticeList = postRepository.findBySpaceAndTypeSortedByNewest(spaceBySpaceId, "notice", Pageable.ofSize(3)); // TODO 3. return List spaceHomeNoticeList = new ArrayList<>(); @@ -162,7 +164,7 @@ public List getNoticeInfoForHome(Long spaceId) @Transactional public void updatePost(Long userId, Long spaceId, Long postId, CreatePostRequest updatePostReqeust) { // TODO 1: postId에 해당하는 post find - Post post = postDao.findById(postId).orElseThrow(() -> new CustomException(POST_NOT_EXIST)); + Post post = postRepository.findById(postId).orElseThrow(() -> new CustomException(POST_NOT_EXIST)); // TODO 2: 게시글이 해당 스페이스에 속하는 지 검증 if(!post.getSpace().getSpaceId().equals(spaceId)) { @@ -185,13 +187,13 @@ public void updatePost(Long userId, Long spaceId, Long postId, CreatePostRequest post.updatePost(updatePostReqeust.getTitle(), updatePostReqeust.getContent(), updateImages); updateImages.forEach(image -> image.setPost(post)); - postDao.save(post); + postRepository.save(post); } @Transactional public void deletePost(Long userId, Long spaceId, Long postId) { // TODO 1: postId에 해당하는 post find - Post post = postDao.findById(postId).orElseThrow(() -> new CustomException(POST_NOT_EXIST)); + Post post = postRepository.findById(postId).orElseThrow(() -> new CustomException(POST_NOT_EXIST)); // TODO 2: 게시글이 해당 스페이스에 속하는 지 검증 if(!post.getSpace().getSpaceId().equals(spaceId)) { @@ -200,7 +202,7 @@ public void deletePost(Long userId, Long spaceId, Long postId) { // TODO 3: 게시글 삭제 post.updateInactive(); - postDao.save(post); + postRepository.save(post); } diff --git a/src/main/java/space/space_spring/domain/chat/chatroom/controller/ChatRoomController.java b/src/main/java/space/space_spring/domain/chat/chatroom/controller/ChatRoomController.java index 546da4e3..5c20b6e4 100644 --- a/src/main/java/space/space_spring/domain/chat/chatroom/controller/ChatRoomController.java +++ b/src/main/java/space/space_spring/domain/chat/chatroom/controller/ChatRoomController.java @@ -4,24 +4,24 @@ import org.springframework.validation.BindingResult; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import space.space_spring.argumentResolver.jwtLogin.JwtLoginAuth; -import space.space_spring.argumentResolver.userSpace.UserSpaceAuth; +import space.space_spring.global.argumentResolver.jwtLogin.JwtLoginAuth; +import space.space_spring.global.argumentResolver.userSpace.UserSpaceAuth; import space.space_spring.domain.chat.chatroom.model.request.CreateChatRoomRequest; import space.space_spring.domain.chat.chatroom.model.request.JoinChatRoomRequest; import space.space_spring.domain.chat.chatroom.model.response.ChatSuccessResponse; import space.space_spring.domain.chat.chatroom.model.response.CreateChatRoomResponse; import space.space_spring.domain.chat.chatroom.model.response.ReadChatRoomMemberResponse; import space.space_spring.domain.chat.chatroom.model.response.ReadChatRoomResponse; -import space.space_spring.exception.CustomException; -import space.space_spring.response.BaseResponse; +import space.space_spring.global.exception.CustomException; +import space.space_spring.global.common.response.BaseResponse; import space.space_spring.domain.chat.chatroom.service.component.ChatRoomService; -import space.space_spring.service.S3Uploader; +import space.space_spring.global.util.S3Uploader; import java.io.IOException; -import static space.space_spring.entity.enumStatus.UserSpaceAuth.MANAGER; -import static space.space_spring.response.status.BaseExceptionResponseStatus.*; -import static space.space_spring.util.bindingResult.BindingResultUtils.getErrorMessage; +import static space.space_spring.global.common.enumStatus.UserSpaceAuth.MANAGER; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.*; +import static space.space_spring.global.util.bindingResult.BindingResultUtils.getErrorMessage; @RestController @RequiredArgsConstructor diff --git a/src/main/java/space/space_spring/domain/chat/chatroom/model/ChatRoom.java b/src/main/java/space/space_spring/domain/chat/chatroom/model/ChatRoom.java index 5c3afabd..bcb13577 100644 --- a/src/main/java/space/space_spring/domain/chat/chatroom/model/ChatRoom.java +++ b/src/main/java/space/space_spring/domain/chat/chatroom/model/ChatRoom.java @@ -1,6 +1,5 @@ package space.space_spring.domain.chat.chatroom.model; -import jakarta.annotation.Nullable; import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import lombok.AccessLevel; @@ -9,7 +8,7 @@ import lombok.NoArgsConstructor; import org.hibernate.annotations.Comment; -import space.space_spring.entity.BaseEntity; +import space.space_spring.global.common.entity.BaseEntity; import space.space_spring.domain.space.model.entity.Space; @Entity diff --git a/src/main/java/space/space_spring/domain/chat/chatroom/model/UserChatRoom.java b/src/main/java/space/space_spring/domain/chat/chatroom/model/UserChatRoom.java index 113c04c1..4507072c 100644 --- a/src/main/java/space/space_spring/domain/chat/chatroom/model/UserChatRoom.java +++ b/src/main/java/space/space_spring/domain/chat/chatroom/model/UserChatRoom.java @@ -1,6 +1,5 @@ package space.space_spring.domain.chat.chatroom.model; -import jakarta.annotation.Nullable; import jakarta.persistence.*; import jakarta.validation.constraints.NotNull; import lombok.AccessLevel; @@ -11,7 +10,7 @@ import space.space_spring.domain.user.model.entity.User; import java.time.LocalDateTime; -import space.space_spring.entity.BaseEntity; +import space.space_spring.global.common.entity.BaseEntity; @Entity @Getter diff --git a/src/main/java/space/space_spring/domain/chat/chatroom/repository/ChatRoomRepository.java b/src/main/java/space/space_spring/domain/chat/chatroom/repository/ChatRoomRepository.java index 7d273a0d..430bc332 100644 --- a/src/main/java/space/space_spring/domain/chat/chatroom/repository/ChatRoomRepository.java +++ b/src/main/java/space/space_spring/domain/chat/chatroom/repository/ChatRoomRepository.java @@ -4,7 +4,7 @@ import org.springframework.stereotype.Repository; import space.space_spring.domain.chat.chatroom.repository.custom.ChatRoomRepositoryCustom; import space.space_spring.domain.chat.chatroom.model.ChatRoom; -import space.space_spring.entity.enumStatus.BaseStatusType; +import space.space_spring.global.common.enumStatus.BaseStatusType; @Repository public interface ChatRoomRepository extends JpaRepository, ChatRoomRepositoryCustom { diff --git a/src/main/java/space/space_spring/domain/chat/chatroom/repository/UserChatRoomRepository.java b/src/main/java/space/space_spring/domain/chat/chatroom/repository/UserChatRoomRepository.java index 0380a007..1f232e02 100644 --- a/src/main/java/space/space_spring/domain/chat/chatroom/repository/UserChatRoomRepository.java +++ b/src/main/java/space/space_spring/domain/chat/chatroom/repository/UserChatRoomRepository.java @@ -4,7 +4,7 @@ import space.space_spring.domain.chat.chatroom.model.ChatRoom; import space.space_spring.domain.chat.chatroom.model.UserChatRoom; import space.space_spring.domain.user.model.entity.User; -import space.space_spring.entity.enumStatus.BaseStatusType; +import space.space_spring.global.common.enumStatus.BaseStatusType; import java.util.List; diff --git a/src/main/java/space/space_spring/domain/chat/chatroom/repository/custom/ChatRoomRepositoryImpl.java b/src/main/java/space/space_spring/domain/chat/chatroom/repository/custom/ChatRoomRepositoryImpl.java index f5aba3df..5332c3a2 100644 --- a/src/main/java/space/space_spring/domain/chat/chatroom/repository/custom/ChatRoomRepositoryImpl.java +++ b/src/main/java/space/space_spring/domain/chat/chatroom/repository/custom/ChatRoomRepositoryImpl.java @@ -8,7 +8,7 @@ import space.space_spring.domain.chat.chatroom.model.ChatRoom; import java.util.List; -import space.space_spring.entity.enumStatus.BaseStatusType; +import space.space_spring.global.common.enumStatus.BaseStatusType; @RequiredArgsConstructor diff --git a/src/main/java/space/space_spring/domain/chat/chatroom/service/component/ChatRoomService.java b/src/main/java/space/space_spring/domain/chat/chatroom/service/component/ChatRoomService.java index 84855e24..a68889fa 100644 --- a/src/main/java/space/space_spring/domain/chat/chatroom/service/component/ChatRoomService.java +++ b/src/main/java/space/space_spring/domain/chat/chatroom/service/component/ChatRoomService.java @@ -1,5 +1,7 @@ package space.space_spring.domain.chat.chatroom.service.component; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.*; + import jakarta.transaction.Transactional; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -25,17 +27,15 @@ import space.space_spring.domain.userSpace.model.entity.UserSpace; import space.space_spring.domain.chat.chatting.model.document.ChatMessage; -import space.space_spring.entity.enumStatus.BaseStatusType; -import space.space_spring.exception.CustomException; +import space.space_spring.global.common.enumStatus.BaseStatusType; +import space.space_spring.global.exception.CustomException; import space.space_spring.global.util.TimeUtils; -import space.space_spring.util.space.SpaceUtils; -import space.space_spring.util.user.UserUtils; +import space.space_spring.global.util.space.SpaceUtils; +import space.space_spring.global.util.user.UserUtils; import java.time.LocalDateTime; import java.util.*; -import space.space_spring.util.userSpace.UserSpaceUtils; - -import static space.space_spring.response.status.BaseExceptionResponseStatus.*; +import space.space_spring.global.util.userSpace.UserSpaceUtils; @Service @Slf4j diff --git a/src/main/java/space/space_spring/domain/chat/chatroom/service/module/ChatRoomModuleService.java b/src/main/java/space/space_spring/domain/chat/chatroom/service/module/ChatRoomModuleService.java index a10a8490..87e6f81f 100644 --- a/src/main/java/space/space_spring/domain/chat/chatroom/service/module/ChatRoomModuleService.java +++ b/src/main/java/space/space_spring/domain/chat/chatroom/service/module/ChatRoomModuleService.java @@ -1,6 +1,6 @@ package space.space_spring.domain.chat.chatroom.service.module; -import static space.space_spring.response.status.BaseExceptionResponseStatus.CHATROOM_NOT_EXIST; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.CHATROOM_NOT_EXIST; import jakarta.transaction.Transactional; import java.util.List; @@ -9,8 +9,8 @@ import org.springframework.stereotype.Component; import space.space_spring.domain.chat.chatroom.model.ChatRoom; import space.space_spring.domain.chat.chatroom.repository.ChatRoomRepository; -import space.space_spring.entity.enumStatus.BaseStatusType; -import space.space_spring.exception.CustomException; +import space.space_spring.global.common.enumStatus.BaseStatusType; +import space.space_spring.global.exception.CustomException; @Component @RequiredArgsConstructor diff --git a/src/main/java/space/space_spring/domain/chat/chatroom/service/module/UserChatRoomModuleService.java b/src/main/java/space/space_spring/domain/chat/chatroom/service/module/UserChatRoomModuleService.java index b9239704..62259857 100644 --- a/src/main/java/space/space_spring/domain/chat/chatroom/service/module/UserChatRoomModuleService.java +++ b/src/main/java/space/space_spring/domain/chat/chatroom/service/module/UserChatRoomModuleService.java @@ -1,6 +1,6 @@ package space.space_spring.domain.chat.chatroom.service.module; -import static space.space_spring.response.status.BaseExceptionResponseStatus.USER_IS_NOT_IN_CHATROOM; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.USER_IS_NOT_IN_CHATROOM; import jakarta.transaction.Transactional; import java.util.List; @@ -11,8 +11,8 @@ import space.space_spring.domain.chat.chatroom.model.UserChatRoom; import space.space_spring.domain.chat.chatroom.repository.UserChatRoomRepository; import space.space_spring.domain.user.model.entity.User; -import space.space_spring.entity.enumStatus.BaseStatusType; -import space.space_spring.exception.CustomException; +import space.space_spring.global.common.enumStatus.BaseStatusType; +import space.space_spring.global.exception.CustomException; @Component @RequiredArgsConstructor diff --git a/src/main/java/space/space_spring/domain/chat/chatting/controller/ChattingController.java b/src/main/java/space/space_spring/domain/chat/chatting/controller/ChattingController.java index c09083c3..e6e7afdf 100644 --- a/src/main/java/space/space_spring/domain/chat/chatting/controller/ChattingController.java +++ b/src/main/java/space/space_spring/domain/chat/chatting/controller/ChattingController.java @@ -5,7 +5,7 @@ import org.springframework.messaging.handler.annotation.*; import org.springframework.messaging.simp.annotation.SubscribeMapping; import org.springframework.web.bind.annotation.RestController; -import space.space_spring.argumentResolver.userSpace.CheckUserSpace; +import space.space_spring.global.argumentResolver.userSpace.CheckUserSpace; import space.space_spring.domain.chat.chatting.model.request.ChatMessageRequest; import space.space_spring.domain.chat.chatting.model.response.ChatMessageLogResponse; import space.space_spring.domain.chat.chatting.model.response.ChatMessageResponse; diff --git a/src/main/java/space/space_spring/domain/chat/chatting/model/document/ChatMessage.java b/src/main/java/space/space_spring/domain/chat/chatting/model/document/ChatMessage.java index c9797d84..c154b095 100644 --- a/src/main/java/space/space_spring/domain/chat/chatting/model/document/ChatMessage.java +++ b/src/main/java/space/space_spring/domain/chat/chatting/model/document/ChatMessage.java @@ -5,8 +5,8 @@ import org.springframework.data.annotation.Id; import org.springframework.data.annotation.TypeAlias; import org.springframework.data.mongodb.core.mapping.Document; -import space.space_spring.entity.enumStatus.BaseStatusType; -import space.space_spring.entity.enumStatus.ChatMessageType; +import space.space_spring.global.common.enumStatus.BaseStatusType; +import space.space_spring.global.common.enumStatus.ChatMessageType; import java.time.LocalDateTime; import java.time.ZoneId; diff --git a/src/main/java/space/space_spring/domain/chat/chatting/model/request/ChatMessageRequest.java b/src/main/java/space/space_spring/domain/chat/chatting/model/request/ChatMessageRequest.java index 9a9b3f52..effa1b85 100644 --- a/src/main/java/space/space_spring/domain/chat/chatting/model/request/ChatMessageRequest.java +++ b/src/main/java/space/space_spring/domain/chat/chatting/model/request/ChatMessageRequest.java @@ -4,7 +4,7 @@ import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Size; import lombok.Getter; -import space.space_spring.entity.enumStatus.ChatMessageType; +import space.space_spring.global.common.enumStatus.ChatMessageType; import java.util.HashMap; diff --git a/src/main/java/space/space_spring/domain/chat/chatting/model/response/ChatMessageResponse.java b/src/main/java/space/space_spring/domain/chat/chatting/model/response/ChatMessageResponse.java index 95650d7b..9e0c4774 100644 --- a/src/main/java/space/space_spring/domain/chat/chatting/model/response/ChatMessageResponse.java +++ b/src/main/java/space/space_spring/domain/chat/chatting/model/response/ChatMessageResponse.java @@ -4,7 +4,7 @@ import lombok.Builder; import lombok.Getter; import space.space_spring.domain.chat.chatting.model.document.ChatMessage; -import space.space_spring.entity.enumStatus.ChatMessageType; +import space.space_spring.global.common.enumStatus.ChatMessageType; import java.util.HashMap; diff --git a/src/main/java/space/space_spring/domain/chat/chatting/repository/ChattingRepository.java b/src/main/java/space/space_spring/domain/chat/chatting/repository/ChattingRepository.java index 6da67b92..b3bec597 100644 --- a/src/main/java/space/space_spring/domain/chat/chatting/repository/ChattingRepository.java +++ b/src/main/java/space/space_spring/domain/chat/chatting/repository/ChattingRepository.java @@ -6,7 +6,7 @@ import java.time.LocalDateTime; import java.util.List; -import space.space_spring.entity.enumStatus.BaseStatusType; +import space.space_spring.global.common.enumStatus.BaseStatusType; @Repository public interface ChattingRepository extends MongoRepository { diff --git a/src/main/java/space/space_spring/domain/chat/chatting/service/component/ChattingService.java b/src/main/java/space/space_spring/domain/chat/chatting/service/component/ChattingService.java index d2e8915e..595a163c 100644 --- a/src/main/java/space/space_spring/domain/chat/chatting/service/component/ChattingService.java +++ b/src/main/java/space/space_spring/domain/chat/chatting/service/component/ChattingService.java @@ -12,13 +12,13 @@ import space.space_spring.domain.chat.chatting.service.module.ChattingModuleService; import space.space_spring.domain.chat.chatting.model.document.ChatMessage; import space.space_spring.domain.userSpace.model.entity.UserSpace; -import space.space_spring.exception.CustomException; -import space.space_spring.service.S3Uploader; -import space.space_spring.util.userSpace.UserSpaceUtils; +import space.space_spring.global.exception.CustomException; +import space.space_spring.global.util.S3Uploader; +import space.space_spring.global.util.userSpace.UserSpaceUtils; import java.io.IOException; -import static space.space_spring.response.status.BaseExceptionResponseStatus.USER_IS_NOT_IN_SPACE; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.USER_IS_NOT_IN_SPACE; @Service diff --git a/src/main/java/space/space_spring/domain/chat/chatting/service/module/ChattingModuleService.java b/src/main/java/space/space_spring/domain/chat/chatting/service/module/ChattingModuleService.java index 51628273..08400bd0 100644 --- a/src/main/java/space/space_spring/domain/chat/chatting/service/module/ChattingModuleService.java +++ b/src/main/java/space/space_spring/domain/chat/chatting/service/module/ChattingModuleService.java @@ -11,7 +11,7 @@ import space.space_spring.domain.chat.chatroom.model.ChatRoom; import space.space_spring.domain.chat.chatting.model.document.ChatMessage; import space.space_spring.domain.chat.chatting.repository.ChattingRepository; -import space.space_spring.entity.enumStatus.BaseStatusType; +import space.space_spring.global.common.enumStatus.BaseStatusType; import space.space_spring.global.util.TimeUtils; @Component diff --git a/src/main/java/space/space_spring/domain/pay/controller/PayController.java b/src/main/java/space/space_spring/domain/pay/controller/PayController.java index 4d786e33..fbf16abb 100644 --- a/src/main/java/space/space_spring/domain/pay/controller/PayController.java +++ b/src/main/java/space/space_spring/domain/pay/controller/PayController.java @@ -5,18 +5,15 @@ import org.springframework.validation.BindingResult; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import space.space_spring.argumentResolver.jwtLogin.JwtLoginAuth; +import space.space_spring.global.argumentResolver.jwtLogin.JwtLoginAuth; import space.space_spring.domain.pay.model.request.PayCreateRequest; import space.space_spring.domain.pay.model.response.*; -import space.space_spring.exception.CustomException; -import space.space_spring.response.BaseResponse; +import space.space_spring.global.exception.CustomException; +import space.space_spring.global.common.response.BaseResponse; import space.space_spring.domain.pay.service.PayService; -import space.space_spring.util.pay.PayUtils; -import space.space_spring.util.user.UserUtils; -import space.space_spring.util.userSpace.UserSpaceUtils; -import static space.space_spring.response.status.BaseExceptionResponseStatus.*; -import static space.space_spring.util.bindingResult.BindingResultUtils.getErrorMessage; +import static space.space_spring.global.util.bindingResult.BindingResultUtils.getErrorMessage; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.*; @RestController @RequiredArgsConstructor diff --git a/src/main/java/space/space_spring/domain/pay/model/EqualSplitPayAmountPolicy.java b/src/main/java/space/space_spring/domain/pay/model/EqualSplitPayAmountPolicy.java index ff75215a..24f22b14 100644 --- a/src/main/java/space/space_spring/domain/pay/model/EqualSplitPayAmountPolicy.java +++ b/src/main/java/space/space_spring/domain/pay/model/EqualSplitPayAmountPolicy.java @@ -2,11 +2,11 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; -import space.space_spring.exception.CustomException; +import space.space_spring.global.exception.CustomException; import java.util.List; -import static space.space_spring.response.status.BaseExceptionResponseStatus.INVALID_EQUAL_SPLIT_AMOUNT; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.INVALID_EQUAL_SPLIT_AMOUNT; @NoArgsConstructor(access = AccessLevel.PROTECTED) public class EqualSplitPayAmountPolicy implements PayAmountPolicy { diff --git a/src/main/java/space/space_spring/domain/pay/model/IndividualPayAmountPolicy.java b/src/main/java/space/space_spring/domain/pay/model/IndividualPayAmountPolicy.java index 5524bbee..23539249 100644 --- a/src/main/java/space/space_spring/domain/pay/model/IndividualPayAmountPolicy.java +++ b/src/main/java/space/space_spring/domain/pay/model/IndividualPayAmountPolicy.java @@ -2,11 +2,11 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; -import space.space_spring.exception.CustomException; +import space.space_spring.global.exception.CustomException; import java.util.List; -import static space.space_spring.response.status.BaseExceptionResponseStatus.INVALID_INDIVIDUAL_AMOUNT; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.INVALID_INDIVIDUAL_AMOUNT; @NoArgsConstructor(access = AccessLevel.PROTECTED) diff --git a/src/main/java/space/space_spring/domain/pay/model/entity/PayRequest.java b/src/main/java/space/space_spring/domain/pay/model/entity/PayRequest.java index bc341759..147509a9 100644 --- a/src/main/java/space/space_spring/domain/pay/model/entity/PayRequest.java +++ b/src/main/java/space/space_spring/domain/pay/model/entity/PayRequest.java @@ -9,7 +9,7 @@ import space.space_spring.domain.pay.model.dto.PayRequestInfoDto; import space.space_spring.domain.pay.model.firstCollection.PayRequestTargets; import space.space_spring.domain.user.model.entity.User; -import space.space_spring.entity.BaseEntity; +import space.space_spring.global.common.entity.BaseEntity; import space.space_spring.domain.space.model.entity.Space; import java.util.ArrayList; diff --git a/src/main/java/space/space_spring/domain/pay/model/entity/PayRequestTarget.java b/src/main/java/space/space_spring/domain/pay/model/entity/PayRequestTarget.java index fbefb308..5706c350 100644 --- a/src/main/java/space/space_spring/domain/pay/model/entity/PayRequestTarget.java +++ b/src/main/java/space/space_spring/domain/pay/model/entity/PayRequestTarget.java @@ -6,7 +6,7 @@ import lombok.Getter; import lombok.NoArgsConstructor; import space.space_spring.domain.pay.model.dto.PayTargetInfoDto; -import space.space_spring.entity.BaseEntity; +import space.space_spring.global.common.entity.BaseEntity; @Entity @Getter diff --git a/src/main/java/space/space_spring/domain/pay/model/request/PayCreateRequest.java b/src/main/java/space/space_spring/domain/pay/model/request/PayCreateRequest.java index 6cc98486..3097ceeb 100644 --- a/src/main/java/space/space_spring/domain/pay/model/request/PayCreateRequest.java +++ b/src/main/java/space/space_spring/domain/pay/model/request/PayCreateRequest.java @@ -7,9 +7,8 @@ import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; -import space.space_spring.domain.pay.model.PayCreateTargetInfo; import space.space_spring.domain.pay.model.PayType; -import space.space_spring.global.common.EnumValidator; +import space.space_spring.global.validator.EnumValidator; import java.util.List; diff --git a/src/main/java/space/space_spring/domain/pay/service/PayService.java b/src/main/java/space/space_spring/domain/pay/service/PayService.java index dd1e0101..b1b27db4 100644 --- a/src/main/java/space/space_spring/domain/pay/service/PayService.java +++ b/src/main/java/space/space_spring/domain/pay/service/PayService.java @@ -18,13 +18,12 @@ import space.space_spring.domain.pay.model.response.PayHomeViewResponse; import space.space_spring.domain.pay.repository.PayRequestRepository; import space.space_spring.domain.pay.repository.PayRequestTargetRepository; -import space.space_spring.exception.CustomException; +import space.space_spring.global.exception.CustomException; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.*; import java.util.ArrayList; import java.util.List; -import static space.space_spring.response.status.BaseExceptionResponseStatus.*; - @Service @RequiredArgsConstructor @Transactional(readOnly = true) diff --git a/src/main/java/space/space_spring/domain/space/controller/SpaceController.java b/src/main/java/space/space_spring/domain/space/controller/SpaceController.java index 52ba46fe..8fe6a818 100644 --- a/src/main/java/space/space_spring/domain/space/controller/SpaceController.java +++ b/src/main/java/space/space_spring/domain/space/controller/SpaceController.java @@ -6,8 +6,8 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; -import space.space_spring.argumentResolver.jwtLogin.JwtLoginAuth; -import space.space_spring.argumentResolver.userSpace.CheckUserSpace; +import space.space_spring.global.argumentResolver.jwtLogin.JwtLoginAuth; +import space.space_spring.global.argumentResolver.userSpace.CheckUserSpace; import space.space_spring.domain.space.model.dto.GetSpaceJoinDto; import space.space_spring.domain.space.model.dto.PostSpaceJoinDto; import space.space_spring.domain.space.model.request.PostSpaceCreateDto; @@ -16,18 +16,18 @@ import space.space_spring.domain.userSpace.model.GetUserProfileInSpaceDto; import space.space_spring.domain.userSpace.model.PutUserProfileInSpaceDto; import space.space_spring.domain.space.model.entity.Space; -import space.space_spring.exception.CustomException; -import space.space_spring.response.BaseResponse; +import space.space_spring.global.exception.CustomException; +import space.space_spring.global.common.response.BaseResponse; import space.space_spring.domain.pay.service.PayService; -import space.space_spring.service.PostService; -import space.space_spring.service.S3Uploader; +import space.space_spring.domain.board.service.PostService; +import space.space_spring.global.util.S3Uploader; import space.space_spring.domain.space.service.SpaceService; -import space.space_spring.util.userSpace.UserSpaceUtils; +import space.space_spring.global.util.userSpace.UserSpaceUtils; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.*; import java.io.IOException; -import static space.space_spring.response.status.BaseExceptionResponseStatus.*; -import static space.space_spring.util.bindingResult.BindingResultUtils.getErrorMessage; +import static space.space_spring.global.util.bindingResult.BindingResultUtils.getErrorMessage; @RestController @RequiredArgsConstructor diff --git a/src/main/java/space/space_spring/domain/space/model/entity/Space.java b/src/main/java/space/space_spring/domain/space/model/entity/Space.java index 55769e7a..b0ca06da 100644 --- a/src/main/java/space/space_spring/domain/space/model/entity/Space.java +++ b/src/main/java/space/space_spring/domain/space/model/entity/Space.java @@ -5,7 +5,7 @@ import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; -import space.space_spring.entity.BaseEntity; +import space.space_spring.global.common.entity.BaseEntity; @Entity @Getter diff --git a/src/main/java/space/space_spring/domain/space/service/SpaceService.java b/src/main/java/space/space_spring/domain/space/service/SpaceService.java index 0a037d6b..ab126e07 100644 --- a/src/main/java/space/space_spring/domain/space/service/SpaceService.java +++ b/src/main/java/space/space_spring/domain/space/service/SpaceService.java @@ -15,16 +15,16 @@ import space.space_spring.domain.space.model.entity.Space; import space.space_spring.domain.user.model.entity.User; import space.space_spring.domain.userSpace.model.entity.UserSpace; -import space.space_spring.entity.enumStatus.UserSpaceAuth; -import space.space_spring.exception.CustomException; -import space.space_spring.util.space.SpaceUtils; -import space.space_spring.util.user.UserUtils; -import space.space_spring.util.userSpace.UserSpaceUtils; +import space.space_spring.global.common.enumStatus.UserSpaceAuth; +import space.space_spring.global.exception.CustomException; +import space.space_spring.global.util.space.SpaceUtils; +import space.space_spring.global.util.user.UserUtils; +import space.space_spring.global.util.userSpace.UserSpaceUtils; import java.time.ZoneId; import java.util.Optional; -import static space.space_spring.response.status.BaseExceptionResponseStatus.USER_IS_NOT_IN_SPACE; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.USER_IS_NOT_IN_SPACE; @Service diff --git a/src/main/java/space/space_spring/domain/user/controller/UserController.java b/src/main/java/space/space_spring/domain/user/controller/UserController.java index ccf0f455..b77d6b39 100644 --- a/src/main/java/space/space_spring/domain/user/controller/UserController.java +++ b/src/main/java/space/space_spring/domain/user/controller/UserController.java @@ -5,17 +5,17 @@ import org.springframework.validation.BindingResult; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import space.space_spring.argumentResolver.jwtLogin.JwtLoginAuth; +import space.space_spring.global.argumentResolver.jwtLogin.JwtLoginAuth; import space.space_spring.domain.user.model.GetUserProfileListDto; import space.space_spring.domain.user.model.request.PostUserSignupRequest; import space.space_spring.domain.user.model.response.GetSpaceInfoForUserResponse; -import space.space_spring.exception.CustomException; -import space.space_spring.response.BaseResponse; +import space.space_spring.global.exception.CustomException; +import space.space_spring.global.common.response.BaseResponse; import space.space_spring.domain.user.service.UserService; -import space.space_spring.util.userSpace.UserSpaceUtils; +import space.space_spring.global.util.userSpace.UserSpaceUtils; -import static space.space_spring.response.status.BaseExceptionResponseStatus.*; -import static space.space_spring.util.bindingResult.BindingResultUtils.getErrorMessage; +import static space.space_spring.global.util.bindingResult.BindingResultUtils.getErrorMessage; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.*; @Slf4j @RestController diff --git a/src/main/java/space/space_spring/domain/user/model/entity/User.java b/src/main/java/space/space_spring/domain/user/model/entity/User.java index bee0b88a..f161bc07 100644 --- a/src/main/java/space/space_spring/domain/user/model/entity/User.java +++ b/src/main/java/space/space_spring/domain/user/model/entity/User.java @@ -5,8 +5,8 @@ import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; -import space.space_spring.entity.BaseEntity; -import space.space_spring.entity.enumStatus.UserSignupType; +import space.space_spring.global.common.entity.BaseEntity; +import space.space_spring.global.common.enumStatus.UserSignupType; @Entity @Table(name = "Users") diff --git a/src/main/java/space/space_spring/domain/user/repository/UserDao.java b/src/main/java/space/space_spring/domain/user/repository/UserDao.java index 06b362f2..b37e67f7 100644 --- a/src/main/java/space/space_spring/domain/user/repository/UserDao.java +++ b/src/main/java/space/space_spring/domain/user/repository/UserDao.java @@ -6,7 +6,7 @@ import jakarta.persistence.TypedQuery; import org.springframework.stereotype.Repository; import space.space_spring.domain.user.model.entity.User; -import space.space_spring.entity.enumStatus.UserSignupType; +import space.space_spring.global.common.enumStatus.UserSignupType; import java.util.Optional; diff --git a/src/main/java/space/space_spring/domain/user/service/UserService.java b/src/main/java/space/space_spring/domain/user/service/UserService.java index 2052d00c..47ed25f9 100644 --- a/src/main/java/space/space_spring/domain/user/service/UserService.java +++ b/src/main/java/space/space_spring/domain/user/service/UserService.java @@ -11,17 +11,17 @@ import space.space_spring.domain.user.model.request.PostUserSignupRequest; import space.space_spring.domain.user.model.response.GetSpaceInfoForUserResponse; import space.space_spring.domain.userSpace.model.entity.UserSpace; -import space.space_spring.entity.enumStatus.UserSignupType; -import space.space_spring.exception.CustomException; +import space.space_spring.global.common.enumStatus.UserSignupType; +import space.space_spring.global.exception.CustomException; import space.space_spring.domain.user.repository.UserDao; import space.space_spring.domain.user.model.entity.User; -import space.space_spring.util.user.UserUtils; +import space.space_spring.global.util.user.UserUtils; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.*; import java.util.ArrayList; import java.util.List; -import static space.space_spring.entity.enumStatus.UserSignupType.LOCAL; -import static space.space_spring.response.status.BaseExceptionResponseStatus.*; +import static space.space_spring.global.common.enumStatus.UserSignupType.LOCAL; @Service @RequiredArgsConstructor diff --git a/src/main/java/space/space_spring/domain/userSpace/model/entity/UserSpace.java b/src/main/java/space/space_spring/domain/userSpace/model/entity/UserSpace.java index 5b34ed7c..cc45b8f4 100644 --- a/src/main/java/space/space_spring/domain/userSpace/model/entity/UserSpace.java +++ b/src/main/java/space/space_spring/domain/userSpace/model/entity/UserSpace.java @@ -8,8 +8,8 @@ import lombok.NoArgsConstructor; import space.space_spring.domain.space.model.entity.Space; import space.space_spring.domain.user.model.entity.User; -import space.space_spring.entity.BaseEntity; -import space.space_spring.entity.enumStatus.UserSpaceAuth; +import space.space_spring.global.common.entity.BaseEntity; +import space.space_spring.global.common.enumStatus.UserSpaceAuth; @Entity @Getter diff --git a/src/main/java/space/space_spring/domain/userSpace/repository/UserSpaceDao.java b/src/main/java/space/space_spring/domain/userSpace/repository/UserSpaceDao.java index 80ac48ed..6eae2051 100644 --- a/src/main/java/space/space_spring/domain/userSpace/repository/UserSpaceDao.java +++ b/src/main/java/space/space_spring/domain/userSpace/repository/UserSpaceDao.java @@ -11,7 +11,7 @@ import space.space_spring.domain.space.model.entity.Space; import space.space_spring.domain.user.model.entity.User; import space.space_spring.domain.userSpace.model.entity.UserSpace; -import space.space_spring.entity.enumStatus.UserSpaceAuth; +import space.space_spring.global.common.enumStatus.UserSpaceAuth; import java.util.*; diff --git a/src/main/java/space/space_spring/controller/LiveKitController.java b/src/main/java/space/space_spring/domain/voiceRoom/controller/LiveKitController.java similarity index 86% rename from src/main/java/space/space_spring/controller/LiveKitController.java rename to src/main/java/space/space_spring/domain/voiceRoom/controller/LiveKitController.java index 683491e1..87e98d12 100644 --- a/src/main/java/space/space_spring/controller/LiveKitController.java +++ b/src/main/java/space/space_spring/domain/voiceRoom/controller/LiveKitController.java @@ -1,4 +1,4 @@ -package space.space_spring.controller; +package space.space_spring.domain.voiceRoom.controller; import io.livekit.server.AccessToken; import jakarta.annotation.Nullable; @@ -10,11 +10,11 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; -import space.space_spring.dto.VoiceRoom.LiveKitDto.LiveKitSession; -import space.space_spring.dto.VoiceRoom.ParticipantDto; -import space.space_spring.dto.VoiceRoom.RoomDto; -import space.space_spring.dto.VoiceRoom.LiveKitDto.GetTokenRequest; -import space.space_spring.service.LiveKitService; +import space.space_spring.domain.voiceRoom.model.dto.LiveKitDto.LiveKitSession; +import space.space_spring.domain.voiceRoom.model.dto.ParticipantDto; +import space.space_spring.domain.voiceRoom.model.dto.RoomDto; +import space.space_spring.domain.voiceRoom.model.dto.LiveKitDto.GetTokenRequest; +import space.space_spring.domain.voiceRoom.service.LiveKitService; import java.util.List; diff --git a/src/main/java/space/space_spring/controller/VoiceRoomController.java b/src/main/java/space/space_spring/domain/voiceRoom/controller/VoiceRoomController.java similarity index 86% rename from src/main/java/space/space_spring/controller/VoiceRoomController.java rename to src/main/java/space/space_spring/domain/voiceRoom/controller/VoiceRoomController.java index 603ff6e5..64aab4a4 100644 --- a/src/main/java/space/space_spring/controller/VoiceRoomController.java +++ b/src/main/java/space/space_spring/domain/voiceRoom/controller/VoiceRoomController.java @@ -1,4 +1,4 @@ -package space.space_spring.controller; +package space.space_spring.domain.voiceRoom.controller; import jakarta.servlet.http.HttpServletResponse; import jakarta.validation.constraints.NotNull; @@ -6,27 +6,30 @@ import org.springframework.validation.BindingResult; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import space.space_spring.argumentResolver.jwtLogin.JwtLoginAuth; -import space.space_spring.argumentResolver.userSpace.UserSpaceAuth; -import space.space_spring.argumentResolver.userSpace.UserSpaceId; +import space.space_spring.global.argumentResolver.jwtLogin.JwtLoginAuth; +import space.space_spring.global.argumentResolver.userSpace.UserSpaceAuth; +import space.space_spring.global.argumentResolver.userSpace.UserSpaceId; import space.space_spring.domain.userSpace.repository.UserSpaceDao; -import space.space_spring.dao.VoiceRoomRepository; -import space.space_spring.dto.VoiceRoom.*; - -import space.space_spring.exception.CustomException; -import space.space_spring.response.BaseResponse; -import space.space_spring.service.LiveKitService; -import space.space_spring.service.VoiceRoomParticipantService; -import space.space_spring.service.VoiceRoomService; -import space.space_spring.util.space.SpaceUtils; -import space.space_spring.util.user.UserUtils; -import space.space_spring.util.userSpace.UserSpaceUtils; +import space.space_spring.domain.voiceRoom.repository.VoiceRoomRepository; +import space.space_spring.domain.voiceRoom.model.dto.GetParticipantList; +import space.space_spring.domain.voiceRoom.model.dto.GetVoiceRoomList; +import space.space_spring.domain.voiceRoom.model.dto.PatchVoiceRoom; +import space.space_spring.domain.voiceRoom.model.dto.PostVoiceRoomDto; + +import space.space_spring.global.exception.CustomException; +import space.space_spring.global.common.response.BaseResponse; +import space.space_spring.domain.voiceRoom.service.LiveKitService; +import space.space_spring.domain.voiceRoom.service.VoiceRoomParticipantService; +import space.space_spring.domain.voiceRoom.service.VoiceRoomService; +import space.space_spring.global.util.space.SpaceUtils; +import space.space_spring.global.util.user.UserUtils; +import space.space_spring.global.util.userSpace.UserSpaceUtils; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.*; import java.util.List; -import static space.space_spring.entity.enumStatus.UserSpaceAuth.MANAGER; -import static space.space_spring.response.status.BaseExceptionResponseStatus.*; -import static space.space_spring.util.bindingResult.BindingResultUtils.getErrorMessage; +import static space.space_spring.global.common.enumStatus.UserSpaceAuth.MANAGER; +import static space.space_spring.global.util.bindingResult.BindingResultUtils.getErrorMessage; @RestController @RequiredArgsConstructor diff --git a/src/main/java/space/space_spring/dto/VoiceRoom/GetParticipantList.java b/src/main/java/space/space_spring/domain/voiceRoom/model/dto/GetParticipantList.java similarity index 96% rename from src/main/java/space/space_spring/dto/VoiceRoom/GetParticipantList.java rename to src/main/java/space/space_spring/domain/voiceRoom/model/dto/GetParticipantList.java index bf1b4865..a4e831ba 100644 --- a/src/main/java/space/space_spring/dto/VoiceRoom/GetParticipantList.java +++ b/src/main/java/space/space_spring/domain/voiceRoom/model/dto/GetParticipantList.java @@ -1,4 +1,4 @@ -package space.space_spring.dto.VoiceRoom; +package space.space_spring.domain.voiceRoom.model.dto; import jakarta.validation.constraints.NotNull; import lombok.AllArgsConstructor; @@ -6,7 +6,6 @@ import lombok.Getter; import lombok.Setter; -import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; diff --git a/src/main/java/space/space_spring/dto/VoiceRoom/GetToken.java b/src/main/java/space/space_spring/domain/voiceRoom/model/dto/GetToken.java similarity index 64% rename from src/main/java/space/space_spring/dto/VoiceRoom/GetToken.java rename to src/main/java/space/space_spring/domain/voiceRoom/model/dto/GetToken.java index a6893d82..a56178e7 100644 --- a/src/main/java/space/space_spring/dto/VoiceRoom/GetToken.java +++ b/src/main/java/space/space_spring/domain/voiceRoom/model/dto/GetToken.java @@ -1,8 +1,5 @@ -package space.space_spring.dto.VoiceRoom; +package space.space_spring.domain.voiceRoom.model.dto; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Null; -import lombok.AllArgsConstructor; import lombok.Getter; public class GetToken { diff --git a/src/main/java/space/space_spring/dto/VoiceRoom/GetVoiceRoomList.java b/src/main/java/space/space_spring/domain/voiceRoom/model/dto/GetVoiceRoomList.java similarity index 88% rename from src/main/java/space/space_spring/dto/VoiceRoom/GetVoiceRoomList.java rename to src/main/java/space/space_spring/domain/voiceRoom/model/dto/GetVoiceRoomList.java index 241b1174..f40d4101 100644 --- a/src/main/java/space/space_spring/dto/VoiceRoom/GetVoiceRoomList.java +++ b/src/main/java/space/space_spring/domain/voiceRoom/model/dto/GetVoiceRoomList.java @@ -1,16 +1,11 @@ -package space.space_spring.dto.VoiceRoom; +package space.space_spring.domain.voiceRoom.model.dto; import jakarta.annotation.Nullable; -import jakarta.validation.constraints.NotNull; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; -import lombok.Setter; -import java.util.Comparator; import java.util.List; -import java.util.stream.Collectors; -import java.util.stream.Stream; public class GetVoiceRoomList { @Getter diff --git a/src/main/java/space/space_spring/dto/VoiceRoom/LiveKitDto/GetTokenRequest.java b/src/main/java/space/space_spring/domain/voiceRoom/model/dto/LiveKitDto/GetTokenRequest.java similarity index 75% rename from src/main/java/space/space_spring/dto/VoiceRoom/LiveKitDto/GetTokenRequest.java rename to src/main/java/space/space_spring/domain/voiceRoom/model/dto/LiveKitDto/GetTokenRequest.java index 06835c62..82338ef0 100644 --- a/src/main/java/space/space_spring/dto/VoiceRoom/LiveKitDto/GetTokenRequest.java +++ b/src/main/java/space/space_spring/domain/voiceRoom/model/dto/LiveKitDto/GetTokenRequest.java @@ -1,4 +1,4 @@ -package space.space_spring.dto.VoiceRoom.LiveKitDto; +package space.space_spring.domain.voiceRoom.model.dto.LiveKitDto; import lombok.Getter; import lombok.Setter; diff --git a/src/main/java/space/space_spring/dto/VoiceRoom/LiveKitDto/LiveKitSession.java b/src/main/java/space/space_spring/domain/voiceRoom/model/dto/LiveKitDto/LiveKitSession.java similarity index 95% rename from src/main/java/space/space_spring/dto/VoiceRoom/LiveKitDto/LiveKitSession.java rename to src/main/java/space/space_spring/domain/voiceRoom/model/dto/LiveKitDto/LiveKitSession.java index 325bc4e7..3f339c36 100644 --- a/src/main/java/space/space_spring/dto/VoiceRoom/LiveKitDto/LiveKitSession.java +++ b/src/main/java/space/space_spring/domain/voiceRoom/model/dto/LiveKitDto/LiveKitSession.java @@ -1,4 +1,4 @@ -package space.space_spring.dto.VoiceRoom.LiveKitDto; +package space.space_spring.domain.voiceRoom.model.dto.LiveKitDto; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/src/main/java/space/space_spring/dto/VoiceRoom/LiveKitDto/LiveKitSessionResponse.java b/src/main/java/space/space_spring/domain/voiceRoom/model/dto/LiveKitDto/LiveKitSessionResponse.java similarity index 68% rename from src/main/java/space/space_spring/dto/VoiceRoom/LiveKitDto/LiveKitSessionResponse.java rename to src/main/java/space/space_spring/domain/voiceRoom/model/dto/LiveKitDto/LiveKitSessionResponse.java index 13ffab67..96055671 100644 --- a/src/main/java/space/space_spring/dto/VoiceRoom/LiveKitDto/LiveKitSessionResponse.java +++ b/src/main/java/space/space_spring/domain/voiceRoom/model/dto/LiveKitDto/LiveKitSessionResponse.java @@ -1,7 +1,6 @@ -package space.space_spring.dto.VoiceRoom.LiveKitDto; +package space.space_spring.domain.voiceRoom.model.dto.LiveKitDto; import com.fasterxml.jackson.annotation.JsonProperty; -import space.space_spring.dto.VoiceRoom.LiveKitDto.LiveKitSession; import java.util.List; diff --git a/src/main/java/space/space_spring/dto/VoiceRoom/ParticipantDto.java b/src/main/java/space/space_spring/domain/voiceRoom/model/dto/ParticipantDto.java similarity index 98% rename from src/main/java/space/space_spring/dto/VoiceRoom/ParticipantDto.java rename to src/main/java/space/space_spring/domain/voiceRoom/model/dto/ParticipantDto.java index ffb2065b..d7c1b394 100644 --- a/src/main/java/space/space_spring/dto/VoiceRoom/ParticipantDto.java +++ b/src/main/java/space/space_spring/domain/voiceRoom/model/dto/ParticipantDto.java @@ -1,4 +1,4 @@ -package space.space_spring.dto.VoiceRoom; +package space.space_spring.domain.voiceRoom.model.dto; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/main/java/space/space_spring/dto/VoiceRoom/ParticipantListDto.java b/src/main/java/space/space_spring/domain/voiceRoom/model/dto/ParticipantListDto.java similarity index 96% rename from src/main/java/space/space_spring/dto/VoiceRoom/ParticipantListDto.java rename to src/main/java/space/space_spring/domain/voiceRoom/model/dto/ParticipantListDto.java index 848dfbbd..855d8215 100644 --- a/src/main/java/space/space_spring/dto/VoiceRoom/ParticipantListDto.java +++ b/src/main/java/space/space_spring/domain/voiceRoom/model/dto/ParticipantListDto.java @@ -1,4 +1,4 @@ -package space.space_spring.dto.VoiceRoom; +package space.space_spring.domain.voiceRoom.model.dto; import java.util.Collections; import java.util.List; diff --git a/src/main/java/space/space_spring/dto/VoiceRoom/PatchVoiceRoom.java b/src/main/java/space/space_spring/domain/voiceRoom/model/dto/PatchVoiceRoom.java similarity index 87% rename from src/main/java/space/space_spring/dto/VoiceRoom/PatchVoiceRoom.java rename to src/main/java/space/space_spring/domain/voiceRoom/model/dto/PatchVoiceRoom.java index c5544d4f..cc4a7104 100644 --- a/src/main/java/space/space_spring/dto/VoiceRoom/PatchVoiceRoom.java +++ b/src/main/java/space/space_spring/domain/voiceRoom/model/dto/PatchVoiceRoom.java @@ -1,9 +1,8 @@ -package space.space_spring.dto.VoiceRoom; +package space.space_spring.domain.voiceRoom.model.dto; import jakarta.annotation.Nullable; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; -import lombok.AllArgsConstructor; import lombok.Getter; import lombok.Setter; diff --git a/src/main/java/space/space_spring/dto/VoiceRoom/PostVoiceRoomDto.java b/src/main/java/space/space_spring/domain/voiceRoom/model/dto/PostVoiceRoomDto.java similarity index 87% rename from src/main/java/space/space_spring/dto/VoiceRoom/PostVoiceRoomDto.java rename to src/main/java/space/space_spring/domain/voiceRoom/model/dto/PostVoiceRoomDto.java index 0395b5c6..66239b37 100644 --- a/src/main/java/space/space_spring/dto/VoiceRoom/PostVoiceRoomDto.java +++ b/src/main/java/space/space_spring/domain/voiceRoom/model/dto/PostVoiceRoomDto.java @@ -1,8 +1,7 @@ -package space.space_spring.dto.VoiceRoom; +package space.space_spring.domain.voiceRoom.model.dto; import jakarta.validation.constraints.NotNull; import lombok.AllArgsConstructor; -import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/src/main/java/space/space_spring/dto/VoiceRoom/RoomDto.java b/src/main/java/space/space_spring/domain/voiceRoom/model/dto/RoomDto.java similarity index 97% rename from src/main/java/space/space_spring/dto/VoiceRoom/RoomDto.java rename to src/main/java/space/space_spring/domain/voiceRoom/model/dto/RoomDto.java index 0d418f01..d5684206 100644 --- a/src/main/java/space/space_spring/dto/VoiceRoom/RoomDto.java +++ b/src/main/java/space/space_spring/domain/voiceRoom/model/dto/RoomDto.java @@ -1,12 +1,11 @@ -package space.space_spring.dto.VoiceRoom; +package space.space_spring.domain.voiceRoom.model.dto; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import livekit.LivekitModels; -import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; -import space.space_spring.entity.VoiceRoom; +import space.space_spring.domain.voiceRoom.model.entity.VoiceRoom; import java.util.List; import java.util.stream.Collectors; diff --git a/src/main/java/space/space_spring/dto/VoiceRoom/VoiceRoomEntityList.java b/src/main/java/space/space_spring/domain/voiceRoom/model/dto/VoiceRoomEntityList.java similarity index 85% rename from src/main/java/space/space_spring/dto/VoiceRoom/VoiceRoomEntityList.java rename to src/main/java/space/space_spring/domain/voiceRoom/model/dto/VoiceRoomEntityList.java index f3266800..02524377 100644 --- a/src/main/java/space/space_spring/dto/VoiceRoom/VoiceRoomEntityList.java +++ b/src/main/java/space/space_spring/domain/voiceRoom/model/dto/VoiceRoomEntityList.java @@ -1,6 +1,6 @@ -package space.space_spring.dto.VoiceRoom; +package space.space_spring.domain.voiceRoom.model.dto; -import space.space_spring.entity.VoiceRoom; +import space.space_spring.domain.voiceRoom.model.entity.VoiceRoom; import java.util.List; import java.util.stream.Collectors; diff --git a/src/main/java/space/space_spring/dto/VoiceRoom/VoiceRoomListDto.java b/src/main/java/space/space_spring/domain/voiceRoom/model/dto/VoiceRoomListDto.java similarity index 95% rename from src/main/java/space/space_spring/dto/VoiceRoom/VoiceRoomListDto.java rename to src/main/java/space/space_spring/domain/voiceRoom/model/dto/VoiceRoomListDto.java index 06d5effb..edd1ae65 100644 --- a/src/main/java/space/space_spring/dto/VoiceRoom/VoiceRoomListDto.java +++ b/src/main/java/space/space_spring/domain/voiceRoom/model/dto/VoiceRoomListDto.java @@ -1,7 +1,7 @@ -package space.space_spring.dto.VoiceRoom; +package space.space_spring.domain.voiceRoom.model.dto; import livekit.LivekitModels; -import space.space_spring.entity.VoiceRoom; +import space.space_spring.domain.voiceRoom.model.entity.VoiceRoom; import java.util.Collections; import java.util.Comparator; diff --git a/src/main/java/space/space_spring/entity/VoiceRoom.java b/src/main/java/space/space_spring/domain/voiceRoom/model/entity/VoiceRoom.java similarity index 87% rename from src/main/java/space/space_spring/entity/VoiceRoom.java rename to src/main/java/space/space_spring/domain/voiceRoom/model/entity/VoiceRoom.java index f6cf6ab4..6e1b7e0d 100644 --- a/src/main/java/space/space_spring/entity/VoiceRoom.java +++ b/src/main/java/space/space_spring/domain/voiceRoom/model/entity/VoiceRoom.java @@ -1,17 +1,18 @@ -package space.space_spring.entity; +package space.space_spring.domain.voiceRoom.model.entity; import jakarta.persistence.*; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; import space.space_spring.domain.space.model.entity.Space; -import space.space_spring.dto.VoiceRoom.RoomDto; +import space.space_spring.domain.voiceRoom.model.dto.RoomDto; +import space.space_spring.global.common.entity.BaseEntity; @Entity @Table(name = "VoiceRoom") @Getter @NoArgsConstructor -public class VoiceRoom extends BaseEntity{ +public class VoiceRoom extends BaseEntity { @Id @GeneratedValue @Column(name="voice_room_id") diff --git a/src/main/java/space/space_spring/dao/VoiceRoomDao.java b/src/main/java/space/space_spring/domain/voiceRoom/repository/VoiceRoomDao.java similarity index 87% rename from src/main/java/space/space_spring/dao/VoiceRoomDao.java rename to src/main/java/space/space_spring/domain/voiceRoom/repository/VoiceRoomDao.java index 87c2b946..ab894094 100644 --- a/src/main/java/space/space_spring/dao/VoiceRoomDao.java +++ b/src/main/java/space/space_spring/domain/voiceRoom/repository/VoiceRoomDao.java @@ -1,11 +1,11 @@ -package space.space_spring.dao; +package space.space_spring.domain.voiceRoom.repository; import jakarta.persistence.EntityManager; import jakarta.persistence.PersistenceContext; import jakarta.transaction.Transactional; import org.springframework.stereotype.Repository; import space.space_spring.domain.space.model.entity.Space; -import space.space_spring.entity.VoiceRoom; +import space.space_spring.domain.voiceRoom.model.entity.VoiceRoom; @Repository public class VoiceRoomDao { diff --git a/src/main/java/space/space_spring/dao/VoiceRoomRepository.java b/src/main/java/space/space_spring/domain/voiceRoom/repository/VoiceRoomRepository.java similarity index 93% rename from src/main/java/space/space_spring/dao/VoiceRoomRepository.java rename to src/main/java/space/space_spring/domain/voiceRoom/repository/VoiceRoomRepository.java index 200f06a4..4b6aac8e 100644 --- a/src/main/java/space/space_spring/dao/VoiceRoomRepository.java +++ b/src/main/java/space/space_spring/domain/voiceRoom/repository/VoiceRoomRepository.java @@ -1,11 +1,11 @@ -package space.space_spring.dao; +package space.space_spring.domain.voiceRoom.repository; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; import space.space_spring.domain.space.model.entity.Space; -import space.space_spring.entity.VoiceRoom; +import space.space_spring.domain.voiceRoom.model.entity.VoiceRoom; import java.util.List; import java.util.Optional; diff --git a/src/main/java/space/space_spring/service/LiveKitService.java b/src/main/java/space/space_spring/domain/voiceRoom/service/LiveKitService.java similarity index 93% rename from src/main/java/space/space_spring/service/LiveKitService.java rename to src/main/java/space/space_spring/domain/voiceRoom/service/LiveKitService.java index a9527465..08fc939f 100644 --- a/src/main/java/space/space_spring/service/LiveKitService.java +++ b/src/main/java/space/space_spring/domain/voiceRoom/service/LiveKitService.java @@ -1,4 +1,4 @@ -package space.space_spring.service; +package space.space_spring.domain.voiceRoom.service; import io.livekit.server.*; import livekit.LivekitModels; @@ -8,10 +8,11 @@ import org.springframework.stereotype.Service; import org.springframework.web.client.RestTemplate; import retrofit2.Response; -import space.space_spring.dto.VoiceRoom.*; -import space.space_spring.dto.VoiceRoom.LiveKitDto.GetTokenRequest; -import space.space_spring.dto.VoiceRoom.LiveKitDto.LiveKitSession; -import space.space_spring.dto.VoiceRoom.LiveKitDto.LiveKitSessionResponse; +import space.space_spring.domain.voiceRoom.model.dto.ParticipantDto; +import space.space_spring.domain.voiceRoom.model.dto.RoomDto; +import space.space_spring.domain.voiceRoom.model.dto.LiveKitDto.GetTokenRequest; +import space.space_spring.domain.voiceRoom.model.dto.LiveKitDto.LiveKitSession; +import space.space_spring.domain.voiceRoom.model.dto.LiveKitDto.LiveKitSessionResponse; import java.security.SecureRandom; import java.util.List; diff --git a/src/main/java/space/space_spring/service/VoiceRoomParticipantService.java b/src/main/java/space/space_spring/domain/voiceRoom/service/VoiceRoomParticipantService.java similarity index 88% rename from src/main/java/space/space_spring/service/VoiceRoomParticipantService.java rename to src/main/java/space/space_spring/domain/voiceRoom/service/VoiceRoomParticipantService.java index 1fe4a208..bf841d70 100644 --- a/src/main/java/space/space_spring/service/VoiceRoomParticipantService.java +++ b/src/main/java/space/space_spring/domain/voiceRoom/service/VoiceRoomParticipantService.java @@ -1,20 +1,20 @@ -package space.space_spring.service; +package space.space_spring.domain.voiceRoom.service; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.core.task.TaskExecutor; import org.springframework.stereotype.Service; -import space.space_spring.dao.VoiceRoomRepository; +import space.space_spring.domain.voiceRoom.repository.VoiceRoomRepository; import space.space_spring.domain.space.model.entity.Space; import space.space_spring.domain.user.repository.UserDao; import space.space_spring.domain.userSpace.repository.UserSpaceDao; -import space.space_spring.dto.VoiceRoom.GetParticipantList; -import space.space_spring.dto.VoiceRoom.ParticipantDto; -import space.space_spring.dto.VoiceRoom.ParticipantListDto; -import space.space_spring.dto.VoiceRoom.RoomDto; -import space.space_spring.exception.CustomException; -import space.space_spring.util.LiveKitUtils; +import space.space_spring.domain.voiceRoom.model.dto.GetParticipantList; +import space.space_spring.domain.voiceRoom.model.dto.ParticipantDto; +import space.space_spring.domain.voiceRoom.model.dto.ParticipantListDto; +import space.space_spring.domain.voiceRoom.model.dto.RoomDto; +import space.space_spring.global.exception.CustomException; +import space.space_spring.global.util.LiveKitUtils; import java.util.Collections; import java.util.List; @@ -22,7 +22,7 @@ import java.util.concurrent.CompletableFuture; import java.util.stream.Collectors; -import static space.space_spring.response.status.BaseExceptionResponseStatus.VOICEROOM_NOT_EXIST; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.VOICEROOM_NOT_EXIST; @Service @RequiredArgsConstructor diff --git a/src/main/java/space/space_spring/service/VoiceRoomService.java b/src/main/java/space/space_spring/domain/voiceRoom/service/VoiceRoomService.java similarity index 85% rename from src/main/java/space/space_spring/service/VoiceRoomService.java rename to src/main/java/space/space_spring/domain/voiceRoom/service/VoiceRoomService.java index a905e6d3..74bc3150 100644 --- a/src/main/java/space/space_spring/service/VoiceRoomService.java +++ b/src/main/java/space/space_spring/domain/voiceRoom/service/VoiceRoomService.java @@ -1,4 +1,4 @@ -package space.space_spring.service; +package space.space_spring.domain.voiceRoom.service; import livekit.LivekitModels; import lombok.RequiredArgsConstructor; @@ -7,15 +7,22 @@ import org.springframework.stereotype.Service; import space.space_spring.domain.user.repository.UserDao; import space.space_spring.domain.userSpace.repository.UserSpaceDao; -import space.space_spring.dao.VoiceRoomDao; -import space.space_spring.dao.VoiceRoomRepository; -import space.space_spring.dto.VoiceRoom.*; +import space.space_spring.domain.voiceRoom.repository.VoiceRoomDao; +import space.space_spring.domain.voiceRoom.repository.VoiceRoomRepository; +import space.space_spring.domain.voiceRoom.model.dto.GetParticipantList; +import space.space_spring.domain.voiceRoom.model.dto.GetVoiceRoomList; +import space.space_spring.domain.voiceRoom.model.dto.ParticipantDto; +import space.space_spring.domain.voiceRoom.model.dto.ParticipantListDto; +import space.space_spring.domain.voiceRoom.model.dto.PatchVoiceRoom; +import space.space_spring.domain.voiceRoom.model.dto.PostVoiceRoomDto; +import space.space_spring.domain.voiceRoom.model.dto.RoomDto; +import space.space_spring.domain.voiceRoom.model.dto.VoiceRoomListDto; import space.space_spring.domain.space.model.entity.Space; import space.space_spring.domain.user.model.entity.User; -import space.space_spring.entity.VoiceRoom; -import space.space_spring.exception.CustomException; -import space.space_spring.util.LiveKitUtils; -import space.space_spring.util.space.SpaceUtils; +import space.space_spring.domain.voiceRoom.model.entity.VoiceRoom; +import space.space_spring.global.exception.CustomException; +import space.space_spring.global.util.LiveKitUtils; +import space.space_spring.global.util.space.SpaceUtils; import java.util.ArrayList; import java.util.Collections; @@ -24,10 +31,7 @@ import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import static space.space_spring.response.status.BaseExceptionResponseStatus.VOICEROOM_NOT_EXIST; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.VOICEROOM_NOT_EXIST; @Service @RequiredArgsConstructor @@ -43,7 +47,7 @@ public class VoiceRoomService { private final TaskExecutor taskExecutor; private final VoiceRoomParticipantService voiceRoomParticipantService; - public Long createVoiceRoom(long spaceId,PostVoiceRoomDto.Request req){ + public Long createVoiceRoom(long spaceId, PostVoiceRoomDto.Request req){ Space targetSpace = spaceUtils.findSpaceBySpaceId(spaceId); Integer orderInt = voiceRoomRepository.findMaxOrderBySpace(targetSpace); //Space currentSpace=voiceRoomRepository.findActiveVoiceRoomsBySpaceId(spaceId); @@ -63,7 +67,7 @@ public Long createVoiceRoom(long spaceId,PostVoiceRoomDto.Request req){ /** // room 정보 가져오기 병렬적용 */ - public List getVoiceRoomInfoListConcurrency(long spaceId,GetVoiceRoomList.Request req){ + public List getVoiceRoomInfoListConcurrency(long spaceId, GetVoiceRoomList.Request req){ Integer limit = req.getLimit(); boolean showParticipant =req.isShowParticipant(); @@ -102,7 +106,7 @@ public List getVoiceRoomInfoListConcurrency(long - Map roomIdParticipantMap=voiceRoomParticipantService.getParticipantList(roomIdList); + Map roomIdParticipantMap=voiceRoomParticipantService.getParticipantList(roomIdList); if(showParticipant){ voiceRoomListDto.setParticipantListDto(roomIdParticipantMap); diff --git a/src/main/java/space/space_spring/dto/oAuth/OAuthLoginResponse.java b/src/main/java/space/space_spring/dto/oAuth/OAuthLoginResponse.java deleted file mode 100644 index 751d4183..00000000 --- a/src/main/java/space/space_spring/dto/oAuth/OAuthLoginResponse.java +++ /dev/null @@ -1,13 +0,0 @@ -package space.space_spring.dto.oAuth; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; - -@Getter -@NoArgsConstructor -@AllArgsConstructor -public class OAuthLoginResponse { - - private Long userId; -} diff --git a/src/main/java/space/space_spring/argumentResolver/jwtLogin/JwtLoginAuth.java b/src/main/java/space/space_spring/global/argumentResolver/jwtLogin/JwtLoginAuth.java similarity index 81% rename from src/main/java/space/space_spring/argumentResolver/jwtLogin/JwtLoginAuth.java rename to src/main/java/space/space_spring/global/argumentResolver/jwtLogin/JwtLoginAuth.java index d0db6f99..303c89fa 100644 --- a/src/main/java/space/space_spring/argumentResolver/jwtLogin/JwtLoginAuth.java +++ b/src/main/java/space/space_spring/global/argumentResolver/jwtLogin/JwtLoginAuth.java @@ -1,4 +1,4 @@ -package space.space_spring.argumentResolver.jwtLogin; +package space.space_spring.global.argumentResolver.jwtLogin; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/src/main/java/space/space_spring/argumentResolver/jwtLogin/JwtLoginAuthHandlerArgumentResolver.java b/src/main/java/space/space_spring/global/argumentResolver/jwtLogin/JwtLoginAuthHandlerArgumentResolver.java similarity index 94% rename from src/main/java/space/space_spring/argumentResolver/jwtLogin/JwtLoginAuthHandlerArgumentResolver.java rename to src/main/java/space/space_spring/global/argumentResolver/jwtLogin/JwtLoginAuthHandlerArgumentResolver.java index d638dea0..ec5da537 100644 --- a/src/main/java/space/space_spring/argumentResolver/jwtLogin/JwtLoginAuthHandlerArgumentResolver.java +++ b/src/main/java/space/space_spring/global/argumentResolver/jwtLogin/JwtLoginAuthHandlerArgumentResolver.java @@ -1,4 +1,4 @@ -package space.space_spring.argumentResolver.jwtLogin; +package space.space_spring.global.argumentResolver.jwtLogin; import jakarta.servlet.http.HttpServletRequest; import org.springframework.core.MethodParameter; diff --git a/src/main/java/space/space_spring/argumentResolver/userSpace/CheckUserSpace.java b/src/main/java/space/space_spring/global/argumentResolver/userSpace/CheckUserSpace.java similarity index 82% rename from src/main/java/space/space_spring/argumentResolver/userSpace/CheckUserSpace.java rename to src/main/java/space/space_spring/global/argumentResolver/userSpace/CheckUserSpace.java index dbaf59be..5bfd1a1f 100644 --- a/src/main/java/space/space_spring/argumentResolver/userSpace/CheckUserSpace.java +++ b/src/main/java/space/space_spring/global/argumentResolver/userSpace/CheckUserSpace.java @@ -1,4 +1,4 @@ -package space.space_spring.argumentResolver.userSpace; +package space.space_spring.global.argumentResolver.userSpace; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/src/main/java/space/space_spring/argumentResolver/userSpace/UserSpaceAuth.java b/src/main/java/space/space_spring/global/argumentResolver/userSpace/UserSpaceAuth.java similarity index 81% rename from src/main/java/space/space_spring/argumentResolver/userSpace/UserSpaceAuth.java rename to src/main/java/space/space_spring/global/argumentResolver/userSpace/UserSpaceAuth.java index 615c3ac4..16159294 100644 --- a/src/main/java/space/space_spring/argumentResolver/userSpace/UserSpaceAuth.java +++ b/src/main/java/space/space_spring/global/argumentResolver/userSpace/UserSpaceAuth.java @@ -1,4 +1,4 @@ -package space.space_spring.argumentResolver.userSpace; +package space.space_spring.global.argumentResolver.userSpace; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/src/main/java/space/space_spring/argumentResolver/userSpace/UserSpaceAuthHandlerArgumentResolver.java b/src/main/java/space/space_spring/global/argumentResolver/userSpace/UserSpaceAuthHandlerArgumentResolver.java similarity index 95% rename from src/main/java/space/space_spring/argumentResolver/userSpace/UserSpaceAuthHandlerArgumentResolver.java rename to src/main/java/space/space_spring/global/argumentResolver/userSpace/UserSpaceAuthHandlerArgumentResolver.java index 9e811960..bca8acc1 100644 --- a/src/main/java/space/space_spring/argumentResolver/userSpace/UserSpaceAuthHandlerArgumentResolver.java +++ b/src/main/java/space/space_spring/global/argumentResolver/userSpace/UserSpaceAuthHandlerArgumentResolver.java @@ -1,4 +1,4 @@ -package space.space_spring.argumentResolver.userSpace; +package space.space_spring.global.argumentResolver.userSpace; import jakarta.servlet.http.HttpServletRequest; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/space/space_spring/argumentResolver/userSpace/UserSpaceId.java b/src/main/java/space/space_spring/global/argumentResolver/userSpace/UserSpaceId.java similarity index 80% rename from src/main/java/space/space_spring/argumentResolver/userSpace/UserSpaceId.java rename to src/main/java/space/space_spring/global/argumentResolver/userSpace/UserSpaceId.java index d36a84df..4fb86ad1 100644 --- a/src/main/java/space/space_spring/argumentResolver/userSpace/UserSpaceId.java +++ b/src/main/java/space/space_spring/global/argumentResolver/userSpace/UserSpaceId.java @@ -1,4 +1,4 @@ -package space.space_spring.argumentResolver.userSpace; +package space.space_spring.global.argumentResolver.userSpace; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/src/main/java/space/space_spring/argumentResolver/userSpace/UserSpaceIdHandlerArgumentResolver.java b/src/main/java/space/space_spring/global/argumentResolver/userSpace/UserSpaceIdHandlerArgumentResolver.java similarity index 90% rename from src/main/java/space/space_spring/argumentResolver/userSpace/UserSpaceIdHandlerArgumentResolver.java rename to src/main/java/space/space_spring/global/argumentResolver/userSpace/UserSpaceIdHandlerArgumentResolver.java index 79ab77b2..350ac0cf 100644 --- a/src/main/java/space/space_spring/argumentResolver/userSpace/UserSpaceIdHandlerArgumentResolver.java +++ b/src/main/java/space/space_spring/global/argumentResolver/userSpace/UserSpaceIdHandlerArgumentResolver.java @@ -1,4 +1,4 @@ -package space.space_spring.argumentResolver.userSpace; +package space.space_spring.global.argumentResolver.userSpace; import jakarta.servlet.http.HttpServletRequest; import org.springframework.core.MethodParameter; @@ -7,7 +7,6 @@ import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.method.support.HandlerMethodArgumentResolver; import org.springframework.web.method.support.ModelAndViewContainer; -import space.space_spring.argumentResolver.jwtLogin.JwtLoginAuth; @Component public class UserSpaceIdHandlerArgumentResolver implements HandlerMethodArgumentResolver { diff --git a/src/main/java/space/space_spring/global/common/.gitkeep b/src/main/java/space/space_spring/global/common/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/src/main/java/space/space_spring/entity/BaseEntity.java b/src/main/java/space/space_spring/global/common/entity/BaseEntity.java similarity index 89% rename from src/main/java/space/space_spring/entity/BaseEntity.java rename to src/main/java/space/space_spring/global/common/entity/BaseEntity.java index d2cd2103..e75d1647 100644 --- a/src/main/java/space/space_spring/entity/BaseEntity.java +++ b/src/main/java/space/space_spring/global/common/entity/BaseEntity.java @@ -1,10 +1,10 @@ -package space.space_spring.entity; +package space.space_spring.global.common.entity; import jakarta.persistence.*; import lombok.Getter; import java.time.LocalDateTime; -import space.space_spring.entity.enumStatus.BaseStatusType; +import space.space_spring.global.common.enumStatus.BaseStatusType; @Getter @MappedSuperclass diff --git a/src/main/java/space/space_spring/entity/enumStatus/BaseStatusType.java b/src/main/java/space/space_spring/global/common/enumStatus/BaseStatusType.java similarity index 62% rename from src/main/java/space/space_spring/entity/enumStatus/BaseStatusType.java rename to src/main/java/space/space_spring/global/common/enumStatus/BaseStatusType.java index 8da42e6a..f6b02f15 100644 --- a/src/main/java/space/space_spring/entity/enumStatus/BaseStatusType.java +++ b/src/main/java/space/space_spring/global/common/enumStatus/BaseStatusType.java @@ -1,4 +1,4 @@ -package space.space_spring.entity.enumStatus; +package space.space_spring.global.common.enumStatus; import lombok.Getter; diff --git a/src/main/java/space/space_spring/entity/enumStatus/ChatMessageType.java b/src/main/java/space/space_spring/global/common/enumStatus/ChatMessageType.java similarity index 84% rename from src/main/java/space/space_spring/entity/enumStatus/ChatMessageType.java rename to src/main/java/space/space_spring/global/common/enumStatus/ChatMessageType.java index b0b73ee9..9025307a 100644 --- a/src/main/java/space/space_spring/entity/enumStatus/ChatMessageType.java +++ b/src/main/java/space/space_spring/global/common/enumStatus/ChatMessageType.java @@ -1,4 +1,4 @@ -package space.space_spring.entity.enumStatus; +package space.space_spring.global.common.enumStatus; import lombok.Getter; diff --git a/src/main/java/space/space_spring/entity/enumStatus/UserSignupType.java b/src/main/java/space/space_spring/global/common/enumStatus/UserSignupType.java similarity index 83% rename from src/main/java/space/space_spring/entity/enumStatus/UserSignupType.java rename to src/main/java/space/space_spring/global/common/enumStatus/UserSignupType.java index 9c2b62e3..ea59012d 100644 --- a/src/main/java/space/space_spring/entity/enumStatus/UserSignupType.java +++ b/src/main/java/space/space_spring/global/common/enumStatus/UserSignupType.java @@ -1,4 +1,4 @@ -package space.space_spring.entity.enumStatus; +package space.space_spring.global.common.enumStatus; import lombok.Getter; diff --git a/src/main/java/space/space_spring/entity/enumStatus/UserSpaceAuth.java b/src/main/java/space/space_spring/global/common/enumStatus/UserSpaceAuth.java similarity index 79% rename from src/main/java/space/space_spring/entity/enumStatus/UserSpaceAuth.java rename to src/main/java/space/space_spring/global/common/enumStatus/UserSpaceAuth.java index 7024b35d..86e26844 100644 --- a/src/main/java/space/space_spring/entity/enumStatus/UserSpaceAuth.java +++ b/src/main/java/space/space_spring/global/common/enumStatus/UserSpaceAuth.java @@ -1,4 +1,4 @@ -package space.space_spring.entity.enumStatus; +package space.space_spring.global.common.enumStatus; import lombok.Getter; diff --git a/src/main/java/space/space_spring/response/BaseErrorResponse.java b/src/main/java/space/space_spring/global/common/response/BaseErrorResponse.java similarity index 90% rename from src/main/java/space/space_spring/response/BaseErrorResponse.java rename to src/main/java/space/space_spring/global/common/response/BaseErrorResponse.java index 5f1776b6..414baf15 100644 --- a/src/main/java/space/space_spring/response/BaseErrorResponse.java +++ b/src/main/java/space/space_spring/global/common/response/BaseErrorResponse.java @@ -1,9 +1,9 @@ -package space.space_spring.response; +package space.space_spring.global.common.response; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import lombok.Getter; import org.springframework.http.HttpStatus; -import space.space_spring.response.status.ResponseStatus; +import space.space_spring.global.common.response.status.ResponseStatus; import java.time.LocalDateTime; diff --git a/src/main/java/space/space_spring/response/BaseResponse.java b/src/main/java/space/space_spring/global/common/response/BaseResponse.java similarity index 80% rename from src/main/java/space/space_spring/response/BaseResponse.java rename to src/main/java/space/space_spring/global/common/response/BaseResponse.java index 38a47f35..c191e7c7 100644 --- a/src/main/java/space/space_spring/response/BaseResponse.java +++ b/src/main/java/space/space_spring/global/common/response/BaseResponse.java @@ -1,12 +1,12 @@ -package space.space_spring.response; +package space.space_spring.global.common.response; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import lombok.Getter; import org.springframework.http.HttpStatus; -import space.space_spring.response.status.ResponseStatus; +import space.space_spring.global.common.response.status.ResponseStatus; -import static space.space_spring.response.status.BaseExceptionResponseStatus.SUCCESS; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.SUCCESS; @Getter @JsonPropertyOrder({"code", "status", "message", "result"}) diff --git a/src/main/java/space/space_spring/response/status/BaseExceptionResponseStatus.java b/src/main/java/space/space_spring/global/common/response/status/BaseExceptionResponseStatus.java similarity index 99% rename from src/main/java/space/space_spring/response/status/BaseExceptionResponseStatus.java rename to src/main/java/space/space_spring/global/common/response/status/BaseExceptionResponseStatus.java index 00dad0a3..46e8f461 100644 --- a/src/main/java/space/space_spring/response/status/BaseExceptionResponseStatus.java +++ b/src/main/java/space/space_spring/global/common/response/status/BaseExceptionResponseStatus.java @@ -1,4 +1,4 @@ -package space.space_spring.response.status; +package space.space_spring.global.common.response.status; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/space/space_spring/response/status/ResponseStatus.java b/src/main/java/space/space_spring/global/common/response/status/ResponseStatus.java similarity index 73% rename from src/main/java/space/space_spring/response/status/ResponseStatus.java rename to src/main/java/space/space_spring/global/common/response/status/ResponseStatus.java index 660cd7d4..a53b64a3 100644 --- a/src/main/java/space/space_spring/response/status/ResponseStatus.java +++ b/src/main/java/space/space_spring/global/common/response/status/ResponseStatus.java @@ -1,4 +1,4 @@ -package space.space_spring.response.status; +package space.space_spring.global.common.response.status; import org.springframework.http.HttpStatus; diff --git a/src/main/java/space/space_spring/global/config/.gitkeep b/src/main/java/space/space_spring/global/config/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/src/main/java/space/space_spring/config/QueryDslConfig.java b/src/main/java/space/space_spring/global/config/QueryDslConfig.java similarity index 92% rename from src/main/java/space/space_spring/config/QueryDslConfig.java rename to src/main/java/space/space_spring/global/config/QueryDslConfig.java index 245e0a5a..36aab7e4 100644 --- a/src/main/java/space/space_spring/config/QueryDslConfig.java +++ b/src/main/java/space/space_spring/global/config/QueryDslConfig.java @@ -1,4 +1,4 @@ -package space.space_spring.config; +package space.space_spring.global.config; import com.querydsl.jpa.impl.JPAQueryFactory; import jakarta.persistence.EntityManager; diff --git a/src/main/java/space/space_spring/config/RestTemplateConfig.java b/src/main/java/space/space_spring/global/config/RestTemplateConfig.java similarity index 93% rename from src/main/java/space/space_spring/config/RestTemplateConfig.java rename to src/main/java/space/space_spring/global/config/RestTemplateConfig.java index 4ca2e082..e44dca32 100644 --- a/src/main/java/space/space_spring/config/RestTemplateConfig.java +++ b/src/main/java/space/space_spring/global/config/RestTemplateConfig.java @@ -1,4 +1,4 @@ -package space.space_spring.config; +package space.space_spring.global.config; import org.springframework.boot.web.client.RestTemplateBuilder; import org.springframework.context.annotation.Configuration; diff --git a/src/main/java/space/space_spring/config/S3config.java b/src/main/java/space/space_spring/global/config/S3config.java similarity index 96% rename from src/main/java/space/space_spring/config/S3config.java rename to src/main/java/space/space_spring/global/config/S3config.java index 661f302d..2e090033 100644 --- a/src/main/java/space/space_spring/config/S3config.java +++ b/src/main/java/space/space_spring/global/config/S3config.java @@ -1,4 +1,4 @@ -package space.space_spring.config; +package space.space_spring.global.config; import com.amazonaws.auth.AWSCredentials; diff --git a/src/main/java/space/space_spring/config/SecurityConfig.java b/src/main/java/space/space_spring/global/config/SecurityConfig.java similarity index 95% rename from src/main/java/space/space_spring/config/SecurityConfig.java rename to src/main/java/space/space_spring/global/config/SecurityConfig.java index e5168428..21f06c61 100644 --- a/src/main/java/space/space_spring/config/SecurityConfig.java +++ b/src/main/java/space/space_spring/global/config/SecurityConfig.java @@ -1,6 +1,5 @@ -package space.space_spring.config; +package space.space_spring.global.config; -import org.springframework.boot.autoconfigure.security.servlet.PathRequest; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; diff --git a/src/main/java/space/space_spring/config/ThreadPoolConfig.java b/src/main/java/space/space_spring/global/config/ThreadPoolConfig.java similarity index 96% rename from src/main/java/space/space_spring/config/ThreadPoolConfig.java rename to src/main/java/space/space_spring/global/config/ThreadPoolConfig.java index a1c32d1d..d11b1767 100644 --- a/src/main/java/space/space_spring/config/ThreadPoolConfig.java +++ b/src/main/java/space/space_spring/global/config/ThreadPoolConfig.java @@ -1,4 +1,4 @@ -package space.space_spring.config; +package space.space_spring.global.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/src/main/java/space/space_spring/config/WebConfig.java b/src/main/java/space/space_spring/global/config/WebConfig.java similarity index 80% rename from src/main/java/space/space_spring/config/WebConfig.java rename to src/main/java/space/space_spring/global/config/WebConfig.java index 6676d459..9ccd758c 100644 --- a/src/main/java/space/space_spring/config/WebConfig.java +++ b/src/main/java/space/space_spring/global/config/WebConfig.java @@ -1,4 +1,4 @@ -package space.space_spring.config; +package space.space_spring.global.config; import lombok.RequiredArgsConstructor; import org.springframework.context.annotation.Configuration; @@ -7,13 +7,13 @@ import org.springframework.web.servlet.config.annotation.InterceptorRegistration; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -import space.space_spring.argumentResolver.jwtLogin.JwtLoginAuthHandlerArgumentResolver; -import space.space_spring.argumentResolver.userSpace.UserSpaceAuthHandlerArgumentResolver; -import space.space_spring.argumentResolver.userSpace.UserSpaceIdHandlerArgumentResolver; -import space.space_spring.config.interceptorURL.JwtLoginInterceptorURL; -import space.space_spring.config.interceptorURL.UserSpaceValidationInterceptorURL; -import space.space_spring.interceptor.UserSpaceValidationInterceptor; -import space.space_spring.interceptor.jwtLogin.JwtLoginAuthInterceptor; +import space.space_spring.global.argumentResolver.jwtLogin.JwtLoginAuthHandlerArgumentResolver; +import space.space_spring.global.argumentResolver.userSpace.UserSpaceAuthHandlerArgumentResolver; +import space.space_spring.global.argumentResolver.userSpace.UserSpaceIdHandlerArgumentResolver; +import space.space_spring.global.config.interceptorURL.JwtLoginInterceptorURL; +import space.space_spring.global.config.interceptorURL.UserSpaceValidationInterceptorURL; +import space.space_spring.global.interceptor.UserSpaceValidationInterceptor; +import space.space_spring.global.interceptor.jwtLogin.JwtLoginAuthInterceptor; import java.util.List; diff --git a/src/main/java/space/space_spring/config/WebSocketConfig.java b/src/main/java/space/space_spring/global/config/WebSocketConfig.java similarity index 95% rename from src/main/java/space/space_spring/config/WebSocketConfig.java rename to src/main/java/space/space_spring/global/config/WebSocketConfig.java index 1559e4ca..2e75ea8c 100644 --- a/src/main/java/space/space_spring/config/WebSocketConfig.java +++ b/src/main/java/space/space_spring/global/config/WebSocketConfig.java @@ -1,4 +1,4 @@ -package space.space_spring.config; +package space.space_spring.global.config; import lombok.RequiredArgsConstructor; import org.springframework.context.annotation.Bean; @@ -10,7 +10,7 @@ import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer; import org.springframework.web.socket.config.annotation.WebSocketTransportRegistration; import org.springframework.web.socket.server.standard.ServletServerContainerFactoryBean; -import space.space_spring.interceptor.jwtSocket.JwtChannelInterceptor; +import space.space_spring.global.interceptor.jwtSocket.JwtChannelInterceptor; @Configuration @EnableWebSocketMessageBroker diff --git a/src/main/java/space/space_spring/config/filter/RequestCachingFilter.java b/src/main/java/space/space_spring/global/config/filter/RequestCachingFilter.java similarity index 94% rename from src/main/java/space/space_spring/config/filter/RequestCachingFilter.java rename to src/main/java/space/space_spring/global/config/filter/RequestCachingFilter.java index 70a24358..90b7cd29 100644 --- a/src/main/java/space/space_spring/config/filter/RequestCachingFilter.java +++ b/src/main/java/space/space_spring/global/config/filter/RequestCachingFilter.java @@ -1,4 +1,4 @@ -package space.space_spring.config.filter; +package space.space_spring.global.config.filter; import jakarta.servlet.FilterChain; import jakarta.servlet.ServletException; diff --git a/src/main/java/space/space_spring/config/interceptorURL/JwtLoginInterceptorURL.java b/src/main/java/space/space_spring/global/config/interceptorURL/JwtLoginInterceptorURL.java similarity index 86% rename from src/main/java/space/space_spring/config/interceptorURL/JwtLoginInterceptorURL.java rename to src/main/java/space/space_spring/global/config/interceptorURL/JwtLoginInterceptorURL.java index 21886d4e..7941b6e9 100644 --- a/src/main/java/space/space_spring/config/interceptorURL/JwtLoginInterceptorURL.java +++ b/src/main/java/space/space_spring/global/config/interceptorURL/JwtLoginInterceptorURL.java @@ -1,4 +1,4 @@ -package space.space_spring.config.interceptorURL; +package space.space_spring.global.config.interceptorURL; import lombok.Getter; diff --git a/src/main/java/space/space_spring/config/interceptorURL/UserSpaceValidationInterceptorURL.java b/src/main/java/space/space_spring/global/config/interceptorURL/UserSpaceValidationInterceptorURL.java similarity index 87% rename from src/main/java/space/space_spring/config/interceptorURL/UserSpaceValidationInterceptorURL.java rename to src/main/java/space/space_spring/global/config/interceptorURL/UserSpaceValidationInterceptorURL.java index afd0c19c..7cfd1c53 100644 --- a/src/main/java/space/space_spring/config/interceptorURL/UserSpaceValidationInterceptorURL.java +++ b/src/main/java/space/space_spring/global/config/interceptorURL/UserSpaceValidationInterceptorURL.java @@ -1,4 +1,4 @@ -package space.space_spring.config.interceptorURL; +package space.space_spring.global.config.interceptorURL; import lombok.Getter; diff --git a/src/main/java/space/space_spring/global/error/.gitkeep b/src/main/java/space/space_spring/global/error/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/src/main/java/space/space_spring/exception/BadRequestException.java b/src/main/java/space/space_spring/global/exception/BadRequestException.java similarity index 72% rename from src/main/java/space/space_spring/exception/BadRequestException.java rename to src/main/java/space/space_spring/global/exception/BadRequestException.java index 2f49cda0..61e22906 100644 --- a/src/main/java/space/space_spring/exception/BadRequestException.java +++ b/src/main/java/space/space_spring/global/exception/BadRequestException.java @@ -1,7 +1,7 @@ -package space.space_spring.exception; +package space.space_spring.global.exception; import lombok.Getter; -import space.space_spring.response.status.ResponseStatus; +import space.space_spring.global.common.response.status.ResponseStatus; @Getter public class BadRequestException extends RuntimeException { diff --git a/src/main/java/space/space_spring/exception/CustomException.java b/src/main/java/space/space_spring/global/exception/CustomException.java similarity index 79% rename from src/main/java/space/space_spring/exception/CustomException.java rename to src/main/java/space/space_spring/global/exception/CustomException.java index d7305f96..b4efd83a 100644 --- a/src/main/java/space/space_spring/exception/CustomException.java +++ b/src/main/java/space/space_spring/global/exception/CustomException.java @@ -1,7 +1,7 @@ -package space.space_spring.exception; +package space.space_spring.global.exception; import lombok.Getter; -import space.space_spring.response.status.ResponseStatus; +import space.space_spring.global.common.response.status.ResponseStatus; @Getter public class CustomException extends RuntimeException{ diff --git a/src/main/java/space/space_spring/exception/InternalServerErrorException.java b/src/main/java/space/space_spring/global/exception/InternalServerErrorException.java similarity index 73% rename from src/main/java/space/space_spring/exception/InternalServerErrorException.java rename to src/main/java/space/space_spring/global/exception/InternalServerErrorException.java index 4f271771..b3ce2d48 100644 --- a/src/main/java/space/space_spring/exception/InternalServerErrorException.java +++ b/src/main/java/space/space_spring/global/exception/InternalServerErrorException.java @@ -1,7 +1,7 @@ -package space.space_spring.exception; +package space.space_spring.global.exception; import lombok.Getter; -import space.space_spring.response.status.ResponseStatus; +import space.space_spring.global.common.response.status.ResponseStatus; @Getter public class InternalServerErrorException extends RuntimeException{ private final ResponseStatus exceptionStatus; diff --git a/src/main/java/space/space_spring/exception/jwt/bad_request/JwtBadRequestException.java b/src/main/java/space/space_spring/global/exception/jwt/bad_request/JwtBadRequestException.java similarity index 70% rename from src/main/java/space/space_spring/exception/jwt/bad_request/JwtBadRequestException.java rename to src/main/java/space/space_spring/global/exception/jwt/bad_request/JwtBadRequestException.java index f881a84c..7aa1fc70 100644 --- a/src/main/java/space/space_spring/exception/jwt/bad_request/JwtBadRequestException.java +++ b/src/main/java/space/space_spring/global/exception/jwt/bad_request/JwtBadRequestException.java @@ -1,7 +1,7 @@ -package space.space_spring.exception.jwt.bad_request; +package space.space_spring.global.exception.jwt.bad_request; import lombok.Getter; -import space.space_spring.response.status.ResponseStatus; +import space.space_spring.global.common.response.status.ResponseStatus; @Getter public class JwtBadRequestException extends RuntimeException { diff --git a/src/main/java/space/space_spring/exception/jwt/bad_request/JwtNoTokenException.java b/src/main/java/space/space_spring/global/exception/jwt/bad_request/JwtNoTokenException.java similarity index 69% rename from src/main/java/space/space_spring/exception/jwt/bad_request/JwtNoTokenException.java rename to src/main/java/space/space_spring/global/exception/jwt/bad_request/JwtNoTokenException.java index 9b0cdd08..adaa9898 100644 --- a/src/main/java/space/space_spring/exception/jwt/bad_request/JwtNoTokenException.java +++ b/src/main/java/space/space_spring/global/exception/jwt/bad_request/JwtNoTokenException.java @@ -1,7 +1,7 @@ -package space.space_spring.exception.jwt.bad_request; +package space.space_spring.global.exception.jwt.bad_request; import lombok.Getter; -import space.space_spring.response.status.ResponseStatus; +import space.space_spring.global.common.response.status.ResponseStatus; @Getter public class JwtNoTokenException extends JwtBadRequestException { diff --git a/src/main/java/space/space_spring/exception/jwt/bad_request/JwtUnsupportedTokenException.java b/src/main/java/space/space_spring/global/exception/jwt/bad_request/JwtUnsupportedTokenException.java similarity index 70% rename from src/main/java/space/space_spring/exception/jwt/bad_request/JwtUnsupportedTokenException.java rename to src/main/java/space/space_spring/global/exception/jwt/bad_request/JwtUnsupportedTokenException.java index a81a9ccc..d98c35ac 100644 --- a/src/main/java/space/space_spring/exception/jwt/bad_request/JwtUnsupportedTokenException.java +++ b/src/main/java/space/space_spring/global/exception/jwt/bad_request/JwtUnsupportedTokenException.java @@ -1,7 +1,7 @@ -package space.space_spring.exception.jwt.bad_request; +package space.space_spring.global.exception.jwt.bad_request; import lombok.Getter; -import space.space_spring.response.status.ResponseStatus; +import space.space_spring.global.common.response.status.ResponseStatus; @Getter public class JwtUnsupportedTokenException extends JwtBadRequestException { diff --git a/src/main/java/space/space_spring/exception/jwt/unauthorized/JwtExpiredTokenException.java b/src/main/java/space/space_spring/global/exception/jwt/unauthorized/JwtExpiredTokenException.java similarity index 70% rename from src/main/java/space/space_spring/exception/jwt/unauthorized/JwtExpiredTokenException.java rename to src/main/java/space/space_spring/global/exception/jwt/unauthorized/JwtExpiredTokenException.java index 3d32ff61..0e6932e5 100644 --- a/src/main/java/space/space_spring/exception/jwt/unauthorized/JwtExpiredTokenException.java +++ b/src/main/java/space/space_spring/global/exception/jwt/unauthorized/JwtExpiredTokenException.java @@ -1,7 +1,7 @@ -package space.space_spring.exception.jwt.unauthorized; +package space.space_spring.global.exception.jwt.unauthorized; import lombok.Getter; -import space.space_spring.response.status.ResponseStatus; +import space.space_spring.global.common.response.status.ResponseStatus; @Getter public class JwtExpiredTokenException extends JwtUnauthorizedTokenException { diff --git a/src/main/java/space/space_spring/exception/jwt/unauthorized/JwtInvalidTokenException.java b/src/main/java/space/space_spring/global/exception/jwt/unauthorized/JwtInvalidTokenException.java similarity index 70% rename from src/main/java/space/space_spring/exception/jwt/unauthorized/JwtInvalidTokenException.java rename to src/main/java/space/space_spring/global/exception/jwt/unauthorized/JwtInvalidTokenException.java index a7bf33a7..55e21dc1 100644 --- a/src/main/java/space/space_spring/exception/jwt/unauthorized/JwtInvalidTokenException.java +++ b/src/main/java/space/space_spring/global/exception/jwt/unauthorized/JwtInvalidTokenException.java @@ -1,7 +1,7 @@ -package space.space_spring.exception.jwt.unauthorized; +package space.space_spring.global.exception.jwt.unauthorized; import lombok.Getter; -import space.space_spring.response.status.ResponseStatus; +import space.space_spring.global.common.response.status.ResponseStatus; @Getter public class JwtInvalidTokenException extends JwtUnauthorizedTokenException { diff --git a/src/main/java/space/space_spring/exception/jwt/unauthorized/JwtMalformedTokenException.java b/src/main/java/space/space_spring/global/exception/jwt/unauthorized/JwtMalformedTokenException.java similarity index 70% rename from src/main/java/space/space_spring/exception/jwt/unauthorized/JwtMalformedTokenException.java rename to src/main/java/space/space_spring/global/exception/jwt/unauthorized/JwtMalformedTokenException.java index d880970a..da55fb31 100644 --- a/src/main/java/space/space_spring/exception/jwt/unauthorized/JwtMalformedTokenException.java +++ b/src/main/java/space/space_spring/global/exception/jwt/unauthorized/JwtMalformedTokenException.java @@ -1,7 +1,7 @@ -package space.space_spring.exception.jwt.unauthorized; +package space.space_spring.global.exception.jwt.unauthorized; import lombok.Getter; -import space.space_spring.response.status.ResponseStatus; +import space.space_spring.global.common.response.status.ResponseStatus; @Getter public class JwtMalformedTokenException extends JwtUnauthorizedTokenException { diff --git a/src/main/java/space/space_spring/exception/jwt/unauthorized/JwtUnauthorizedTokenException.java b/src/main/java/space/space_spring/global/exception/jwt/unauthorized/JwtUnauthorizedTokenException.java similarity index 71% rename from src/main/java/space/space_spring/exception/jwt/unauthorized/JwtUnauthorizedTokenException.java rename to src/main/java/space/space_spring/global/exception/jwt/unauthorized/JwtUnauthorizedTokenException.java index 08326574..c93632b4 100644 --- a/src/main/java/space/space_spring/exception/jwt/unauthorized/JwtUnauthorizedTokenException.java +++ b/src/main/java/space/space_spring/global/exception/jwt/unauthorized/JwtUnauthorizedTokenException.java @@ -1,7 +1,7 @@ -package space.space_spring.exception.jwt.unauthorized; +package space.space_spring.global.exception.jwt.unauthorized; import lombok.Getter; -import space.space_spring.response.status.ResponseStatus; +import space.space_spring.global.common.response.status.ResponseStatus; @Getter public class JwtUnauthorizedTokenException extends RuntimeException { diff --git a/src/main/java/space/space_spring/exceptionHandler/BaseExceptionControllerAdvice.java b/src/main/java/space/space_spring/global/exceptionHandler/BaseExceptionControllerAdvice.java similarity index 92% rename from src/main/java/space/space_spring/exceptionHandler/BaseExceptionControllerAdvice.java rename to src/main/java/space/space_spring/global/exceptionHandler/BaseExceptionControllerAdvice.java index 4cf1d623..34cbdc42 100644 --- a/src/main/java/space/space_spring/exceptionHandler/BaseExceptionControllerAdvice.java +++ b/src/main/java/space/space_spring/global/exceptionHandler/BaseExceptionControllerAdvice.java @@ -1,4 +1,4 @@ -package space.space_spring.exceptionHandler; +package space.space_spring.global.exceptionHandler; import jakarta.servlet.http.HttpServletRequest; import jakarta.validation.ConstraintViolationException; @@ -14,15 +14,13 @@ import org.springframework.web.servlet.NoHandlerFoundException; import org.springframework.web.util.ContentCachingRequestWrapper; import org.springframework.web.util.WebUtils; -import space.space_spring.exception.BadRequestException; -import space.space_spring.exception.InternalServerErrorException; -import space.space_spring.response.BaseErrorResponse; +import space.space_spring.global.exception.BadRequestException; +import space.space_spring.global.exception.InternalServerErrorException; +import space.space_spring.global.common.response.BaseErrorResponse; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.*; -import java.io.BufferedReader; import java.io.IOException; -import static space.space_spring.response.status.BaseExceptionResponseStatus.*; - @Slf4j @RestControllerAdvice public class BaseExceptionControllerAdvice { diff --git a/src/main/java/space/space_spring/exceptionHandler/CustomExceptionControllerAdvice.java b/src/main/java/space/space_spring/global/exceptionHandler/CustomExceptionControllerAdvice.java similarity index 83% rename from src/main/java/space/space_spring/exceptionHandler/CustomExceptionControllerAdvice.java rename to src/main/java/space/space_spring/global/exceptionHandler/CustomExceptionControllerAdvice.java index 06b811a1..adf47ec9 100644 --- a/src/main/java/space/space_spring/exceptionHandler/CustomExceptionControllerAdvice.java +++ b/src/main/java/space/space_spring/global/exceptionHandler/CustomExceptionControllerAdvice.java @@ -1,4 +1,4 @@ -package space.space_spring.exceptionHandler; +package space.space_spring.global.exceptionHandler; import jakarta.annotation.Priority; import lombok.extern.slf4j.Slf4j; @@ -7,8 +7,8 @@ import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestControllerAdvice; -import space.space_spring.exception.CustomException; -import space.space_spring.response.BaseErrorResponse; +import space.space_spring.global.exception.CustomException; +import space.space_spring.global.common.response.BaseErrorResponse; @Slf4j @Priority(0) diff --git a/src/main/java/space/space_spring/exceptionHandler/JwtExceptionControllerAdvice.java b/src/main/java/space/space_spring/global/exceptionHandler/JwtExceptionControllerAdvice.java similarity index 77% rename from src/main/java/space/space_spring/exceptionHandler/JwtExceptionControllerAdvice.java rename to src/main/java/space/space_spring/global/exceptionHandler/JwtExceptionControllerAdvice.java index 9d2b67d4..c8a12a37 100644 --- a/src/main/java/space/space_spring/exceptionHandler/JwtExceptionControllerAdvice.java +++ b/src/main/java/space/space_spring/global/exceptionHandler/JwtExceptionControllerAdvice.java @@ -1,4 +1,4 @@ -package space.space_spring.exceptionHandler; +package space.space_spring.global.exceptionHandler; import jakarta.annotation.Priority; import lombok.extern.slf4j.Slf4j; @@ -6,9 +6,9 @@ import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestControllerAdvice; -import space.space_spring.exception.jwt.bad_request.JwtBadRequestException; -import space.space_spring.exception.jwt.unauthorized.JwtUnauthorizedTokenException; -import space.space_spring.response.BaseErrorResponse; +import space.space_spring.global.exception.jwt.bad_request.JwtBadRequestException; +import space.space_spring.global.exception.jwt.unauthorized.JwtUnauthorizedTokenException; +import space.space_spring.global.common.response.BaseErrorResponse; @Slf4j @Priority(0) diff --git a/src/main/java/space/space_spring/interceptor/UserSpaceValidationInterceptor.java b/src/main/java/space/space_spring/global/interceptor/UserSpaceValidationInterceptor.java similarity index 91% rename from src/main/java/space/space_spring/interceptor/UserSpaceValidationInterceptor.java rename to src/main/java/space/space_spring/global/interceptor/UserSpaceValidationInterceptor.java index 2eea716d..f7107fd3 100644 --- a/src/main/java/space/space_spring/interceptor/UserSpaceValidationInterceptor.java +++ b/src/main/java/space/space_spring/global/interceptor/UserSpaceValidationInterceptor.java @@ -1,4 +1,4 @@ -package space.space_spring.interceptor; +package space.space_spring.global.interceptor; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; @@ -7,20 +7,19 @@ import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.HandlerMapping; -import space.space_spring.argumentResolver.userSpace.CheckUserSpace; +import space.space_spring.global.argumentResolver.userSpace.CheckUserSpace; import space.space_spring.domain.space.repository.SpaceDao; import space.space_spring.domain.user.repository.UserDao; import space.space_spring.domain.userSpace.repository.UserSpaceDao; import space.space_spring.domain.space.model.entity.Space; import space.space_spring.domain.user.model.entity.User; import space.space_spring.domain.userSpace.model.entity.UserSpace; -import space.space_spring.exception.CustomException; +import space.space_spring.global.exception.CustomException; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.*; import java.util.Map; import java.util.Optional; -import static space.space_spring.response.status.BaseExceptionResponseStatus.*; - @Component @RequiredArgsConstructor public class UserSpaceValidationInterceptor implements HandlerInterceptor { diff --git a/src/main/java/space/space_spring/interceptor/jwtLogin/JwtLoginAuthInterceptor.java b/src/main/java/space/space_spring/global/interceptor/jwtLogin/JwtLoginAuthInterceptor.java similarity index 82% rename from src/main/java/space/space_spring/interceptor/jwtLogin/JwtLoginAuthInterceptor.java rename to src/main/java/space/space_spring/global/interceptor/jwtLogin/JwtLoginAuthInterceptor.java index db9fc283..e6206a8c 100644 --- a/src/main/java/space/space_spring/interceptor/jwtLogin/JwtLoginAuthInterceptor.java +++ b/src/main/java/space/space_spring/global/interceptor/jwtLogin/JwtLoginAuthInterceptor.java @@ -1,4 +1,4 @@ -package space.space_spring.interceptor.jwtLogin; +package space.space_spring.global.interceptor.jwtLogin; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; @@ -7,12 +7,11 @@ import org.springframework.stereotype.Component; import org.springframework.web.servlet.HandlerInterceptor; import space.space_spring.domain.authorization.jwt.model.TokenType; -import space.space_spring.exception.jwt.bad_request.JwtNoTokenException; -import space.space_spring.exception.jwt.bad_request.JwtUnsupportedTokenException; -import space.space_spring.exception.jwt.unauthorized.JwtExpiredTokenException; +import space.space_spring.global.exception.jwt.bad_request.JwtNoTokenException; +import space.space_spring.global.exception.jwt.bad_request.JwtUnsupportedTokenException; +import space.space_spring.global.exception.jwt.unauthorized.JwtExpiredTokenException; import space.space_spring.domain.authorization.jwt.model.JwtLoginProvider; - -import static space.space_spring.response.status.BaseExceptionResponseStatus.*; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.*; @Component @RequiredArgsConstructor diff --git a/src/main/java/space/space_spring/interceptor/jwtSocket/JwtChannelInterceptor.java b/src/main/java/space/space_spring/global/interceptor/jwtSocket/JwtChannelInterceptor.java similarity index 83% rename from src/main/java/space/space_spring/interceptor/jwtSocket/JwtChannelInterceptor.java rename to src/main/java/space/space_spring/global/interceptor/jwtSocket/JwtChannelInterceptor.java index 5ae95aea..17e4f0ae 100644 --- a/src/main/java/space/space_spring/interceptor/jwtSocket/JwtChannelInterceptor.java +++ b/src/main/java/space/space_spring/global/interceptor/jwtSocket/JwtChannelInterceptor.java @@ -1,4 +1,4 @@ -package space.space_spring.interceptor.jwtSocket; +package space.space_spring.global.interceptor.jwtSocket; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -9,12 +9,11 @@ import org.springframework.messaging.support.ChannelInterceptor; import org.springframework.stereotype.Component; import space.space_spring.domain.authorization.jwt.model.TokenType; -import space.space_spring.exception.jwt.bad_request.JwtNoTokenException; -import space.space_spring.exception.jwt.bad_request.JwtUnsupportedTokenException; -import space.space_spring.exception.jwt.unauthorized.JwtExpiredTokenException; +import space.space_spring.global.exception.jwt.bad_request.JwtNoTokenException; +import space.space_spring.global.exception.jwt.bad_request.JwtUnsupportedTokenException; +import space.space_spring.global.exception.jwt.unauthorized.JwtExpiredTokenException; import space.space_spring.domain.authorization.jwt.model.JwtLoginProvider; - -import static space.space_spring.response.status.BaseExceptionResponseStatus.*; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.*; @Slf4j @Component diff --git a/src/main/java/space/space_spring/util/LiveKitUtils.java b/src/main/java/space/space_spring/global/util/LiveKitUtils.java similarity index 95% rename from src/main/java/space/space_spring/util/LiveKitUtils.java rename to src/main/java/space/space_spring/global/util/LiveKitUtils.java index f9c36e88..57ecbdc9 100644 --- a/src/main/java/space/space_spring/util/LiveKitUtils.java +++ b/src/main/java/space/space_spring/global/util/LiveKitUtils.java @@ -1,4 +1,4 @@ -package space.space_spring.util; +package space.space_spring.global.util; import io.livekit.server.AccessToken; import io.livekit.server.RoomJoin; @@ -10,8 +10,7 @@ import org.springframework.stereotype.Component; import org.springframework.web.client.RestTemplate; import retrofit2.Response; -import space.space_spring.dto.VoiceRoom.ParticipantDto; -import space.space_spring.dto.VoiceRoom.RoomDto; +import space.space_spring.domain.voiceRoom.model.dto.ParticipantDto; import java.util.List; @Component diff --git a/src/main/java/space/space_spring/service/S3Uploader.java b/src/main/java/space/space_spring/global/util/S3Uploader.java similarity index 94% rename from src/main/java/space/space_spring/service/S3Uploader.java rename to src/main/java/space/space_spring/global/util/S3Uploader.java index dc023658..06e745e8 100644 --- a/src/main/java/space/space_spring/service/S3Uploader.java +++ b/src/main/java/space/space_spring/global/util/S3Uploader.java @@ -1,4 +1,4 @@ -package space.space_spring.service; +package space.space_spring.global.util; import com.amazonaws.services.s3.AmazonS3; import com.amazonaws.services.s3.model.CannedAccessControlList; @@ -9,8 +9,8 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; -import space.space_spring.exception.CustomException; -import space.space_spring.validator.AllowedImageFileExtensions; +import space.space_spring.global.exception.CustomException; +import space.space_spring.global.validator.AllowedImageFileExtensions; import java.io.File; import java.io.FileOutputStream; @@ -20,8 +20,8 @@ import java.util.Optional; import java.util.UUID; -import static space.space_spring.response.status.BaseExceptionResponseStatus.BASE64_CONVERT_FAIL_IN_MEMORY; -import static space.space_spring.response.status.BaseExceptionResponseStatus.MULTIPARTFILE_CONVERT_FAIL_IN_MEMORY; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.BASE64_CONVERT_FAIL_IN_MEMORY; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.MULTIPARTFILE_CONVERT_FAIL_IN_MEMORY; @Slf4j @RequiredArgsConstructor diff --git a/src/main/java/space/space_spring/util/bindingResult/BindingResultUtils.java b/src/main/java/space/space_spring/global/util/bindingResult/BindingResultUtils.java similarity index 87% rename from src/main/java/space/space_spring/util/bindingResult/BindingResultUtils.java rename to src/main/java/space/space_spring/global/util/bindingResult/BindingResultUtils.java index 30e601e6..04767d22 100644 --- a/src/main/java/space/space_spring/util/bindingResult/BindingResultUtils.java +++ b/src/main/java/space/space_spring/global/util/bindingResult/BindingResultUtils.java @@ -1,4 +1,4 @@ -package space.space_spring.util.bindingResult; +package space.space_spring.global.util.bindingResult; import org.springframework.validation.BindingResult; diff --git a/src/main/java/space/space_spring/util/pay/PayUtils.java b/src/main/java/space/space_spring/global/util/pay/PayUtils.java similarity index 75% rename from src/main/java/space/space_spring/util/pay/PayUtils.java rename to src/main/java/space/space_spring/global/util/pay/PayUtils.java index 9e59a80e..f342af20 100644 --- a/src/main/java/space/space_spring/util/pay/PayUtils.java +++ b/src/main/java/space/space_spring/global/util/pay/PayUtils.java @@ -1,4 +1,4 @@ -package space.space_spring.util.pay; +package space.space_spring.global.util.pay; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; @@ -6,10 +6,10 @@ import space.space_spring.domain.pay.repository.PayDao; import space.space_spring.domain.pay.model.entity.PayRequest; import space.space_spring.domain.pay.model.entity.PayRequestTarget; -import space.space_spring.exception.CustomException; +import space.space_spring.global.exception.CustomException; -import static space.space_spring.response.status.BaseExceptionResponseStatus.PAY_REQUEST_NOT_FOUND; -import static space.space_spring.response.status.BaseExceptionResponseStatus.PAY_REQUEST_TARGET_NOT_FOUND; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.PAY_REQUEST_NOT_FOUND; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.PAY_REQUEST_TARGET_NOT_FOUND; @Component @RequiredArgsConstructor diff --git a/src/main/java/space/space_spring/util/post/ConvertCreatedDate.java b/src/main/java/space/space_spring/global/util/post/ConvertCreatedDate.java similarity index 96% rename from src/main/java/space/space_spring/util/post/ConvertCreatedDate.java rename to src/main/java/space/space_spring/global/util/post/ConvertCreatedDate.java index 838246d9..fd11d853 100644 --- a/src/main/java/space/space_spring/util/post/ConvertCreatedDate.java +++ b/src/main/java/space/space_spring/global/util/post/ConvertCreatedDate.java @@ -1,4 +1,4 @@ -package space.space_spring.util.post; +package space.space_spring.global.util.post; import java.time.LocalDateTime; import java.time.temporal.ChronoUnit; diff --git a/src/main/java/space/space_spring/util/space/SpaceUtils.java b/src/main/java/space/space_spring/global/util/space/SpaceUtils.java similarity index 75% rename from src/main/java/space/space_spring/util/space/SpaceUtils.java rename to src/main/java/space/space_spring/global/util/space/SpaceUtils.java index 06749902..980a5aff 100644 --- a/src/main/java/space/space_spring/util/space/SpaceUtils.java +++ b/src/main/java/space/space_spring/global/util/space/SpaceUtils.java @@ -1,13 +1,13 @@ -package space.space_spring.util.space; +package space.space_spring.global.util.space; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import space.space_spring.domain.space.repository.SpaceDao; import space.space_spring.domain.space.model.entity.Space; -import space.space_spring.exception.CustomException; +import space.space_spring.global.exception.CustomException; -import static space.space_spring.response.status.BaseExceptionResponseStatus.SPACE_NOT_FOUND; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.SPACE_NOT_FOUND; @Component @RequiredArgsConstructor diff --git a/src/main/java/space/space_spring/util/user/UserUtils.java b/src/main/java/space/space_spring/global/util/user/UserUtils.java similarity index 85% rename from src/main/java/space/space_spring/util/user/UserUtils.java rename to src/main/java/space/space_spring/global/util/user/UserUtils.java index 19aac85c..1bec32a2 100644 --- a/src/main/java/space/space_spring/util/user/UserUtils.java +++ b/src/main/java/space/space_spring/global/util/user/UserUtils.java @@ -1,17 +1,17 @@ -package space.space_spring.util.user; +package space.space_spring.global.util.user; + +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.*; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import space.space_spring.domain.user.repository.UserDao; import space.space_spring.domain.user.model.entity.User; -import space.space_spring.entity.enumStatus.UserSignupType; -import space.space_spring.exception.CustomException; +import space.space_spring.global.common.enumStatus.UserSignupType; +import space.space_spring.global.exception.CustomException; import java.util.UUID; -import static space.space_spring.response.status.BaseExceptionResponseStatus.*; - @Component @RequiredArgsConstructor public class UserUtils { diff --git a/src/main/java/space/space_spring/util/userSpace/MemoryUserSpaceUtils.java b/src/main/java/space/space_spring/global/util/userSpace/MemoryUserSpaceUtils.java similarity index 85% rename from src/main/java/space/space_spring/util/userSpace/MemoryUserSpaceUtils.java rename to src/main/java/space/space_spring/global/util/userSpace/MemoryUserSpaceUtils.java index bc44ed72..ca9c546a 100644 --- a/src/main/java/space/space_spring/util/userSpace/MemoryUserSpaceUtils.java +++ b/src/main/java/space/space_spring/global/util/userSpace/MemoryUserSpaceUtils.java @@ -1,4 +1,4 @@ -package space.space_spring.util.userSpace; +package space.space_spring.global.util.userSpace; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; @@ -9,13 +9,13 @@ import space.space_spring.domain.space.model.entity.Space; import space.space_spring.domain.user.model.entity.User; import space.space_spring.domain.userSpace.model.entity.UserSpace; -import space.space_spring.entity.enumStatus.UserSpaceAuth; -import space.space_spring.exception.CustomException; +import space.space_spring.global.common.enumStatus.UserSpaceAuth; +import space.space_spring.global.exception.CustomException; import java.util.Optional; -import static space.space_spring.response.status.BaseExceptionResponseStatus.USER_IS_ALREADY_IN_SPACE; -import static space.space_spring.response.status.BaseExceptionResponseStatus.USER_IS_NOT_IN_SPACE; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.USER_IS_ALREADY_IN_SPACE; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.USER_IS_NOT_IN_SPACE; @Component @RequiredArgsConstructor diff --git a/src/main/java/space/space_spring/util/userSpace/UserSpaceUtils.java b/src/main/java/space/space_spring/global/util/userSpace/UserSpaceUtils.java similarity index 90% rename from src/main/java/space/space_spring/util/userSpace/UserSpaceUtils.java rename to src/main/java/space/space_spring/global/util/userSpace/UserSpaceUtils.java index 9187cc01..28fa8683 100644 --- a/src/main/java/space/space_spring/util/userSpace/UserSpaceUtils.java +++ b/src/main/java/space/space_spring/global/util/userSpace/UserSpaceUtils.java @@ -1,4 +1,4 @@ -package space.space_spring.util.userSpace; +package space.space_spring.global.util.userSpace; import space.space_spring.domain.userSpace.model.entity.UserSpace; diff --git a/src/main/java/space/space_spring/validator/AllowedImageFileExtensions.java b/src/main/java/space/space_spring/global/validator/AllowedImageFileExtensions.java similarity index 95% rename from src/main/java/space/space_spring/validator/AllowedImageFileExtensions.java rename to src/main/java/space/space_spring/global/validator/AllowedImageFileExtensions.java index 57b39739..cf4e0dbc 100644 --- a/src/main/java/space/space_spring/validator/AllowedImageFileExtensions.java +++ b/src/main/java/space/space_spring/global/validator/AllowedImageFileExtensions.java @@ -1,4 +1,4 @@ -package space.space_spring.validator; +package space.space_spring.global.validator; import lombok.Getter; diff --git a/src/main/java/space/space_spring/global/common/EnumValidator.java b/src/main/java/space/space_spring/global/validator/EnumValidator.java similarity index 93% rename from src/main/java/space/space_spring/global/common/EnumValidator.java rename to src/main/java/space/space_spring/global/validator/EnumValidator.java index 01e92b86..b4454c57 100644 --- a/src/main/java/space/space_spring/global/common/EnumValidator.java +++ b/src/main/java/space/space_spring/global/validator/EnumValidator.java @@ -1,4 +1,4 @@ -package space.space_spring.global.common; +package space.space_spring.global.validator; import jakarta.validation.Constraint; import jakarta.validation.Payload; diff --git a/src/main/java/space/space_spring/global/common/EnumValidatorConstraint.java b/src/main/java/space/space_spring/global/validator/EnumValidatorConstraint.java similarity index 93% rename from src/main/java/space/space_spring/global/common/EnumValidatorConstraint.java rename to src/main/java/space/space_spring/global/validator/EnumValidatorConstraint.java index 76a6ed42..596b6353 100644 --- a/src/main/java/space/space_spring/global/common/EnumValidatorConstraint.java +++ b/src/main/java/space/space_spring/global/validator/EnumValidatorConstraint.java @@ -1,4 +1,4 @@ -package space.space_spring.global.common; +package space.space_spring.global.validator; import jakarta.validation.ConstraintValidator; import jakarta.validation.ConstraintValidatorContext; diff --git a/src/main/java/space/space_spring/controller/ImageS3Controller.java b/src/main/java/space/space_spring/tempController/ImageS3Controller.java similarity index 91% rename from src/main/java/space/space_spring/controller/ImageS3Controller.java rename to src/main/java/space/space_spring/tempController/ImageS3Controller.java index 41be0232..f3b8aa04 100644 --- a/src/main/java/space/space_spring/controller/ImageS3Controller.java +++ b/src/main/java/space/space_spring/tempController/ImageS3Controller.java @@ -1,4 +1,4 @@ -package space.space_spring.controller; +package space.space_spring.tempController; import lombok.RequiredArgsConstructor; import org.springframework.http.ResponseEntity; @@ -7,7 +7,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; -import space.space_spring.service.S3Uploader; +import space.space_spring.global.util.S3Uploader; import java.io.IOException; diff --git a/src/main/java/space/space_spring/controller/TestController.java b/src/main/java/space/space_spring/tempController/TestController.java similarity index 78% rename from src/main/java/space/space_spring/controller/TestController.java rename to src/main/java/space/space_spring/tempController/TestController.java index 25f09cb0..7921683a 100644 --- a/src/main/java/space/space_spring/controller/TestController.java +++ b/src/main/java/space/space_spring/tempController/TestController.java @@ -1,16 +1,15 @@ -package space.space_spring.controller; +package space.space_spring.tempController; import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RestController; -import space.space_spring.argumentResolver.jwtLogin.JwtLoginAuth; +import space.space_spring.global.argumentResolver.jwtLogin.JwtLoginAuth; -import space.space_spring.argumentResolver.userSpace.CheckUserSpace; -import space.space_spring.argumentResolver.userSpace.UserSpaceAuth; -import space.space_spring.argumentResolver.userSpace.UserSpaceId; -import space.space_spring.response.BaseResponse; +import space.space_spring.global.argumentResolver.userSpace.CheckUserSpace; +import space.space_spring.global.argumentResolver.userSpace.UserSpaceAuth; +import space.space_spring.global.argumentResolver.userSpace.UserSpaceId; +import space.space_spring.global.common.response.BaseResponse; @RestController @Slf4j diff --git a/src/main/java/space/space_spring/controller/ViewTestController.java b/src/main/java/space/space_spring/tempController/ViewTestController.java similarity index 90% rename from src/main/java/space/space_spring/controller/ViewTestController.java rename to src/main/java/space/space_spring/tempController/ViewTestController.java index 327a225f..ab477dbd 100644 --- a/src/main/java/space/space_spring/controller/ViewTestController.java +++ b/src/main/java/space/space_spring/tempController/ViewTestController.java @@ -1,7 +1,5 @@ -package space.space_spring.controller; +package space.space_spring.tempController; -import lombok.Getter; -import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; diff --git a/src/test/java/space/space_spring/domain/authorization/jwt/model/JwtLoginTokenResolverTest.java b/src/test/java/space/space_spring/domain/authorization/jwt/model/JwtLoginTokenResolverTest.java index ad6e8b14..93a286db 100644 --- a/src/test/java/space/space_spring/domain/authorization/jwt/model/JwtLoginTokenResolverTest.java +++ b/src/test/java/space/space_spring/domain/authorization/jwt/model/JwtLoginTokenResolverTest.java @@ -3,8 +3,8 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.springframework.mock.web.MockHttpServletRequest; -import space.space_spring.exception.jwt.bad_request.JwtNoTokenException; -import space.space_spring.exception.jwt.bad_request.JwtUnsupportedTokenException; +import space.space_spring.global.exception.jwt.bad_request.JwtNoTokenException; +import space.space_spring.global.exception.jwt.bad_request.JwtUnsupportedTokenException; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; diff --git a/src/test/java/space/space_spring/domain/authorization/jwt/service/JwtServiceTest.java b/src/test/java/space/space_spring/domain/authorization/jwt/service/JwtServiceTest.java index 8d9abe31..15c9c576 100644 --- a/src/test/java/space/space_spring/domain/authorization/jwt/service/JwtServiceTest.java +++ b/src/test/java/space/space_spring/domain/authorization/jwt/service/JwtServiceTest.java @@ -20,9 +20,9 @@ import space.space_spring.domain.user.repository.UserRepository; import space.space_spring.domain.authorization.jwt.model.entity.RefreshTokenStorage; import space.space_spring.domain.user.model.entity.User; -import space.space_spring.entity.enumStatus.UserSignupType; -import space.space_spring.exception.jwt.unauthorized.JwtExpiredTokenException; -import space.space_spring.exception.jwt.unauthorized.JwtUnauthorizedTokenException; +import space.space_spring.global.common.enumStatus.UserSignupType; +import space.space_spring.global.exception.jwt.unauthorized.JwtExpiredTokenException; +import space.space_spring.global.exception.jwt.unauthorized.JwtUnauthorizedTokenException; import java.util.Date; import java.util.Optional; diff --git a/src/test/java/space/space_spring/domain/chat/chatroom/controller/ChatRoomControllerTest.java b/src/test/java/space/space_spring/domain/chat/chatroom/controller/ChatRoomControllerTest.java index 1d494a4c..83973fb7 100644 --- a/src/test/java/space/space_spring/domain/chat/chatroom/controller/ChatRoomControllerTest.java +++ b/src/test/java/space/space_spring/domain/chat/chatroom/controller/ChatRoomControllerTest.java @@ -16,7 +16,7 @@ //import space.space_spring.argumentResolver.jwtLogin.JwtLoginAuthHandlerArgumentResolver; //import space.space_spring.argumentResolver.userSpace.UserSpaceAuthHandlerArgumentResolver; //import space.space_spring.argumentResolver.userSpace.UserSpaceIdHandlerArgumentResolver; -//import space.space_spring.config.SecurityConfig; +//import space.space_spring.global.config.SecurityConfig; //import space.space_spring.domain.chat.chatroom.controller.ChatRoomController; //import space.space_spring.domain.chat.chatroom.model.request.CreateChatRoomRequest; //import space.space_spring.domain.chat.chatroom.model.request.JoinChatRoomRequest; @@ -29,7 +29,7 @@ //import space.space_spring.interceptor.UserSpaceValidationInterceptor; //import space.space_spring.interceptor.jwtLogin.JwtLoginAuthInterceptor; //import space.space_spring.domain.chat.chatroom.service.component.ChatRoomService; -//import space.space_spring.service.S3Uploader; +//import space.space_spring.global.util.S3Uploader; // //import java.nio.charset.StandardCharsets; //import java.util.List; diff --git a/src/test/java/space/space_spring/domain/chat/chatroom/repository/ChatRoomRepositoryTest.java b/src/test/java/space/space_spring/domain/chat/chatroom/repository/ChatRoomRepositoryTest.java index 0c7cfce7..3f6c7a56 100644 --- a/src/test/java/space/space_spring/domain/chat/chatroom/repository/ChatRoomRepositoryTest.java +++ b/src/test/java/space/space_spring/domain/chat/chatroom/repository/ChatRoomRepositoryTest.java @@ -4,7 +4,7 @@ //import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; //import org.springframework.context.annotation.Import; -//import space.space_spring.config.QueryDslConfig; +//import space.space_spring.global.config.QueryDslConfig; //import space.space_spring.domain.chat.chatroom.repository.ChatRoomRepository; //import space.space_spring.domain.chat.chatroom.repository.UserChatRoomRepository; //import space.space_spring.domain.chat.chatroom.model.ChatRoom; diff --git a/src/test/java/space/space_spring/domain/chat/chatroom/repository/UserChatRoomRepositoryTest.java b/src/test/java/space/space_spring/domain/chat/chatroom/repository/UserChatRoomRepositoryTest.java index 7762cbd9..ce5eea38 100644 --- a/src/test/java/space/space_spring/domain/chat/chatroom/repository/UserChatRoomRepositoryTest.java +++ b/src/test/java/space/space_spring/domain/chat/chatroom/repository/UserChatRoomRepositoryTest.java @@ -4,7 +4,7 @@ //import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; //import org.springframework.context.annotation.Import; -//import space.space_spring.config.QueryDslConfig; +//import space.space_spring.global.config.QueryDslConfig; //import space.space_spring.dao.chat.ChatRoomDao; //import space.space_spring.dao.chat.UserChatRoomDao; //import space.space_spring.domain.chat.chatroom.model.ChatRoom; diff --git a/src/test/java/space/space_spring/domain/chat/chatroom/service/ChatRoomServiceTest.java b/src/test/java/space/space_spring/domain/chat/chatroom/service/ChatRoomServiceTest.java index 71ade11e..10104c37 100644 --- a/src/test/java/space/space_spring/domain/chat/chatroom/service/ChatRoomServiceTest.java +++ b/src/test/java/space/space_spring/domain/chat/chatroom/service/ChatRoomServiceTest.java @@ -20,8 +20,8 @@ //import space.space_spring.entity.*; //import space.space_spring.entity.enumStatus.UserSignupType; //import space.space_spring.entity.enumStatus.UserSpaceAuth; -//import space.space_spring.util.space.SpaceUtils; -//import space.space_spring.util.user.UserUtils; +//import space.space_spring.global.util.space.SpaceUtils; +//import space.space_spring.global.util.user.UserUtils; // //import java.nio.charset.StandardCharsets; //import java.time.LocalDateTime; diff --git a/src/test/java/space/space_spring/domain/pay/controller/PayControllerTest.java b/src/test/java/space/space_spring/domain/pay/controller/PayControllerTest.java index 5edea02c..af5eb853 100644 --- a/src/test/java/space/space_spring/domain/pay/controller/PayControllerTest.java +++ b/src/test/java/space/space_spring/domain/pay/controller/PayControllerTest.java @@ -5,27 +5,22 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.FilterType; -import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.security.test.context.support.WithMockUser; import org.springframework.test.web.servlet.MockMvc; -import space.space_spring.argumentResolver.jwtLogin.JwtLoginAuthHandlerArgumentResolver; -import space.space_spring.argumentResolver.userSpace.UserSpaceAuthHandlerArgumentResolver; -import space.space_spring.argumentResolver.userSpace.UserSpaceIdHandlerArgumentResolver; +import space.space_spring.global.argumentResolver.jwtLogin.JwtLoginAuthHandlerArgumentResolver; +import space.space_spring.global.argumentResolver.userSpace.UserSpaceAuthHandlerArgumentResolver; +import space.space_spring.global.argumentResolver.userSpace.UserSpaceIdHandlerArgumentResolver; import space.space_spring.domain.pay.model.request.PayCreateRequest; import space.space_spring.domain.pay.model.request.TargetInfoRequest; import space.space_spring.domain.pay.service.PayService; -import space.space_spring.interceptor.UserSpaceValidationInterceptor; -import space.space_spring.interceptor.jwtLogin.JwtLoginAuthInterceptor; +import space.space_spring.global.interceptor.UserSpaceValidationInterceptor; +import space.space_spring.global.interceptor.jwtLogin.JwtLoginAuthInterceptor; import java.util.List; -import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.any; import static org.mockito.BDDMockito.given; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; diff --git a/src/test/java/space/space_spring/domain/pay/model/EqualSplitPayAmountPolicyTest.java b/src/test/java/space/space_spring/domain/pay/model/EqualSplitPayAmountPolicyTest.java index f2f83be1..ab708905 100644 --- a/src/test/java/space/space_spring/domain/pay/model/EqualSplitPayAmountPolicyTest.java +++ b/src/test/java/space/space_spring/domain/pay/model/EqualSplitPayAmountPolicyTest.java @@ -2,13 +2,13 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import space.space_spring.exception.CustomException; +import space.space_spring.global.exception.CustomException; import java.util.List; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.jupiter.api.Assertions.*; -import static space.space_spring.response.status.BaseExceptionResponseStatus.INVALID_EQUAL_SPLIT_AMOUNT; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.INVALID_EQUAL_SPLIT_AMOUNT; class EqualSplitPayAmountPolicyTest { diff --git a/src/test/java/space/space_spring/domain/pay/model/IndividualPayAmountPolicyTest.java b/src/test/java/space/space_spring/domain/pay/model/IndividualPayAmountPolicyTest.java index 636f3e97..7357f967 100644 --- a/src/test/java/space/space_spring/domain/pay/model/IndividualPayAmountPolicyTest.java +++ b/src/test/java/space/space_spring/domain/pay/model/IndividualPayAmountPolicyTest.java @@ -2,13 +2,13 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import space.space_spring.exception.CustomException; +import space.space_spring.global.exception.CustomException; import java.util.List; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.jupiter.api.Assertions.*; -import static space.space_spring.response.status.BaseExceptionResponseStatus.INVALID_INDIVIDUAL_AMOUNT; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.INVALID_INDIVIDUAL_AMOUNT; class IndividualPayAmountPolicyTest { diff --git a/src/test/java/space/space_spring/domain/pay/model/entity/PayRequestTest.java b/src/test/java/space/space_spring/domain/pay/model/entity/PayRequestTest.java index b984bdf6..2474a471 100644 --- a/src/test/java/space/space_spring/domain/pay/model/entity/PayRequestTest.java +++ b/src/test/java/space/space_spring/domain/pay/model/entity/PayRequestTest.java @@ -6,7 +6,7 @@ import space.space_spring.domain.pay.model.dto.PayRequestInfoDto; import space.space_spring.domain.space.model.entity.Space; import space.space_spring.domain.user.model.entity.User; -import space.space_spring.entity.enumStatus.UserSignupType; +import space.space_spring.global.common.enumStatus.UserSignupType; import static org.assertj.core.api.Assertions.assertThat; diff --git a/src/test/java/space/space_spring/domain/pay/model/firstCollection/PayRequestTargetsTest.java b/src/test/java/space/space_spring/domain/pay/model/firstCollection/PayRequestTargetsTest.java index 9f3ad02c..54f2bc90 100644 --- a/src/test/java/space/space_spring/domain/pay/model/firstCollection/PayRequestTargetsTest.java +++ b/src/test/java/space/space_spring/domain/pay/model/firstCollection/PayRequestTargetsTest.java @@ -1,6 +1,5 @@ package space.space_spring.domain.pay.model.firstCollection; -import org.assertj.core.groups.Tuple; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -9,7 +8,7 @@ import space.space_spring.domain.pay.model.entity.PayRequestTarget; import space.space_spring.domain.space.model.entity.Space; import space.space_spring.domain.user.model.entity.User; -import space.space_spring.entity.enumStatus.UserSignupType; +import space.space_spring.global.common.enumStatus.UserSignupType; import java.util.List; diff --git a/src/test/java/space/space_spring/domain/pay/model/firstCollection/PayRequestsTest.java b/src/test/java/space/space_spring/domain/pay/model/firstCollection/PayRequestsTest.java index 8ca52311..c4eaeaa2 100644 --- a/src/test/java/space/space_spring/domain/pay/model/firstCollection/PayRequestsTest.java +++ b/src/test/java/space/space_spring/domain/pay/model/firstCollection/PayRequestsTest.java @@ -8,7 +8,7 @@ import space.space_spring.domain.pay.model.entity.PayRequestTarget; import space.space_spring.domain.space.model.entity.Space; import space.space_spring.domain.user.model.entity.User; -import space.space_spring.entity.enumStatus.UserSignupType; +import space.space_spring.global.common.enumStatus.UserSignupType; import java.util.List; diff --git a/src/test/java/space/space_spring/domain/pay/service/PayServiceTest.java b/src/test/java/space/space_spring/domain/pay/service/PayServiceTest.java index c0a04b2d..d92f64b7 100644 --- a/src/test/java/space/space_spring/domain/pay/service/PayServiceTest.java +++ b/src/test/java/space/space_spring/domain/pay/service/PayServiceTest.java @@ -23,14 +23,14 @@ import space.space_spring.domain.user.repository.UserRepository; import space.space_spring.domain.space.model.entity.Space; import space.space_spring.domain.userSpace.model.entity.UserSpace; -import space.space_spring.entity.enumStatus.UserSignupType; -import space.space_spring.entity.enumStatus.UserSpaceAuth; -import space.space_spring.exception.CustomException; +import space.space_spring.global.common.enumStatus.UserSignupType; +import space.space_spring.global.common.enumStatus.UserSpaceAuth; +import space.space_spring.global.exception.CustomException; import java.util.List; import static org.assertj.core.api.Assertions.*; -import static space.space_spring.response.status.BaseExceptionResponseStatus.*; +import static space.space_spring.global.common.response.status.BaseExceptionResponseStatus.*; @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @Transactional diff --git a/src/test/java/space/space_spring/service/UserServiceTest.java b/src/test/java/space/space_spring/domain/user/service/UserServiceTest.java similarity index 97% rename from src/test/java/space/space_spring/service/UserServiceTest.java rename to src/test/java/space/space_spring/domain/user/service/UserServiceTest.java index d0a19710..8aaac712 100644 --- a/src/test/java/space/space_spring/service/UserServiceTest.java +++ b/src/test/java/space/space_spring/domain/user/service/UserServiceTest.java @@ -1,4 +1,4 @@ -package space.space_spring.service; +package space.space_spring.domain.user.service; import org.springframework.boot.test.context.SpringBootTest;