Delete 'EmployeeController.java'

main
pxqbzjk5c 4 weeks ago
parent 490bc0829c
commit 98e7bded78

@ -1,80 +0,0 @@
package com.prj.controller;
import java.util.List;
import com.prj.common.core.controller.BaseController;
import com.prj.common.core.domain.AjaxResult;
import com.prj.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.prj.domain.Employee;
import com.prj.service.IEmployeeService;
@RestController
@RequestMapping("/employee")
public class EmployeeController extends BaseController
{
@Autowired
private IEmployeeService employeeService;
/**
*
*/
@GetMapping("/list")
public TableDataInfo list(Employee employee)
{
startPage();
List<Employee> list = employeeService.selectEmployeeList(employee);
return getDataByPage(list);
}
/**
*
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(employeeService.selectEmployeeById(id));
}
/**
*
*/
@PostMapping
public AjaxResult add(@RequestBody Employee employee)
{
return toAjax(employeeService.insertEmployee(employee));
}
/**
*
*/
@PutMapping
@Transactional(timeout = 20,readOnly = false,isolation = Isolation.DEFAULT,propagation = Propagation.REQUIRED)
public AjaxResult edit(@RequestBody Employee employee)
{
//其它针对数据库的操作
return toAjax(employeeService.updateEmployee(employee));
}
/**
*
*/
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(employeeService.deleteEmployeeByIds(ids));
}
}
Loading…
Cancel
Save