This commit is contained in:
Zakharov_Rostislav 2024-04-03 15:41:29 +04:00
parent 1eb5ca8366
commit d8403015f7
3 changed files with 5 additions and 3 deletions

View File

@ -7,7 +7,7 @@
"cwd": "${workspaceFolder}",
"mainClass": "com.ip.library.LibraryApplication",
"projectName": "library",
"args": "--populate",
"args": "",
"envFile": "${workspaceFolder}/.env"
}
]

View File

@ -1,6 +1,6 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.2.4'
id 'org.springframework.boot' version '3.2.2'
id 'io.spring.dependency-management' version '1.1.4'
}
@ -20,6 +20,8 @@ dependencies {
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.3.0'
implementation 'org.modelmapper:modelmapper:3.2.0'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

View File

@ -32,7 +32,7 @@ public class UserService {
}
public UserEntity create(UserEntity entity) {
if (!entity.getRole().equals("user")) {
if (entity.getRole() == null || !entity.getRole().equals("user")) {
entity.setRole("user");
}
entity.setBooks(new ArrayList<BookEntity>());