diff --git a/src/main/java/com/parentsgowork/server/domain/JobInfo.java b/src/main/java/com/parentsgowork/server/domain/JobInfo.java index f3794a9..c3f6950 100644 --- a/src/main/java/com/parentsgowork/server/domain/JobInfo.java +++ b/src/main/java/com/parentsgowork/server/domain/JobInfo.java @@ -25,7 +25,8 @@ public class JobInfo extends BaseEntity { @Column private String title; - @Column + @Lob + @Column(columnDefinition = "LONGTEXT") private String content; // @Column(columnDefinition = "TEXT") diff --git a/src/main/java/com/parentsgowork/server/service/educationInfoService/EducationInfoCommandService.java b/src/main/java/com/parentsgowork/server/service/educationInfoService/EducationInfoCommandService.java index 9f41423..f918332 100644 --- a/src/main/java/com/parentsgowork/server/service/educationInfoService/EducationInfoCommandService.java +++ b/src/main/java/com/parentsgowork/server/service/educationInfoService/EducationInfoCommandService.java @@ -3,6 +3,6 @@ import com.parentsgowork.server.web.dto.EducationInfoDTO.EducationInfoResponseDTO; public interface EducationInfoCommandService { - EducationInfoResponseDTO.DeleteEducationInfoDTO delete(Long userId, Long educationInfoId); + EducationInfoResponseDTO.DeleteEducationInfoDTO delete(Long educationInfoId, Long userId); } diff --git a/src/main/java/com/parentsgowork/server/service/educationInfoService/EducationInfoCommandServiceImpl.java b/src/main/java/com/parentsgowork/server/service/educationInfoService/EducationInfoCommandServiceImpl.java index a6653c6..458c464 100644 --- a/src/main/java/com/parentsgowork/server/service/educationInfoService/EducationInfoCommandServiceImpl.java +++ b/src/main/java/com/parentsgowork/server/service/educationInfoService/EducationInfoCommandServiceImpl.java @@ -19,7 +19,7 @@ public class EducationInfoCommandServiceImpl implements EducationInfoCommandServ private final UserRepository userRepository; @Override - public EducationInfoResponseDTO.DeleteEducationInfoDTO delete(Long userId, Long educationInfoId) { + public EducationInfoResponseDTO.DeleteEducationInfoDTO delete(Long educationInfoId, Long userId) { userRepository.findById(userId) .orElseThrow(() -> new UserHandler(ErrorStatus.USER_NOT_FOUND)); diff --git a/src/main/java/com/parentsgowork/server/service/jobInfoService/JobInfoCommandService.java b/src/main/java/com/parentsgowork/server/service/jobInfoService/JobInfoCommandService.java index 5758d7b..59fda50 100644 --- a/src/main/java/com/parentsgowork/server/service/jobInfoService/JobInfoCommandService.java +++ b/src/main/java/com/parentsgowork/server/service/jobInfoService/JobInfoCommandService.java @@ -9,6 +9,6 @@ public interface JobInfoCommandService { List addJobInfo(Long userId, List saveJobInfoDTOList); - JobInfoResponseDTO.DeleteJobInfoDTO delete(Long userId, Long jobInfoId); + JobInfoResponseDTO.DeleteJobInfoDTO delete(Long jobInfoId, Long userId); } diff --git a/src/main/java/com/parentsgowork/server/service/jobInfoService/JobInfoCommandServiceImpl.java b/src/main/java/com/parentsgowork/server/service/jobInfoService/JobInfoCommandServiceImpl.java index 5dcce22..423a2b8 100644 --- a/src/main/java/com/parentsgowork/server/service/jobInfoService/JobInfoCommandServiceImpl.java +++ b/src/main/java/com/parentsgowork/server/service/jobInfoService/JobInfoCommandServiceImpl.java @@ -45,7 +45,7 @@ public List addJobInfo(Long userId, List new JobInfoHandler(ErrorStatus.USER_NOT_FOUND)); diff --git a/src/main/java/com/parentsgowork/server/service/policyInfoService/PolicyInfoCommandService.java b/src/main/java/com/parentsgowork/server/service/policyInfoService/PolicyInfoCommandService.java index 66e3257..de96234 100644 --- a/src/main/java/com/parentsgowork/server/service/policyInfoService/PolicyInfoCommandService.java +++ b/src/main/java/com/parentsgowork/server/service/policyInfoService/PolicyInfoCommandService.java @@ -4,6 +4,6 @@ import com.parentsgowork.server.web.dto.PolicyInfoDTO.PolicyInfoResponseDTO; public interface PolicyInfoCommandService { - PolicyInfoResponseDTO.DeletePolicyInfoDTO delete(Long userId, Long policyInfoId); + PolicyInfoResponseDTO.DeletePolicyInfoDTO delete(Long policyInfoId, Long userId); } diff --git a/src/main/java/com/parentsgowork/server/service/policyInfoService/PolicyInfoCommandServiceImpl.java b/src/main/java/com/parentsgowork/server/service/policyInfoService/PolicyInfoCommandServiceImpl.java index de80741..acfe26a 100644 --- a/src/main/java/com/parentsgowork/server/service/policyInfoService/PolicyInfoCommandServiceImpl.java +++ b/src/main/java/com/parentsgowork/server/service/policyInfoService/PolicyInfoCommandServiceImpl.java @@ -9,8 +9,10 @@ import com.parentsgowork.server.repository.UserRepository; import com.parentsgowork.server.web.dto.PolicyInfoDTO.PolicyInfoResponseDTO; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; +@Slf4j @Service @RequiredArgsConstructor public class PolicyInfoCommandServiceImpl implements PolicyInfoCommandService { @@ -19,16 +21,23 @@ public class PolicyInfoCommandServiceImpl implements PolicyInfoCommandService { private final UserRepository userRepository; @Override - public PolicyInfoResponseDTO.DeletePolicyInfoDTO delete(Long userId, Long policyInfoId) { + public PolicyInfoResponseDTO.DeletePolicyInfoDTO delete(Long policyInfoId, Long userId) { + log.info("[삭제 시도] userId: {}, policyInfoId: {}", userId, policyInfoId); userRepository.findById(userId) .orElseThrow(() -> new UserHandler(ErrorStatus.USER_NOT_FOUND)); PolicyInfo policyInfo = policyInfoRepository.findByIdAndUserId(policyInfoId, userId) - .orElseThrow(() -> new PolicyInfoHandler(ErrorStatus.POLICY_INFO_NOT_FOUND)); + .orElseThrow(() -> { + log.warn("[삭제 실패] policyInfoId: {}는 userId: {}의 데이터가 아님 또는 없음", policyInfoId, userId); + return new PolicyInfoHandler(ErrorStatus.POLICY_INFO_NOT_FOUND); + }); policyInfoRepository.deleteById(policyInfoId); + log.info("[삭제 성공] policyInfoId: {}", policyInfoId); + return PolicyInfoConverter.DeletePolicyInfoDTO(policyInfo); } + }