我们需要根据IP去限制用户单位时间的访问次数,防止刷手机验证码,屏蔽注册机等,使用注解就非常灵活了 1 定义注解 @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) @Documented//最高优先级 @Order(Ord ...
分类:
编程语言 时间:
2020-01-16 10:59:30
阅读次数:
90
1、定义注解类 @Target({ ElementType.METHOD }) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface DistributedLock { //锁名称 String lockName() de ...
分类:
编程语言 时间:
2020-01-13 20:05:14
阅读次数:
150
对实体类的属性进行校验,等处理。 自定义注解 import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Inherited; import ...
分类:
其他好文 时间:
2020-01-12 13:36:30
阅读次数:
93
1. 创建自己的Starter 一个完整的Spring Boot Starter可能包含以下组件: autoconfigure模块:包含自动配置的代码 starter模块:提供对autoconfigure模块的依赖,以及一些其它的依赖 (PS:如果你不需要区分这两个概念的话,也可以将自动配置代码模块 ...
分类:
编程语言 时间:
2020-01-08 12:21:10
阅读次数:
79
springboot版本为2.0.7 @SpringBootApplication引入@EnableAutoConfiguration @Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) @Documented @Inher ...
分类:
其他好文 时间:
2020-01-02 15:58:32
阅读次数:
289
@SpringBootApplication是一个组合注解,用于快捷配置启动类 源码如下: @Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) @Documented @Inherited @SpringBootConfig ...
分类:
移动开发 时间:
2019-12-31 18:58:39
阅读次数:
113
@ComponentScan 1 @Retention(RetentionPolicy.RUNTIME) 2 @Target(ElementType.TYPE) 3 @Documented 4 @Repeatable(ComponentScans.class) 5 public @interface ...
分类:
其他好文 时间:
2019-12-23 13:31:10
阅读次数:
94
介绍下AARRR模型,AARRR模型是Acquisition(获取)、Activation(活跃)、Retention(留存)、Revenue(收入)、Refer(传播)的缩写,对应了产品生命周期的每个阶段。而无论是那个阶段,都是围绕着中间的用户展开,为用户提供有价值的产品和服务。 赠:septem ...
分类:
其他好文 时间:
2019-12-20 22:20:24
阅读次数:
94
1、自定义注解 @target 说明了Annotation所修饰的对象范围: constructor、method、field、package、type等等。 @retention 定义了该Annotation被保留的时间长短, source(源文件保留)、class( class保留)、runti ...
分类:
编程语言 时间:
2019-12-19 00:02:39
阅读次数:
123
1.自定义注解 @Target(ElementType.METHOD) //注解放置的目标位置,METHOD是可注解在方法级别上 @Retention(RetentionPolicy.RUNTIME) //注解在哪个阶段执行 @Documented //生成文档 public @interface ...
分类:
其他好文 时间:
2019-12-17 22:05:00
阅读次数:
90