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

建议Engine struct添加any类型的自定义字段tags #1244

Closed
systemview2018 opened this issue Dec 3, 2024 · 1 comment
Closed

建议Engine struct添加any类型的自定义字段tags #1244

systemview2018 opened this issue Dec 3, 2024 · 1 comment
Labels
invalid issue invalid issue (not related to Hertz or described in document or not enough information provided) stale

Comments

@systemview2018
Copy link

目前感觉router的的mw定制化的调用地方有待丰富。
如果是独立的gateway工程,那针对每一个接口都可以独立定制mw。
但是如果是多gateway工程,那么一般来讲通用的mw都是存放基础库里面。 那么在基础库里面就没有办法获取接口上面的信息。

比如我如果有一个mw是校验权限,但是要根据类型校验,那么这个是要在接口定义的地方指定类型。
按照目前的写法就只能写两个mw,然后分别在接口上面指定。

但是实际上应该是mw去拿到router定义的Engine对象,然后根据条件去判断。
所以建议添加tags 字段,供用户自己扩展.

@github-actions github-actions bot added the invalid issue invalid issue (not related to Hertz or described in document or not enough information provided) label Dec 3, 2024
Copy link

github-actions bot commented Dec 3, 2024

This issue has been marked as invalid question, please give more information by following the issue template. The issue will be closed in 1 days if no further activity occurs.

@github-actions github-actions bot added the stale label Dec 3, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid issue invalid issue (not related to Hertz or described in document or not enough information provided) stale
Development

No branches or pull requests

1 participant