日期和数字的自定义格式注解

@DateTimeFormat

@DateTimeFormat(iso = DATE)//匹配格式为yyyy-MM-dd
private Date birthday;
@DateTimeFormat(pattern = "yyyy/MM/dd")//自定义格式
private Date birthday;

@NumberFormat

@NumberFormat(style = CURRENCY)//¥
private Integer money;
@NumberFormat(pattern = "¥#")//自定义格式,输入可带¥
private Integer money;
posted @ 2021-03-17 22:40  阿灿呀  阅读(390)  评论(0)    收藏  举报