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] 수강신청 기능 구현 #14

Merged
merged 5 commits into from
Mar 31, 2024
Merged

Conversation

SeonJuuuun
Copy link
Member

관련 이슈

설명

  • 락을 사용해 수강신청 동시성 제어 구현
  • 수강신청 기능 구현
  • 상품 목록 조회 기능 구현

Comment on lines 50 to 58
public MemberShip(Long id, User student, Product product, Integer remainingCount) {
this.id = id;
this.student = student;
this.product = product;
this.remainingCount = remainingCount;
}

public static MemberShip of(User student, Product product, Integer remainingCount) {
return new MemberShip(null, student, product, remainingCount);
Copy link
Contributor

Choose a reason for hiding this comment

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

final 키워드로 불변성을 보장해주면 좋을거같아요

@@ -33,4 +33,12 @@ public class Product extends BaseEntity {
private User teacher;

private Integer count;

public Product(Long id, String name, ProductType type, User teacher, Integer count) {
Copy link
Contributor

Choose a reason for hiding this comment

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

이것도 final키워드 붙혀주세요.

@@ -36,4 +36,13 @@ public class User extends BaseEntity {

@Enumerated(EnumType.STRING)
private Identity identity;

public User(Long id, String name, String deviceToken, String passWord, Gender gender, Identity identity) {
Copy link
Contributor

Choose a reason for hiding this comment

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

222

@PostMapping("/apply/{productId}")
public Long apply(
@AuthenticationPrincipal final Long userId,
@PathVariable Long productId) {
Copy link
Contributor

Choose a reason for hiding this comment

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

333

@SeonJuuuun SeonJuuuun merged commit 024babe into develop Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants