This commit is contained in:
@@ -4,6 +4,8 @@ import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
import org.springframework.data.annotation.CreatedDate;
|
||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
import ru.soune.nocopy.entity.user.User;
|
||||
import ru.soune.nocopy.entity.user.UserContent;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
import org.springframework.data.annotation.CreatedDate;
|
||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
import ru.soune.nocopy.entity.user.User;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package ru.soune.nocopy.entity;
|
||||
package ru.soune.nocopy.entity.user;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
@@ -0,0 +1,31 @@
|
||||
package ru.soune.nocopy.entity.user;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Entity
|
||||
@Table(name = "email_verification_tokens")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class EmailVerificationToken {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "user_id", nullable = false)
|
||||
private User user;
|
||||
|
||||
@Column(name = "token", nullable = false, length = 6)
|
||||
private String token;
|
||||
|
||||
@Column(name = "expires_at", nullable = false)
|
||||
private LocalDateTime expiresAt;
|
||||
|
||||
@Column(name = "created_at", nullable = false)
|
||||
private LocalDateTime createdAt;
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package ru.soune.nocopy.entity;
|
||||
package ru.soune.nocopy.entity.user;
|
||||
|
||||
public enum GenderType {
|
||||
MALE, FEMALE
|
||||
+8
-2
@@ -1,4 +1,4 @@
|
||||
package ru.soune.nocopy.entity;
|
||||
package ru.soune.nocopy.entity.user;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import jakarta.persistence.*;
|
||||
@@ -6,6 +6,9 @@ import jakarta.validation.constraints.Size;
|
||||
import lombok.*;
|
||||
import org.springframework.data.annotation.CreatedDate;
|
||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
import ru.soune.nocopy.entity.ImageProtection;
|
||||
import ru.soune.nocopy.entity.SubscriptionType;
|
||||
import ru.soune.nocopy.entity.Violation;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
@@ -33,6 +36,9 @@ public class User {
|
||||
@Column(name = "email", nullable = false, length = 1024, unique = true)
|
||||
private String email;
|
||||
|
||||
@Column(name = "email_verified", nullable = false)
|
||||
private Boolean emailVerified = false;
|
||||
|
||||
@Column(name = "company")
|
||||
private String company;
|
||||
|
||||
@@ -64,7 +70,7 @@ public class User {
|
||||
private LocalDateTime lastLoginAt;
|
||||
|
||||
@Column(name = "is_active")
|
||||
private Boolean isActive = true;
|
||||
private Boolean isActive = false;
|
||||
|
||||
@OneToMany(mappedBy = "user", cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
@JsonIgnore
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package ru.soune.nocopy.entity;
|
||||
package ru.soune.nocopy.entity.user;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
+2
-1
@@ -1,9 +1,10 @@
|
||||
package ru.soune.nocopy.entity;
|
||||
package ru.soune.nocopy.entity.user;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
import org.springframework.data.annotation.CreatedDate;
|
||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
import ru.soune.nocopy.entity.ContentStatus;
|
||||
import ru.soune.nocopy.entity.file.FileType;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
Reference in New Issue
Block a user