1 | package finki.paw5.web.controllers;
|
---|
2 |
|
---|
3 | import finki.paw5.model.enumerations.AgeGroup;
|
---|
4 | import finki.paw5.model.enumerations.Gender;
|
---|
5 | import finki.paw5.model.enumerations.Size;
|
---|
6 | import finki.paw5.model.enumerations.Species;
|
---|
7 | import finki.paw5.service.PostService;
|
---|
8 | import org.springframework.stereotype.Controller;
|
---|
9 | import org.springframework.web.bind.annotation.PostMapping;
|
---|
10 | import org.springframework.web.bind.annotation.RequestMapping;
|
---|
11 | import org.springframework.web.bind.annotation.RequestParam;
|
---|
12 |
|
---|
13 | @Controller
|
---|
14 | @RequestMapping("/CreatePost")
|
---|
15 | public class PostController {
|
---|
16 |
|
---|
17 | private final PostService postService;
|
---|
18 |
|
---|
19 | public PostController(PostService postService){
|
---|
20 | this.postService = postService;
|
---|
21 | }
|
---|
22 |
|
---|
23 | @PostMapping
|
---|
24 | public String submit (@RequestParam String name,
|
---|
25 | @RequestParam Gender gender,
|
---|
26 | @RequestParam AgeGroup ageGroup,
|
---|
27 | @RequestParam Size size,
|
---|
28 | @RequestParam Species species,
|
---|
29 | @RequestParam String breed,
|
---|
30 | @RequestParam String urlimage) {
|
---|
31 |
|
---|
32 | this.postService.submit(name, gender, ageGroup, size, species, breed, urlimage);
|
---|
33 |
|
---|
34 | return null;
|
---|
35 | }
|
---|
36 | }
|
---|