3
3
import com .project .mapdagu .common .entity .BaseTimeEntity ;
4
4
import jakarta .persistence .*;
5
5
import lombok .*;
6
+ import org .springframework .security .crypto .password .PasswordEncoder ;
6
7
7
8
@ Getter
8
9
@ NoArgsConstructor (access = AccessLevel .PROTECTED )
@@ -13,26 +14,34 @@ public class Member extends BaseTimeEntity {
13
14
@ Id
14
15
@ GeneratedValue (strategy = GenerationType .IDENTITY )
15
16
private Long id ;
17
+ private String nickname ;
16
18
private String email ;
17
19
private String password ;
18
- private String nickname ;
20
+ private String userName ;
21
+ private int imageNum ;
22
+ private String intro ;
23
+ private int scoville ;
24
+ private int level ;
19
25
@ Enumerated (EnumType .STRING )
20
26
private Role role ;
21
27
@ Enumerated (EnumType .STRING )
22
28
private SocialType socialType ; // KAKAO, NAVER, GOOGLE
23
29
private String socialId ; // 로그인한 소셜 타입 식별자 값 (일반 로그인의 경우 null)
24
- private String userName ;
25
- private String imageNum ;
26
30
27
31
@ Builder
28
- public Member (String email , String password , String nickname , Role role , SocialType socialType , String socialId , String userName , String imageNum ) {
32
+ public Member (String nickname , String email , String password , String userName , int imageNum , String intro , Role role , SocialType socialType , String socialId ) {
33
+ this .nickname = nickname ;
29
34
this .email = email ;
30
35
this .password = password ;
31
- this .nickname = nickname ;
36
+ this .userName = userName ;
37
+ this .imageNum = imageNum ;
38
+ this .intro = intro ;
32
39
this .role = role ;
33
40
this .socialType = socialType ;
34
41
this .socialId = socialId ;
35
- this .userName = userName ;
36
- this .imageNum = imageNum ;
42
+ }
43
+
44
+ public void passwordEncode (PasswordEncoder passwordEncoder ) {
45
+ this .password = passwordEncoder .encode (this .password );
37
46
}
38
47
}
0 commit comments