Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
7053CEM/back-end/controllers/UserJobTypeController.java
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
34 lines (23 sloc)
1.11 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dev.phoenix.trainingApplicationSystem.controllers; | |
import dev.phoenix.trainingApplicationSystem.services.UserJobTypeService; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.http.HttpStatus; | |
import org.springframework.http.ResponseEntity; | |
import org.springframework.web.bind.annotation.*; | |
import java.util.List; | |
@RestController | |
@RequestMapping("/api/job-field-type") | |
public class UserJobTypeController{ | |
@Autowired | |
private UserJobTypeService userJobTypeService; | |
//adding to fieldtype list | |
@PostMapping("/fieldTypeList/{fieldType}/{userID}") | |
public ResponseEntity<String> addFieldTypeByUserID(@PathVariable String fieldType,@PathVariable String userID){ | |
System.out.println("jobtype payload "+fieldType); | |
return new ResponseEntity<>(userJobTypeService.addJobTypeList(fieldType,userID), HttpStatus.CREATED); | |
} | |
@GetMapping("/list/{userID}") | |
public ResponseEntity<List> getFieldTypeList(@PathVariable String userID){ | |
return new ResponseEntity<>(userJobTypeService.getJobTypeListByUserID(userID), HttpStatus.CREATED); | |
} | |
} | |