롬복
기본 생성자 - protected 선언
@Getter
@Entity
@Table(name = "users")
public class User extends BaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false, length = 15)
private String name;
//필드 .....
//기본 생성자 protected
protected User() {}
public User(String name, String email, String password, UserRole role) {
this.name = name;
this.email = email;
this.password = password;
this.role = role;
}
ResponseDto 반환 형식 - ERD에 작성된 모든 필드
예시) 유저 조회
{
"id": 1,
"name": "user",
"email": "[email protected]",
"password": "test!1234",
"status": "ACTIVE",
"role": "USER",
"auth": "NONE",
"createdAt" : "2024-12-12T20:00:00",
"createdAt" : "2024-12-12T20:00:00"
}