You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
653 B
23 lines
653 B
package cc.bnblogs.annotations.entity; |
|
|
|
import lombok.AllArgsConstructor; |
|
import lombok.Data; |
|
import lombok.NoArgsConstructor; |
|
import org.springframework.boot.context.properties.ConfigurationProperties; |
|
import org.springframework.validation.annotation.Validated; |
|
|
|
import javax.validation.constraints.Max; |
|
import javax.validation.constraints.Min; |
|
|
|
@Data |
|
@AllArgsConstructor |
|
@NoArgsConstructor |
|
@ConfigurationProperties(prefix = "student") |
|
@Validated |
|
public class Student { |
|
private int id; |
|
private String name; |
|
@Max(value = 40,message = "最大值不能超过40") |
|
@Min(value = 10,message = "最小值不能小于10") |
|
private int age; |
|
}
|
|
|