package com.lf.server.controller.organization; import com.lf.server.entity.Result; import com.lf.server.entity.organization.DepEntity; import com.lf.server.service.oraganization.DepService; import io.netty.util.internal.StringUtil; import org.apache.tomcat.util.buf.StringUtils; 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); } @ResponseBody @RequestMapping(value ="/deleteDep", method = RequestMethod.POST, produces = "application/json; charset=UTF-8") public Integer deleteDep(int id){ return depService.deleteDep(id); } @ResponseBody @RequestMapping(value ="/deleteDeps", method = RequestMethod.POST, produces = "application/json; charset=UTF-8") public Integer deleteDeps(Integer[] ids){ if(null == ids || ids.length ==0 ){ return -1; //}else{ // return depService.deleteDep(StringUtils.join(ids,",")); } return 0; } @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(DepEntity depEntity){ return depService.selectDep(depEntity); } @GetMapping(value ="/selectDepAll") public List selectDepAll( ){ return depService.selectDepAll( ); } }