|
|
@ -163,4 +163,17 @@ public class NoteController { |
|
|
|
} |
|
|
|
} |
|
|
|
return ResponseDataUtil.buildError(); |
|
|
|
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(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|