diff --git a/src/main/java/com/sponus/sponusbe/auth/annotation/AuthOrganizationArgumentResolver.java b/src/main/java/com/sponus/sponusbe/auth/annotation/AuthOrganizationArgumentResolver.java index a7388613..e4e56b18 100644 --- a/src/main/java/com/sponus/sponusbe/auth/annotation/AuthOrganizationArgumentResolver.java +++ b/src/main/java/com/sponus/sponusbe/auth/annotation/AuthOrganizationArgumentResolver.java @@ -36,13 +36,12 @@ public boolean supportsParameter(MethodParameter parameter) { @Override public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) { + // TODO : Access Token 없는 경우 처리 CustomUserDetails userDetails = (CustomUserDetails)SecurityContextHolder.getContext() .getAuthentication() .getPrincipal(); - Organization organization = organizationRepository.findById(userDetails.getId()) + return organizationRepository.findById(userDetails.getId()) .orElseThrow(() -> new OrganizationException(OrganizationErrorCode.ORGANIZATION_NOT_FOUND)); - - return organization; } } diff --git a/src/main/java/com/sponus/sponusbe/domain/organization/entity/Organization.java b/src/main/java/com/sponus/sponusbe/domain/organization/entity/Organization.java index 67bd293f..113d864f 100644 --- a/src/main/java/com/sponus/sponusbe/domain/organization/entity/Organization.java +++ b/src/main/java/com/sponus/sponusbe/domain/organization/entity/Organization.java @@ -94,4 +94,8 @@ public class Organization extends BaseEntity { @Builder.Default @OneToMany(mappedBy = "organization") private List organizationLinks = new ArrayList<>(); + + public boolean isStudentOrganization() { + return this.organizationType == OrganizationType.STUDENT; + } } diff --git a/src/main/java/com/sponus/sponusbe/domain/propose/controller/ProposeController.java b/src/main/java/com/sponus/sponusbe/domain/propose/controller/ProposeController.java new file mode 100644 index 00000000..453ca976 --- /dev/null +++ b/src/main/java/com/sponus/sponusbe/domain/propose/controller/ProposeController.java @@ -0,0 +1,65 @@ +package com.sponus.sponusbe.domain.propose.controller; + +import java.util.List; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ModelAttribute; +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; +import org.springframework.web.bind.annotation.RestController; + +import com.sponus.sponusbe.auth.annotation.AuthOrganization; +import com.sponus.sponusbe.domain.organization.entity.Organization; +import com.sponus.sponusbe.domain.propose.controller.dto.request.ProposeCreateRequest; +import com.sponus.sponusbe.domain.propose.controller.dto.request.ProposeGetCondition; +import com.sponus.sponusbe.domain.propose.controller.dto.request.ProposeUpdateRequest; +import com.sponus.sponusbe.domain.propose.controller.dto.response.ProposeCreateResponse; +import com.sponus.sponusbe.domain.propose.controller.dto.response.ProposeDetailGetResponse; +import com.sponus.sponusbe.domain.propose.controller.dto.response.ProposeSummaryGetResponse; +import com.sponus.sponusbe.domain.propose.service.ProposeQueryService; +import com.sponus.sponusbe.domain.propose.service.ProposeService; +import com.sponus.sponusbe.global.common.ApiResponse; + +import jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; + +@RequiredArgsConstructor +@RestController +public class ProposeController { + + private final ProposeService proposeService; + private final ProposeQueryService proposeQueryService; + + @PostMapping("/api/v1/propose") + public ApiResponse createPropose( + @AuthOrganization Organization authOrganization, + @RequestBody @Valid ProposeCreateRequest request + ) { + return ApiResponse.onSuccess(proposeService.createPropose(authOrganization, request)); + } + + @GetMapping("/api/v1/propose/me") + public ApiResponse> getMyProposes( + @AuthOrganization Organization authOrganization, + @ModelAttribute @Valid ProposeGetCondition condition + ) { + return ApiResponse.onSuccess(proposeQueryService.getProposes(authOrganization, condition)); + } + + @GetMapping("/api/v1/propose/{proposeId}") + public ApiResponse getProposeDetail(@PathVariable Long proposeId) { + return ApiResponse.onSuccess(proposeQueryService.getProposeDetail(proposeId)); + } + + @PatchMapping("/api/v1/propose/{proposeId}") + public ApiResponse updatePropose( + @AuthOrganization Organization authOrganization, + @PathVariable Long proposeId, + @RequestBody @Valid ProposeUpdateRequest request + ) { + proposeService.updatePropose(authOrganization, proposeId, request); + return ApiResponse.onSuccess(null); + } +} diff --git a/src/main/java/com/sponus/sponusbe/domain/propose/controller/dto/request/ProposeCreateRequest.java b/src/main/java/com/sponus/sponusbe/domain/propose/controller/dto/request/ProposeCreateRequest.java new file mode 100644 index 00000000..f32d9126 --- /dev/null +++ b/src/main/java/com/sponus/sponusbe/domain/propose/controller/dto/request/ProposeCreateRequest.java @@ -0,0 +1,27 @@ +package com.sponus.sponusbe.domain.propose.controller.dto.request; + +import com.sponus.sponusbe.domain.announcement.entity.Announcement; +import com.sponus.sponusbe.domain.organization.entity.Organization; +import com.sponus.sponusbe.domain.propose.entity.Propose; +import com.sponus.sponusbe.domain.propose.entity.ProposeStatus; + +public record ProposeCreateRequest( + String title, + String content, + Long announcementId +) { + public Propose toEntity( + Announcement announcement, + Organization proposedOrganization, + Organization proposingOrganization + ) { + return Propose.builder() + .title(title) + .content(content) + .status(ProposeStatus.PENDING) + .announcement(announcement) + .proposedOrganization(proposedOrganization) + .proposingOrganization(proposingOrganization) + .build(); + } +} diff --git a/src/main/java/com/sponus/sponusbe/domain/propose/controller/dto/request/ProposeGetCondition.java b/src/main/java/com/sponus/sponusbe/domain/propose/controller/dto/request/ProposeGetCondition.java new file mode 100644 index 00000000..4c4b3875 --- /dev/null +++ b/src/main/java/com/sponus/sponusbe/domain/propose/controller/dto/request/ProposeGetCondition.java @@ -0,0 +1,17 @@ +package com.sponus.sponusbe.domain.propose.controller.dto.request; + +import jakarta.validation.constraints.NotNull; + +public record ProposeGetCondition( + @NotNull + ProposeType proposeType, + Long announcementId +) { + public boolean isSentPropose() { + return proposeType == ProposeType.SEND; + } + + public boolean isReceivedPropose() { + return proposeType == ProposeType.RECEIVED; + } +} diff --git a/src/main/java/com/sponus/sponusbe/domain/propose/controller/dto/request/ProposeType.java b/src/main/java/com/sponus/sponusbe/domain/propose/controller/dto/request/ProposeType.java new file mode 100644 index 00000000..3efd0aa7 --- /dev/null +++ b/src/main/java/com/sponus/sponusbe/domain/propose/controller/dto/request/ProposeType.java @@ -0,0 +1,6 @@ +package com.sponus.sponusbe.domain.propose.controller.dto.request; + +public enum ProposeType { + SEND, RECEIVED; + +} diff --git a/src/main/java/com/sponus/sponusbe/domain/propose/controller/dto/request/ProposeUpdateRequest.java b/src/main/java/com/sponus/sponusbe/domain/propose/controller/dto/request/ProposeUpdateRequest.java new file mode 100644 index 00000000..bf5332e3 --- /dev/null +++ b/src/main/java/com/sponus/sponusbe/domain/propose/controller/dto/request/ProposeUpdateRequest.java @@ -0,0 +1,10 @@ +package com.sponus.sponusbe.domain.propose.controller.dto.request; + +import com.sponus.sponusbe.domain.propose.entity.ProposeStatus; + +public record ProposeUpdateRequest( + String title, + String content, + ProposeStatus status +) { +} diff --git a/src/main/java/com/sponus/sponusbe/domain/propose/controller/dto/response/ProposeCreateResponse.java b/src/main/java/com/sponus/sponusbe/domain/propose/controller/dto/response/ProposeCreateResponse.java new file mode 100644 index 00000000..0b35dc24 --- /dev/null +++ b/src/main/java/com/sponus/sponusbe/domain/propose/controller/dto/response/ProposeCreateResponse.java @@ -0,0 +1,6 @@ +package com.sponus.sponusbe.domain.propose.controller.dto.response; + +public record ProposeCreateResponse( + Long proposeId +) { +} diff --git a/src/main/java/com/sponus/sponusbe/domain/propose/controller/dto/response/ProposeDetailGetResponse.java b/src/main/java/com/sponus/sponusbe/domain/propose/controller/dto/response/ProposeDetailGetResponse.java new file mode 100644 index 00000000..d539d747 --- /dev/null +++ b/src/main/java/com/sponus/sponusbe/domain/propose/controller/dto/response/ProposeDetailGetResponse.java @@ -0,0 +1,42 @@ +package com.sponus.sponusbe.domain.propose.controller.dto.response; + +import java.time.format.DateTimeFormatter; +import java.util.Locale; + +import com.sponus.sponusbe.domain.propose.entity.Propose; + +public record ProposeDetailGetResponse( + Long proposeId, + String title, + String content, + String status, + String proposeImageUrl, + Long proposedOrganizationId, + String proposedOrganizationName, + Long proposingOrganizationId, + String proposingOrganizationName, + + // TODO : 공고 상세 정보 (공고에서 묶기!) + Long announcementId, + String createdDate, + String createdDay +) { + public static ProposeDetailGetResponse from(Propose propose) { + DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("MM.dd"); + DateTimeFormatter dayFormatter = DateTimeFormatter.ofPattern("EEE", Locale.ENGLISH); + return new ProposeDetailGetResponse( + propose.getId(), + propose.getTitle(), + propose.getContent(), + propose.getStatus().name(), + null, // TODO : 제안 이미지 URL + propose.getProposedOrganization().getId(), + propose.getProposedOrganization().getName(), + propose.getProposingOrganization().getId(), + propose.getProposingOrganization().getName(), + propose.getAnnouncement().getId(), + propose.getCreatedAt().format(dateFormatter), + propose.getUpdatedAt().format(dayFormatter) + ); + } +} diff --git a/src/main/java/com/sponus/sponusbe/domain/propose/controller/dto/response/ProposeSummaryGetResponse.java b/src/main/java/com/sponus/sponusbe/domain/propose/controller/dto/response/ProposeSummaryGetResponse.java new file mode 100644 index 00000000..f97df404 --- /dev/null +++ b/src/main/java/com/sponus/sponusbe/domain/propose/controller/dto/response/ProposeSummaryGetResponse.java @@ -0,0 +1,40 @@ +package com.sponus.sponusbe.domain.propose.controller.dto.response; + +import java.time.format.DateTimeFormatter; +import java.util.Locale; + +import com.sponus.sponusbe.domain.propose.entity.Propose; + +public record ProposeSummaryGetResponse( + Long proposeId, + String title, + String status, + String proposeImageUrl, + Long proposedOrganizationId, + String proposedOrganizationName, + Long proposingOrganizationId, + String proposingOrganizationName, + + // TODO : 공고 간략 정보 (공고에서 묶기!) + Long announcementId, + String createdDate, + String createdDay +) { + public static ProposeSummaryGetResponse from(Propose propose) { + DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("MM.dd"); + DateTimeFormatter dayFormatter = DateTimeFormatter.ofPattern("EEE", Locale.ENGLISH); + return new ProposeSummaryGetResponse( + propose.getId(), + propose.getTitle(), + propose.getStatus().name(), + null, // TODO : 제안 이미지 URL + propose.getProposedOrganization().getId(), + propose.getProposedOrganization().getName(), + propose.getProposingOrganization().getId(), + propose.getProposingOrganization().getName(), + propose.getAnnouncement().getId(), + propose.getCreatedAt().format(dateFormatter), + propose.getUpdatedAt().format(dayFormatter) + ); + } +} diff --git a/src/main/java/com/sponus/sponusbe/domain/propose/entity/Propose.java b/src/main/java/com/sponus/sponusbe/domain/propose/entity/Propose.java index a16ec93b..9d7f440b 100644 --- a/src/main/java/com/sponus/sponusbe/domain/propose/entity/Propose.java +++ b/src/main/java/com/sponus/sponusbe/domain/propose/entity/Propose.java @@ -6,6 +6,7 @@ import com.sponus.sponusbe.domain.announcement.entity.Announcement; import com.sponus.sponusbe.domain.organization.entity.Organization; import com.sponus.sponusbe.domain.report.entity.Report; +import com.sponus.sponusbe.global.common.BaseEntity; import jakarta.persistence.Column; import jakarta.persistence.ConstraintMode; @@ -32,7 +33,7 @@ @Getter @Entity @Table(name = "propose") -public class Propose { +public class Propose extends BaseEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -48,14 +49,19 @@ public class Propose { @Column(name = "propose_status", nullable = false) private ProposeStatus status; - @ManyToOne(fetch = FetchType.LAZY, optional = false) + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "announcement_id", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT)) private Announcement announcement; - @ManyToOne(fetch = FetchType.LAZY, optional = false) + @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "proposed_organization_id", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT)) private Organization proposedOrganization; + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "proposing_organization_id", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT)) + private Organization proposingOrganization; + + // TODO : 추후에 연관관계 제거 -> 그냥 proposingOrganizationType, getStudentOrganization 메서드로 대체하는게 좋을 것 같음 @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "student_organization_id", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT)) private Organization studentOrganization; @@ -71,4 +77,10 @@ public class Propose { @Builder.Default @OneToMany(mappedBy = "propose") private List proposeAttachments = new ArrayList<>(); + + public void update(String title, String content, ProposeStatus status) { + this.title = title == null ? this.title : title; + this.content = content == null ? this.content : content; + this.status = status == null ? this.status : status; + } } diff --git a/src/main/java/com/sponus/sponusbe/domain/propose/entity/ProposeStatus.java b/src/main/java/com/sponus/sponusbe/domain/propose/entity/ProposeStatus.java index 6a198ae6..e9410d75 100644 --- a/src/main/java/com/sponus/sponusbe/domain/propose/entity/ProposeStatus.java +++ b/src/main/java/com/sponus/sponusbe/domain/propose/entity/ProposeStatus.java @@ -1,5 +1,5 @@ package com.sponus.sponusbe.domain.propose.entity; public enum ProposeStatus { - PENDING, ACCEPTED, REJECTED, CANCELED + PENDING, ACCEPTED, REJECTED, SUSPENDED, CANCELED, ACCEPTED_AND_PAID; } diff --git a/src/main/java/com/sponus/sponusbe/domain/propose/exception/ProposeErrorCode.java b/src/main/java/com/sponus/sponusbe/domain/propose/exception/ProposeErrorCode.java new file mode 100644 index 00000000..ebaa6d5a --- /dev/null +++ b/src/main/java/com/sponus/sponusbe/domain/propose/exception/ProposeErrorCode.java @@ -0,0 +1,27 @@ +package com.sponus.sponusbe.domain.propose.exception; + +import org.springframework.http.HttpStatus; + +import com.sponus.sponusbe.global.common.ApiResponse; +import com.sponus.sponusbe.global.common.BaseErrorCode; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum ProposeErrorCode implements BaseErrorCode { + ANNOUNCEMENT_ID_IS_REQUIRED(HttpStatus.BAD_REQUEST, "4001", "공고 ID가 필요합니다."), + INVALID_ORGANIZATION(HttpStatus.BAD_REQUEST, "4002", "해당 단체의 제안이 아닙니다."), + PROPOSE_NOT_FOUND(HttpStatus.NOT_FOUND, "4041", "해당 제안이 존재하지 않습니다."), + INTERNAL_PROPOSE_EXCEPTION(HttpStatus.INTERNAL_SERVER_ERROR, "5001", "서버 에러가 발생했습니다. 관리자에게 문의해주세요."); + + private final HttpStatus httpStatus; + private final String code; + private final String message; + + @Override + public ApiResponse getErrorResponse() { + return ApiResponse.onFailure(code, message); + } +} diff --git a/src/main/java/com/sponus/sponusbe/domain/propose/exception/ProposeException.java b/src/main/java/com/sponus/sponusbe/domain/propose/exception/ProposeException.java new file mode 100644 index 00000000..389f3103 --- /dev/null +++ b/src/main/java/com/sponus/sponusbe/domain/propose/exception/ProposeException.java @@ -0,0 +1,11 @@ +package com.sponus.sponusbe.domain.propose.exception; + +import com.sponus.sponusbe.global.common.BaseErrorCode; +import com.sponus.sponusbe.global.common.exception.CustomException; + +public class ProposeException extends CustomException { + + public ProposeException(BaseErrorCode errorCode) { + super(errorCode); + } +} diff --git a/src/main/java/com/sponus/sponusbe/domain/propose/repository/ProposeRepository.java b/src/main/java/com/sponus/sponusbe/domain/propose/repository/ProposeRepository.java new file mode 100644 index 00000000..3195bbeb --- /dev/null +++ b/src/main/java/com/sponus/sponusbe/domain/propose/repository/ProposeRepository.java @@ -0,0 +1,17 @@ +package com.sponus.sponusbe.domain.propose.repository; + +import java.util.List; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; + +import com.sponus.sponusbe.domain.propose.entity.Propose; + +public interface ProposeRepository extends JpaRepository { + @Query("SELECT p FROM Propose p WHERE p.proposingOrganization.id = :id") + List findSentPropose(Long id); + + @Query("SELECT p FROM Propose p WHERE p.proposedOrganization.id = :organizationId AND p.announcement.id = :announcementId") + List findReceivedProposeWithAnnouncementId(Long organizationId, Long announcementId); + +} diff --git a/src/main/java/com/sponus/sponusbe/domain/propose/service/ProposeQueryService.java b/src/main/java/com/sponus/sponusbe/domain/propose/service/ProposeQueryService.java new file mode 100644 index 00000000..a6d3a806 --- /dev/null +++ b/src/main/java/com/sponus/sponusbe/domain/propose/service/ProposeQueryService.java @@ -0,0 +1,54 @@ +package com.sponus.sponusbe.domain.propose.service; + +import java.util.List; + +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.sponus.sponusbe.domain.organization.entity.Organization; +import com.sponus.sponusbe.domain.propose.controller.dto.request.ProposeGetCondition; +import com.sponus.sponusbe.domain.propose.controller.dto.response.ProposeDetailGetResponse; +import com.sponus.sponusbe.domain.propose.controller.dto.response.ProposeSummaryGetResponse; +import com.sponus.sponusbe.domain.propose.entity.Propose; +import com.sponus.sponusbe.domain.propose.exception.ProposeErrorCode; +import com.sponus.sponusbe.domain.propose.exception.ProposeException; +import com.sponus.sponusbe.domain.propose.repository.ProposeRepository; + +import lombok.RequiredArgsConstructor; + +@RequiredArgsConstructor +@Transactional(readOnly = true) +@Service +public class ProposeQueryService { + + private final ProposeRepository proposeRepository; + + public List getProposes(Organization organization, ProposeGetCondition condition) { + // TODO : 추후에 QueryDSL 이용 + List response; + if (condition.isSentPropose()) { + // 내가 보낸 제안은 그냥 반환 + response = proposeRepository.findSentPropose(organization.getId()).stream() + .map(ProposeSummaryGetResponse::from) + .toList(); + } else { + // 내가 받은 제안은 공고 id 별로 보여줘야하고, 공고 id가 없으면 안됨 + if (condition.announcementId() == null) { + throw new ProposeException(ProposeErrorCode.ANNOUNCEMENT_ID_IS_REQUIRED); + } + response = proposeRepository.findReceivedProposeWithAnnouncementId( + organization.getId(), + condition.announcementId()) + .stream() + .map(ProposeSummaryGetResponse::from) + .toList(); + } + return response; + } + + public ProposeDetailGetResponse getProposeDetail(Long proposeId) { + final Propose propose = proposeRepository.findById(proposeId) + .orElseThrow(() -> new ProposeException(ProposeErrorCode.PROPOSE_NOT_FOUND)); + return ProposeDetailGetResponse.from(propose); + } +} diff --git a/src/main/java/com/sponus/sponusbe/domain/propose/service/ProposeService.java b/src/main/java/com/sponus/sponusbe/domain/propose/service/ProposeService.java new file mode 100644 index 00000000..b32ec749 --- /dev/null +++ b/src/main/java/com/sponus/sponusbe/domain/propose/service/ProposeService.java @@ -0,0 +1,69 @@ +package com.sponus.sponusbe.domain.propose.service; + +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.sponus.sponusbe.domain.announcement.entity.Announcement; +import com.sponus.sponusbe.domain.announcement.entity.enums.AnnouncementCategory; +import com.sponus.sponusbe.domain.announcement.entity.enums.AnnouncementStatus; +import com.sponus.sponusbe.domain.announcement.entity.enums.AnnouncementType; +import com.sponus.sponusbe.domain.organization.entity.Organization; +import com.sponus.sponusbe.domain.propose.controller.dto.request.ProposeCreateRequest; +import com.sponus.sponusbe.domain.propose.controller.dto.request.ProposeUpdateRequest; +import com.sponus.sponusbe.domain.propose.controller.dto.response.ProposeCreateResponse; +import com.sponus.sponusbe.domain.propose.entity.Propose; +import com.sponus.sponusbe.domain.propose.exception.ProposeErrorCode; +import com.sponus.sponusbe.domain.propose.exception.ProposeException; +import com.sponus.sponusbe.domain.propose.repository.ProposeRepository; + +import lombok.RequiredArgsConstructor; + +@RequiredArgsConstructor +@Transactional +@Service +public class ProposeService { + + private final ProposeRepository proposeRepository; + + public ProposeCreateResponse createPropose(Organization authOrganization, ProposeCreateRequest request) { + // TODO : 공지쪽 연관관계로 인해 동작 안함 + Announcement announcement = getAvailableAnnouncement(request.announcementId()); + return new ProposeCreateResponse( + proposeRepository.save( + request.toEntity( + announcement, + authOrganization, + announcement.getWriter() + ) + ).getId() + ); + } + + public void updatePropose(Organization authOrganization, Long proposeId, ProposeUpdateRequest request) { + final Propose propose = proposeRepository.findById(proposeId) + .orElseThrow(() -> new ProposeException(ProposeErrorCode.PROPOSE_NOT_FOUND)); + + if (!isOrganizationsPropose(authOrganization.getId(), propose)) + throw new ProposeException(ProposeErrorCode.INVALID_ORGANIZATION); + + propose.update(request.title(), request.content(), request.status()); + } + + private boolean isOrganizationsPropose(Long organizationId, Propose propose) { + return propose.getProposingOrganization().getId().equals(organizationId); + } + + private Announcement getAvailableAnnouncement(Long announcementId) { + // TODO : announcementId로 announcement를 찾아서 반환 + // return announcementRepository.findById(announcementId) + // .orElseThrow(() -> new AnnouncementException(AnnouncementErrorCode.ANNOUNCEMENT_NOT_FOUND)); + return Announcement.builder() + .title("title") + .type(AnnouncementType.COLLABORATION) + .category(AnnouncementCategory.IDEA) + .content("content") + .status(AnnouncementStatus.POSTED) + .build(); + } + +} diff --git a/src/main/java/com/sponus/sponusbe/global/common/exception/CustomException.java b/src/main/java/com/sponus/sponusbe/global/common/exception/CustomException.java index 03c69fa6..0510765e 100644 --- a/src/main/java/com/sponus/sponusbe/global/common/exception/CustomException.java +++ b/src/main/java/com/sponus/sponusbe/global/common/exception/CustomException.java @@ -7,7 +7,7 @@ @Getter public class CustomException extends RuntimeException { - private final transient BaseErrorCode errorCode; + private final BaseErrorCode errorCode; public CustomException(BaseErrorCode errorCode) { this.errorCode = errorCode;