source: Prototype Application/Paw5/src/main/java/finki/paw5/web/controllers/PostController.java@ 738b31a

main
Last change on this file since 738b31a was 738b31a, checked in by Filip Chorbeski <86695898+FilipChorbeski@…>, 17 months ago

resolve merge conflict

  • Property mode set to 100644
File size: 1.2 KB
Line 
1package finki.paw5.web.controllers;
2
3import finki.paw5.model.enumerations.AgeGroup;
4import finki.paw5.model.enumerations.Gender;
5import finki.paw5.model.enumerations.Size;
6import finki.paw5.model.enumerations.Species;
7import finki.paw5.service.PostService;
8import org.springframework.stereotype.Controller;
9import org.springframework.web.bind.annotation.PostMapping;
10import org.springframework.web.bind.annotation.RequestMapping;
11import org.springframework.web.bind.annotation.RequestParam;
12
13@Controller
14@RequestMapping("/CreatePost")
15public 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}
Note: See TracBrowser for help on using the repository browser.