|
@@ -5,10 +5,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.gyee.backconfig.config.R;
|
|
|
import com.gyee.backconfig.model.auto.Line;
|
|
|
import com.gyee.backconfig.service.BackConfigService;
|
|
|
+import com.gyee.backconfig.service.auto.ILineService;
|
|
|
import com.gyee.backconfig.vo.Linevo;
|
|
|
import com.gyee.common.model.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.util.Arrays;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -23,6 +26,8 @@ import javax.annotation.Resource;
|
|
|
public class LineController {
|
|
|
@Resource
|
|
|
private BackConfigService backConfigService;
|
|
|
+ @Resource
|
|
|
+ private ILineService lineService;
|
|
|
|
|
|
@GetMapping("/listByPage")
|
|
|
@ResponseBody
|
|
@@ -79,7 +84,7 @@ public class LineController {
|
|
|
}
|
|
|
|
|
|
//新增或者更新
|
|
|
- @PostMapping("/add-Linevo")
|
|
|
+ @PostMapping("/add-Line")
|
|
|
@CrossOrigin(origins = "*", maxAge = 3600)
|
|
|
public R addModifyProjectPlan(@RequestBody Line Line){
|
|
|
boolean saveOrUpdate = backConfigService.saveOrUpdate(Line);
|
|
@@ -89,4 +94,33 @@ public class LineController {
|
|
|
return R.error().message("保存失败");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 批量删除
|
|
|
+ * @param ids
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+// @DeleteMapping(value = "/{remove-ids}")
|
|
|
+// public R deleteAll(@PathVariable("ids") String ids){
|
|
|
+// boolean b = lineService.removeByIds(ids);
|
|
|
+// if (b){
|
|
|
+// return R.ok().data(b);
|
|
|
+// }else {
|
|
|
+// return R.error().data("删除失败!");
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+ @DeleteMapping(value = "/remove-lines/{ids}")
|
|
|
+ public R deleteAll(@PathVariable("ids") String ids) {
|
|
|
+ String[] strings = ids.split(",");
|
|
|
+
|
|
|
+ boolean b = lineService.removeByIds(Arrays.asList(strings));
|
|
|
+
|
|
|
+ if (b) {
|
|
|
+ return R.ok().data(b);
|
|
|
+ } else {
|
|
|
+ return R.error().data("删除失败!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|