Revize abaa5f46
Přidáno uživatelem Jakub Šmíd před asi 2 roky(ů)
- ID abaa5f461242c640ae1e7daaddb6bfc1b1419db9
- Rodič c1df89f5
backend/src/main/java/cz/zcu/kiv/backendapi/catalog/CatalogController.java | ||
---|---|---|
44 | 44 |
@GetMapping("") |
45 | 45 |
@Operation(summary = "returns catalog items based on filter") |
46 | 46 |
public ResponseEntity<List<CatalogItemDto>> getCatalog(@RequestParam(defaultValue = "") String name, @RequestParam(defaultValue = "") String country, @RequestParam(defaultValue = "") String type) { |
47 |
return new ResponseEntity<>(catalogService.getCatalog(name, country, type), HttpStatus.OK); |
|
47 |
|
|
48 |
List<CatalogItemDto> catalog = null; |
|
49 |
long start = System.currentTimeMillis(); |
|
50 |
catalog = catalogService.getCatalog3(name, country, type); |
|
51 |
System.out.println(catalog.size()); |
|
52 |
long time1 = System.currentTimeMillis() - start; |
|
53 |
start = System.currentTimeMillis(); |
|
54 |
catalog = catalogService.getCatalog2(name, country, type); |
|
55 |
System.out.println(catalog.size()); |
|
56 |
|
|
57 |
long time2 = System.currentTimeMillis() - start; |
|
58 |
start = System.currentTimeMillis(); |
|
59 |
catalog = catalogService.getCatalog(name, country, type); |
|
60 |
System.out.println(catalog.size()); |
|
61 |
|
|
62 |
long time3 = System.currentTimeMillis() - start; |
|
63 |
System.out.println(time1 + "\t" + time2 + "\t" + time3); |
|
64 |
return new ResponseEntity<>(catalog, HttpStatus.OK); |
|
48 | 65 |
} |
49 | 66 |
|
50 | 67 |
/** |
Také k dispozici: Unified diff
Experiment with database