对springBoot常用注解进行封装

@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@EnableAsync
@EnableScheduling
@SpringBootApplication
@EnableTransactionManagement
@Import({EntityScanRegister.class})
public @interface OpenBootApplication {
    @AliasFor(annotation = SpringBootApplication.class)
    String[] scanBasePackages() default {};

    @AliasFor(annotation = SpringBootApplication.class)
    Class<?>[] exclude() default {};
}


@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@OpenBootApplication
@EnableDiscoveryClient
public @interface OpenCloudApplication {
    @AliasFor(annotation = OpenBootApplication.class)
    String[] scanBasePackages() default {};

    @AliasFor(annotation = OpenBootApplication.class)
    Class<?>[] exclude() default {};
}


@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Controller
@ResponseBody
@RequestMapping
public @interface RestRequestMapping {
    @AliasFor(value = "value", annotation = Controller.class)
    String beanName() default "";

    @AliasFor(annotation = RequestMapping.class)
    String name() default "";

    @AliasFor(annotation = RequestMapping.class)
    String[] value() default {};

    @AliasFor(annotation = RequestMapping.class)
    String[] path() default {};

    @AliasFor(annotation = RequestMapping.class)
    String[] params() default {};

    @AliasFor(annotation = RequestMapping.class)
    String[] headers() default {};

    @AliasFor(annotation = RequestMapping.class)
    String[] consumes() default {};

    @AliasFor(annotation = RequestMapping.class)
    String[] produces() default {};

}
上一篇:无影使用体验


下一篇:学习报告-动手实战-最佳应用实践之使用RDS MySQL和ECS搭建个人博客