Springfox - PR review fixes

This commit is contained in:
Anshul BANSAL 2019-12-01 13:08:53 +02:00
parent c7e8eb29ef
commit 848abce396
2 changed files with 21 additions and 15 deletions

View File

@ -50,8 +50,14 @@ public class SpringfoxApplication {
}
private ApiInfo apiInfo() {
return new ApiInfo("Springfox API specification", "User REST and Spring Data APIs",
"", "", null, "License of API", "API license URL", Collections.emptyList());
return new ApiInfo("Springfox API specification",
"User REST and Spring Data APIs",
"",
"",
null,
"License of API",
"API license URL",
Collections.emptyList());
}
@Bean

View File

@ -8,41 +8,41 @@ import javax.validation.constraints.NotNull;
import javax.persistence.Entity;
@Entity
public class User{
public class User {
@Id
private Long id;
@NotNull(message = "First Name cannot be null")
private String firstName;
@Min(value = 15, message = "Age should not be less than 15")
@Max(value = 65, message = "Age should not be greater than 65")
private int age;
@Email(regexp=".@.\\..*", message = "Email should be valid")
private String email;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
@ -54,5 +54,5 @@ public class User{
public void setAge(int age) {
this.age = age;
}
}
}