0% found this document useful (0 votes)
16 views2 pages

Controller

The document is a Java Spring Boot controller for managing employee data, providing endpoints to save, update, find, and delete employee records. It includes methods for handling requests with validation and response structures. The controller supports operations based on employee email and password for authentication purposes.

Uploaded by

hareeshmajnu1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views2 pages

Controller

The document is a Java Spring Boot controller for managing employee data, providing endpoints to save, update, find, and delete employee records. It includes methods for handling requests with validation and response structures. The controller supports operations based on employee email and password for authentication purposes.

Uploaded by

hareeshmajnu1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

package [Link].Employee_Management.

controller;

import [Link];

import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];

import [Link].Employee_Management.[Link];
import [Link].Employee_Management.[Link];
import [Link].Employee_Management.[Link];
import [Link].Employee_Management.[Link];
import [Link].Employee_Management.[Link];

import [Link];
import [Link];

@CrossOrigin
@RestController
@RequestMapping("/employee")
public class EmployeeController {

@Autowired
private EmployeeService service;

@PostMapping
public ResponseEntity<ResponseStructure<EmployeeResponse>>
saveEmployee(@RequestBody @Validated EmployeeRequest employeeRequest)
{
return [Link](employeeRequest);
}
// @PutMapping
// public Employee updateEmployee(@RequestBody Employee employee,@RequestParam
int employeeId)
// {
// return [Link](employee, employeeId);
// }
@PutMapping("/employeeId/{employeeId}")
public ResponseEntity<ResponseStructure<EmployeeResponse>>
updateEmployee(@RequestBody @Validated EmployeeRequest employee,@PathVariable int
employeeId)
{
return [Link](employee, employeeId);
}

@GetMapping
public List<Employee> FindAllEmployee()
{
return [Link]();
}
@DeleteMapping("/employeeId/{employeeId}")
public ResponseEntity<ResponseStructure<EmployeeResponse>>
DeleteEmployeeById(@PathVariable int employeeId)
{
return [Link](employeeId);
}
@GetMapping("/employeeEmail/{employeeEmail}")
public Employee findByEmployeeEmail(@PathVariable String employeeEmail) {
return [Link](employeeEmail);
}

@GetMapping("/employeeEmail/{employeeEmail}/employeePassword/{employeePassword}")
public Employee findByEmployeeEmailAndPassword(@PathVariable String
employeeEmail,@PathVariable String employeePassword) {
return [Link](employeeEmail,
employeePassword);
}
}

You might also like