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

feat: Added requests, responses, and search conditions #99

Merged
merged 7 commits into from
Feb 9, 2025

Conversation

koreanMike513
Copy link
Collaborator

@koreanMike513 koreanMike513 commented Feb 4, 2025

  • request, response, 또 food 검색 조건 클래스를 추가하였습니다.

ps.

  • 다른 모든 작업들을 upload 하였습니다. 따로 업로드 하기에는 이미 작업한 부분에서 test 및 build 를 하기에는 실패할 수 밖에 없어서 이번엔 이렇게 올리고 다음번에 더 잘 쪼개서 올리겠습니다 😅

@koreanMike513 koreanMike513 added the enhancement New feature or request label Feb 4, 2025
@koreanMike513 koreanMike513 self-assigned this Feb 4, 2025
public class FoodSearchCondition {
// TODO 거리 추가 구현
// 위도 경도 DEFAULT SET TO LONDON
Double lat = 51.5072;

Choose a reason for hiding this comment

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

상수 또는 설정을 추천드립니다.

@Getter @Setter
@NoArgsConstructor
@AllArgsConstructor
public class UpdateFoodRequestDTO {

Choose a reason for hiding this comment

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

Create 때 사용되는 DTO의 재사용 또는 중복을 줄일 수 있는 방법을 고민해보시면 좋습니다.

@@ -41,16 +39,56 @@ public class FoodDTO {
@JsonProperty("currency_symbol")
private String currencySymbol;

@JsonProperty("rate")
private double rate;

Choose a reason for hiding this comment

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

BigDecimal 사용을 추천드립니다

return new PageImpl<>(result, pageable, count);
}

private BooleanExpression eqFoodName(String search) {

Choose a reason for hiding this comment

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

eq 로직을 계속 반복하지 않는 방법은 없을까요?

return (search != null) ? food.store.name.containsIgnoreCase(search) : null;
}

private OrderSpecifier[] getOrders(List<String> sortBy) {

Choose a reason for hiding this comment

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

List, Map, Array의 사용과 이유가 궁금합니다


@Transactional
public void createFood(CreateFoodRequestDTO request) {
Currency currency = findCurrency(request.getCurrencyCode());

Choose a reason for hiding this comment

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

이 로직이 특별히 여기에 있어야하는 이유가 궁금합니다

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

이건 가게 입장에서 음식을 등록할 때 결제 화폐까지 등록하는 것을 생각하고 넣었습니다.
만약 저희가 지원하지 않는 화폐를 등록하려고 할 때는 등록하지 않게 설정 하려고 했습니다만 지우도록 하겠습니다.

@Transactional
public void updateFood(Long foodId, UpdateFoodRequestDTO request) {
Food food = findFood(foodId);
Currency currency = findCurrency(request.getCurrencyCode());

Choose a reason for hiding this comment

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

위와 동일합니다

@koreanMike513 koreanMike513 merged commit a8cfcc2 into update/update-core-entities Feb 9, 2025
2 checks passed
Copy link

github-actions bot commented Feb 9, 2025

HCP Terraform Plan Output

```
Plan: 1 to add, 0 to change, 0 to destroy.
```
[HCP Terraform Plan](https://app.terraform.io/app/Joyeuse_Planete/workspaces/Joyeuse_Planete/runs/run-D2eg3K8yn8Q7Eznq)

@koreanMike513 koreanMike513 deleted the feat/foods-add-mvc branch February 9, 2025 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants