Skip to content
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

Merged
merged 10 commits into from
Jul 27, 2023
Merged

Conversation

jjongwa
Copy link
Member

@jjongwa jjongwa commented Jul 27, 2023

📄 Summary

#153

🙋🏻 More

신속 정확 구현
RestDocs까지 막힘없이 한 번에?! 폼 미쳤다 진짜

@jjongwa jjongwa added this to the 3차 스프린트 milestone Jul 27, 2023
@jjongwa jjongwa self-assigned this Jul 27, 2023
@github-actions
Copy link

github-actions bot commented Jul 27, 2023

📝 Jacoco Test Coverage

Total Project Coverage 81.76% 🍏
File Coverage [86.9%]
Expense.java 100% 🍏
CategoryResponse.java 100% 🍏
ExpenseResponse.java 100% 🍏
PlaceResponse.java 100% 🍏
CategoryController.java 100% 🍏
CategoryService.java 100% 🍏
ItemService.java 83.52% 🍏
Category.java 75%
Place.java 64.71%

Copy link
Collaborator

@LJW25 LJW25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +179 to +180
==== 응답
include::{snippets}/category-controller-test/get-expense-categories/http-response.adoc[]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

response field 실종사건

Copy link
Member Author

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()))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Category처럼 CategoryResponse도 EngName이 먼저 오게 통일하는거 어떤가요?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아니 잘못된 생각이었음. Response에서 EngName 빼주세요. 프론트에서 영어이름 노필요

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

반영완료 07716b0

Comment on lines 56 to 68
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자 이하의 문자열"))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RestDocs 💯
adocs에만 추가해 주시면 완벽할것같습니다

Copy link
Collaborator

@hgo641 hgo641 left a 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")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍👍

Copy link
Collaborator

@waterricecake waterricecake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!

Comment on lines +6 to +15
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", "기타")
);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

경비 조회 기능 하면서 categoryFixture 추가했는데 둘중 하나로 선택해야 할 것 같네요

Copy link
Collaborator

@mcodnjs mcodnjs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

대단한데?

@jjongwa jjongwa merged commit 58b016e into develop Jul 27, 2023
1 check passed
@jjongwa jjongwa deleted the feature/#153-category branch July 28, 2023 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants