class ReadyEventListener implements ApplicationListener<ApplicationReadyEvent> {

    @Autowired
    private SysResourceService resourceService;
    @Autowired
    private SysRoleService roleService;

    @Override
    public void onApplicationEvent(ApplicationReadyEvent event) {<FILL_FUNCTION_BODY>}


}

        //导入资源数据
        ConfigurableApplicationContext applicationContext = event.getApplicationContext();

        //清空数据
        resourceService.truncateResource();

        // 获取当前系统的所有资源
        ResourceCollectorApi resourceCollectorApi = applicationContext.getBean(ResourceCollectorApi.class);
        List<SysResourceEntity> allResources = resourceCollectorApi.getAllResources();
        //添加api接口资源到数据库
        resourceService.saveBatch(allResources);

        //把用户资源和权限缓存
        roleService.resetRoleAuthCache();
    
<no_super_class>