package com.btpn.empolyee.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;

import com.btpn.empolyee.dao.EmployeeDao;
import com.btpn.empolyee.entity.Employee;

@RestController
public class EmployeeController {

	@Autowired
	private EmployeeDao employeeDao;

	@PostMapping("/employees/")
	@ResponseStatus(HttpStatus.CREATED)
	public void saveEmployee(@RequestBody Employee emp){
		employeeDao.save(emp);
	}
	
	@GetMapping("/employees/")
	@ResponseStatus(HttpStatus.OK)
	public Iterable<Employee> allEmployees() {

		return employeeDao.findAll();
	}

}

@@ -190,26 +190,151 @@
 otation.
-GetMapping
+DeleteMapping;%0D%0Aimport org.springframework.web.bind.annotation.GetMapping;%0D%0Aimport org.springframework.web.bind.annotation.PathVariable
 ;%0D%0Aimpor
@@ -381,32 +381,92 @@
 n.PostMapping;%0D%0A
+import org.springframework.web.bind.annotation.PutMapping;%0D%0A
 import org.sprin
@@ -832,16 +832,165 @@
 Dao;%0D%0A%0D%0A
+%09@GetMapping(%22/employees/%22)%0D%0A%09@ResponseStatus(HttpStatus.OK)%0D%0A%09public Iterable%3CEmployee%3E allEmployees() %7B%0D%0A%0D%0A%09%09return employeeDao.findAll();%0D%0A%09%7D%0D%0A%09%0D%0A
 %09@PostMa
@@ -1135,26 +1135,26 @@
 ;%0D%0A%09%7D%0D%0A%09%0D%0A%09@
-Ge
+Pu
 tMapping(%22/e
@@ -1154,32 +1154,36 @@
 ing(%22/employees/
+%7Bid%7D
 %22)%0D%0A%09@ResponseSt
@@ -1215,56 +1215,274 @@
 lic 
-Iterable%3CEmployee%3E allEmployees() %7B%0D%0A%0D%0A%09%09return 
+void updateEmployee(@PathVariable(%22id%22) String id, @RequestBody Employee emp )%7B%0D%0A%09%09emp.setEmpId(id);%0D%0A%09%09employeeDao.save(emp);%0D%0A%09%7D%0D%0A%09%0D%0A%09@DeleteMapping(%22employees/%7Bid%7D%22)%0D%0A%09@ResponseStatus(HttpStatus.OK)%0D%0A%09public void deleteEmployee(@PathVariable(%22id%22) String id)%7B%0D%0A%09%09
 empl
@@ -1485,32 +1485,33 @@
 employeeDao.
-findAll(
+delete(id
 );%0D%0A%09%7D%0D%0A%0D%0A%7D%0D

implement CRUD