File tree Expand file tree Collapse file tree
src/main/java/com/example/solidconnection/mentor Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212import jakarta .persistence .PrePersist ;
1313import lombok .AccessLevel ;
1414import lombok .AllArgsConstructor ;
15- import lombok .Builder ;
1615import lombok .Getter ;
1716import lombok .NoArgsConstructor ;
1817import org .hibernate .annotations .DynamicInsert ;
2524
2625@ Entity
2726@ Getter
28- @ Builder
2927@ EntityListeners (AuditingEntityListener .class )
3028@ DynamicInsert
3129@ AllArgsConstructor
@@ -58,6 +56,12 @@ public class Mentoring {
5856 @ Column
5957 private long menteeId ;
6058
59+ public Mentoring (long mentorId , long menteeId , VerifyStatus verifyStatus ) {
60+ this .mentorId = mentorId ;
61+ this .menteeId = menteeId ;
62+ this .verifyStatus = verifyStatus ;
63+ }
64+
6165 @ PrePersist
6266 public void onPrePersist () {
6367 this .createdAt = ZonedDateTime .now (UTC ).truncatedTo (MICROS ); // 나노초 6자리 까지만 저장
Original file line number Diff line number Diff line change @@ -30,11 +30,11 @@ public class MentoringCommandService {
3030
3131 @ Transactional
3232 public MentoringApplyResponse applyMentoring (long siteUserId , MentoringApplyRequest mentoringApplyRequest ) {
33- Mentoring mentoring = Mentoring . builder ()
34- . mentorId ( mentoringApplyRequest .mentorId ())
35- . menteeId ( siteUserId )
36- . verifyStatus ( VerifyStatus .PENDING )
37- . build ( );
33+ Mentoring mentoring = new Mentoring (
34+ mentoringApplyRequest .mentorId (),
35+ siteUserId ,
36+ VerifyStatus .PENDING
37+ );
3838
3939 return MentoringApplyResponse .from (mentoringRepository .save (mentoring ));
4040 }
You can’t perform that action at this time.
0 commit comments