-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
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); |
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.
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) { |
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.
이것도 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) { |
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.
222
@PostMapping("/apply/{productId}") | ||
public Long apply( | ||
@AuthenticationPrincipal final Long userId, | ||
@PathVariable Long productId) { |
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.
333
관련 이슈
설명