From a0ff442682e20db8a812604e881acf486ba56240 Mon Sep 17 00:00:00 2001 From: nar0ng <71819594+nar0ng@users.noreply.github.com> Date: Wed, 14 Aug 2024 21:46:36 +0900 Subject: [PATCH 1/8] =?UTF-8?q?chore:=20log.domain=20->=20log=EB=A1=9C=20?= =?UTF-8?q?=ED=8F=B4=EB=8D=94=EA=B5=AC=EC=A1=B0=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../log/{domain => }/ActivityType.java | 2 +- .../log/{domain => }/ApplicationType.java | 2 +- .../growingpain/log/{domain => }/Result.java | 2 +- .../controller/JobPostController.java | 12 +++++------ .../dto/ApplicationDetailDTO.java | 4 ++-- .../dto/ApplicationDetailRequestDTO.java | 6 +++--- .../dto/JobApplicationListRetrieveDTO.java | 4 ++-- .../dto/JobApplicationRequestDTO.java | 12 +++++------ .../dto/JobApplicationRetrieveDTO.java | 4 ++-- .../dto/JobPostListRetrieveDTO.java | 4 ++-- .../{domain => }/dto/JobPostRequestDTO.java | 6 +++--- .../{domain => }/dto/JobPostRetrieveDTO.java | 4 ++-- .../log/{domain => }/entity/ActivityLog.java | 4 ++-- .../entity/ApplicationDetail.java | 4 ++-- .../{domain => }/entity/JobApplication.java | 12 +++++------ .../log/{domain => }/entity/JobPost.java | 10 +++++----- .../ApplicationDetailRepository.java | 4 ++-- .../repository/JobApplicationRepository.java | 4 ++-- .../repository/JobPostRepository.java | 4 ++-- .../service/JobApplicationService.java | 2 +- .../log/{domain => }/service/JobService.java | 20 +++++++++---------- .../member/domain/entity/Member.java | 11 +++++----- 22 files changed, 69 insertions(+), 68 deletions(-) rename src/main/java/cotato/growingpain/log/{domain => }/ActivityType.java (90%) rename src/main/java/cotato/growingpain/log/{domain => }/ApplicationType.java (89%) rename src/main/java/cotato/growingpain/log/{domain => }/Result.java (88%) rename src/main/java/cotato/growingpain/log/{domain => }/controller/JobPostController.java (92%) rename src/main/java/cotato/growingpain/log/{domain => }/dto/ApplicationDetailDTO.java (82%) rename src/main/java/cotato/growingpain/log/{domain => }/dto/ApplicationDetailRequestDTO.java (69%) rename src/main/java/cotato/growingpain/log/{domain => }/dto/JobApplicationListRetrieveDTO.java (90%) rename src/main/java/cotato/growingpain/log/{domain => }/dto/JobApplicationRequestDTO.java (82%) rename src/main/java/cotato/growingpain/log/{domain => }/dto/JobApplicationRetrieveDTO.java (93%) rename src/main/java/cotato/growingpain/log/{domain => }/dto/JobPostListRetrieveDTO.java (88%) rename src/main/java/cotato/growingpain/log/{domain => }/dto/JobPostRequestDTO.java (87%) rename src/main/java/cotato/growingpain/log/{domain => }/dto/JobPostRetrieveDTO.java (89%) rename src/main/java/cotato/growingpain/log/{domain => }/entity/ActivityLog.java (97%) rename src/main/java/cotato/growingpain/log/{domain => }/entity/ApplicationDetail.java (95%) rename src/main/java/cotato/growingpain/log/{domain => }/entity/JobApplication.java (94%) rename src/main/java/cotato/growingpain/log/{domain => }/entity/JobPost.java (92%) rename src/main/java/cotato/growingpain/log/{domain => }/repository/ApplicationDetailRepository.java (58%) rename src/main/java/cotato/growingpain/log/{domain => }/repository/JobApplicationRepository.java (68%) rename src/main/java/cotato/growingpain/log/{domain => }/repository/JobPostRepository.java (73%) rename src/main/java/cotato/growingpain/log/{domain => }/service/JobApplicationService.java (85%) rename src/main/java/cotato/growingpain/log/{domain => }/service/JobService.java (85%) diff --git a/src/main/java/cotato/growingpain/log/domain/ActivityType.java b/src/main/java/cotato/growingpain/log/ActivityType.java similarity index 90% rename from src/main/java/cotato/growingpain/log/domain/ActivityType.java rename to src/main/java/cotato/growingpain/log/ActivityType.java index 3e6d6b5..8c25e47 100644 --- a/src/main/java/cotato/growingpain/log/domain/ActivityType.java +++ b/src/main/java/cotato/growingpain/log/ActivityType.java @@ -1,4 +1,4 @@ -package cotato.growingpain.log.domain; +package cotato.growingpain.log; import lombok.Getter; diff --git a/src/main/java/cotato/growingpain/log/domain/ApplicationType.java b/src/main/java/cotato/growingpain/log/ApplicationType.java similarity index 89% rename from src/main/java/cotato/growingpain/log/domain/ApplicationType.java rename to src/main/java/cotato/growingpain/log/ApplicationType.java index 952d010..9382074 100644 --- a/src/main/java/cotato/growingpain/log/domain/ApplicationType.java +++ b/src/main/java/cotato/growingpain/log/ApplicationType.java @@ -1,4 +1,4 @@ -package cotato.growingpain.log.domain; +package cotato.growingpain.log; import lombok.Getter; diff --git a/src/main/java/cotato/growingpain/log/domain/Result.java b/src/main/java/cotato/growingpain/log/Result.java similarity index 88% rename from src/main/java/cotato/growingpain/log/domain/Result.java rename to src/main/java/cotato/growingpain/log/Result.java index c6ab354..a523340 100644 --- a/src/main/java/cotato/growingpain/log/domain/Result.java +++ b/src/main/java/cotato/growingpain/log/Result.java @@ -1,4 +1,4 @@ -package cotato.growingpain.log.domain; +package cotato.growingpain.log; import lombok.Getter; diff --git a/src/main/java/cotato/growingpain/log/domain/controller/JobPostController.java b/src/main/java/cotato/growingpain/log/controller/JobPostController.java similarity index 92% rename from src/main/java/cotato/growingpain/log/domain/controller/JobPostController.java rename to src/main/java/cotato/growingpain/log/controller/JobPostController.java index b3e0216..9c1a8a9 100644 --- a/src/main/java/cotato/growingpain/log/domain/controller/JobPostController.java +++ b/src/main/java/cotato/growingpain/log/controller/JobPostController.java @@ -1,11 +1,11 @@ -package cotato.growingpain.log.domain.controller; +package cotato.growingpain.log.controller; import cotato.growingpain.common.Response; -import cotato.growingpain.log.domain.dto.JobPostListRetrieveDTO; -import cotato.growingpain.log.domain.dto.JobPostRequestDTO; -import cotato.growingpain.log.domain.dto.JobPostRetrieveDTO; -import cotato.growingpain.log.domain.entity.JobPost; -import cotato.growingpain.log.domain.service.JobService; +import cotato.growingpain.log.dto.JobPostListRetrieveDTO; +import cotato.growingpain.log.dto.JobPostRequestDTO; +import cotato.growingpain.log.dto.JobPostRetrieveDTO; +import cotato.growingpain.log.entity.JobPost; +import cotato.growingpain.log.service.JobService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.media.Content; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/src/main/java/cotato/growingpain/log/domain/dto/ApplicationDetailDTO.java b/src/main/java/cotato/growingpain/log/dto/ApplicationDetailDTO.java similarity index 82% rename from src/main/java/cotato/growingpain/log/domain/dto/ApplicationDetailDTO.java rename to src/main/java/cotato/growingpain/log/dto/ApplicationDetailDTO.java index d0162bb..d1c3ce6 100644 --- a/src/main/java/cotato/growingpain/log/domain/dto/ApplicationDetailDTO.java +++ b/src/main/java/cotato/growingpain/log/dto/ApplicationDetailDTO.java @@ -1,6 +1,6 @@ -package cotato.growingpain.log.domain.dto; +package cotato.growingpain.log.dto; -import cotato.growingpain.log.domain.entity.ApplicationDetail; +import cotato.growingpain.log.entity.ApplicationDetail; import lombok.Builder; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/cotato/growingpain/log/domain/dto/ApplicationDetailRequestDTO.java b/src/main/java/cotato/growingpain/log/dto/ApplicationDetailRequestDTO.java similarity index 69% rename from src/main/java/cotato/growingpain/log/domain/dto/ApplicationDetailRequestDTO.java rename to src/main/java/cotato/growingpain/log/dto/ApplicationDetailRequestDTO.java index b461078..ab91ef5 100644 --- a/src/main/java/cotato/growingpain/log/domain/dto/ApplicationDetailRequestDTO.java +++ b/src/main/java/cotato/growingpain/log/dto/ApplicationDetailRequestDTO.java @@ -1,7 +1,7 @@ -package cotato.growingpain.log.domain.dto; +package cotato.growingpain.log.dto; -import cotato.growingpain.log.domain.entity.ApplicationDetail; -import cotato.growingpain.log.domain.entity.JobApplication; +import cotato.growingpain.log.entity.ApplicationDetail; +import cotato.growingpain.log.entity.JobApplication; public record ApplicationDetailRequestDTO( Long id, diff --git a/src/main/java/cotato/growingpain/log/domain/dto/JobApplicationListRetrieveDTO.java b/src/main/java/cotato/growingpain/log/dto/JobApplicationListRetrieveDTO.java similarity index 90% rename from src/main/java/cotato/growingpain/log/domain/dto/JobApplicationListRetrieveDTO.java rename to src/main/java/cotato/growingpain/log/dto/JobApplicationListRetrieveDTO.java index 0ac7f8e..bb409d9 100644 --- a/src/main/java/cotato/growingpain/log/domain/dto/JobApplicationListRetrieveDTO.java +++ b/src/main/java/cotato/growingpain/log/dto/JobApplicationListRetrieveDTO.java @@ -1,6 +1,6 @@ -package cotato.growingpain.log.domain.dto; +package cotato.growingpain.log.dto; -import cotato.growingpain.log.domain.entity.JobApplication; +import cotato.growingpain.log.entity.JobApplication; import lombok.Builder; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/cotato/growingpain/log/domain/dto/JobApplicationRequestDTO.java b/src/main/java/cotato/growingpain/log/dto/JobApplicationRequestDTO.java similarity index 82% rename from src/main/java/cotato/growingpain/log/domain/dto/JobApplicationRequestDTO.java rename to src/main/java/cotato/growingpain/log/dto/JobApplicationRequestDTO.java index b53bea9..a70e922 100644 --- a/src/main/java/cotato/growingpain/log/domain/dto/JobApplicationRequestDTO.java +++ b/src/main/java/cotato/growingpain/log/dto/JobApplicationRequestDTO.java @@ -1,10 +1,10 @@ -package cotato.growingpain.log.domain.dto; +package cotato.growingpain.log.dto; -import cotato.growingpain.log.domain.ApplicationType; -import cotato.growingpain.log.domain.Result; -import cotato.growingpain.log.domain.entity.ApplicationDetail; -import cotato.growingpain.log.domain.entity.JobApplication; -import cotato.growingpain.log.domain.entity.JobPost; +import cotato.growingpain.log.ApplicationType; +import cotato.growingpain.log.Result; +import cotato.growingpain.log.entity.ApplicationDetail; +import cotato.growingpain.log.entity.JobApplication; +import cotato.growingpain.log.entity.JobPost; import cotato.growingpain.member.domain.entity.Member; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/cotato/growingpain/log/domain/dto/JobApplicationRetrieveDTO.java b/src/main/java/cotato/growingpain/log/dto/JobApplicationRetrieveDTO.java similarity index 93% rename from src/main/java/cotato/growingpain/log/domain/dto/JobApplicationRetrieveDTO.java rename to src/main/java/cotato/growingpain/log/dto/JobApplicationRetrieveDTO.java index 5769a1c..899efbe 100644 --- a/src/main/java/cotato/growingpain/log/domain/dto/JobApplicationRetrieveDTO.java +++ b/src/main/java/cotato/growingpain/log/dto/JobApplicationRetrieveDTO.java @@ -1,6 +1,6 @@ -package cotato.growingpain.log.domain.dto; +package cotato.growingpain.log.dto; -import cotato.growingpain.log.domain.entity.JobApplication; +import cotato.growingpain.log.entity.JobApplication; import java.util.List; import lombok.Builder; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/cotato/growingpain/log/domain/dto/JobPostListRetrieveDTO.java b/src/main/java/cotato/growingpain/log/dto/JobPostListRetrieveDTO.java similarity index 88% rename from src/main/java/cotato/growingpain/log/domain/dto/JobPostListRetrieveDTO.java rename to src/main/java/cotato/growingpain/log/dto/JobPostListRetrieveDTO.java index dde7278..ebf9246 100644 --- a/src/main/java/cotato/growingpain/log/domain/dto/JobPostListRetrieveDTO.java +++ b/src/main/java/cotato/growingpain/log/dto/JobPostListRetrieveDTO.java @@ -1,6 +1,6 @@ -package cotato.growingpain.log.domain.dto; +package cotato.growingpain.log.dto; -import cotato.growingpain.log.domain.entity.JobPost; +import cotato.growingpain.log.entity.JobPost; import java.util.List; import lombok.Builder; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/cotato/growingpain/log/domain/dto/JobPostRequestDTO.java b/src/main/java/cotato/growingpain/log/dto/JobPostRequestDTO.java similarity index 87% rename from src/main/java/cotato/growingpain/log/domain/dto/JobPostRequestDTO.java rename to src/main/java/cotato/growingpain/log/dto/JobPostRequestDTO.java index 8ad9ee1..c676a71 100644 --- a/src/main/java/cotato/growingpain/log/domain/dto/JobPostRequestDTO.java +++ b/src/main/java/cotato/growingpain/log/dto/JobPostRequestDTO.java @@ -1,7 +1,7 @@ -package cotato.growingpain.log.domain.dto; +package cotato.growingpain.log.dto; -import cotato.growingpain.log.domain.entity.JobApplication; -import cotato.growingpain.log.domain.entity.JobPost; +import cotato.growingpain.log.entity.JobApplication; +import cotato.growingpain.log.entity.JobPost; import cotato.growingpain.member.domain.entity.Member; import jakarta.validation.constraints.NotBlank; import java.util.ArrayList; diff --git a/src/main/java/cotato/growingpain/log/domain/dto/JobPostRetrieveDTO.java b/src/main/java/cotato/growingpain/log/dto/JobPostRetrieveDTO.java similarity index 89% rename from src/main/java/cotato/growingpain/log/domain/dto/JobPostRetrieveDTO.java rename to src/main/java/cotato/growingpain/log/dto/JobPostRetrieveDTO.java index 6341e65..c2c3407 100644 --- a/src/main/java/cotato/growingpain/log/domain/dto/JobPostRetrieveDTO.java +++ b/src/main/java/cotato/growingpain/log/dto/JobPostRetrieveDTO.java @@ -1,6 +1,6 @@ -package cotato.growingpain.log.domain.dto; +package cotato.growingpain.log.dto; -import cotato.growingpain.log.domain.entity.JobPost; +import cotato.growingpain.log.entity.JobPost; import java.util.List; import lombok.Builder; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/cotato/growingpain/log/domain/entity/ActivityLog.java b/src/main/java/cotato/growingpain/log/entity/ActivityLog.java similarity index 97% rename from src/main/java/cotato/growingpain/log/domain/entity/ActivityLog.java rename to src/main/java/cotato/growingpain/log/entity/ActivityLog.java index 229d0ea..47bad60 100644 --- a/src/main/java/cotato/growingpain/log/domain/entity/ActivityLog.java +++ b/src/main/java/cotato/growingpain/log/entity/ActivityLog.java @@ -1,8 +1,8 @@ -package cotato.growingpain.log.domain.entity; +package cotato.growingpain.log.entity; import com.fasterxml.jackson.annotation.JsonIgnore; import cotato.growingpain.common.domain.BaseTimeEntity; -import cotato.growingpain.log.domain.ActivityType; +import cotato.growingpain.log.ActivityType; import cotato.growingpain.member.domain.entity.Member; import jakarta.persistence.Column; import jakarta.persistence.Entity; diff --git a/src/main/java/cotato/growingpain/log/domain/entity/ApplicationDetail.java b/src/main/java/cotato/growingpain/log/entity/ApplicationDetail.java similarity index 95% rename from src/main/java/cotato/growingpain/log/domain/entity/ApplicationDetail.java rename to src/main/java/cotato/growingpain/log/entity/ApplicationDetail.java index 959cb01..5203869 100644 --- a/src/main/java/cotato/growingpain/log/domain/entity/ApplicationDetail.java +++ b/src/main/java/cotato/growingpain/log/entity/ApplicationDetail.java @@ -1,8 +1,8 @@ -package cotato.growingpain.log.domain.entity; +package cotato.growingpain.log.entity; import com.fasterxml.jackson.annotation.JsonBackReference; import com.fasterxml.jackson.annotation.JsonIgnore; -import cotato.growingpain.log.domain.dto.ApplicationDetailRequestDTO; +import cotato.growingpain.log.dto.ApplicationDetailRequestDTO; import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.FetchType; diff --git a/src/main/java/cotato/growingpain/log/domain/entity/JobApplication.java b/src/main/java/cotato/growingpain/log/entity/JobApplication.java similarity index 94% rename from src/main/java/cotato/growingpain/log/domain/entity/JobApplication.java rename to src/main/java/cotato/growingpain/log/entity/JobApplication.java index aa7f097..6655f4a 100644 --- a/src/main/java/cotato/growingpain/log/domain/entity/JobApplication.java +++ b/src/main/java/cotato/growingpain/log/entity/JobApplication.java @@ -1,14 +1,14 @@ -package cotato.growingpain.log.domain.entity; +package cotato.growingpain.log.entity; import com.fasterxml.jackson.annotation.JsonBackReference; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonManagedReference; import cotato.growingpain.common.domain.BaseTimeEntity; -import cotato.growingpain.log.domain.ApplicationType; -import cotato.growingpain.log.domain.Result; -import cotato.growingpain.log.domain.dto.ApplicationDetailRequestDTO; -import cotato.growingpain.log.domain.dto.JobApplicationRequestDTO; -import cotato.growingpain.log.domain.repository.ApplicationDetailRepository; +import cotato.growingpain.log.ApplicationType; +import cotato.growingpain.log.Result; +import cotato.growingpain.log.dto.ApplicationDetailRequestDTO; +import cotato.growingpain.log.dto.JobApplicationRequestDTO; +import cotato.growingpain.log.repository.ApplicationDetailRepository; import cotato.growingpain.member.domain.entity.Member; import jakarta.persistence.CascadeType; import jakarta.persistence.Column; diff --git a/src/main/java/cotato/growingpain/log/domain/entity/JobPost.java b/src/main/java/cotato/growingpain/log/entity/JobPost.java similarity index 92% rename from src/main/java/cotato/growingpain/log/domain/entity/JobPost.java rename to src/main/java/cotato/growingpain/log/entity/JobPost.java index 82ee92f..4af06db 100644 --- a/src/main/java/cotato/growingpain/log/domain/entity/JobPost.java +++ b/src/main/java/cotato/growingpain/log/entity/JobPost.java @@ -1,11 +1,11 @@ -package cotato.growingpain.log.domain.entity; +package cotato.growingpain.log.entity; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonManagedReference; -import cotato.growingpain.log.domain.dto.JobApplicationRequestDTO; -import cotato.growingpain.log.domain.dto.JobPostRequestDTO; -import cotato.growingpain.log.domain.repository.ApplicationDetailRepository; -import cotato.growingpain.log.domain.repository.JobApplicationRepository; +import cotato.growingpain.log.dto.JobApplicationRequestDTO; +import cotato.growingpain.log.dto.JobPostRequestDTO; +import cotato.growingpain.log.repository.ApplicationDetailRepository; +import cotato.growingpain.log.repository.JobApplicationRepository; import cotato.growingpain.member.domain.entity.Member; import jakarta.persistence.CascadeType; import jakarta.persistence.Column; diff --git a/src/main/java/cotato/growingpain/log/domain/repository/ApplicationDetailRepository.java b/src/main/java/cotato/growingpain/log/repository/ApplicationDetailRepository.java similarity index 58% rename from src/main/java/cotato/growingpain/log/domain/repository/ApplicationDetailRepository.java rename to src/main/java/cotato/growingpain/log/repository/ApplicationDetailRepository.java index c0c690b..102ec1b 100644 --- a/src/main/java/cotato/growingpain/log/domain/repository/ApplicationDetailRepository.java +++ b/src/main/java/cotato/growingpain/log/repository/ApplicationDetailRepository.java @@ -1,6 +1,6 @@ -package cotato.growingpain.log.domain.repository; +package cotato.growingpain.log.repository; -import cotato.growingpain.log.domain.entity.ApplicationDetail; +import cotato.growingpain.log.entity.ApplicationDetail; import org.springframework.data.jpa.repository.JpaRepository; public interface ApplicationDetailRepository extends JpaRepository { diff --git a/src/main/java/cotato/growingpain/log/domain/repository/JobApplicationRepository.java b/src/main/java/cotato/growingpain/log/repository/JobApplicationRepository.java similarity index 68% rename from src/main/java/cotato/growingpain/log/domain/repository/JobApplicationRepository.java rename to src/main/java/cotato/growingpain/log/repository/JobApplicationRepository.java index 3a5b453..5eaada2 100644 --- a/src/main/java/cotato/growingpain/log/domain/repository/JobApplicationRepository.java +++ b/src/main/java/cotato/growingpain/log/repository/JobApplicationRepository.java @@ -1,6 +1,6 @@ -package cotato.growingpain.log.domain.repository; +package cotato.growingpain.log.repository; -import cotato.growingpain.log.domain.entity.JobApplication; +import cotato.growingpain.log.entity.JobApplication; import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/src/main/java/cotato/growingpain/log/domain/repository/JobPostRepository.java b/src/main/java/cotato/growingpain/log/repository/JobPostRepository.java similarity index 73% rename from src/main/java/cotato/growingpain/log/domain/repository/JobPostRepository.java rename to src/main/java/cotato/growingpain/log/repository/JobPostRepository.java index 0cc7ae4..507a857 100644 --- a/src/main/java/cotato/growingpain/log/domain/repository/JobPostRepository.java +++ b/src/main/java/cotato/growingpain/log/repository/JobPostRepository.java @@ -1,6 +1,6 @@ -package cotato.growingpain.log.domain.repository; +package cotato.growingpain.log.repository; -import cotato.growingpain.log.domain.entity.JobPost; +import cotato.growingpain.log.entity.JobPost; import java.util.List; import java.util.Optional; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/src/main/java/cotato/growingpain/log/domain/service/JobApplicationService.java b/src/main/java/cotato/growingpain/log/service/JobApplicationService.java similarity index 85% rename from src/main/java/cotato/growingpain/log/domain/service/JobApplicationService.java rename to src/main/java/cotato/growingpain/log/service/JobApplicationService.java index 09e4eb5..aa29ae4 100644 --- a/src/main/java/cotato/growingpain/log/domain/service/JobApplicationService.java +++ b/src/main/java/cotato/growingpain/log/service/JobApplicationService.java @@ -1,4 +1,4 @@ -package cotato.growingpain.log.domain.service; +package cotato.growingpain.log.service; import cotato.growingpain.member.repository.MemberRepository; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/cotato/growingpain/log/domain/service/JobService.java b/src/main/java/cotato/growingpain/log/service/JobService.java similarity index 85% rename from src/main/java/cotato/growingpain/log/domain/service/JobService.java rename to src/main/java/cotato/growingpain/log/service/JobService.java index 627dd1b..e538627 100644 --- a/src/main/java/cotato/growingpain/log/domain/service/JobService.java +++ b/src/main/java/cotato/growingpain/log/service/JobService.java @@ -1,13 +1,13 @@ -package cotato.growingpain.log.domain.service; - -import cotato.growingpain.log.domain.dto.JobPostListRetrieveDTO; -import cotato.growingpain.log.domain.dto.JobPostRequestDTO; -import cotato.growingpain.log.domain.dto.JobPostRetrieveDTO; -import cotato.growingpain.log.domain.entity.JobApplication; -import cotato.growingpain.log.domain.entity.JobPost; -import cotato.growingpain.log.domain.repository.ApplicationDetailRepository; -import cotato.growingpain.log.domain.repository.JobApplicationRepository; -import cotato.growingpain.log.domain.repository.JobPostRepository; +package cotato.growingpain.log.service; + +import cotato.growingpain.log.dto.JobPostListRetrieveDTO; +import cotato.growingpain.log.dto.JobPostRequestDTO; +import cotato.growingpain.log.dto.JobPostRetrieveDTO; +import cotato.growingpain.log.entity.JobApplication; +import cotato.growingpain.log.entity.JobPost; +import cotato.growingpain.log.repository.ApplicationDetailRepository; +import cotato.growingpain.log.repository.JobApplicationRepository; +import cotato.growingpain.log.repository.JobPostRepository; import cotato.growingpain.member.domain.entity.Member; import cotato.growingpain.member.repository.MemberRepository; import java.util.List; diff --git a/src/main/java/cotato/growingpain/member/domain/entity/Member.java b/src/main/java/cotato/growingpain/member/domain/entity/Member.java index 9b689af..335fa4d 100644 --- a/src/main/java/cotato/growingpain/member/domain/entity/Member.java +++ b/src/main/java/cotato/growingpain/member/domain/entity/Member.java @@ -4,9 +4,9 @@ import cotato.growingpain.comment.domain.entity.Comment; import cotato.growingpain.comment.domain.entity.CommentLike; import cotato.growingpain.common.domain.BaseTimeEntity; -import cotato.growingpain.log.domain.entity.ActivityLog; -import cotato.growingpain.log.domain.entity.JobApplication; -import cotato.growingpain.log.domain.entity.JobPost; +import cotato.growingpain.log.entity.ActivityLog; +import cotato.growingpain.log.entity.JobApplication; +import cotato.growingpain.log.entity.JobPost; import cotato.growingpain.member.domain.MemberJob; import cotato.growingpain.member.domain.MemberProfileShowing; import cotato.growingpain.member.domain.MemberRole; @@ -170,13 +170,14 @@ public void updateRole(MemberRole memberRole) { this.memberRole = memberRole; } - public void updateDefaultInfo(String field, String belong, MemberJob job){ + public void updateDefaultInfo(String field, String belong, MemberJob job) { this.field = field; this.belong = belong; this.job = job; } - public void updateAdditionalInfo(String educationBackground, String skill, String activityHistory, String award, String languageScore, String career, String aboutMe) { + public void updateAdditionalInfo(String educationBackground, String skill, String activityHistory, String award, + String languageScore, String career, String aboutMe) { this.educationBackground = educationBackground; this.skill = skill; this.activityHistory = activityHistory; From df5e27f1f510d280f211d8996ea1c1292ea28397 Mon Sep 17 00:00:00 2001 From: nar0ng <71819594+nar0ng@users.noreply.github.com> Date: Wed, 14 Aug 2024 22:00:33 +0900 Subject: [PATCH 2/8] =?UTF-8?q?chore:=20log.domain=20->=20log=EB=A1=9C=20?= =?UTF-8?q?=ED=8F=B4=EB=8D=94=EA=B5=AC=EC=A1=B0=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../growingpain/log/controller/JobPostController.java | 2 +- .../growingpain/log/{ => domain}/entity/ActivityLog.java | 2 +- .../log/{ => domain}/entity/ApplicationDetail.java | 2 +- .../growingpain/log/{ => domain}/entity/JobApplication.java | 2 +- .../cotato/growingpain/log/{ => domain}/entity/JobPost.java | 2 +- .../cotato/growingpain/log/dto/ApplicationDetailDTO.java | 2 +- .../growingpain/log/dto/ApplicationDetailRequestDTO.java | 4 ++-- .../growingpain/log/dto/JobApplicationListRetrieveDTO.java | 2 +- .../growingpain/log/dto/JobApplicationRequestDTO.java | 6 +++--- .../growingpain/log/dto/JobApplicationRetrieveDTO.java | 2 +- .../cotato/growingpain/log/dto/JobPostListRetrieveDTO.java | 2 +- .../java/cotato/growingpain/log/dto/JobPostRequestDTO.java | 4 ++-- .../java/cotato/growingpain/log/dto/JobPostRetrieveDTO.java | 2 +- .../log/repository/ApplicationDetailRepository.java | 2 +- .../log/repository/JobApplicationRepository.java | 2 +- .../growingpain/log/repository/JobPostRepository.java | 2 +- .../java/cotato/growingpain/log/service/JobService.java | 4 ++-- .../cotato/growingpain/member/domain/entity/Member.java | 6 +++--- 18 files changed, 25 insertions(+), 25 deletions(-) rename src/main/java/cotato/growingpain/log/{ => domain}/entity/ActivityLog.java (98%) rename src/main/java/cotato/growingpain/log/{ => domain}/entity/ApplicationDetail.java (98%) rename src/main/java/cotato/growingpain/log/{ => domain}/entity/JobApplication.java (99%) rename src/main/java/cotato/growingpain/log/{ => domain}/entity/JobPost.java (98%) diff --git a/src/main/java/cotato/growingpain/log/controller/JobPostController.java b/src/main/java/cotato/growingpain/log/controller/JobPostController.java index 9c1a8a9..23c6617 100644 --- a/src/main/java/cotato/growingpain/log/controller/JobPostController.java +++ b/src/main/java/cotato/growingpain/log/controller/JobPostController.java @@ -1,10 +1,10 @@ package cotato.growingpain.log.controller; import cotato.growingpain.common.Response; +import cotato.growingpain.log.domain.entity.JobPost; import cotato.growingpain.log.dto.JobPostListRetrieveDTO; import cotato.growingpain.log.dto.JobPostRequestDTO; import cotato.growingpain.log.dto.JobPostRetrieveDTO; -import cotato.growingpain.log.entity.JobPost; import cotato.growingpain.log.service.JobService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.media.Content; diff --git a/src/main/java/cotato/growingpain/log/entity/ActivityLog.java b/src/main/java/cotato/growingpain/log/domain/entity/ActivityLog.java similarity index 98% rename from src/main/java/cotato/growingpain/log/entity/ActivityLog.java rename to src/main/java/cotato/growingpain/log/domain/entity/ActivityLog.java index 47bad60..797371f 100644 --- a/src/main/java/cotato/growingpain/log/entity/ActivityLog.java +++ b/src/main/java/cotato/growingpain/log/domain/entity/ActivityLog.java @@ -1,4 +1,4 @@ -package cotato.growingpain.log.entity; +package cotato.growingpain.log.domain.entity; import com.fasterxml.jackson.annotation.JsonIgnore; import cotato.growingpain.common.domain.BaseTimeEntity; diff --git a/src/main/java/cotato/growingpain/log/entity/ApplicationDetail.java b/src/main/java/cotato/growingpain/log/domain/entity/ApplicationDetail.java similarity index 98% rename from src/main/java/cotato/growingpain/log/entity/ApplicationDetail.java rename to src/main/java/cotato/growingpain/log/domain/entity/ApplicationDetail.java index 5203869..aa4625b 100644 --- a/src/main/java/cotato/growingpain/log/entity/ApplicationDetail.java +++ b/src/main/java/cotato/growingpain/log/domain/entity/ApplicationDetail.java @@ -1,4 +1,4 @@ -package cotato.growingpain.log.entity; +package cotato.growingpain.log.domain.entity; import com.fasterxml.jackson.annotation.JsonBackReference; import com.fasterxml.jackson.annotation.JsonIgnore; diff --git a/src/main/java/cotato/growingpain/log/entity/JobApplication.java b/src/main/java/cotato/growingpain/log/domain/entity/JobApplication.java similarity index 99% rename from src/main/java/cotato/growingpain/log/entity/JobApplication.java rename to src/main/java/cotato/growingpain/log/domain/entity/JobApplication.java index 6655f4a..4c15b1e 100644 --- a/src/main/java/cotato/growingpain/log/entity/JobApplication.java +++ b/src/main/java/cotato/growingpain/log/domain/entity/JobApplication.java @@ -1,4 +1,4 @@ -package cotato.growingpain.log.entity; +package cotato.growingpain.log.domain.entity; import com.fasterxml.jackson.annotation.JsonBackReference; import com.fasterxml.jackson.annotation.JsonIgnore; diff --git a/src/main/java/cotato/growingpain/log/entity/JobPost.java b/src/main/java/cotato/growingpain/log/domain/entity/JobPost.java similarity index 98% rename from src/main/java/cotato/growingpain/log/entity/JobPost.java rename to src/main/java/cotato/growingpain/log/domain/entity/JobPost.java index 4af06db..5c887a4 100644 --- a/src/main/java/cotato/growingpain/log/entity/JobPost.java +++ b/src/main/java/cotato/growingpain/log/domain/entity/JobPost.java @@ -1,4 +1,4 @@ -package cotato.growingpain.log.entity; +package cotato.growingpain.log.domain.entity; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonManagedReference; diff --git a/src/main/java/cotato/growingpain/log/dto/ApplicationDetailDTO.java b/src/main/java/cotato/growingpain/log/dto/ApplicationDetailDTO.java index d1c3ce6..f10a074 100644 --- a/src/main/java/cotato/growingpain/log/dto/ApplicationDetailDTO.java +++ b/src/main/java/cotato/growingpain/log/dto/ApplicationDetailDTO.java @@ -1,6 +1,6 @@ package cotato.growingpain.log.dto; -import cotato.growingpain.log.entity.ApplicationDetail; +import cotato.growingpain.log.domain.entity.ApplicationDetail; import lombok.Builder; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/cotato/growingpain/log/dto/ApplicationDetailRequestDTO.java b/src/main/java/cotato/growingpain/log/dto/ApplicationDetailRequestDTO.java index ab91ef5..1415112 100644 --- a/src/main/java/cotato/growingpain/log/dto/ApplicationDetailRequestDTO.java +++ b/src/main/java/cotato/growingpain/log/dto/ApplicationDetailRequestDTO.java @@ -1,7 +1,7 @@ package cotato.growingpain.log.dto; -import cotato.growingpain.log.entity.ApplicationDetail; -import cotato.growingpain.log.entity.JobApplication; +import cotato.growingpain.log.domain.entity.ApplicationDetail; +import cotato.growingpain.log.domain.entity.JobApplication; public record ApplicationDetailRequestDTO( Long id, diff --git a/src/main/java/cotato/growingpain/log/dto/JobApplicationListRetrieveDTO.java b/src/main/java/cotato/growingpain/log/dto/JobApplicationListRetrieveDTO.java index bb409d9..810d9a7 100644 --- a/src/main/java/cotato/growingpain/log/dto/JobApplicationListRetrieveDTO.java +++ b/src/main/java/cotato/growingpain/log/dto/JobApplicationListRetrieveDTO.java @@ -1,6 +1,6 @@ package cotato.growingpain.log.dto; -import cotato.growingpain.log.entity.JobApplication; +import cotato.growingpain.log.domain.entity.JobApplication; import lombok.Builder; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/cotato/growingpain/log/dto/JobApplicationRequestDTO.java b/src/main/java/cotato/growingpain/log/dto/JobApplicationRequestDTO.java index a70e922..43b3d71 100644 --- a/src/main/java/cotato/growingpain/log/dto/JobApplicationRequestDTO.java +++ b/src/main/java/cotato/growingpain/log/dto/JobApplicationRequestDTO.java @@ -2,9 +2,9 @@ import cotato.growingpain.log.ApplicationType; import cotato.growingpain.log.Result; -import cotato.growingpain.log.entity.ApplicationDetail; -import cotato.growingpain.log.entity.JobApplication; -import cotato.growingpain.log.entity.JobPost; +import cotato.growingpain.log.domain.entity.ApplicationDetail; +import cotato.growingpain.log.domain.entity.JobApplication; +import cotato.growingpain.log.domain.entity.JobPost; import cotato.growingpain.member.domain.entity.Member; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/cotato/growingpain/log/dto/JobApplicationRetrieveDTO.java b/src/main/java/cotato/growingpain/log/dto/JobApplicationRetrieveDTO.java index 899efbe..47e2a36 100644 --- a/src/main/java/cotato/growingpain/log/dto/JobApplicationRetrieveDTO.java +++ b/src/main/java/cotato/growingpain/log/dto/JobApplicationRetrieveDTO.java @@ -1,6 +1,6 @@ package cotato.growingpain.log.dto; -import cotato.growingpain.log.entity.JobApplication; +import cotato.growingpain.log.domain.entity.JobApplication; import java.util.List; import lombok.Builder; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/cotato/growingpain/log/dto/JobPostListRetrieveDTO.java b/src/main/java/cotato/growingpain/log/dto/JobPostListRetrieveDTO.java index ebf9246..168af89 100644 --- a/src/main/java/cotato/growingpain/log/dto/JobPostListRetrieveDTO.java +++ b/src/main/java/cotato/growingpain/log/dto/JobPostListRetrieveDTO.java @@ -1,6 +1,6 @@ package cotato.growingpain.log.dto; -import cotato.growingpain.log.entity.JobPost; +import cotato.growingpain.log.domain.entity.JobPost; import java.util.List; import lombok.Builder; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/cotato/growingpain/log/dto/JobPostRequestDTO.java b/src/main/java/cotato/growingpain/log/dto/JobPostRequestDTO.java index c676a71..66f333e 100644 --- a/src/main/java/cotato/growingpain/log/dto/JobPostRequestDTO.java +++ b/src/main/java/cotato/growingpain/log/dto/JobPostRequestDTO.java @@ -1,7 +1,7 @@ package cotato.growingpain.log.dto; -import cotato.growingpain.log.entity.JobApplication; -import cotato.growingpain.log.entity.JobPost; +import cotato.growingpain.log.domain.entity.JobApplication; +import cotato.growingpain.log.domain.entity.JobPost; import cotato.growingpain.member.domain.entity.Member; import jakarta.validation.constraints.NotBlank; import java.util.ArrayList; diff --git a/src/main/java/cotato/growingpain/log/dto/JobPostRetrieveDTO.java b/src/main/java/cotato/growingpain/log/dto/JobPostRetrieveDTO.java index c2c3407..3955880 100644 --- a/src/main/java/cotato/growingpain/log/dto/JobPostRetrieveDTO.java +++ b/src/main/java/cotato/growingpain/log/dto/JobPostRetrieveDTO.java @@ -1,6 +1,6 @@ package cotato.growingpain.log.dto; -import cotato.growingpain.log.entity.JobPost; +import cotato.growingpain.log.domain.entity.JobPost; import java.util.List; import lombok.Builder; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/cotato/growingpain/log/repository/ApplicationDetailRepository.java b/src/main/java/cotato/growingpain/log/repository/ApplicationDetailRepository.java index 102ec1b..904f1e9 100644 --- a/src/main/java/cotato/growingpain/log/repository/ApplicationDetailRepository.java +++ b/src/main/java/cotato/growingpain/log/repository/ApplicationDetailRepository.java @@ -1,6 +1,6 @@ package cotato.growingpain.log.repository; -import cotato.growingpain.log.entity.ApplicationDetail; +import cotato.growingpain.log.domain.entity.ApplicationDetail; import org.springframework.data.jpa.repository.JpaRepository; public interface ApplicationDetailRepository extends JpaRepository { diff --git a/src/main/java/cotato/growingpain/log/repository/JobApplicationRepository.java b/src/main/java/cotato/growingpain/log/repository/JobApplicationRepository.java index 5eaada2..26d4dfe 100644 --- a/src/main/java/cotato/growingpain/log/repository/JobApplicationRepository.java +++ b/src/main/java/cotato/growingpain/log/repository/JobApplicationRepository.java @@ -1,6 +1,6 @@ package cotato.growingpain.log.repository; -import cotato.growingpain.log.entity.JobApplication; +import cotato.growingpain.log.domain.entity.JobApplication; import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/src/main/java/cotato/growingpain/log/repository/JobPostRepository.java b/src/main/java/cotato/growingpain/log/repository/JobPostRepository.java index 507a857..742ed4d 100644 --- a/src/main/java/cotato/growingpain/log/repository/JobPostRepository.java +++ b/src/main/java/cotato/growingpain/log/repository/JobPostRepository.java @@ -1,6 +1,6 @@ package cotato.growingpain.log.repository; -import cotato.growingpain.log.entity.JobPost; +import cotato.growingpain.log.domain.entity.JobPost; import java.util.List; import java.util.Optional; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/src/main/java/cotato/growingpain/log/service/JobService.java b/src/main/java/cotato/growingpain/log/service/JobService.java index e538627..6bb47fc 100644 --- a/src/main/java/cotato/growingpain/log/service/JobService.java +++ b/src/main/java/cotato/growingpain/log/service/JobService.java @@ -1,10 +1,10 @@ package cotato.growingpain.log.service; +import cotato.growingpain.log.domain.entity.JobApplication; +import cotato.growingpain.log.domain.entity.JobPost; import cotato.growingpain.log.dto.JobPostListRetrieveDTO; import cotato.growingpain.log.dto.JobPostRequestDTO; import cotato.growingpain.log.dto.JobPostRetrieveDTO; -import cotato.growingpain.log.entity.JobApplication; -import cotato.growingpain.log.entity.JobPost; import cotato.growingpain.log.repository.ApplicationDetailRepository; import cotato.growingpain.log.repository.JobApplicationRepository; import cotato.growingpain.log.repository.JobPostRepository; diff --git a/src/main/java/cotato/growingpain/member/domain/entity/Member.java b/src/main/java/cotato/growingpain/member/domain/entity/Member.java index 335fa4d..4da47c2 100644 --- a/src/main/java/cotato/growingpain/member/domain/entity/Member.java +++ b/src/main/java/cotato/growingpain/member/domain/entity/Member.java @@ -4,9 +4,9 @@ import cotato.growingpain.comment.domain.entity.Comment; import cotato.growingpain.comment.domain.entity.CommentLike; import cotato.growingpain.common.domain.BaseTimeEntity; -import cotato.growingpain.log.entity.ActivityLog; -import cotato.growingpain.log.entity.JobApplication; -import cotato.growingpain.log.entity.JobPost; +import cotato.growingpain.log.domain.entity.ActivityLog; +import cotato.growingpain.log.domain.entity.JobApplication; +import cotato.growingpain.log.domain.entity.JobPost; import cotato.growingpain.member.domain.MemberJob; import cotato.growingpain.member.domain.MemberProfileShowing; import cotato.growingpain.member.domain.MemberRole; From 8fc9b99305740c57eed9170fc411d029b2514408 Mon Sep 17 00:00:00 2001 From: nar0ng <71819594+nar0ng@users.noreply.github.com> Date: Wed, 14 Aug 2024 22:05:18 +0900 Subject: [PATCH 3/8] =?UTF-8?q?chore:=20dto=20=ED=8F=B4=EB=8D=94=20request?= =?UTF-8?q?=EC=99=80=20retrieve=EB=A1=9C=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../growingpain/log/controller/JobPostController.java | 6 +++--- .../growingpain/log/domain/entity/ApplicationDetail.java | 2 +- .../growingpain/log/domain/entity/JobApplication.java | 4 ++-- .../java/cotato/growingpain/log/domain/entity/JobPost.java | 4 ++-- .../log/dto/{ => request}/ApplicationDetailRequestDTO.java | 2 +- .../log/dto/{ => request}/JobApplicationRequestDTO.java | 2 +- .../log/dto/{ => request}/JobPostRequestDTO.java | 2 +- .../log/dto/{ => request}/JobPostRetrieveDTO.java | 3 ++- .../dto/{ => retrieve}/JobApplicationListRetrieveDTO.java | 2 +- .../log/dto/{ => retrieve}/JobApplicationRetrieveDTO.java | 3 ++- .../log/dto/{ => retrieve}/JobPostListRetrieveDTO.java | 2 +- .../java/cotato/growingpain/log/service/JobService.java | 6 +++--- 12 files changed, 20 insertions(+), 18 deletions(-) rename src/main/java/cotato/growingpain/log/dto/{ => request}/ApplicationDetailRequestDTO.java (91%) rename src/main/java/cotato/growingpain/log/dto/{ => request}/JobApplicationRequestDTO.java (97%) rename src/main/java/cotato/growingpain/log/dto/{ => request}/JobPostRequestDTO.java (96%) rename src/main/java/cotato/growingpain/log/dto/{ => request}/JobPostRetrieveDTO.java (88%) rename src/main/java/cotato/growingpain/log/dto/{ => retrieve}/JobApplicationListRetrieveDTO.java (96%) rename src/main/java/cotato/growingpain/log/dto/{ => retrieve}/JobApplicationRetrieveDTO.java (93%) rename src/main/java/cotato/growingpain/log/dto/{ => retrieve}/JobPostListRetrieveDTO.java (94%) diff --git a/src/main/java/cotato/growingpain/log/controller/JobPostController.java b/src/main/java/cotato/growingpain/log/controller/JobPostController.java index 23c6617..c21a63c 100644 --- a/src/main/java/cotato/growingpain/log/controller/JobPostController.java +++ b/src/main/java/cotato/growingpain/log/controller/JobPostController.java @@ -2,9 +2,9 @@ import cotato.growingpain.common.Response; import cotato.growingpain.log.domain.entity.JobPost; -import cotato.growingpain.log.dto.JobPostListRetrieveDTO; -import cotato.growingpain.log.dto.JobPostRequestDTO; -import cotato.growingpain.log.dto.JobPostRetrieveDTO; +import cotato.growingpain.log.dto.request.JobPostRequestDTO; +import cotato.growingpain.log.dto.request.JobPostRetrieveDTO; +import cotato.growingpain.log.dto.retrieve.JobPostListRetrieveDTO; import cotato.growingpain.log.service.JobService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.media.Content; diff --git a/src/main/java/cotato/growingpain/log/domain/entity/ApplicationDetail.java b/src/main/java/cotato/growingpain/log/domain/entity/ApplicationDetail.java index aa4625b..2af9c1e 100644 --- a/src/main/java/cotato/growingpain/log/domain/entity/ApplicationDetail.java +++ b/src/main/java/cotato/growingpain/log/domain/entity/ApplicationDetail.java @@ -2,7 +2,7 @@ import com.fasterxml.jackson.annotation.JsonBackReference; import com.fasterxml.jackson.annotation.JsonIgnore; -import cotato.growingpain.log.dto.ApplicationDetailRequestDTO; +import cotato.growingpain.log.dto.request.ApplicationDetailRequestDTO; import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.FetchType; diff --git a/src/main/java/cotato/growingpain/log/domain/entity/JobApplication.java b/src/main/java/cotato/growingpain/log/domain/entity/JobApplication.java index 4c15b1e..f736bc0 100644 --- a/src/main/java/cotato/growingpain/log/domain/entity/JobApplication.java +++ b/src/main/java/cotato/growingpain/log/domain/entity/JobApplication.java @@ -6,8 +6,8 @@ import cotato.growingpain.common.domain.BaseTimeEntity; import cotato.growingpain.log.ApplicationType; import cotato.growingpain.log.Result; -import cotato.growingpain.log.dto.ApplicationDetailRequestDTO; -import cotato.growingpain.log.dto.JobApplicationRequestDTO; +import cotato.growingpain.log.dto.request.ApplicationDetailRequestDTO; +import cotato.growingpain.log.dto.request.JobApplicationRequestDTO; import cotato.growingpain.log.repository.ApplicationDetailRepository; import cotato.growingpain.member.domain.entity.Member; import jakarta.persistence.CascadeType; diff --git a/src/main/java/cotato/growingpain/log/domain/entity/JobPost.java b/src/main/java/cotato/growingpain/log/domain/entity/JobPost.java index 5c887a4..334cccc 100644 --- a/src/main/java/cotato/growingpain/log/domain/entity/JobPost.java +++ b/src/main/java/cotato/growingpain/log/domain/entity/JobPost.java @@ -2,8 +2,8 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonManagedReference; -import cotato.growingpain.log.dto.JobApplicationRequestDTO; -import cotato.growingpain.log.dto.JobPostRequestDTO; +import cotato.growingpain.log.dto.request.JobApplicationRequestDTO; +import cotato.growingpain.log.dto.request.JobPostRequestDTO; import cotato.growingpain.log.repository.ApplicationDetailRepository; import cotato.growingpain.log.repository.JobApplicationRepository; import cotato.growingpain.member.domain.entity.Member; diff --git a/src/main/java/cotato/growingpain/log/dto/ApplicationDetailRequestDTO.java b/src/main/java/cotato/growingpain/log/dto/request/ApplicationDetailRequestDTO.java similarity index 91% rename from src/main/java/cotato/growingpain/log/dto/ApplicationDetailRequestDTO.java rename to src/main/java/cotato/growingpain/log/dto/request/ApplicationDetailRequestDTO.java index 1415112..9d0fc5d 100644 --- a/src/main/java/cotato/growingpain/log/dto/ApplicationDetailRequestDTO.java +++ b/src/main/java/cotato/growingpain/log/dto/request/ApplicationDetailRequestDTO.java @@ -1,4 +1,4 @@ -package cotato.growingpain.log.dto; +package cotato.growingpain.log.dto.request; import cotato.growingpain.log.domain.entity.ApplicationDetail; import cotato.growingpain.log.domain.entity.JobApplication; diff --git a/src/main/java/cotato/growingpain/log/dto/JobApplicationRequestDTO.java b/src/main/java/cotato/growingpain/log/dto/request/JobApplicationRequestDTO.java similarity index 97% rename from src/main/java/cotato/growingpain/log/dto/JobApplicationRequestDTO.java rename to src/main/java/cotato/growingpain/log/dto/request/JobApplicationRequestDTO.java index 43b3d71..ae6341a 100644 --- a/src/main/java/cotato/growingpain/log/dto/JobApplicationRequestDTO.java +++ b/src/main/java/cotato/growingpain/log/dto/request/JobApplicationRequestDTO.java @@ -1,4 +1,4 @@ -package cotato.growingpain.log.dto; +package cotato.growingpain.log.dto.request; import cotato.growingpain.log.ApplicationType; import cotato.growingpain.log.Result; diff --git a/src/main/java/cotato/growingpain/log/dto/JobPostRequestDTO.java b/src/main/java/cotato/growingpain/log/dto/request/JobPostRequestDTO.java similarity index 96% rename from src/main/java/cotato/growingpain/log/dto/JobPostRequestDTO.java rename to src/main/java/cotato/growingpain/log/dto/request/JobPostRequestDTO.java index 66f333e..652a1ce 100644 --- a/src/main/java/cotato/growingpain/log/dto/JobPostRequestDTO.java +++ b/src/main/java/cotato/growingpain/log/dto/request/JobPostRequestDTO.java @@ -1,4 +1,4 @@ -package cotato.growingpain.log.dto; +package cotato.growingpain.log.dto.request; import cotato.growingpain.log.domain.entity.JobApplication; import cotato.growingpain.log.domain.entity.JobPost; diff --git a/src/main/java/cotato/growingpain/log/dto/JobPostRetrieveDTO.java b/src/main/java/cotato/growingpain/log/dto/request/JobPostRetrieveDTO.java similarity index 88% rename from src/main/java/cotato/growingpain/log/dto/JobPostRetrieveDTO.java rename to src/main/java/cotato/growingpain/log/dto/request/JobPostRetrieveDTO.java index 3955880..3fb6796 100644 --- a/src/main/java/cotato/growingpain/log/dto/JobPostRetrieveDTO.java +++ b/src/main/java/cotato/growingpain/log/dto/request/JobPostRetrieveDTO.java @@ -1,6 +1,7 @@ -package cotato.growingpain.log.dto; +package cotato.growingpain.log.dto.request; import cotato.growingpain.log.domain.entity.JobPost; +import cotato.growingpain.log.dto.retrieve.JobApplicationRetrieveDTO; import java.util.List; import lombok.Builder; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/cotato/growingpain/log/dto/JobApplicationListRetrieveDTO.java b/src/main/java/cotato/growingpain/log/dto/retrieve/JobApplicationListRetrieveDTO.java similarity index 96% rename from src/main/java/cotato/growingpain/log/dto/JobApplicationListRetrieveDTO.java rename to src/main/java/cotato/growingpain/log/dto/retrieve/JobApplicationListRetrieveDTO.java index 810d9a7..ecae0c2 100644 --- a/src/main/java/cotato/growingpain/log/dto/JobApplicationListRetrieveDTO.java +++ b/src/main/java/cotato/growingpain/log/dto/retrieve/JobApplicationListRetrieveDTO.java @@ -1,4 +1,4 @@ -package cotato.growingpain.log.dto; +package cotato.growingpain.log.dto.retrieve; import cotato.growingpain.log.domain.entity.JobApplication; import lombok.Builder; diff --git a/src/main/java/cotato/growingpain/log/dto/JobApplicationRetrieveDTO.java b/src/main/java/cotato/growingpain/log/dto/retrieve/JobApplicationRetrieveDTO.java similarity index 93% rename from src/main/java/cotato/growingpain/log/dto/JobApplicationRetrieveDTO.java rename to src/main/java/cotato/growingpain/log/dto/retrieve/JobApplicationRetrieveDTO.java index 47e2a36..390aa38 100644 --- a/src/main/java/cotato/growingpain/log/dto/JobApplicationRetrieveDTO.java +++ b/src/main/java/cotato/growingpain/log/dto/retrieve/JobApplicationRetrieveDTO.java @@ -1,6 +1,7 @@ -package cotato.growingpain.log.dto; +package cotato.growingpain.log.dto.retrieve; import cotato.growingpain.log.domain.entity.JobApplication; +import cotato.growingpain.log.dto.ApplicationDetailDTO; import java.util.List; import lombok.Builder; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/cotato/growingpain/log/dto/JobPostListRetrieveDTO.java b/src/main/java/cotato/growingpain/log/dto/retrieve/JobPostListRetrieveDTO.java similarity index 94% rename from src/main/java/cotato/growingpain/log/dto/JobPostListRetrieveDTO.java rename to src/main/java/cotato/growingpain/log/dto/retrieve/JobPostListRetrieveDTO.java index 168af89..6f4789c 100644 --- a/src/main/java/cotato/growingpain/log/dto/JobPostListRetrieveDTO.java +++ b/src/main/java/cotato/growingpain/log/dto/retrieve/JobPostListRetrieveDTO.java @@ -1,4 +1,4 @@ -package cotato.growingpain.log.dto; +package cotato.growingpain.log.dto.retrieve; import cotato.growingpain.log.domain.entity.JobPost; import java.util.List; diff --git a/src/main/java/cotato/growingpain/log/service/JobService.java b/src/main/java/cotato/growingpain/log/service/JobService.java index 6bb47fc..2848f51 100644 --- a/src/main/java/cotato/growingpain/log/service/JobService.java +++ b/src/main/java/cotato/growingpain/log/service/JobService.java @@ -2,9 +2,9 @@ import cotato.growingpain.log.domain.entity.JobApplication; import cotato.growingpain.log.domain.entity.JobPost; -import cotato.growingpain.log.dto.JobPostListRetrieveDTO; -import cotato.growingpain.log.dto.JobPostRequestDTO; -import cotato.growingpain.log.dto.JobPostRetrieveDTO; +import cotato.growingpain.log.dto.request.JobPostRequestDTO; +import cotato.growingpain.log.dto.request.JobPostRetrieveDTO; +import cotato.growingpain.log.dto.retrieve.JobPostListRetrieveDTO; import cotato.growingpain.log.repository.ApplicationDetailRepository; import cotato.growingpain.log.repository.JobApplicationRepository; import cotato.growingpain.log.repository.JobPostRepository; From f3e416e99f928609414364f9ff3b8ed4326a71e1 Mon Sep 17 00:00:00 2001 From: nar0ng <71819594+nar0ng@users.noreply.github.com> Date: Thu, 15 Aug 2024 01:42:24 +0900 Subject: [PATCH 4/8] =?UTF-8?q?feat:=20=ED=99=9C=EB=8F=99=EA=B8=B0?= =?UTF-8?q?=EB=A1=9D=20=EC=A0=80=EC=9E=A5=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ctivityType.java => ActivityCategory.java} | 4 +- .../log/controller/ActivityLogController.java | 38 +++++++++++++ .../log/domain/entity/ActivityLog.java | 41 +++++++------- .../growingpain/log/dto/ActivityLogDTO.java | 53 +++++++++++++++++++ .../log/repository/ActivityLogRepository.java | 7 +++ .../log/service/ActivityLogService.java | 29 ++++++++++ .../growingpain/log/service/JobService.java | 6 --- 7 files changed, 147 insertions(+), 31 deletions(-) rename src/main/java/cotato/growingpain/log/{ActivityType.java => ActivityCategory.java} (82%) create mode 100644 src/main/java/cotato/growingpain/log/controller/ActivityLogController.java create mode 100644 src/main/java/cotato/growingpain/log/dto/ActivityLogDTO.java create mode 100644 src/main/java/cotato/growingpain/log/repository/ActivityLogRepository.java create mode 100644 src/main/java/cotato/growingpain/log/service/ActivityLogService.java diff --git a/src/main/java/cotato/growingpain/log/ActivityType.java b/src/main/java/cotato/growingpain/log/ActivityCategory.java similarity index 82% rename from src/main/java/cotato/growingpain/log/ActivityType.java rename to src/main/java/cotato/growingpain/log/ActivityCategory.java index 8c25e47..479922c 100644 --- a/src/main/java/cotato/growingpain/log/ActivityType.java +++ b/src/main/java/cotato/growingpain/log/ActivityCategory.java @@ -3,7 +3,7 @@ import lombok.Getter; @Getter -public enum ActivityType { +public enum ActivityCategory { EXTRA_ACTIVITY("대외활동"), VOLUNTEER_ACTIVITY("봉사활동"), @@ -14,7 +14,7 @@ public enum ActivityType { private final String description; - ActivityType(String description) { + ActivityCategory(String description) { this.description = description; } } \ No newline at end of file diff --git a/src/main/java/cotato/growingpain/log/controller/ActivityLogController.java b/src/main/java/cotato/growingpain/log/controller/ActivityLogController.java new file mode 100644 index 0000000..a230aae --- /dev/null +++ b/src/main/java/cotato/growingpain/log/controller/ActivityLogController.java @@ -0,0 +1,38 @@ +package cotato.growingpain.log.controller; + +import cotato.growingpain.common.Response; +import cotato.growingpain.log.domain.entity.ActivityLog; +import cotato.growingpain.log.dto.ActivityLogDTO; +import cotato.growingpain.log.service.ActivityLogService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.http.HttpStatus; +import org.springframework.security.core.annotation.AuthenticationPrincipal; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +@Slf4j +@RestController +@RequestMapping("/api/activity-logs") +@RequiredArgsConstructor +public class ActivityLogController { + private final ActivityLogService activityLogService; + + @Operation(summary = "활동 기록 저장", description = "활동 기록을 등록하기 위한 메소드") + @ApiResponse(content = @Content(schema = @Schema(implementation = Response.class))) + @PostMapping("") + @ResponseStatus(HttpStatus.CREATED) + public Response createJobPost(@RequestBody @Valid ActivityLogDTO activityLogDto, + @AuthenticationPrincipal Long memberId) { + activityLogService.createActivityLog(activityLogDto, memberId); + return Response.createSuccess("활동 기록 등록 완료", null); + } +} diff --git a/src/main/java/cotato/growingpain/log/domain/entity/ActivityLog.java b/src/main/java/cotato/growingpain/log/domain/entity/ActivityLog.java index 797371f..a87e2da 100644 --- a/src/main/java/cotato/growingpain/log/domain/entity/ActivityLog.java +++ b/src/main/java/cotato/growingpain/log/domain/entity/ActivityLog.java @@ -2,7 +2,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import cotato.growingpain.common.domain.BaseTimeEntity; -import cotato.growingpain.log.ActivityType; +import cotato.growingpain.log.ActivityCategory; import cotato.growingpain.member.domain.entity.Member; import jakarta.persistence.Column; import jakarta.persistence.Entity; @@ -40,8 +40,8 @@ public class ActivityLog extends BaseTimeEntity { /* ------------ Information Column ------------ */ /* -------------------------------------------- */ @Enumerated(EnumType.STRING) - @Column(name = "activity_type") - private ActivityType activityType; + @Column(name = "activity_category") + private ActivityCategory activityCategory; @Column(name = "activity_name") private String activityName; @@ -58,17 +58,14 @@ public class ActivityLog extends BaseTimeEntity { @Column(name = "contribution") private int contribution; - @Column(name = "activity_start_date") - private String activityStartDate; - - @Column(name = "activity_close_date") - private String activityCloseDate; + @Column(name = "activity_duration") + private String activityDuration; - @Column(name = "image_url") - private String imageUrl; + @Column(name = "activity_type") + private String activityType; - @Column(name = "file_url") - private String fileUrl; + @Column(name = "url") + private String url; @CreatedDate @Column(updatable = false) @@ -87,31 +84,29 @@ public class ActivityLog extends BaseTimeEntity { @Builder public ActivityLog( - ActivityType activityType, + ActivityCategory activityCategory, String activityName, String content, String performance, String role, - Integer contribution, - String activityStartDate, - String activityCloseDate, - String imageUrl, - String fileUrl, + String activityDuration, + String activityType, + String url, + int contribution, Member member ) { // Relation Column this.member = member; // Information Column - this.activityType = activityType; + this.activityCategory = activityCategory; this.activityName = activityName; this.content = content; this.performance = performance; this.role = role; + this.activityDuration = activityDuration; this.contribution = contribution; - this.activityStartDate = activityStartDate; - this.activityCloseDate = activityCloseDate; - this.imageUrl = imageUrl; - this.fileUrl = fileUrl; + this.activityType = activityType; + this.url = url; } } diff --git a/src/main/java/cotato/growingpain/log/dto/ActivityLogDTO.java b/src/main/java/cotato/growingpain/log/dto/ActivityLogDTO.java new file mode 100644 index 0000000..0442b9d --- /dev/null +++ b/src/main/java/cotato/growingpain/log/dto/ActivityLogDTO.java @@ -0,0 +1,53 @@ +package cotato.growingpain.log.dto; + +import cotato.growingpain.log.ActivityCategory; +import cotato.growingpain.log.domain.entity.ActivityLog; +import cotato.growingpain.member.domain.entity.Member; +import lombok.Builder; +import lombok.extern.slf4j.Slf4j; + +@Slf4j +@Builder +public record ActivityLogDTO( + Long id, + ActivityCategory activityCategory, + String activityName, + String content, + String performance, + String role, + String activityDuration, + String activityType, + String url, + int contribution +) { + public static ActivityLogDTO fromEntity(ActivityLog activityLog) { + return ActivityLogDTO.builder() + .id(activityLog.getId()) + .activityCategory(activityLog.getActivityCategory()) + .activityDuration(activityLog.getActivityDuration()) + .content(activityLog.getContent()) + .performance(activityLog.getPerformance()) + .role(activityLog.getRole()) + .activityDuration(activityLog.getActivityDuration()) + .activityType(activityLog.getActivityType()) + .contribution(activityLog.getContribution()) + .url(activityLog.getUrl()) + .build(); + } + + public ActivityLog toEntity(Member member) { + ActivityLog activityLog = ActivityLog.builder() + .activityName(this.activityName) + .activityCategory(this.activityCategory) + .activityDuration(this.activityDuration) + .content(this.content) + .performance(this.performance) + .role(this.role) + .contribution(this.contribution) + .activityType(this.activityType) + .url(this.url) + .member(member) + .build(); + return activityLog; + } +} diff --git a/src/main/java/cotato/growingpain/log/repository/ActivityLogRepository.java b/src/main/java/cotato/growingpain/log/repository/ActivityLogRepository.java new file mode 100644 index 0000000..83e4361 --- /dev/null +++ b/src/main/java/cotato/growingpain/log/repository/ActivityLogRepository.java @@ -0,0 +1,7 @@ +package cotato.growingpain.log.repository; + +import cotato.growingpain.log.domain.entity.ActivityLog; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface ActivityLogRepository extends JpaRepository { +} diff --git a/src/main/java/cotato/growingpain/log/service/ActivityLogService.java b/src/main/java/cotato/growingpain/log/service/ActivityLogService.java new file mode 100644 index 0000000..37ad7fb --- /dev/null +++ b/src/main/java/cotato/growingpain/log/service/ActivityLogService.java @@ -0,0 +1,29 @@ +package cotato.growingpain.log.service; + +import cotato.growingpain.log.domain.entity.ActivityLog; +import cotato.growingpain.log.dto.ActivityLogDTO; +import cotato.growingpain.log.repository.ActivityLogRepository; +import cotato.growingpain.member.domain.entity.Member; +import cotato.growingpain.member.repository.MemberRepository; +import jakarta.transaction.Transactional; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +@Slf4j +@Service +@RequiredArgsConstructor +public class ActivityLogService { + + private final MemberRepository memberRepository; + private final ActivityLogRepository activityLogRepository; + + @Transactional + public void createActivityLog(final ActivityLogDTO activityLogDto, Long memberId) { + Member member = memberRepository.findById(memberId) + .orElseThrow(() -> new RuntimeException("Member not found with ID: " + memberId)); + ActivityLog activityLog = activityLogDto.toEntity(member); + activityLogRepository.save(activityLog); + } + +} diff --git a/src/main/java/cotato/growingpain/log/service/JobService.java b/src/main/java/cotato/growingpain/log/service/JobService.java index 2848f51..9bcdb5a 100644 --- a/src/main/java/cotato/growingpain/log/service/JobService.java +++ b/src/main/java/cotato/growingpain/log/service/JobService.java @@ -34,14 +34,8 @@ public void createJobPost(final JobPostRequestDTO jobPostRequest, Long memberId) Member member = memberRepository.findById(memberId) .orElseThrow(() -> new RuntimeException("Member not found with ID: " + memberId)); - log.info("Found member with ID: {}", member.getId()); - log.info(jobPostRequest.jobApplications().toString()); - JobPost jobPost = jobPostRequest.toEntity(member); - log.info("Creating job post with job part: {}", jobPost.getJobPart()); - log.debug("JobPost details: {}", jobPost); - JobPost savedJobPost = jobPostRepository.save(jobPost); jobPost.getJobApplications().forEach(jobApplication -> { From 697e9d662a7197f13c92615932adf79360d0b86e Mon Sep 17 00:00:00 2001 From: nar0ng <71819594+nar0ng@users.noreply.github.com> Date: Thu, 15 Aug 2024 03:59:07 +0900 Subject: [PATCH 5/8] =?UTF-8?q?feat:=20=ED=99=9C=EB=8F=99=EA=B8=B0?= =?UTF-8?q?=EB=A1=9D=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../log/controller/ActivityLogController.java | 12 ++++++++ .../log/controller/JobPostController.java | 4 +-- .../dto/request/ActivityLogRequestDTO.java | 29 +++++++++++++++++++ .../log/repository/ActivityLogRepository.java | 4 +++ .../log/service/ActivityLogService.java | 14 +++++++++ 5 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 src/main/java/cotato/growingpain/log/dto/request/ActivityLogRequestDTO.java diff --git a/src/main/java/cotato/growingpain/log/controller/ActivityLogController.java b/src/main/java/cotato/growingpain/log/controller/ActivityLogController.java index a230aae..69a2780 100644 --- a/src/main/java/cotato/growingpain/log/controller/ActivityLogController.java +++ b/src/main/java/cotato/growingpain/log/controller/ActivityLogController.java @@ -9,10 +9,12 @@ import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.responses.ApiResponse; import jakarta.validation.Valid; +import java.util.List; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpStatus; import org.springframework.security.core.annotation.AuthenticationPrincipal; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -35,4 +37,14 @@ public Response createJobPost(@RequestBody @Valid ActivityLogDTO ac activityLogService.createActivityLog(activityLogDto, memberId); return Response.createSuccess("활동 기록 등록 완료", null); } + + @Operation(summary = "활동 기록 리스트 조회", description = "활동 기록 리스트를 조회하기 위한 메소드") + @ApiResponse(content = @Content(schema = @Schema(implementation = Response.class))) + @GetMapping("") + @ResponseStatus(HttpStatus.OK) + public Response> retrieveActivityLogList( + @AuthenticationPrincipal Long memberId) { + List activityLogList = activityLogService.retrieveActivityLogsByMemberId(memberId); + return Response.createSuccess("활동 기록 조회 완료", activityLogList); + } } diff --git a/src/main/java/cotato/growingpain/log/controller/JobPostController.java b/src/main/java/cotato/growingpain/log/controller/JobPostController.java index c21a63c..436061b 100644 --- a/src/main/java/cotato/growingpain/log/controller/JobPostController.java +++ b/src/main/java/cotato/growingpain/log/controller/JobPostController.java @@ -18,9 +18,9 @@ import org.springframework.security.core.annotation.AuthenticationPrincipal; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PatchMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseStatus; @@ -66,7 +66,7 @@ public Response getJobPostById(@PathVariable Long jobPostId) @Operation(summary = "지원 현황 내용 수정", description = "지원 현황을 수정하기 위한 메소드") @ApiResponse(content = @Content(schema = @Schema(implementation = Response.class))) - @PutMapping("/{jobPostId}") + @PatchMapping("/{jobPostId}") @ResponseStatus(HttpStatus.OK) public Response updateJobPost( @PathVariable Long jobPostId, diff --git a/src/main/java/cotato/growingpain/log/dto/request/ActivityLogRequestDTO.java b/src/main/java/cotato/growingpain/log/dto/request/ActivityLogRequestDTO.java new file mode 100644 index 0000000..0b40df9 --- /dev/null +++ b/src/main/java/cotato/growingpain/log/dto/request/ActivityLogRequestDTO.java @@ -0,0 +1,29 @@ +package cotato.growingpain.log.dto.request; + +import cotato.growingpain.log.ActivityCategory; +import cotato.growingpain.log.domain.entity.ActivityLog; +import cotato.growingpain.member.domain.entity.Member; + +public record ActivityLogRequestDTO( + ActivityCategory activityCategory, + String activityName, + String role, + String activityDuration, + String activityType, + String url, + int contribution +) { + public ActivityLog toEntity(Member member) { + ActivityLog activityLog = ActivityLog.builder() + .activityName(this.activityName) + .activityCategory(this.activityCategory) + .activityDuration(this.activityDuration) + .role(this.role) + .contribution(this.contribution) + .activityType(this.activityType) + .url(this.url) + .member(member) + .build(); + return activityLog; + } +} diff --git a/src/main/java/cotato/growingpain/log/repository/ActivityLogRepository.java b/src/main/java/cotato/growingpain/log/repository/ActivityLogRepository.java index 83e4361..6ad8b85 100644 --- a/src/main/java/cotato/growingpain/log/repository/ActivityLogRepository.java +++ b/src/main/java/cotato/growingpain/log/repository/ActivityLogRepository.java @@ -1,7 +1,11 @@ package cotato.growingpain.log.repository; import cotato.growingpain.log.domain.entity.ActivityLog; +import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; +@Repository public interface ActivityLogRepository extends JpaRepository { + List findByMemberId(Long memberId); } diff --git a/src/main/java/cotato/growingpain/log/service/ActivityLogService.java b/src/main/java/cotato/growingpain/log/service/ActivityLogService.java index 37ad7fb..74d0325 100644 --- a/src/main/java/cotato/growingpain/log/service/ActivityLogService.java +++ b/src/main/java/cotato/growingpain/log/service/ActivityLogService.java @@ -2,10 +2,12 @@ import cotato.growingpain.log.domain.entity.ActivityLog; import cotato.growingpain.log.dto.ActivityLogDTO; +import cotato.growingpain.log.dto.request.ActivityLogRequestDTO; import cotato.growingpain.log.repository.ActivityLogRepository; import cotato.growingpain.member.domain.entity.Member; import cotato.growingpain.member.repository.MemberRepository; import jakarta.transaction.Transactional; +import java.util.List; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -18,6 +20,14 @@ public class ActivityLogService { private final MemberRepository memberRepository; private final ActivityLogRepository activityLogRepository; + @Transactional + public void createActivityLog(final ActivityLogRequestDTO activityLogRequestDTO, Long memberId) { + Member member = memberRepository.findById(memberId) + .orElseThrow(() -> new RuntimeException("Member not found with ID: " + memberId)); + ActivityLog activityLog = activityLogRequestDTO.toEntity(member); + activityLogRepository.save(activityLog); + } + @Transactional public void createActivityLog(final ActivityLogDTO activityLogDto, Long memberId) { Member member = memberRepository.findById(memberId) @@ -26,4 +36,8 @@ public void createActivityLog(final ActivityLogDTO activityLogDto, Long memberId activityLogRepository.save(activityLog); } + @Transactional + public List retrieveActivityLogsByMemberId(Long memberId) { + return activityLogRepository.findByMemberId(memberId); + } } From 1ee08660eadb307bd617e2a9c21f101855958c66 Mon Sep 17 00:00:00 2001 From: nar0ng <71819594+nar0ng@users.noreply.github.com> Date: Thu, 15 Aug 2024 04:16:57 +0900 Subject: [PATCH 6/8] =?UTF-8?q?feat:=20=ED=99=9C=EB=8F=99=EA=B8=B0?= =?UTF-8?q?=EB=A1=9D=20=EC=83=81=EC=84=B8=20=EC=A1=B0=ED=9A=8C=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../log/controller/ActivityLogController.java | 22 +++++++++++++++---- .../log/repository/ActivityLogRepository.java | 3 +++ .../log/service/ActivityLogService.java | 15 +++++++------ 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/src/main/java/cotato/growingpain/log/controller/ActivityLogController.java b/src/main/java/cotato/growingpain/log/controller/ActivityLogController.java index 69a2780..d8eb7f8 100644 --- a/src/main/java/cotato/growingpain/log/controller/ActivityLogController.java +++ b/src/main/java/cotato/growingpain/log/controller/ActivityLogController.java @@ -1,8 +1,11 @@ package cotato.growingpain.log.controller; +import static cotato.growingpain.common.Response.createSuccess; + import cotato.growingpain.common.Response; import cotato.growingpain.log.domain.entity.ActivityLog; import cotato.growingpain.log.dto.ActivityLogDTO; +import cotato.growingpain.log.dto.request.ActivityLogRequestDTO; import cotato.growingpain.log.service.ActivityLogService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.media.Content; @@ -15,6 +18,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.core.annotation.AuthenticationPrincipal; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -32,10 +36,10 @@ public class ActivityLogController { @ApiResponse(content = @Content(schema = @Schema(implementation = Response.class))) @PostMapping("") @ResponseStatus(HttpStatus.CREATED) - public Response createJobPost(@RequestBody @Valid ActivityLogDTO activityLogDto, + public Response createJobPost(@RequestBody @Valid ActivityLogRequestDTO activityLogRequestDTO, @AuthenticationPrincipal Long memberId) { - activityLogService.createActivityLog(activityLogDto, memberId); - return Response.createSuccess("활동 기록 등록 완료", null); + activityLogService.createActivityLog(activityLogRequestDTO, memberId); + return createSuccess("활동 기록 등록 완료", null); } @Operation(summary = "활동 기록 리스트 조회", description = "활동 기록 리스트를 조회하기 위한 메소드") @@ -45,6 +49,16 @@ public Response createJobPost(@RequestBody @Valid ActivityLogDTO ac public Response> retrieveActivityLogList( @AuthenticationPrincipal Long memberId) { List activityLogList = activityLogService.retrieveActivityLogsByMemberId(memberId); - return Response.createSuccess("활동 기록 조회 완료", activityLogList); + return createSuccess("활동 기록 조회 완료", activityLogList); + } + + @Operation(summary = "활동 기록 상세 조회", description = "활동 기록을 상세 조회하기 위한 메소드") + @ApiResponse(content = @Content(schema = @Schema(implementation = Response.class))) + @GetMapping("/{activityLogId}") + @ResponseStatus(HttpStatus.OK) + public Response retrieveActivityLogById( + @PathVariable Long activityLogId) { + ActivityLogDTO activityLogDTO = activityLogService.retrieveActivityLogById(activityLogId); + return Response.createSuccess("활동 기록 상세 조회 완료", activityLogDTO); } } diff --git a/src/main/java/cotato/growingpain/log/repository/ActivityLogRepository.java b/src/main/java/cotato/growingpain/log/repository/ActivityLogRepository.java index 6ad8b85..2eddacd 100644 --- a/src/main/java/cotato/growingpain/log/repository/ActivityLogRepository.java +++ b/src/main/java/cotato/growingpain/log/repository/ActivityLogRepository.java @@ -2,10 +2,13 @@ import cotato.growingpain.log.domain.entity.ActivityLog; import java.util.List; +import java.util.Optional; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; @Repository public interface ActivityLogRepository extends JpaRepository { List findByMemberId(Long memberId); + + Optional findById(Long activityLogId); } diff --git a/src/main/java/cotato/growingpain/log/service/ActivityLogService.java b/src/main/java/cotato/growingpain/log/service/ActivityLogService.java index 74d0325..b4cf476 100644 --- a/src/main/java/cotato/growingpain/log/service/ActivityLogService.java +++ b/src/main/java/cotato/growingpain/log/service/ActivityLogService.java @@ -8,6 +8,7 @@ import cotato.growingpain.member.repository.MemberRepository; import jakarta.transaction.Transactional; import java.util.List; +import java.util.NoSuchElementException; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -29,15 +30,15 @@ public void createActivityLog(final ActivityLogRequestDTO activityLogRequestDTO, } @Transactional - public void createActivityLog(final ActivityLogDTO activityLogDto, Long memberId) { - Member member = memberRepository.findById(memberId) - .orElseThrow(() -> new RuntimeException("Member not found with ID: " + memberId)); - ActivityLog activityLog = activityLogDto.toEntity(member); - activityLogRepository.save(activityLog); + public List retrieveActivityLogsByMemberId(Long memberId) { + return activityLogRepository.findByMemberId(memberId); } @Transactional - public List retrieveActivityLogsByMemberId(Long memberId) { - return activityLogRepository.findByMemberId(memberId); + public ActivityLogDTO retrieveActivityLogById(Long activityLogId) { + ActivityLog activityLog = activityLogRepository.findById(activityLogId) + .orElseThrow(() -> new NoSuchElementException("ActivityLog not found with ID: " + activityLogId)); + + return ActivityLogDTO.fromEntity(activityLog); } } From 03141450d4a18e7fbf61a62154ebcafa8095124c Mon Sep 17 00:00:00 2001 From: nar0ng <71819594+nar0ng@users.noreply.github.com> Date: Thu, 15 Aug 2024 16:08:07 +0900 Subject: [PATCH 7/8] =?UTF-8?q?feat:=20=ED=99=9C=EB=8F=99=EA=B8=B0?= =?UTF-8?q?=EB=A1=9D=20=EC=88=98=EC=A0=95=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../log/controller/ActivityLogController.java | 21 ++++++++++++++----- .../log/domain/entity/ActivityLog.java | 13 ++++++++++++ .../growingpain/log/dto/ActivityLogDTO.java | 1 + .../log/repository/ActivityLogRepository.java | 3 ++- .../log/service/ActivityLogService.java | 14 ++++++++++++- .../growingpain/log/service/JobService.java | 1 + 6 files changed, 46 insertions(+), 7 deletions(-) diff --git a/src/main/java/cotato/growingpain/log/controller/ActivityLogController.java b/src/main/java/cotato/growingpain/log/controller/ActivityLogController.java index d8eb7f8..0381c22 100644 --- a/src/main/java/cotato/growingpain/log/controller/ActivityLogController.java +++ b/src/main/java/cotato/growingpain/log/controller/ActivityLogController.java @@ -3,7 +3,6 @@ import static cotato.growingpain.common.Response.createSuccess; import cotato.growingpain.common.Response; -import cotato.growingpain.log.domain.entity.ActivityLog; import cotato.growingpain.log.dto.ActivityLogDTO; import cotato.growingpain.log.dto.request.ActivityLogRequestDTO; import cotato.growingpain.log.service.ActivityLogService; @@ -18,6 +17,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.core.annotation.AuthenticationPrincipal; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PatchMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -36,8 +36,9 @@ public class ActivityLogController { @ApiResponse(content = @Content(schema = @Schema(implementation = Response.class))) @PostMapping("") @ResponseStatus(HttpStatus.CREATED) - public Response createJobPost(@RequestBody @Valid ActivityLogRequestDTO activityLogRequestDTO, - @AuthenticationPrincipal Long memberId) { + public Response createJobPost( + @RequestBody @Valid ActivityLogRequestDTO activityLogRequestDTO, + @AuthenticationPrincipal Long memberId) { activityLogService.createActivityLog(activityLogRequestDTO, memberId); return createSuccess("활동 기록 등록 완료", null); } @@ -46,9 +47,9 @@ public Response createJobPost(@RequestBody @Valid ActivityLogReques @ApiResponse(content = @Content(schema = @Schema(implementation = Response.class))) @GetMapping("") @ResponseStatus(HttpStatus.OK) - public Response> retrieveActivityLogList( + public Response> retrieveActivityLogList( @AuthenticationPrincipal Long memberId) { - List activityLogList = activityLogService.retrieveActivityLogsByMemberId(memberId); + List activityLogList = activityLogService.retrieveActivityLogsByMemberId(memberId); return createSuccess("활동 기록 조회 완료", activityLogList); } @@ -61,4 +62,14 @@ public Response retrieveActivityLogById( ActivityLogDTO activityLogDTO = activityLogService.retrieveActivityLogById(activityLogId); return Response.createSuccess("활동 기록 상세 조회 완료", activityLogDTO); } + + @Operation(summary = "활동 기록 수정", description = "활동 기록을 수정하기 위한 메소드") + @ApiResponse(content = @Content(schema = @Schema(implementation = Response.class))) + @PatchMapping("/{activityLogId}") + @ResponseStatus(HttpStatus.OK) + public Response updateActivityLog(@PathVariable Long activityLogId, + @RequestBody ActivityLogDTO updatedActivityLogDTO) { + ActivityLogDTO updatedActivityLog = activityLogService.updateActivityLog(activityLogId, updatedActivityLogDTO); + return Response.createSuccess("활동 기록 수정 완료", updatedActivityLog); + } } diff --git a/src/main/java/cotato/growingpain/log/domain/entity/ActivityLog.java b/src/main/java/cotato/growingpain/log/domain/entity/ActivityLog.java index a87e2da..6e97959 100644 --- a/src/main/java/cotato/growingpain/log/domain/entity/ActivityLog.java +++ b/src/main/java/cotato/growingpain/log/domain/entity/ActivityLog.java @@ -3,6 +3,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import cotato.growingpain.common.domain.BaseTimeEntity; import cotato.growingpain.log.ActivityCategory; +import cotato.growingpain.log.dto.ActivityLogDTO; import cotato.growingpain.member.domain.entity.Member; import jakarta.persistence.Column; import jakarta.persistence.Entity; @@ -109,4 +110,16 @@ public ActivityLog( this.activityType = activityType; this.url = url; } + + public void updateFromDTO(ActivityLogDTO updatedActivityLogDTO) { + this.activityCategory = updatedActivityLogDTO.activityCategory(); + this.activityName = updatedActivityLogDTO.activityName(); + this.content = updatedActivityLogDTO.content(); + this.performance = updatedActivityLogDTO.performance(); + this.role = updatedActivityLogDTO.role(); + this.activityDuration = updatedActivityLogDTO.activityDuration(); + this.activityType = updatedActivityLogDTO.activityType(); + this.url = updatedActivityLogDTO.url(); + this.contribution = updatedActivityLogDTO.contribution(); + } } diff --git a/src/main/java/cotato/growingpain/log/dto/ActivityLogDTO.java b/src/main/java/cotato/growingpain/log/dto/ActivityLogDTO.java index 0442b9d..8347fd4 100644 --- a/src/main/java/cotato/growingpain/log/dto/ActivityLogDTO.java +++ b/src/main/java/cotato/growingpain/log/dto/ActivityLogDTO.java @@ -23,6 +23,7 @@ public record ActivityLogDTO( public static ActivityLogDTO fromEntity(ActivityLog activityLog) { return ActivityLogDTO.builder() .id(activityLog.getId()) + .activityName(activityLog.getActivityName()) .activityCategory(activityLog.getActivityCategory()) .activityDuration(activityLog.getActivityDuration()) .content(activityLog.getContent()) diff --git a/src/main/java/cotato/growingpain/log/repository/ActivityLogRepository.java b/src/main/java/cotato/growingpain/log/repository/ActivityLogRepository.java index 2eddacd..62eb5db 100644 --- a/src/main/java/cotato/growingpain/log/repository/ActivityLogRepository.java +++ b/src/main/java/cotato/growingpain/log/repository/ActivityLogRepository.java @@ -1,6 +1,7 @@ package cotato.growingpain.log.repository; import cotato.growingpain.log.domain.entity.ActivityLog; +import cotato.growingpain.log.dto.request.ActivityLogRequestDTO; import java.util.List; import java.util.Optional; import org.springframework.data.jpa.repository.JpaRepository; @@ -8,7 +9,7 @@ @Repository public interface ActivityLogRepository extends JpaRepository { - List findByMemberId(Long memberId); + List findByMemberId(Long memberId); Optional findById(Long activityLogId); } diff --git a/src/main/java/cotato/growingpain/log/service/ActivityLogService.java b/src/main/java/cotato/growingpain/log/service/ActivityLogService.java index b4cf476..8e3aa06 100644 --- a/src/main/java/cotato/growingpain/log/service/ActivityLogService.java +++ b/src/main/java/cotato/growingpain/log/service/ActivityLogService.java @@ -30,7 +30,7 @@ public void createActivityLog(final ActivityLogRequestDTO activityLogRequestDTO, } @Transactional - public List retrieveActivityLogsByMemberId(Long memberId) { + public List retrieveActivityLogsByMemberId(Long memberId) { return activityLogRepository.findByMemberId(memberId); } @@ -41,4 +41,16 @@ public ActivityLogDTO retrieveActivityLogById(Long activityLogId) { return ActivityLogDTO.fromEntity(activityLog); } + + @Transactional + public ActivityLogDTO updateActivityLog(Long activityLogId, ActivityLogDTO updatedActivityLogDTO) { + ActivityLog existingActivityLog = activityLogRepository.findById(activityLogId) + .orElseThrow(() -> new NoSuchElementException("ActivityLog not found with ID: " + activityLogId)); + + existingActivityLog.updateFromDTO(updatedActivityLogDTO); + + ActivityLog savedActivityLog = activityLogRepository.save(existingActivityLog); + + return ActivityLogDTO.fromEntity(savedActivityLog); + } } diff --git a/src/main/java/cotato/growingpain/log/service/JobService.java b/src/main/java/cotato/growingpain/log/service/JobService.java index 9bcdb5a..0c1e5b2 100644 --- a/src/main/java/cotato/growingpain/log/service/JobService.java +++ b/src/main/java/cotato/growingpain/log/service/JobService.java @@ -87,4 +87,5 @@ public void deleteJobPost(Long jobPostId, Long memberId) { jobPostRepository.delete(jobPost); } + } From 00426edebb9b56ff2b3c02cda67a6d41be1ea323 Mon Sep 17 00:00:00 2001 From: nar0ng <71819594+nar0ng@users.noreply.github.com> Date: Thu, 15 Aug 2024 18:35:41 +0900 Subject: [PATCH 8/8] =?UTF-8?q?feat:=20=ED=99=9C=EB=8F=99=EA=B8=B0?= =?UTF-8?q?=EB=A1=9D=20=EC=82=AD=EC=A0=9C=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../log/controller/ActivityLogController.java | 12 ++++++++++++ .../log/repository/ActivityLogRepository.java | 2 ++ .../log/service/ActivityLogService.java | 9 +++++++-- .../log/service/JobApplicationService.java | 14 -------------- 4 files changed, 21 insertions(+), 16 deletions(-) delete mode 100644 src/main/java/cotato/growingpain/log/service/JobApplicationService.java diff --git a/src/main/java/cotato/growingpain/log/controller/ActivityLogController.java b/src/main/java/cotato/growingpain/log/controller/ActivityLogController.java index 0381c22..bc7f595 100644 --- a/src/main/java/cotato/growingpain/log/controller/ActivityLogController.java +++ b/src/main/java/cotato/growingpain/log/controller/ActivityLogController.java @@ -16,6 +16,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpStatus; import org.springframework.security.core.annotation.AuthenticationPrincipal; +import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PatchMapping; import org.springframework.web.bind.annotation.PathVariable; @@ -72,4 +73,15 @@ public Response updateActivityLog(@PathVariable Long activityLog ActivityLogDTO updatedActivityLog = activityLogService.updateActivityLog(activityLogId, updatedActivityLogDTO); return Response.createSuccess("활동 기록 수정 완료", updatedActivityLog); } + + @Operation(summary = "활동 기록 삭제", description = "활동 기록을 삭제하기 위한 메소드") + @ApiResponse(content = @Content(schema = @Schema(implementation = Response.class))) + @DeleteMapping("/{activityLogId}") + @ResponseStatus(HttpStatus.NO_CONTENT) + public Response deleteActivityLog(@PathVariable Long activityLogId, + @AuthenticationPrincipal Long memberId) { + activityLogService.deleteActivityLog(activityLogId, memberId); + + return Response.createSuccess("활동 기록 삭제 완료", null); + } } diff --git a/src/main/java/cotato/growingpain/log/repository/ActivityLogRepository.java b/src/main/java/cotato/growingpain/log/repository/ActivityLogRepository.java index 62eb5db..b7fc015 100644 --- a/src/main/java/cotato/growingpain/log/repository/ActivityLogRepository.java +++ b/src/main/java/cotato/growingpain/log/repository/ActivityLogRepository.java @@ -11,5 +11,7 @@ public interface ActivityLogRepository extends JpaRepository { List findByMemberId(Long memberId); + Optional findByMemberIdAndId(Long activityLogId, Long memberId); + Optional findById(Long activityLogId); } diff --git a/src/main/java/cotato/growingpain/log/service/ActivityLogService.java b/src/main/java/cotato/growingpain/log/service/ActivityLogService.java index 8e3aa06..65ce04b 100644 --- a/src/main/java/cotato/growingpain/log/service/ActivityLogService.java +++ b/src/main/java/cotato/growingpain/log/service/ActivityLogService.java @@ -46,11 +46,16 @@ public ActivityLogDTO retrieveActivityLogById(Long activityLogId) { public ActivityLogDTO updateActivityLog(Long activityLogId, ActivityLogDTO updatedActivityLogDTO) { ActivityLog existingActivityLog = activityLogRepository.findById(activityLogId) .orElseThrow(() -> new NoSuchElementException("ActivityLog not found with ID: " + activityLogId)); - existingActivityLog.updateFromDTO(updatedActivityLogDTO); - ActivityLog savedActivityLog = activityLogRepository.save(existingActivityLog); return ActivityLogDTO.fromEntity(savedActivityLog); } + + @Transactional + public void deleteActivityLog(Long activityLogId, Long memberId) { + ActivityLog existingActivityLog = activityLogRepository.findByMemberIdAndId(activityLogId, memberId) + .orElseThrow(() -> new NoSuchElementException("ActivityLog not found with ID: " + activityLogId)); + activityLogRepository.delete(existingActivityLog); + } } diff --git a/src/main/java/cotato/growingpain/log/service/JobApplicationService.java b/src/main/java/cotato/growingpain/log/service/JobApplicationService.java deleted file mode 100644 index aa29ae4..0000000 --- a/src/main/java/cotato/growingpain/log/service/JobApplicationService.java +++ /dev/null @@ -1,14 +0,0 @@ -package cotato.growingpain.log.service; - -import cotato.growingpain.member.repository.MemberRepository; -import lombok.RequiredArgsConstructor; -import org.springframework.stereotype.Service; - -@Service -@RequiredArgsConstructor -public class JobApplicationService { - - private final MemberRepository memberRepository; - - -}