Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autoscan增加过滤路径功能 #55

Merged
merged 1 commit into from
Jun 27, 2022
Merged

Conversation

Yangandmore
Copy link
Contributor

在目前autoscan基础上,提供了过滤路径或文件的功能,可提供过滤扫描的文件或文件夹

@Jzow Jzow self-requested a review June 27, 2022 08:39
@@ -7,7 +7,7 @@ struct User {
age: u16,
}

#[summer_boot::auto_scan]
#[summer_boot::auto_scan("summer-boot-tests/")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我理解这样做的目的,我觉得这个是可选的属性,开发者既可以自己指定路径,也可以用自动扫描,我这里建议是为了后期扩展 可以分 component_scan

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没错,这就是一个可选属性,所以在没有添加括号和里面的路径的时候,就是全局扫描

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果需要添加,则可以在里面手动添加过滤路径,以逗号隔开,就可以隔离多个路径,
#[summer_boot::auto_scan("a", "b")

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果需要添加,则可以在里面手动添加过滤路径,以逗号隔开,就可以隔离多个路径, #[summer_boot::auto_scan("a", "b")

这是个不错的提议,如果auto_scan后期变动频繁,我们可以把它封装新的宏,如果不频繁还是使用ummer_boot::auto_scan + 路径

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

上述的功能已经在这个pr里已实现,当前pr下更新如下:
#[summer_boot::auto_scan] #[summer_boot::auto_scan("url")] #[summer_boot::auto_scan("url_a", "url_b")]

@Jzow Jzow added the good first issue Good for newcomers label Jun 27, 2022
@Yangandmore Yangandmore merged commit 311e7a3 into wansenai:master Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants