示例#1
0
 public IActionResult AddNote([FromBody] NoteModel noteModel)
 {
     if (noteModel?.Title?.Length > Limits.MAX_NOTE_TITLE)
     {
         throw new InputValueTooLargeException();
     }
     if (noteModel?.Content?.Length > Limits.MAX_NOTE_CONTENT)
     {
         throw new InputValueTooLargeException();
     }
     return(new JsonResult(NotesService.AddNote(PwdManService, GetToken(), noteModel)));
 }
示例#2
0
 public IActionResult DeleteNote(long id)
 {
     return(new JsonResult(NotesService.DeleteNote(PwdManService, GetToken(), id)));
 }
示例#3
0
 public IActionResult GetNotes()
 {
     return(new JsonResult(NotesService.GetNotes(PwdManService, GetToken())));
 }