-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from kea-dpang/develop
Develop
- Loading branch information
Showing
13 changed files
with
246 additions
and
93 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
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
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,33 @@ | ||
package kea.dpang.item.base; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
/** | ||
* BaseErrorResponse는 API 에러 응답의 기본 형식을 정의하는 클래스 | ||
* 모든 API 에러 응답은 이 클래스를 상속받아야 하며, BaseResponse의 속성에 추가로 에러에 대한 상세 정보를 포함한다. | ||
*/ | ||
@Getter | ||
@Setter | ||
public class ErrorResponse extends BaseResponse { | ||
|
||
private String error; | ||
private String path; | ||
private LocalDateTime timestamp; | ||
|
||
/** | ||
* @param status HTTP 상태 코드 | ||
* @param message 에러 메시지 | ||
* @param error 발생한 에러의 이름 | ||
* @param path 에러가 발생한 요청 경로 | ||
* @param timestamp 에러 발생 시간 | ||
*/ | ||
public ErrorResponse(int status, String message, String error, String path, LocalDateTime timestamp) { | ||
super(status, message); | ||
this.error = error; | ||
this.path = path; | ||
this.timestamp = timestamp; | ||
} | ||
} |
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,27 @@ | ||
package kea.dpang.item.base; | ||
|
||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
/** | ||
* SuccessResponse는 API 성공 응답의 기본 형식을 정의하는 클래스 | ||
* 모든 API 성공 응답은 이 클래스를 상속받아야 하며, BaseResponse의 속성에 추가로 성공에 대한 데이터를 포함한다. | ||
*/ | ||
@Getter | ||
@Setter | ||
public class SuccessResponse<T> extends BaseResponse { | ||
|
||
private T data; | ||
|
||
/** | ||
* @param status HTTP 상태 코드 | ||
* @param message 성공 메시지 | ||
* @param data 성공 데이터 | ||
*/ | ||
public SuccessResponse(int status, String message, T data) { | ||
super(status, message); | ||
this.data = data; | ||
} | ||
} | ||
|
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
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
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
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
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,15 @@ | ||
package kea.dpang.item.feign; | ||
|
||
import kea.dpang.item.base.SuccessResponse; | ||
import org.springframework.cloud.openfeign.FeignClient; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
|
||
@FeignClient(name = "user-server") | ||
public interface UserFeignClient { | ||
|
||
// 리뷰 작성자 이름을 받아오기 위한 API | ||
@GetMapping("/api/users/reviewer/{reviewerId}") | ||
ResponseEntity<SuccessResponse<String>> getReviewer (@PathVariable Long reviewerId); | ||
} |
Oops, something went wrong.