@ApiOperation(value = "Get All Jobs", notes = "Anything Else?") @ApiResponses( value = { @ApiResponse(code = 200, message = "OK"), @ApiResponse(code = 500, message = "Something wrong in Server") }) @RequestMapping(value = "/jobs", method = RequestMethod.GET) @ResponseBody public List<Job> getAllJobs() { logger.debug("Request is in getAllJobs()"); return jobRepository.getAllJobs(); }
@RequestMapping(value = "/jobs", method = RequestMethod.POST) @ResponseBody public RestResponse addJob(@RequestBody Job job) { logger.debug("Request is in addJob(): job: " + job.toString()); RestResponse response = new RestResponse(true, "Success"); try { jobRepository.addJob(job); } catch (Exception e) { response.setSuccess(false); response.setMessage(e.getMessage()); } return response; }
@RequestMapping(value = "/jobs/title{title}", method = RequestMethod.GET) @ResponseBody public List<Job> getJobsByTitle(@RequestParam String title) { logger.debug("Request is in getJobsByTitle(): title: " + title); return jobRepository.getJobsByTitle(title); }
@RequestMapping(value = "/jobs/company{company}", method = RequestMethod.GET) @ResponseBody public List<Job> getJobsByCompany(@RequestParam String company) { logger.debug("Request is in getJobsByCompany(): company: " + company); return jobRepository.getJobsByCompany(company); }
@RequestMapping(value = "/jobs/titles", method = RequestMethod.GET) @ResponseBody public List<String> getJobsTitles() { logger.debug("Request is in getJobsTitles()"); return jobRepository.getJobsTitles(); }
@RequestMapping(value = "/jobs/zip{zipCode}", method = RequestMethod.GET) @ResponseBody public List<Job> getJobsByZipCode(@RequestParam String zipCode) { logger.debug("Request is in getJobsByZipCode(): zipCode: " + zipCode); return jobRepository.getJobsByZipCode(zipCode); }