-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
카테고리 목록 조회 API 구현 #158
카테고리 목록 조회 API 구현 #158
Conversation
📝 Jacoco Test Coverage
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
굳
==== 응답 | ||
include::{snippets}/category-controller-test/get-expense-categories/http-response.adoc[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
response field 실종사건
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아차차 6e1ad5d
public List<CategoryResponse> getExpenseCategories() { | ||
final List<Category> expenseCategories = categoryRepository.findExpenseCategory(); | ||
return expenseCategories.stream() | ||
.map(category -> new CategoryResponse(category.getId(), category.getKorName(), category.getEngName())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Category처럼 CategoryResponse도 EngName이 먼저 오게 통일하는거 어떤가요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아니 잘못된 생각이었음. Response에서 EngName 빼주세요. 프론트에서 영어이름 노필요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
반영완료 07716b0
responseFields( | ||
fieldWithPath("[].id") | ||
.type(JsonFieldType.NUMBER) | ||
.description("카테고리 ID") | ||
.attributes(field("constraint", "양의 정수")), | ||
fieldWithPath("[].engName") | ||
.type(JsonFieldType.STRING) | ||
.description("카테고리 영문명") | ||
.attributes(field("constraint", "50자 이하의 문자열")), | ||
fieldWithPath("[].korName") | ||
.type(JsonFieldType.STRING) | ||
.description("카테고리 한글명") | ||
.attributes(field("constraint", "50자 이하의 문자열")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RestDocs 💯
adocs에만 추가해 주시면 완벽할것같습니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
디노고생고생하셨습니다~
|
||
public interface CategoryRepository extends JpaRepository<Category, Long> { | ||
|
||
@Query("SELECT c FROM Category c WHERE MOD(c.id, 100) = 0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다!
public class CategoryFixture { | ||
|
||
public static final List<Category> EXPENSE_CATEGORIES = List.of( | ||
new Category(100L, "food", "음식"), | ||
new Category(200L, "culture", "문화"), | ||
new Category(300L, "shopping", "쇼핑"), | ||
new Category(400L, "accommodation", "숙박"), | ||
new Category(500L, "transportation", "교통"), | ||
new Category(600L, "etc", "기타") | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
경비 조회 기능 하면서 categoryFixture 추가했는데 둘중 하나로 선택해야 할 것 같네요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
대단한데?
📄 Summary
🙋🏻 More