File tree Expand file tree Collapse file tree 7 files changed +61
-0
lines changed
leaf-demo/src/main/java/com/example/demo
springboot-starter-leaf/src/main/java/com/codingapi/leaf/framework Expand file tree Collapse file tree 7 files changed +61
-0
lines changed Original file line number Diff line number Diff line change 11package com .example .demo ;
22
3+ import com .codingapi .leaf .framework .LeafScanner ;
34import org .springframework .boot .SpringApplication ;
45import org .springframework .boot .autoconfigure .SpringBootApplication ;
56
89 * @since 1.0.0
910 */
1011@ SpringBootApplication
12+ @ LeafScanner
1113public class DemoApplication {
1214
1315 public static void main (String [] args ) {
Original file line number Diff line number Diff line change 11package com .example .demo .domain ;
22
3+ import com .codingapi .leaf .framework .Leaf ;
34import com .codingapi .leaf .framework .LeafUtils ;
45import lombok .Getter ;
56import lombok .Setter ;
1011 */
1112@ Setter
1213@ Getter
14+ @ Leaf
1315public class Demo {
1416
1517 private long id ;
Original file line number Diff line number Diff line change 11package com .example .demo .domain ;
22
3+ import com .codingapi .leaf .framework .Leaf ;
34import com .codingapi .leaf .framework .LeafUtils ;
45import lombok .Getter ;
56import lombok .Setter ;
1011 */
1112@ Setter
1213@ Getter
14+ @ Leaf
1315public class Example {
1416
1517 private long id ;
Original file line number Diff line number Diff line change 1+ package com .codingapi .leaf .framework ;
2+
3+ import lombok .extern .slf4j .Slf4j ;
4+ import org .springframework .beans .factory .support .BeanDefinitionRegistry ;
5+ import org .springframework .context .annotation .ImportBeanDefinitionRegistrar ;
6+ import org .springframework .core .type .AnnotationMetadata ;
7+
8+ @ Slf4j
9+ public class AutoConfigurationImportSelector implements ImportBeanDefinitionRegistrar {
10+
11+
12+ @ Override
13+ public void registerBeanDefinitions (AnnotationMetadata importingClassMetadata , BeanDefinitionRegistry registry ) {
14+ log .info ("importingClassMetadata:{}" ,importingClassMetadata );
15+ }
16+ }
Original file line number Diff line number Diff line change 1+ package com .codingapi .leaf .framework ;
2+
3+ import java .lang .annotation .Retention ;
4+ import java .lang .annotation .Target ;
5+
6+ import static java .lang .annotation .ElementType .FIELD ;
7+ import static java .lang .annotation .ElementType .METHOD ;
8+ import static java .lang .annotation .RetentionPolicy .RUNTIME ;
9+
10+ @ Target ({METHOD , FIELD })
11+ @ Retention (RUNTIME )
12+ public @interface GeneratedValue {
13+
14+ }
Original file line number Diff line number Diff line change 1+ package com .codingapi .leaf .framework ;
2+
3+ import java .lang .annotation .*;
4+
5+ @ Target (ElementType .TYPE )
6+ @ Retention (RetentionPolicy .RUNTIME )
7+ @ Documented
8+ public @interface Leaf {
9+
10+ }
Original file line number Diff line number Diff line change 1+ package com .codingapi .leaf .framework ;
2+
3+ import org .springframework .context .annotation .Import ;
4+
5+ import java .lang .annotation .*;
6+
7+ @ Target (ElementType .TYPE )
8+ @ Retention (RetentionPolicy .RUNTIME )
9+ @ Documented
10+ @ Import (AutoConfigurationImportSelector .class )
11+ public @interface LeafScanner {
12+
13+ String [] scanBasePackages () default {};
14+
15+ }
You can’t perform that action at this time.
0 commit comments