Skip to content

Commit

Permalink
refactor: 동행 멤버 관련 코드 삭제 및 커뮤니티 댓글 관련 패키지 구조 조정
Browse files Browse the repository at this point in the history
- AccompanyMemberController 등 동행 멤버 관련 코드 삭제
- CommunityComment 관련 클래스 패키지 구조 조정 및 리팩토링

Signed-off-by: Namgyu11 <[email protected]>
  • Loading branch information
Namgyu11 committed Sep 30, 2024
1 parent c1afe54 commit f689ec8
Show file tree
Hide file tree
Showing 64 changed files with 248 additions and 431 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package connectripbe.connectrip_be.comment.dto;
package connectripbe.connectrip_be.accompany.comment.dto;

import connectripbe.connectrip_be.comment.entity.AccompanyCommentEntity;
import connectripbe.connectrip_be.accompany.comment.entity.AccompanyCommentEntity;
import connectripbe.connectrip_be.accompany.post.entity.AccompanyPostEntity;
import connectripbe.connectrip_be.member.entity.MemberEntity;
import connectripbe.connectrip_be.post.entity.AccompanyPostEntity;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package connectripbe.connectrip_be.comment.dto;
package connectripbe.connectrip_be.accompany.comment.dto;

import connectripbe.connectrip_be.comment.entity.AccompanyCommentEntity;
import connectripbe.connectrip_be.accompany.comment.entity.AccompanyCommentEntity;
import connectripbe.connectrip_be.global.util.time.DateTimeUtils;
import lombok.AllArgsConstructor;
import lombok.Builder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package connectripbe.connectrip_be.comment.entity;
package connectripbe.connectrip_be.accompany.comment.entity;

import connectripbe.connectrip_be.accompany.post.entity.AccompanyPostEntity;
import connectripbe.connectrip_be.global.entity.BaseEntity;
import connectripbe.connectrip_be.member.entity.MemberEntity;
import connectripbe.connectrip_be.post.entity.AccompanyPostEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package connectripbe.connectrip_be.comment.repository;

import connectripbe.connectrip_be.comment.entity.AccompanyCommentEntity;
import org.springframework.data.jpa.repository.JpaRepository;
package connectripbe.connectrip_be.accompany.comment.repository;

import connectripbe.connectrip_be.accompany.comment.entity.AccompanyCommentEntity;
import java.util.List;
import java.util.Optional;
import org.springframework.data.jpa.repository.JpaRepository;

