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

Simplified validation logic #11343

Closed
985492783 opened this issue Nov 7, 2023 · 0 comments
Closed

Simplified validation logic #11343

985492783 opened this issue Nov 7, 2023 · 0 comments
Labels
kind/enhancement Category issues or prs related to enhancement.

Comments

@985492783
Copy link
Contributor

linked #10734
当前问题:

  1. 目前的逻辑是http用url+method+module去拼tag,grpc用request的name,这样带来一些了问题,例如重载方法需要在checker中判断,逻辑被隐藏,并且由于有些controller中的方法用错checker导致出现不可控bug。
  2. 希望ParamExtractor能够check更多的参数,目前被写死了。
  3. 代码复用率低,大量重复代码。

解决方案:

  1. 用注解代替tag,类似Secured注解,让controller中的方法选择checker,而不是让checker判断方法。
  2. 用统一filter来处理checker,增强复用能力
  3. 修改ParamExtractor成泛类,以便后续扩展更多的参数校验能力。
@KomachiSion KomachiSion added the kind/enhancement Category issues or prs related to enhancement. label Nov 9, 2023
KomachiSion pushed a commit that referenced this issue Nov 15, 2023
* 优化节点显示,添加mode

* Simplified validation logic

* add license

* fix unit test

* add config,console,naming unit test and rename annotation

* add config,console,naming unit test and rename annotation

* fix EnvUtils test

* fix EnvUtils test

* fix ParamExtractorFilterTest

* fix ParamExtractorFilterTest

* fix ParamExtractorFilterTest

* fix ParamExtractorFilterTest

* fix ParamExtractorFilterTest
KomachiSion pushed a commit that referenced this issue Nov 17, 2023
* fix NPE

* fix NPE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Category issues or prs related to enhancement.
Projects
None yet
Development

No branches or pull requests

2 participants