UpdatePostDto继承自CreatePostDto, 那他的验证功能为啥没有继承呢?
createPostDto创建文章 对titile, body字段验证没问题, UpdatePostDto继承了它, 那应该也可以验证这两个字段的, 但调用的话更新只加id, 其他两个字段没有做验证
[upl-image-preview uuid=0fa346da-d584-409f-b7a7-737b725a3419 url=https://cn-nb1.rains3.com/3rcd/2024-02-28/1709087041-925107-image.png fullscreen_uri=https://cn-nb1.rains3.com/3rcd/2024-02-28/1709087041-925107-image.png]
[upl-image-preview uuid=9873e3ec-59fa-4877-857c-4dddaa54daf8 url=https://cn-nb1.rains3.com/3rcd/2024-02-28/1709087166-814551-image.png fullscreen_uri=https://cn-nb1.rains3.com/3rcd/2024-02-28/1709087166-814551-image.png]
查下结果, 真没有验证
[upl-image-preview uuid=b33343ee-1b9e-4aa6-94a9-02f8d2f08348 url=https://cn-nb1.rains3.com/3rcd/2024-02-28/1709087200-94168-image.png fullscreen_uri=https://cn-nb1.rains3.com/3rcd/2024-02-28/1709087200-94168-image.png]
这是什么原因, 还是说更新接口使用UpdatePostDto只能验证该类的, 继承的父类中的验证无效是吗? 那父类CreatePostDto里加groups属性是干啥的?
代码不贴了, 直接复制粘贴的
@Cloneable