andeya / faygo

Faygo is a fast and concise Go Web framework that can be used to develop high-performance web app(especially API) with fewer codes. Just define a struct handler, faygo will automatically bind/verify the request parameters and generate the online API doc.

Home Page:https://github.com/henrylee2cn/faydoc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Handler struct 校验参数能否支持不同参数关联校验

nange opened this issue · comments

比如StartTime,EndTime两个字段,我希望校验EndTime的值是否大于StartTime。目前能实现这个需求吗?

目前不支持这个需求

考虑支持么,比如能否在Handler struct 增加一个方法:
Validate() error 来实现这个功能?

这样和你在handler里面调用方法进一步判断,没什么差别了

可以考虑使用 https://github.com/bytedance/go-tagexpr 来实现

OK,看了一下,很强大。