1717package top .continew .admin .system .controller ;
1818
1919import cn .hutool .core .collection .CollUtil ;
20+ import io .swagger .v3 .oas .annotations .Parameter ;
21+ import io .swagger .v3 .oas .annotations .enums .ParameterIn ;
2022import io .swagger .v3 .oas .annotations .tags .Tag ;
21- import org .springframework .web .bind .annotation .RestController ;
23+ import org .springframework .validation .annotation .Validated ;
24+ import org .springframework .web .bind .annotation .*;
2225import top .continew .admin .common .controller .BaseController ;
2326import top .continew .admin .system .enums .NoticeMethodEnum ;
2427import top .continew .admin .system .enums .NoticeScopeEnum ;
3134import top .continew .starter .extension .crud .annotation .CrudApi ;
3235import top .continew .starter .extension .crud .annotation .CrudRequestMapping ;
3336import top .continew .starter .extension .crud .enums .Api ;
37+ import top .continew .starter .extension .crud .validation .CrudValidationGroup ;
3438
3539import java .lang .reflect .Method ;
3640import java .util .Arrays ;
@@ -69,4 +73,13 @@ public void preHandle(CrudApi crudApi, Object[] args, Method targetMethod, Class
6973 .contains (method ), "通知方式 [{}] 不正确" , method ));
7074 }
7175 }
76+ @ Parameter (name = "id" , description = "ID" , example = "1" , in = ParameterIn .PATH )
77+ @ ResponseBody
78+ @ PutMapping ({"/{id}" })
79+ public void update (@ Validated ({CrudValidationGroup .Update .class }) @ RequestBody NoticeReq req ,
80+ @ PathVariable ("id" ) Long id ) {
81+ //更新公告并删除阅读记录
82+ this .baseService .update (req , id );
83+ this .baseService .deleteReadLog (List .of (id ));
84+ }
7285}
0 commit comments