-
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 #27 from impati/feature/product-19
상품 CRUD 작업분 리팩토링
- Loading branch information
Showing
16 changed files
with
142 additions
and
81 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
6 changes: 6 additions & 0 deletions
6
product-api/src/main/kotlin/com/example/productapi/product/api/exceptionhandler/Error.kt
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,6 @@ | ||
package com.example.productapi.product.api.exceptionhandler | ||
|
||
class Error( | ||
val fieldName: String, | ||
val rejectedValue: String | ||
) |
5 changes: 3 additions & 2 deletions
5
...-api/src/main/kotlin/com/example/productapi/product/api/exceptionhandler/ErrorResponse.kt
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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
package com.example.productapi.product.api.exceptionhandler | ||
|
||
class ErrorResponse( | ||
class ErrorResponse<T>( | ||
val statusCode: String, | ||
val message: String | ||
val message: String, | ||
val errorData: T? = null | ||
) { | ||
} |
54 changes: 43 additions & 11 deletions
54
...ain/kotlin/com/example/productapi/product/api/exceptionhandler/ProductExceptionHandler.kt
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
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
21 changes: 21 additions & 0 deletions
21
product-api/src/test/kotlin/com/example/productapi/product/api/controller/RestDocsUtils.kt
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,21 @@ | ||
package com.example.productapi.product.api.controller | ||
|
||
|
||
import org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document | ||
import org.springframework.restdocs.mockmvc.RestDocumentationResultHandler | ||
import org.springframework.restdocs.operation.preprocess.Preprocessors | ||
import org.springframework.restdocs.snippet.Snippet | ||
|
||
class RestDocsUtils { | ||
|
||
companion object { | ||
fun prettyDocument(identifier: String, vararg snippets: Snippet): RestDocumentationResultHandler { | ||
return document( | ||
identifier, | ||
Preprocessors.preprocessRequest(Preprocessors.prettyPrint()), | ||
Preprocessors.preprocessResponse(Preprocessors.prettyPrint()), | ||
*snippets | ||
) | ||
} | ||
} | ||
} |
Oops, something went wrong.