File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
springboot-validator/src/main/java/com/zyd/model Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 1818import org .hibernate .validator .constraints .Email ;
1919import org .hibernate .validator .constraints .Length ;
2020import org .hibernate .validator .constraints .NotEmpty ;
21- import org .hibernate .validator .constraints .URL ;
2221
2322import javax .validation .constraints .Max ;
2423import javax .validation .constraints .Min ;
@@ -49,7 +48,8 @@ public class User {
4948 @ Email (message = "默认的邮箱验证@Email不通过" )
5049 private String email ;
5150
52- @ URL (host = "www.baidu.com" , message = "URL格式不正确" )
51+ // @URL(host = "www.baidu.com", message = "URL格式不正确")
52+ @ Pattern (regexp = "(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]" , message = "URL格式不正确" )
5353 private String url ;
5454
5555 public String getUsername () {
You can’t perform that action at this time.
0 commit comments