1
0
mirror of https://github.com/FatttSnake/Pinnacle-OA.git synced 2026-04-05 23:11:24 +08:00

senderName filter and selectByTitile completed

This commit is contained in:
cccccyb
2023-05-03 01:03:00 +08:00
parent 42dd714ed1
commit 90aad35eb4
11 changed files with 257 additions and 123 deletions

View File

@@ -40,13 +40,20 @@ public class NoticeController {
//添加公告
@GetMapping
public ResponseResult selectAllNotice() {
List<Notice> noticeList = noticeService.selectAllNotice();
Integer code = noticeList != null ? ResponseCode.DATABASE_SELECT_OK : ResponseCode.DATABASE_SELECT_ERROR;
public ResponseResult selectAllNotice(String title) {
List<Notice> noticeList;
if (title == null) {
noticeList = noticeService.selectAllNotice();
} else {
noticeList = noticeService.selectByTitle(title);
}
int code = noticeList != null ? ResponseCode.DATABASE_SELECT_OK : ResponseCode.DATABASE_SELECT_ERROR;
String msg = noticeList != null ? "" : "数据查询失败,请尝试!";
return ResponseResult.build(code, msg, noticeList);
}
@PostMapping
public ResponseResult updateNotice(@RequestBody Notice notice) {
notice.setId(null); //清除id使新插入的数据id自增