1
|
package cz.zcu.kiv.backendapi.path;
|
2
|
|
3
|
import cz.zcu.kiv.backendapi.catalog.ICatalogItemService;
|
4
|
import io.swagger.v3.oas.annotations.Operation;
|
5
|
import lombok.RequiredArgsConstructor;
|
6
|
import org.springframework.web.bind.annotation.PostMapping;
|
7
|
import org.springframework.web.bind.annotation.RequestBody;
|
8
|
import org.springframework.web.bind.annotation.RequestMapping;
|
9
|
import org.springframework.web.bind.annotation.RestController;
|
10
|
|
11
|
/**
|
12
|
* Controller for paths
|
13
|
*/
|
14
|
@RestController
|
15
|
@RequiredArgsConstructor
|
16
|
@RequestMapping("/path")
|
17
|
public class PathController {
|
18
|
|
19
|
/**
|
20
|
* Catalog item service
|
21
|
*/
|
22
|
private final ICatalogItemService catalogItemService;
|
23
|
|
24
|
/**
|
25
|
* Returns path with highlighted text and found catalog items
|
26
|
*
|
27
|
* @param pathDto catalog DTO with text to be searched
|
28
|
* @return path DTO with highlighted text and found catalog items
|
29
|
*/
|
30
|
@PostMapping("")
|
31
|
@Operation(summary = "returns path with highlighted text and found catalog items based on given text")
|
32
|
public PathDto getPath(@RequestBody PathDto pathDto) {
|
33
|
return catalogItemService.getPath(pathDto.getText());
|
34
|
}
|
35
|
}
|