source: src/main/java/it/finki/tinki/web/controller/SearchController.java@ 33d4f5d

Last change on this file since 33d4f5d was 33d4f5d, checked in by Vzdra <vladko.zdravkovski@…>, 3 years ago

bugfixes and refactoring

  • Property mode set to 100644
File size: 1.2 KB
Line 
1package it.finki.tinki.web.controller;
2
3import it.finki.tinki.model.dto.response.work.InternshipResponseDTO;
4import it.finki.tinki.model.dto.response.work.JobResponseDTO;
5import it.finki.tinki.model.dto.response.work.ProjectResponseDTO;
6import it.finki.tinki.service.WorkService;
7import org.springframework.web.bind.annotation.*;
8
9import java.util.List;
10
11@RestController
12@CrossOrigin("http://localhost:3000")
13@RequestMapping("/api/search")
14public class SearchController {
15
16 WorkService workService;
17
18 public SearchController(WorkService workService) {
19 this.workService = workService;
20 }
21
22 @GetMapping(path = "/job")
23 public List<JobResponseDTO> jobRes(@RequestParam(name = "text") String text){
24 return this.workService.fullTextJobSearch(text);
25 }
26
27 @GetMapping(path = "/internship")
28 public List<InternshipResponseDTO> internshipRes(@RequestParam(name = "text") String text){
29 return this.workService.fullTextInternshipSearch(text);
30 }
31
32 @GetMapping(path = "/project")
33 public List<ProjectResponseDTO> projectRes(@RequestParam(name = "text") String text){
34 return this.workService.fullTextProjectSearch(text);
35 }
36}
Note: See TracBrowser for help on using the repository browser.