Projekt

Obecné

Profil

Stáhnout (979 Bajtů) Statistiky
| Větev: | Tag: | Revize:
1
package cz.zcu.kiv.backendapi.path;
2

    
3
import cz.zcu.kiv.backendapi.catalog.ICatalogItemService;
4
import lombok.RequiredArgsConstructor;
5
import org.springframework.web.bind.annotation.GetMapping;
6
import org.springframework.web.bind.annotation.RequestBody;
7
import org.springframework.web.bind.annotation.RequestMapping;
8
import org.springframework.web.bind.annotation.RestController;
9

    
10
/**
11
 * Controller for paths
12
 */
13
@RestController
14
@RequiredArgsConstructor
15
@RequestMapping("/path")
16
public class PathController {
17

    
18
    /**
19
     * Catalog item service
20
     */
21
    private final ICatalogItemService catalogItemService;
22

    
23
    /**
24
     * Returns path with highlighted text and found catalog items
25
     *
26
     * @param pathDto catalog DTO with text to be searched
27
     * @return path DTO with highlighted text and found catalog items
28
     */
29
    @GetMapping("")
30
    public PathDto getPath(@RequestBody PathDto pathDto) {
31
        return catalogItemService.getPath(pathDto.getText());
32
    }
33
}
(1-1/2)