1 package de.japrost.jabudget.spring;
2
3 import static de.japrost.jabudget.spring.PathMapping.BASE;
4 import static de.japrost.jabudget.spring.PathMapping.SERIALIZATION_DESERIALIZE;
5 import static de.japrost.jabudget.spring.PathMapping.SERIALIZATION_SERIALIZE;
6
7 import org.springframework.web.bind.annotation.GetMapping;
8 import org.springframework.web.bind.annotation.RequestMapping;
9 import org.springframework.web.bind.annotation.RestController;
10
11 import de.japrost.jabudget.service.SerializationService;
12
13
14
15
16 @RestController
17 @RequestMapping(BASE)
18 public class SerializationController {
19
20 private final SerializationService serializationService;
21
22
23
24
25
26
27 public SerializationController(SerializationService serializationService) {
28 this.serializationService = serializationService;
29 }
30
31
32
33
34 @GetMapping(SERIALIZATION_SERIALIZE)
35 public void defaultSerialize() {
36 serializationService.serialize();
37 }
38
39
40
41
42
43 @GetMapping(SERIALIZATION_DESERIALIZE)
44 public void defaultDeserialize() {
45 serializationService.deserialize();
46 }
47 }