Skip to content
Permalink
154311c6a7
Switch branches/tags

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?
Go to file
 
 
Cannot retrieve contributors at this time
34 lines (23 sloc) 1.11 KB
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);
}
}