1.修改求职者生日验证及参数验证

This commit is contained in:
sh
2025-11-25 16:56:32 +08:00
parent 46c78f72a4
commit 6e2cdba1d9
4 changed files with 29 additions and 23 deletions

View File

@@ -49,7 +49,7 @@ public class AppUser extends BaseEntity
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "生日", width = 30, dateFormat = "yyyy-MM-dd")
@ApiModelProperty("生日")
private LocalDate birthDate;
private String birthDate;
@Excel(name = "学历 对应字典education")
@ApiModelProperty("学历 对应字典education")

View File

@@ -203,4 +203,20 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
.atZone(ZONE_ID)
.toLocalDateTime();
}
/**
* @param dateStr 日期字符串需符合yyyy-MM-dd格式
* @return 转换后的Date对象转换失败则返回null
*/
public static Date stringToDateWithYmd(String dateStr,String format) {
if (dateStr == null || dateStr.trim().isEmpty()) {
return null;
}
try {
return new SimpleDateFormat(format).parse(dateStr);
} catch (ParseException e) {
return null;
}
}
}