ADD file via upload

冉杨品飞
pxqbzjk5c 3 weeks ago
parent 27fd5c8ad1
commit 4d08a7af86

@ -0,0 +1,75 @@
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.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.Dept;
import com.prj.service.IDeptService;
@RestController
@RequestMapping("/dept_info")
public class DeptController extends BaseController
{
@Autowired
private IDeptService deptService;
/**
*
*/
@GetMapping("/list")
public TableDataInfo list(Dept dept)
{
startPage();
List<Dept> list = deptService.selectDeptList(dept);
return getDataByPage(list);
}
/**
*
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(deptService.selectDeptById(id));
}
/**
*
*/
@PostMapping
public AjaxResult add(@RequestBody Dept dept)
{
return toAjax(deptService.insertDept(dept));
}
/**
*
*/
@PutMapping
public AjaxResult edit(@RequestBody Dept dept)
{
return toAjax(deptService.updateDept(dept));
}
/**
*
*/
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(deptService.deleteDeptByIds(ids));
}
}
Loading…
Cancel
Save