#42 fix birthDate and degree to User
This commit is contained in:
parent
51c755ac07
commit
e8461e26eb
@ -85,9 +85,9 @@ public class User extends BaseEntity {
|
|||||||
@BatchSize(size = 20)
|
@BatchSize(size = 20)
|
||||||
private Set<UserRole> roles;
|
private Set<UserRole> roles;
|
||||||
|
|
||||||
@Size(max = 4)
|
@Column(name = "birth_year")
|
||||||
@Column(name = "birth_year", length = 4)
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
private Integer birthYear;
|
private Date birthYear;
|
||||||
|
|
||||||
public enum UserDegree {
|
public enum UserDegree {
|
||||||
CANDIDATE("Кандидат технических наук"),
|
CANDIDATE("Кандидат технических наук"),
|
||||||
@ -211,11 +211,11 @@ public class User extends BaseEntity {
|
|||||||
this.patronymic = patronymic;
|
this.patronymic = patronymic;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getBirthYear() {
|
public Date getBirthYear() {
|
||||||
return birthYear;
|
return birthYear;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBirthYear(Integer birthYear) {
|
public void setBirthYear(Date birthYear) {
|
||||||
this.birthYear = birthYear;
|
this.birthYear = birthYear;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ import ru.ulstu.user.controller.UserController;
|
|||||||
import javax.validation.constraints.Pattern;
|
import javax.validation.constraints.Pattern;
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@ -70,11 +71,8 @@ public class UserDto implements OdinDto {
|
|||||||
@Size(min = Constants.MIN_PASSWORD_LENGTH, max = 50)
|
@Size(min = Constants.MIN_PASSWORD_LENGTH, max = 50)
|
||||||
private String passwordConfirm;
|
private String passwordConfirm;
|
||||||
|
|
||||||
@OdinCaption("Год рождения")
|
private Date birthYear;
|
||||||
@Size(max = 4)
|
|
||||||
private Integer birthYear;
|
|
||||||
|
|
||||||
@OdinCaption("Ученая степень")
|
|
||||||
private User.UserDegree degree;
|
private User.UserDegree degree;
|
||||||
|
|
||||||
public UserDto() {
|
public UserDto() {
|
||||||
@ -172,11 +170,11 @@ public class UserDto implements OdinDto {
|
|||||||
return passwordConfirm;
|
return passwordConfirm;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getBirthYear() {
|
public Date getBirthYear() {
|
||||||
return birthYear;
|
return birthYear;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBirthYear(Integer birthYear) {
|
public void setBirthYear(Date birthYear) {
|
||||||
this.birthYear = birthYear;
|
this.birthYear = birthYear;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
|
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
|
||||||
<changeSet author="tanya" id="20190404_000000-1">
|
<changeSet author="tanya" id="20190404_000000-1">
|
||||||
<addColumn tableName="users">
|
<addColumn tableName="users">
|
||||||
<column name="birth_year" type="integer"></column>
|
<column name="birth_year" type="timestamp"></column>
|
||||||
</addColumn>
|
</addColumn>
|
||||||
<addColumn tableName="users">
|
<addColumn tableName="users">
|
||||||
<column name="degree" type="varchar(255)"></column>
|
<column name="degree" type="varchar(255)"></column>
|
||||||
|
Loading…
Reference in New Issue
Block a user