так, ну на логин перебрасывает :_)
This commit is contained in:
parent
8bdbd72802
commit
88cb673966
@ -1,5 +0,0 @@
|
|||||||
package com.example.backend.favorites.repository;
|
|
||||||
|
|
||||||
public class CrudRepository<T1, T2> {
|
|
||||||
|
|
||||||
}
|
|
@ -1,5 +1,6 @@
|
|||||||
package com.example.backend.users.api;
|
package com.example.backend.users.api;
|
||||||
|
|
||||||
|
import com.example.backend.users.model.UserRole;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
@ -13,14 +14,14 @@ public class UserDTO {
|
|||||||
|
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@Size(min = 2, max = 50)
|
@Size(min = 2, max = 50)
|
||||||
private String username;
|
private String login;
|
||||||
|
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@Size(min = 2, max = 10)
|
@Size(min = 2, max = 10)
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private boolean isAdmin;
|
private UserRole role;
|
||||||
|
|
||||||
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
|
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
|
||||||
public Integer getId() {
|
public Integer getId() {
|
||||||
@ -31,12 +32,12 @@ public class UserDTO {
|
|||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUsername() {
|
public String getLogin() {
|
||||||
return username;
|
return login;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUsername(String username) {
|
public void setLogin(String login) {
|
||||||
this.username = username;
|
this.login = login;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPassword() {
|
public String getPassword() {
|
||||||
@ -47,11 +48,11 @@ public class UserDTO {
|
|||||||
this.password = password;
|
this.password = password;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getIsAdmin() {
|
public UserRole getRole() {
|
||||||
return isAdmin;
|
return role;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIsAdmin(boolean isAdmin) {
|
public void setRole(UserRole role) {
|
||||||
this.isAdmin = isAdmin;
|
this.role = role;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,5 @@ import org.springframework.data.repository.CrudRepository;
|
|||||||
import com.example.backend.users.model.UserEntity;
|
import com.example.backend.users.model.UserEntity;
|
||||||
|
|
||||||
public interface UserRepository extends CrudRepository<UserEntity, Integer> {
|
public interface UserRepository extends CrudRepository<UserEntity, Integer> {
|
||||||
Optional<UserEntity> findByUsernameIgnoreCase(String username);
|
|
||||||
|
|
||||||
Optional<UserEntity> findByLoginIgnoreCase(String login);
|
Optional<UserEntity> findByLoginIgnoreCase(String login);
|
||||||
}
|
}
|
||||||
|
0
backend/src/main/resources/templates/login.html
Normal file
0
backend/src/main/resources/templates/login.html
Normal file
BIN
data.mv.db
BIN
data.mv.db
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user