Skip to content

Commit 8ce66c4

Browse files
author
Ivan
committed
for review
1 parent db8ec34 commit 8ce66c4

File tree

1 file changed

+0
-27
lines changed
  • 3-0-spring-mvc/3-0-1-hello-spring-mvc/src/main/java/com/bobocode/mvc/controller

1 file changed

+0
-27
lines changed
Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,14 @@
11
package com.bobocode.mvc.controller;
22

3-
import com.bobocode.mvc.model.Note;
43
import com.bobocode.mvc.storage.Notes;
54
import lombok.RequiredArgsConstructor;
6-
import org.springframework.stereotype.Controller;
7-
import org.springframework.web.bind.annotation.GetMapping;
8-
import org.springframework.web.bind.annotation.ModelAttribute;
9-
import org.springframework.web.bind.annotation.PostMapping;
105
import org.springframework.web.bind.annotation.RequestMapping;
116

12-
import java.util.List;
13-
14-
@Controller
157
@RequiredArgsConstructor
168
@RequestMapping("/notes")
179
public class NoteController {
1810

1911
private final Notes notes;
2012

21-
@ModelAttribute
22-
private List<Note> noteListAttr() {
23-
return notes.getAll();
24-
}
25-
26-
@ModelAttribute
27-
private Note noteAttr() {
28-
return new Note();
29-
}
30-
31-
@GetMapping
32-
public String getNotes() {
33-
return "notes";
34-
}
3513

36-
@PostMapping
37-
public String addNote(Note note) {
38-
notes.add(note);
39-
return "redirect:/notes";
40-
}
4114
}

0 commit comments

Comments
 (0)