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:
@@ -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自增
|
||||
|
||||
Reference in New Issue
Block a user