package com.lf.server.controller.data; import com.lf.server.entity.data.DepEntity; import com.lf.server.service.data.DepService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; /** * 组织机构 * @author sws * @date 2022-09-23 */ @RestController @RequestMapping("/dep") public class DepController { @Autowired DepService depService; @RequestMapping(value ="/insertDep", method = RequestMethod.POST, produces = "application/json; charset=UTF-8") public Integer insertDep(DepEntity depEntity){ return depService.insertDep(depEntity); } @RequestMapping(value ="/insertDes", method = RequestMethod.POST, produces = "application/json; charset=UTF-8") public Integer insertDes(@RequestBody List depEntity){ return depService.insertDeps(depEntity); } @ResponseBody @RequestMapping(value ="/deleteDep", method = RequestMethod.POST, produces = "application/json; charset=UTF-8") public Integer deleteDep(int id){ return depService.deleteDep(id); } @RequestMapping(value ="/deleteDeps", method = RequestMethod.POST, produces = "application/json; charset=UTF-8") public Integer deleteDeps(@RequestBody List ids){ if(!ids.isEmpty()){ return depService.deleteDeps(ids); }else { return -1; } } @ResponseBody @RequestMapping(value ="/updateDep", method = RequestMethod.POST, produces = "application/json; charset=UTF-8") public Integer updateDep(DepEntity depEntity){ return depService.updateDep(depEntity); } @GetMapping(value ="/selectDep") public DepEntity selectDep(int id){ return depService.selectDep(id); } @GetMapping(value ="/selectDepAll") public List selectDepAll( ){ return depService.selectDepAll( ); } }