Skip to content

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

Open
tanpenggood wants to merge 2 commits into
mercyblitz:masterfrom
tanpenggood:feature-tanpenggood-20210228
Open

Feat:使一个Controller类中支持多个接口方法#15
tanpenggood wants to merge 2 commits into
mercyblitz:masterfrom
tanpenggood:feature-tanpenggood-20210228

Conversation

@tanpenggood

Copy link
Copy Markdown

@tanpenggood

Copy link
Copy Markdown
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