-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ✨ 포트폴리오 Repository, Exception 작성 * ✨ 가능한 작업 Repository, Exception 작성 * ✨ 홍보 요청 내역 Repository, Exception 작성 * ✨ 홍보 내역 결과 Repository, Exception 작성 * ♻️ 메소드명 변경
- Loading branch information
1 parent
c5ab024
commit e8089dd
Showing
14 changed files
with
182 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/main/java/org/example/gather_back_end/portfolio/exception/PortfolioErrorCode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.example.gather_back_end.portfolio.exception; | ||
|
||
import static org.example.gather_back_end.util.constant.StaticValue.NOT_FOUND; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import org.example.gather_back_end.util.exception.BaseErrorCode; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public enum PortfolioErrorCode implements BaseErrorCode { | ||
|
||
PORTFOLIO_NOT_FOUND_EXCEPTION(NOT_FOUND, "PORTFOLIO_404", "존재하지 않는 포트폴리오입니다."); | ||
|
||
private final int httpStatus; | ||
private final String code; | ||
private final String message; | ||
} |
10 changes: 10 additions & 0 deletions
10
...main/java/org/example/gather_back_end/portfolio/exception/PortfolioNotFoundException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.example.gather_back_end.portfolio.exception; | ||
|
||
import org.example.gather_back_end.util.exception.BaseException; | ||
|
||
public class PortfolioNotFoundException extends BaseException { | ||
|
||
public PortfolioNotFoundException() { | ||
super(PortfolioErrorCode.PORTFOLIO_NOT_FOUND_EXCEPTION); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...ava/org/example/gather_back_end/promotionrequest/exception/PromotionRequestErrorCode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.example.gather_back_end.promotionrequest.exception; | ||
|
||
import static org.example.gather_back_end.util.constant.StaticValue.NOT_FOUND; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import org.example.gather_back_end.util.exception.BaseErrorCode; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public enum PromotionRequestErrorCode implements BaseErrorCode { | ||
|
||
PROMOTION_REQUEST_NOT_FOUND_EXCEPTION(NOT_FOUND, "PROMOTION_REQUEST_404", "존재하지 않는 홍보 요청 내역입니다."); | ||
|
||
private final int httpStatus; | ||
private final String code; | ||
private final String message; | ||
} |
10 changes: 10 additions & 0 deletions
10
...example/gather_back_end/promotionrequest/exception/PromotionRequestNotFoundException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.example.gather_back_end.promotionrequest.exception; | ||
|
||
import org.example.gather_back_end.util.exception.BaseException; | ||
|
||
public class PromotionRequestNotFoundException extends BaseException { | ||
|
||
public PromotionRequestNotFoundException() { | ||
super(PromotionRequestErrorCode.PROMOTION_REQUEST_NOT_FOUND_EXCEPTION); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
.../java/org/example/gather_back_end/promotionresult/exception/PromotionResultErrorCode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.example.gather_back_end.promotionresult.exception; | ||
|
||
import static org.example.gather_back_end.util.constant.StaticValue.NOT_FOUND; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import org.example.gather_back_end.util.exception.BaseErrorCode; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public enum PromotionResultErrorCode implements BaseErrorCode { | ||
|
||
PROMOTION_RESULT_NOT_FOUND_EXCEPTION(NOT_FOUND, "PROMOTION_RESULT_404", "존재하지 않는 홍보 요청 결과 내역입니다."); | ||
|
||
private final int httpStatus; | ||
private final String code; | ||
private final String message; | ||
} |
11 changes: 11 additions & 0 deletions
11
...g/example/gather_back_end/promotionresult/exception/PromotionResultNotFoundException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package org.example.gather_back_end.promotionresult.exception; | ||
|
||
import org.example.gather_back_end.util.exception.BaseException; | ||
|
||
public class PromotionResultNotFoundException extends BaseException { | ||
|
||
public PromotionResultNotFoundException() { | ||
super(PromotionResultErrorCode.PROMOTION_RESULT_NOT_FOUND_EXCEPTION); | ||
} | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/org/example/gather_back_end/repository/PortfolioRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.example.gather_back_end.repository; | ||
|
||
import java.util.Optional; | ||
import org.example.gather_back_end.domain.Portfolio; | ||
import org.example.gather_back_end.portfolio.exception.PortfolioNotFoundException; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface PortfolioRepository extends JpaRepository<Portfolio, Long> { | ||
|
||
default Portfolio getById(Long id) { | ||
return findById(id).orElseThrow(PortfolioNotFoundException::new); | ||
} | ||
|
||
Optional<Portfolio> findById(Long id); | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/org/example/gather_back_end/repository/PromotionRequestRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.example.gather_back_end.repository; | ||
|
||
import java.util.Optional; | ||
import org.example.gather_back_end.domain.PromotionRequest; | ||
import org.example.gather_back_end.promotionrequest.exception.PromotionRequestNotFoundException; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface PromotionRequestRepository extends JpaRepository<PromotionRequest, Long> { | ||
|
||
default PromotionRequest getById(Long id) { | ||
return findById(id).orElseThrow(PromotionRequestNotFoundException::new); | ||
} | ||
Optional<PromotionRequest> findById(Long id); | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/org/example/gather_back_end/repository/PromotionResultRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.example.gather_back_end.repository; | ||
|
||
import java.util.Optional; | ||
import org.example.gather_back_end.domain.PromotionResult; | ||
import org.example.gather_back_end.promotionresult.exception.PromotionResultNotFoundException; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface PromotionResultRepository extends JpaRepository<PromotionResult, Long> { | ||
|
||
default PromotionResult getById(Long id) { | ||
return findById(id).orElseThrow(PromotionResultNotFoundException::new); | ||
} | ||
|
||
Optional<PromotionResult> findById(Long id); | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/org/example/gather_back_end/repository/WorkRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.example.gather_back_end.repository; | ||
|
||
import java.util.Optional; | ||
import org.example.gather_back_end.domain.Work; | ||
import org.example.gather_back_end.work.exception.WorkNotFoundException; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface WorkRepository extends JpaRepository<Work, Long> { | ||
|
||
default Work getById(Long id) { | ||
return findById(id).orElseThrow(WorkNotFoundException::new); | ||
} | ||
|
||
Optional<Work> findById(Long id); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/main/java/org/example/gather_back_end/work/exception/WorkErrorCode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.example.gather_back_end.work.exception; | ||
|
||
import static org.example.gather_back_end.util.constant.StaticValue.NOT_FOUND; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import org.example.gather_back_end.util.exception.BaseErrorCode; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public enum WorkErrorCode implements BaseErrorCode { | ||
|
||
WORK_NOT_FOUND_EXCEPTION(NOT_FOUND, "WORK_404", "존재하지 않는 작업입니다."); | ||
|
||
private final int httpStatus; | ||
private final String code; | ||
private final String message; | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/org/example/gather_back_end/work/exception/WorkNotFoundException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.example.gather_back_end.work.exception; | ||
|
||
import org.example.gather_back_end.util.exception.BaseException; | ||
|
||
public class WorkNotFoundException extends BaseException { | ||
|
||
public WorkNotFoundException() { | ||
super(WorkErrorCode.WORK_NOT_FOUND_EXCEPTION); | ||
} | ||
} |