验证规则写在哪里比较好?
对于验证规则,可以写在 controller 里,也可以重载一个 Request, 写在它里面,还有使用 repository 层的,规则写在 repository 里。个人倾向于直接写在 controller 里,不知大家有什么看法?
推荐文章: