Ver código fonte

started controller

mpierse 5 anos atrás
pai
commit
09ddc55170

+ 12
- 0
src/main/java/io/zipcoder/crudapp/Person.java Ver arquivo

@@ -0,0 +1,12 @@
1
+package io.zipcoder.crudapp;
2
+
3
+import javax.persistence.Entity;
4
+
5
+@Entity
6
+public class Person {
7
+
8
+    Long id;
9
+    String firstName;
10
+    String lastName;
11
+
12
+}

+ 23
- 0
src/main/java/io/zipcoder/crudapp/PersonController.java Ver arquivo

@@ -0,0 +1,23 @@
1
+package io.zipcoder.crudapp;
2
+
3
+import org.springframework.web.bind.annotation.GetMapping;
4
+import org.springframework.web.bind.annotation.RequestMapping;
5
+import org.springframework.web.bind.annotation.RestController;
6
+
7
+import java.util.List;
8
+
9
+@RestController
10
+public class PersonController {
11
+
12
+    @RequestMapping()
13
+    public Person createPerson(Person p){}
14
+
15
+    public Person getPerson(int id){}
16
+
17
+    public List<Person> getPersonList(){}
18
+
19
+    public Person updatePerson(){}
20
+
21
+    public void deletePerson(int id){}
22
+
23
+}