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

Feat:使一个Controller类中支持多个接口方法 #15

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tanpenggood
Copy link

@tanpenggood
Copy link
Author

Method[] publicMethods = controllerClass.getMethods();

在使用java.lang.Class.getMethods方法获取当前类的public方法时,也还存在可优化空间。

该API返回的public方法还包含了继承对象的public方法。如,始终包含了Objectpublic方法

附 javadoc

Returns an array containing {@code Method} objects reflecting all the
public methods of the class or interface represented by this {@code
Class} object, including those declared by the class or interface and
those inherited from superclasses and superinterfaces.

DiligentNezha pushed a commit to DiligentNezha/geekbang-lessons that referenced this pull request Nov 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

多个方法上的@Path导致路径错误
1 participant