一、单个删除
注意:此删除逻辑删除,只是把要删除的东西 状态改为1,1代表删除,需要在数据库中加入字段delete表示状态
1.1 controller
@Controller
@RequestMapping("/ads")
public class AdController {
@Resource
private IAdService adService;
@RequestMapping("/deleteById.action")
@ResponseBody
public R deleteById(Integer id) throws Exception{
adService.deleteById(id);
return R.ok();
}
}
1.2 service
@Service
public class AdServiceImpl implements IAdService {
@Resource
private IAdDAO adDAO;
@Override
public void deleteById(Integer id) throws Exception {
if(null==id){
throw new BusinessException(ResponceCode.PARAMETER_EXCEPTION.getCode(),