From 79c9c809f91f25e7b6ff4c2f6627aee600b1dc92 Mon Sep 17 00:00:00 2001 From: pan <1029559041@qq.com> Date: Fri, 31 Jul 2020 19:56:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AE=BA=E6=96=87=E7=AC=94?= =?UTF-8?q?=E8=AE=B0=E7=BC=96=E8=BE=91=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bupt/note/Controller/NoteController.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/com/bupt/note/Controller/NoteController.java b/src/main/java/com/bupt/note/Controller/NoteController.java index a74cc18..d68610d 100644 --- a/src/main/java/com/bupt/note/Controller/NoteController.java +++ b/src/main/java/com/bupt/note/Controller/NoteController.java @@ -163,4 +163,17 @@ public class NoteController { } return ResponseDataUtil.buildError(); } + + @PutMapping("update") + public ResponseData put(@RequestBody NoteForm noteForm){ + if(StringUtils.isNoneEmpty(noteForm.getNoteId(),noteForm.getNoteContent())){ + Note note=noteRepository.getOne(noteForm.getNoteId()); + note.setNoteContent(noteForm.getNoteContent()); + noteRepository.save(note); + return ResponseDataUtil.buildSuccess(); + }else{ + logger.error("笔记更新失败"); + return ResponseDataUtil.buildError(); + } + } }