hertz
hertz copied to clipboard
how to use vd in hz |如何使用校验相关参数在hz命令行中
Describe the Question
how to use vd in hz |如何使用校验相关参数在hz命令行中 Reproducible Code
vd 相关文档过于简单了,我尝试了很多次,才成功生成想要的代码
另外vd 相关限制也很痛苦,比如
string password = 2 [(api.go_tag)='json:"password,required"',(api.vd)="len($)>=8 && len($)<=16; msg:'length must between 8 to 16 | 密码长度需要在8-16之间'"];
msg 部分如果单引号合双引号互换就会无法生成对的代码。
没有复杂使用的例子导致只能靠尝试或者猜测来编写