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

[#18] Feature: Trade 즉시 구매, 판매 구현 #30

Merged
merged 8 commits into from
Oct 8, 2022

Conversation

vymr1000
Copy link
Collaborator

@vymr1000 vymr1000 commented Oct 1, 2022

관련된 이슈 번호

요약

  • 즉시 구매, 즉시 판매 구현

변경사항 (할 일)

  • 즉시구매 구현
  • 즉시 판매 구현
  • 구매, 판매(입찰)로 프로세스 단일화

@vymr1000 vymr1000 self-assigned this Oct 1, 2022
.filter(e -> e.getValue().getModelNumber().equals(modelNumber))
.filter(e -> e.getValue().getSize().equals(size)).findFirst()
.map(e -> e.getValue().getId())
.orElse(0L);
Copy link
Collaborator

Choose a reason for hiding this comment

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

  • size 가 신발이나 의류의 크기를 의미하는것같은데 맞나요?
    • paging 처리에서 사용하는 size와 혼동이 생길 여지가 있네요.. 더 좋은 이름이 없을까요?
  • isExists 는 보통 is를 제외하고 사용합니다.
  • filter는 두번 사용할 필요는 없습니다. 하나의 필터에 모든조건을 넣으면 반복이 줄어 성능이 좋아집니다.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

피드백 감사합니다..!

Copy link
Collaborator

@f-lab-lion f-lab-lion Oct 6, 2022

Choose a reason for hiding this comment

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

이부분도 존재여부만 판단하면 되기때문에
boolean 으로 바꾸고, anyMatch를 사용하면 좋습니다.
anyMatch는 하나라도 찾으면 이후 loop를 돌지 않기때문에 모든 element를 순회하는 fliter보다 성능이 좋을것입니다.
Id값이 정말 필요한것이라면 findByModelNumberAndSize()를 활용하는것이 좋습니다

private Long userId;
private Long productId;
private String modelNumber;
Copy link
Contributor

Choose a reason for hiding this comment

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

product ID에서 모델넘버로바뀐이유가뭔지 알수있을까요?

private Long userId;
private Long productId;
private String modelNumber;
Copy link
Contributor

Choose a reason for hiding this comment

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

모델넘버는 기본 키값이 될수 없을거같은데 ProductId가 맞는거 같습니다.

@superkkj superkkj merged commit 06708fe into develop Oct 8, 2022
@vymr1000 vymr1000 deleted the feature/#18-trade branch October 17, 2022 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants