配置高级[email protected] 宽松绑定/松散绑定--- 常用计量单位绑定--- 数据校验

  

 

         <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid</artifactId>
            <version>1.1.16</version>
        </dependency>

 

 

 

 

 

 

 

 

 

@ConfigurationProperties:具体的做属性绑定
@EnableConfigurationProperties注解:开启属性绑定,并设置对应的目标

 

 

 

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
</dependency>

 

 

 

 

 

 

 

 

 

 

  

 

 

 

 

 

 

 

 

 

 

      <!--1.导入JSR303规范-->
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
        </dependency>
        <!--使用hibernate框架提供的校验器做实现类-->
        <dependency>
            <groupId>org.hibernate.validator</groupId>
            <artifactId>hibernate-validator</artifactId>
        </dependency>

 

 

 

 

 

 

 

 

 

 

 因为在yml里面误认为是int类型,并且识别为八进制

 

 

猜你喜欢

转载自blog.csdn.net/weixin_59496235/article/details/126643881