java程序员-http://www.it-ebooks.info/

年轻的我,脚踩大地,仰望天空,路还很长....

博客园 首页 新随笔 联系 订阅 管理
ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(true);
        scanner.addIncludeFilter(new AnnotationTypeFilter(Tenant.class));
        Set<BeanDefinition> beanDefinitions = scanner.findCandidateComponents("com.example.spex");
        beanDefinitions.forEach(e -> {
            System.out.println(e.getBeanClassName());
        });
package com.example.spex.demos.web;

import java.util.List;

@Tenant
public class UserDTO {

    private String code;
    private List<User> content;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public List<User> getContent() {
        return content;
    }

    public void setContent(List<User> content) {
        this.content = content;
    }
}

 

posted on 2024-01-13 12:46  gstsyyb  阅读(157)  评论(0编辑  收藏  举报