public interface AccompanyCommentRepository extends JpaRepository<AccompanyCommentEntity, Long> {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package connectripbe.connectrip_be.comment.service;

import connectripbe.connectrip_be.comment.dto.AccompanyCommentRequest;
import connectripbe.connectrip_be.comment.dto.AccompanyCommentResponse;
package connectripbe.connectrip_be.accompany.comment.service;

import connectripbe.connectrip_be.accompany.comment.dto.AccompanyCommentRequest;
import connectripbe.connectrip_be.accompany.comment.dto.AccompanyCommentResponse;
import java.util.List;

public interface AccompanyCommentService {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package connectripbe.connectrip_be.comment.service.impl;

import connectripbe.connectrip_be.comment.dto.AccompanyCommentRequest;
import connectripbe.connectrip_be.comment.dto.AccompanyCommentResponse;
import connectripbe.connectrip_be.comment.entity.AccompanyCommentEntity;
import connectripbe.connectrip_be.comment.repository.AccompanyCommentRepository;
import connectripbe.connectrip_be.comment.service.AccompanyCommentService;
package connectripbe.connectrip_be.accompany.comment.service.impl;

import connectripbe.connectrip_be.accompany.comment.dto.AccompanyCommentRequest;
import connectripbe.connectrip_be.accompany.comment.dto.AccompanyCommentResponse;
import connectripbe.connectrip_be.accompany.comment.entity.AccompanyCommentEntity;
import connectripbe.connectrip_be.accompany.comment.repository.AccompanyCommentRepository;
import connectripbe.connectrip_be.accompany.comment.service.AccompanyCommentService;
import connectripbe.connectrip_be.accompany.post.entity.AccompanyPostEntity;
import connectripbe.connectrip_be.accompany.post.repository.AccompanyPostRepository;
import connectripbe.connectrip_be.global.exception.GlobalException;
import connectripbe.connectrip_be.global.exception.type.ErrorCode;
import connectripbe.connectrip_be.global.util.bucket4j.annotation.RateLimit;
import connectripbe.connectrip_be.member.entity.MemberEntity;
import connectripbe.connectrip_be.member.repository.MemberJpaRepository;
import connectripbe.connectrip_be.notification.service.NotificationService;
import connectripbe.connectrip_be.post.entity.AccompanyPostEntity;
import connectripbe.connectrip_be.post.repository.AccompanyPostRepository;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
package connectripbe.connectrip_be.comment.web;
package connectripbe.connectrip_be.accompany.comment.web;

import connectripbe.connectrip_be.comment.dto.AccompanyCommentRequest;
import connectripbe.connectrip_be.comment.dto.AccompanyCommentResponse;
import connectripbe.connectrip_be.comment.service.AccompanyCommentService;
import connectripbe.connectrip_be.accompany.comment.dto.AccompanyCommentRequest;
import connectripbe.connectrip_be.accompany.comment.dto.AccompanyCommentResponse;
import connectripbe.connectrip_be.accompany.comment.service.AccompanyCommentService;
import jakarta.validation.Valid;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("api/v1/comment")
Expand All @@ -20,8 +25,7 @@ public class AccompanyCommentController {
private final AccompanyCommentService accompanyCommentService;

/**
* 특정 게시물의 댓글 목록 조회.
* 주어진 게시물 ID에 해당하는 모든 댓글을 조회하여 반환합니다.
* 특정 게시물의 댓글 목록 조회. 주어진 게시물 ID에 해당하는 모든 댓글을 조회하여 반환합니다.
*
* @param postId 댓글을 조회할 게시물의 ID
* @return 댓글 목록을 담은 ResponseEntity<List<AccompanyCommentResponse>>
Expand All @@ -35,9 +39,7 @@ public ResponseEntity<List<AccompanyCommentResponse>> getCommentList(
}

/**
* 댓글 생성.
* 주어진 요청 정보와 로그인한 사용자의 이메일을 이용해 댓글을 생성하고, 생성된 댓글을 반환합니다.
* 로그인한 사용자만 댓글을 작성할 수 있습니다.
* 댓글 생성. 주어진 요청 정보와 로그인한 사용자의 이메일을 이용해 댓글을 생성하고, 생성된 댓글을 반환합니다. 로그인한 사용자만 댓글을 작성할 수 있습니다.
*
* @param request 댓글 생성 요청 정보 (게시물 ID, 댓글 내용 포함)
* @param memberId 로그인한 사용자의 아이디
Expand All @@ -53,9 +55,7 @@ public ResponseEntity<AccompanyCommentResponse> createComment(
}

/**
* 댓글 삭제.
* 주어진 댓글 ID에 해당하는 댓글을 삭제합니다.
* 로그인한 사용자만 자신의 댓글을 삭제할 수 있습니다.
* 댓글 삭제. 주어진 댓글 ID에 해당하는 댓글을 삭제합니다. 로그인한 사용자만 자신의 댓글을 삭제할 수 있습니다.
*
* @param memberId 로그인한 사용자의 아이디
* @param commentId 삭제할 댓글의 아이디
Expand All @@ -71,9 +71,7 @@ public ResponseEntity<?> deleteComment(
}

/**
* 댓글 수정.
* 주어진 요청 정보와 댓글 ID를 이용해 댓글을 수정하고, 수정된 댓글을 반환합니다.
* 로그인한 사용자만 자신의 댓글을 수정할 수 있습니다.
* 댓글 수정. 주어진 요청 정보와 댓글 ID를 이용해 댓글을 수정하고, 수정된 댓글을 반환합니다. 로그인한 사용자만 자신의 댓글을 수정할 수 있습니다.
*
* @param commentId 수정할 댓글의 ID
* @param request 댓글 수정 요청 정보 (수정된 댓글 내용 포함)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package connectripbe.connectrip_be.post.dto;
package connectripbe.connectrip_be.accompany.post.dto;

import static org.springframework.util.StringUtils.truncate;

import connectripbe.connectrip_be.accompany.post.entity.AccompanyPostEntity;
import connectripbe.connectrip_be.global.util.time.DateTimeUtils;
import connectripbe.connectrip_be.post.entity.AccompanyPostEntity;
import lombok.Builder;

// todo-noah: 이름 변경, utc 분리
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package connectripbe.connectrip_be.post.dto;
package connectripbe.connectrip_be.accompany.post.dto;

import connectripbe.connectrip_be.accompany.post.entity.AccompanyPostEntity;
import connectripbe.connectrip_be.chat.entity.ChatRoomEntity;
import connectripbe.connectrip_be.global.util.time.DateTimeUtils;
import connectripbe.connectrip_be.post.entity.AccompanyPostEntity;
import lombok.Builder;

@Builder
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package connectripbe.connectrip_be.post.dto;
package connectripbe.connectrip_be.accompany.post.dto;

public record CheckDuplicatedCustomUrlDto(boolean isDuplicatedCustomUrl) {
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package connectripbe.connectrip_be.post.dto;
package connectripbe.connectrip_be.accompany.post.dto;

import java.time.LocalDateTime;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package connectripbe.connectrip_be.post.dto;
package connectripbe.connectrip_be.accompany.post.dto;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package connectripbe.connectrip_be.post.dto;
package connectripbe.connectrip_be.accompany.post.dto;

import java.time.LocalDateTime;
import lombok.Builder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package connectripbe.connectrip_be.post.entity;
package connectripbe.connectrip_be.accompany.post.entity;

import connectripbe.connectrip_be.global.entity.BaseEntity;
import connectripbe.connectrip_be.member.entity.MemberEntity;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package connectripbe.connectrip_be.post.entity.enums;
package connectripbe.connectrip_be.accompany.post.entity.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package connectripbe.connectrip_be.post.exception;
package connectripbe.connectrip_be.accompany.post.exception;

import connectripbe.connectrip_be.global.exception.GlobalException;
import connectripbe.connectrip_be.global.exception.type.ErrorCode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package connectripbe.connectrip_be.post.exception;
package connectripbe.connectrip_be.accompany.post.exception;

import connectripbe.connectrip_be.global.exception.GlobalException;
import connectripbe.connectrip_be.global.exception.type.ErrorCode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package connectripbe.connectrip_be.post.repository;
package connectripbe.connectrip_be.accompany.post.repository;

import connectripbe.connectrip_be.post.entity.AccompanyPostEntity;
import connectripbe.connectrip_be.accompany.post.entity.AccompanyPostEntity;
import java.util.Optional;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package connectripbe.connectrip_be.post.service;
package connectripbe.connectrip_be.accompany.post.service;

import connectripbe.connectrip_be.post.dto.AccompanyPostResponse;
import connectripbe.connectrip_be.post.dto.CreateAccompanyPostRequest;
import connectripbe.connectrip_be.post.dto.SearchAccompanyPostSummaryResponse;
import connectripbe.connectrip_be.post.dto.UpdateAccompanyPostRequest;
import connectripbe.connectrip_be.accompany.post.dto.AccompanyPostResponse;
import connectripbe.connectrip_be.accompany.post.dto.CreateAccompanyPostRequest;
import connectripbe.connectrip_be.accompany.post.dto.SearchAccompanyPostSummaryResponse;
import connectripbe.connectrip_be.accompany.post.dto.UpdateAccompanyPostRequest;


public interface AccompanyPostService {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
package connectripbe.connectrip_be.post.service.impl;

import connectripbe.connectrip_be.accompany_status.entity.AccompanyStatusEntity;
import connectripbe.connectrip_be.accompany_status.entity.AccompanyStatusEnum;
import connectripbe.connectrip_be.accompany_status.repository.AccompanyStatusJpaRepository;
package connectripbe.connectrip_be.accompany.post.service.impl;

import connectripbe.connectrip_be.accompany.post.dto.AccompanyPostListResponse;
import connectripbe.connectrip_be.accompany.post.dto.AccompanyPostResponse;
import connectripbe.connectrip_be.accompany.post.dto.CreateAccompanyPostRequest;
import connectripbe.connectrip_be.accompany.post.dto.SearchAccompanyPostSummaryResponse;
import connectripbe.connectrip_be.accompany.post.dto.UpdateAccompanyPostRequest;
import connectripbe.connectrip_be.accompany.post.entity.AccompanyPostEntity;
import connectripbe.connectrip_be.accompany.post.exception.NotFoundAccompanyPostException;
import connectripbe.connectrip_be.accompany.post.repository.AccompanyPostRepository;
import connectripbe.connectrip_be.accompany.post.service.AccompanyPostService;
import connectripbe.connectrip_be.accompany.status.entity.AccompanyStatusEntity;
import connectripbe.connectrip_be.accompany.status.entity.AccompanyStatusEnum;
import connectripbe.connectrip_be.accompany.status.repository.AccompanyStatusJpaRepository;
import connectripbe.connectrip_be.chat.entity.ChatRoomEntity;
import connectripbe.connectrip_be.chat.repository.ChatRoomRepository;
import connectripbe.connectrip_be.chat.service.ChatRoomService;
Expand All @@ -13,15 +22,6 @@
import connectripbe.connectrip_be.member.exception.MemberNotOwnerException;
import connectripbe.connectrip_be.member.exception.NotFoundMemberException;
import connectripbe.connectrip_be.member.repository.MemberJpaRepository;
import connectripbe.connectrip_be.post.dto.AccompanyPostListResponse;
import connectripbe.connectrip_be.post.dto.AccompanyPostResponse;
import connectripbe.connectrip_be.post.dto.CreateAccompanyPostRequest;
import connectripbe.connectrip_be.post.dto.SearchAccompanyPostSummaryResponse;
import connectripbe.connectrip_be.post.dto.UpdateAccompanyPostRequest;
import connectripbe.connectrip_be.post.entity.AccompanyPostEntity;
import connectripbe.connectrip_be.post.exception.NotFoundAccompanyPostException;
import connectripbe.connectrip_be.post.repository.AccompanyPostRepository;
import connectripbe.connectrip_be.post.service.AccompanyPostService;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package connectripbe.connectrip_be.post.web;
package connectripbe.connectrip_be.accompany.post.web;

import connectripbe.connectrip_be.accompany.post.dto.AccompanyPostResponse;
import connectripbe.connectrip_be.accompany.post.dto.CheckDuplicatedCustomUrlDto;
import connectripbe.connectrip_be.accompany.post.dto.CreateAccompanyPostRequest;
import connectripbe.connectrip_be.accompany.post.dto.SearchAccompanyPostSummaryResponse;
import connectripbe.connectrip_be.accompany.post.dto.UpdateAccompanyPostRequest;
import connectripbe.connectrip_be.accompany.post.exception.DuplicatedCustomUrlException;
import connectripbe.connectrip_be.accompany.post.service.AccompanyPostService;
import connectripbe.connectrip_be.global.dto.GlobalResponse;
import connectripbe.connectrip_be.post.dto.AccompanyPostResponse;
import connectripbe.connectrip_be.post.dto.CheckDuplicatedCustomUrlDto;
import connectripbe.connectrip_be.post.dto.CreateAccompanyPostRequest;
import connectripbe.connectrip_be.post.dto.SearchAccompanyPostSummaryResponse;
import connectripbe.connectrip_be.post.dto.UpdateAccompanyPostRequest;
import connectripbe.connectrip_be.post.exception.DuplicatedCustomUrlException;
import connectripbe.connectrip_be.post.service.AccompanyPostService;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package connectripbe.connectrip_be.post.web;
package connectripbe.connectrip_be.accompany.post.web;

import connectripbe.connectrip_be.post.entity.AccompanyPostEntity;
import connectripbe.connectrip_be.post.exception.NotFoundAccompanyPostException;
import connectripbe.connectrip_be.post.repository.AccompanyPostRepository;
import connectripbe.connectrip_be.accompany.post.entity.AccompanyPostEntity;
import connectripbe.connectrip_be.accompany.post.exception.NotFoundAccompanyPostException;
import connectripbe.connectrip_be.accompany.post.repository.AccompanyPostRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package connectripbe.connectrip_be.accompany_status.entity;
package connectripbe.connectrip_be.accompany.status.entity;

import connectripbe.connectrip_be.accompany.post.entity.AccompanyPostEntity;
import connectripbe.connectrip_be.global.entity.BaseEntity;
import connectripbe.connectrip_be.post.entity.AccompanyPostEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.EnumType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package connectripbe.connectrip_be.accompany_status.entity;
package connectripbe.connectrip_be.accompany.status.entity;

import lombok.Getter;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package connectripbe.connectrip_be.accompany_status.exception;
package connectripbe.connectrip_be.accompany.status.exception;

import connectripbe.connectrip_be.global.exception.GlobalException;
import connectripbe.connectrip_be.global.exception.type.ErrorCode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package connectripbe.connectrip_be.accompany_status.exception;
package connectripbe.connectrip_be.accompany.status.exception;

import connectripbe.connectrip_be.global.exception.GlobalException;
import connectripbe.connectrip_be.global.exception.type.ErrorCode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package connectripbe.connectrip_be.accompany_status.repository;
package connectripbe.connectrip_be.accompany.status.repository;

import connectripbe.connectrip_be.accompany_status.entity.AccompanyStatusEntity;
import connectripbe.connectrip_be.post.entity.AccompanyPostEntity;
import connectripbe.connectrip_be.accompany.post.entity.AccompanyPostEntity;
import connectripbe.connectrip_be.accompany.status.entity.AccompanyStatusEntity;
import java.util.Optional;
import org.springframework.data.jpa.repository.JpaRepository;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package connectripbe.connectrip_be.accompany_status.response;
package connectripbe.connectrip_be.accompany.status.response;

import connectripbe.connectrip_be.accompany_status.entity.AccompanyStatusEnum;
import connectripbe.connectrip_be.accompany.status.entity.AccompanyStatusEnum;

public record AccompanyStatusResponse(
long accompanyPostId,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package connectripbe.connectrip_be.accompany_status.service;
package connectripbe.connectrip_be.accompany.status.service;

import connectripbe.connectrip_be.accompany_status.response.AccompanyStatusResponse;
import connectripbe.connectrip_be.accompany.status.response.AccompanyStatusResponse;

public interface AccompanyStatusService {

Expand Down
Loading

0 comments on commit f689ec8

Please sign in to comment.