zoukankan      html  css  js  c++  java
  • Springmvc关于实体类的注解:

    @JsonSerialize(using=ToStringSerializer.class)    将数字类型的数据转换为字符串类型
    
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")

    @JsonIgnore

    以下需要引入hibernate-validator-5.4.1.Final.jar

    @Range(min = 0, max = 255 , message = "代码类型必须在0-255之间")
    @Length(min = 1, max = 15, message = "类型名称1-15个字")

    @NotBlank(message="分组名称不能为空")

    @NotNull 不为空

    以下需要引入validation-api-1.1.0.Final.jar

    @Pattern(regexp = "^(((\d{3,4}-{0,1}){0,1}\d{7,8}(-{0,1}\d{3,4}){0,1})|(1[3|4|5|7|8]\d{9}))$", message = "手机格式错误")   正则表达式

    @Pattern(regexp = "^(((\d{3,4}-{0,1}){0,1}\d{7,8}(-{0,1}\d{3,4}){0,1})|(1[3|4|5|7|8]\d{9}))$", message = "电话格式错误")

  • 相关阅读:
    vue
    手写Promise
    Promise应用
    Promise
    JS_URL模块
    模板字符串应用
    JS-OOP
    jQuery——过时,但是经典,关注核心点即可。
    MySql补充
    offset系列
  • 原文地址:https://www.cnblogs.com/gaomanito/p/8400265.html
Copyright © 2011-2022 走看看