获得徽章 0
- 有人用过 golang 的 hertz 这个http工具吗?知道 BindAndValidate 绑定,前端传递的时间如何绑定吗?我这传递 2022-12-23 16:26:13 这样的参数,如何都绑定不了,
对应如下
type User struct {
Id uint64 `json:"id" gorm:"primaryKey" query:"id" vd:"$!='Hertz'" `
Name string `json:"name" gorm:"column:name" query:"name" vd:"$!='Hertz'" `
Age int `json:"age" gorm:"column:age" query:"age" vd:"$>0" msg:"年龄必须大于0" `
Birthday *LocalTime `json:"birthday" gorm:"column:birthday" query:"birthday" `
}展开评论3
![[呲牙]](http://lf-web-assets.juejin.cn/obj/juejin-web/xitu_juejin_web/img/jj_emoji_2.cd1e2bd.png)
![[鄙视]](http://lf-web-assets.juejin.cn/obj/juejin-web/xitu_juejin_web/img/jj_emoji_45.df24295.png)
![[捂脸]](http://lf-web-assets.juejin.cn/obj/juejin-web/xitu_juejin_web/img/jj_emoji_28.8981538.png)