From b49adee62acf436ca083d8ccf1719fa4e71f0696 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Wed, 24 Apr 2024 11:59:48 +0400 Subject: [PATCH] Add user ids --- src/main/java/ru/ulstu/user/model/User.java | 48 ++++++++++++------- .../db/changelog-20190607_000002-schema.xml | 11 +++++ 2 files changed, 42 insertions(+), 17 deletions(-) diff --git a/src/main/java/ru/ulstu/user/model/User.java b/src/main/java/ru/ulstu/user/model/User.java index e4461d5..a7a51d9 100644 --- a/src/main/java/ru/ulstu/user/model/User.java +++ b/src/main/java/ru/ulstu/user/model/User.java @@ -4,17 +4,7 @@ import org.hibernate.annotations.BatchSize; import ru.ulstu.configuration.Constants; import ru.ulstu.core.model.BaseEntity; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EnumType; -import javax.persistence.Enumerated; -import javax.persistence.JoinColumn; -import javax.persistence.JoinTable; -import javax.persistence.ManyToMany; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; +import javax.persistence.*; import javax.validation.constraints.Email; import javax.validation.constraints.NotNull; import javax.validation.constraints.Pattern; @@ -28,7 +18,6 @@ import java.util.Set; @Table(name = "users") public class User extends BaseEntity { private final static String USER_ABBREVIATE_TEMPLATE = "%s %s %s"; - @NotNull @Pattern(regexp = Constants.LOGIN_REGEX) @Size(min = 1, max = 50) @@ -39,27 +28,22 @@ public class User extends BaseEntity { @Size(min = 60, max = 60) @Column(name = "password_hash", length = 60, nullable = false) private String password; - @NotNull @Size(max = 50) @Column(name = "first_name", length = 50, nullable = false) private String firstName; - @NotNull @Size(max = 50) @Column(name = "last_name", length = 50, nullable = false) private String lastName; - @Size(max = 50) @Column(name = "patronymic", length = 50) private String patronymic; - @NotNull @Email @Size(min = 5, max = 100) @Column(length = 100, nullable = false, unique = true) private String email; - @NotNull @Column(nullable = false) private boolean activated; @@ -96,6 +80,12 @@ public class User extends BaseEntity { @JoinColumn(name = "blocker_id") private User blocker; + private String orcId; + + private String scopusId; + + private String elibraryId; + public enum UserDegree { CANDIDATE("Кандидат технических наук"), DOCTOR("Доктор технических наук"); @@ -242,6 +232,30 @@ public class User extends BaseEntity { this.blocker = blocker; } + public String getOrcId() { + return orcId; + } + + public void setOrcId(String orcId) { + this.orcId = orcId; + } + + public String getScopusId() { + return scopusId; + } + + public void setScopusId(String scopusId) { + this.scopusId = scopusId; + } + + public String getElibraryId() { + return elibraryId; + } + + public void setElibraryId(String elibraryId) { + this.elibraryId = elibraryId; + } + public String getUserAbbreviate() { return String.format(USER_ABBREVIATE_TEMPLATE, lastName == null ? "" : lastName, diff --git a/src/main/resources/db/changelog-20190607_000002-schema.xml b/src/main/resources/db/changelog-20190607_000002-schema.xml index 9531c87..64bc974 100644 --- a/src/main/resources/db/changelog-20190607_000002-schema.xml +++ b/src/main/resources/db/changelog-20190607_000002-schema.xml @@ -9,4 +9,15 @@ + + + + + + + + + + +