💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
### 定义注解 使用@interface定义注解(Annotation)。 ![](http://blog.liufei1988.com/69fc6fb988536a1fac682023dd989c13) 使用元注解定义注解: * @Target ![](http://blog.liufei1988.com/ae460901f3da3f51a65ae044914319cf) * @Retention ![](http://blog.liufei1988.com/f5f863bac25ee85ce03ecde0045aed03) * @Repeatable ![](http://blog.liufei1988.com/2e05bc8611fb1b619ec640bc28df07bf) * @Inherited ![](http://blog.liufei1988.com/45502296b4325e85a63fd85593a41f4e) 定义Annotation的步骤: 1. 用@interface定义注解 2. 用元注解(meta annotation)配置注解 * Target:必须设置 * Retention:一般设置为RUNTIME * 通常不必写@Inherited, @Repeatable等等 3. 定义注解参数和默认值