Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. @RequestMapping(path = "/schedules")
  2. public class SchedulesController {
  3.  
  4. @GetMapping("/{area}/{subarea}")
  5. public MyObject getFlight(@PathVariable("area") String area, @PathVariable("subarea") String subarea,
  6. MyModel model) {
  7.  
  8. ...
  9. return new MyObject();
  10. }
  11. }
  12.  
  13. @Data
  14. public class MyModel {
  15. LocalDate datestamp,
  16. String leadName,
  17. String viceLeadName
  18. }
  19.  
  20. @RequestMapping(path = "/schedules")
  21. public class SchedulesController {
  22.  
  23. @GetMapping("/{area}/{subarea}")
  24. public MyObject getFlight(@PathVariable("area") String area, @PathVariable("subarea") String subarea,
  25. @RequestParam(value = "datestamp", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate datestamp,
  26. @RequestParam(value = "leadName", required = false) String leadName,
  27. @RequestParam(value = "viceLeadName", required = false) String viceLeadName) {
  28.  
  29. ...
  30. return new MyObject();
  31. }
  32. }
  33.  
  34. @RequestMapping(path = "/schedules")
  35. public class SchedulesController {
  36.  
  37. @GetMapping("/{area}/{subarea}")
  38. public MyObject getFlight(MyModel model) {
  39.  
  40. ...
  41. return new MyObject();
  42. }
  43. }
  44.  
  45. @Data
  46. public class MyModel {
  47. String area,
  48. String subArea,
  49. LocalDate datestamp,
  50. String leadName,
  51. String viceLeadName
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement