gin入参多次获取
摘要:在middleware层不要用ShouldBind函数绑定body中的参数,因为ShouldBind执行完后,request中body就空了,业务层就拿不到body了。用下面的代码即可,先拿后放。 userIdReq := new(UserIdReq) var err error if c.Requ
阅读全文
posted @ 2024-07-27 18:10
posted @ 2024-07-27 18:10
posted @ 2024-07-22 19:31
posted @ 2024-07-18 23:40