From d395d2fed08797dbc8628a2f82283493098d23fb Mon Sep 17 00:00:00 2001
From: liriming <1343021927@qq.com>
Date: 星期一, 09 九月 2024 08:35:39 +0800
Subject: [PATCH] pre controller

---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/DmModuleController.java      |    8 ++++----
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmPredictItemController.java |   15 ++++++---------
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmItemTypeController.java    |    2 +-
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmResultTableController.java |   12 ++++++------
 4 files changed, 17 insertions(+), 20 deletions(-)

diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/DmModuleController.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/DmModuleController.java
index 5a414c1..8e1089c 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/DmModuleController.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/DmModuleController.java
@@ -52,11 +52,11 @@
     /**
      * 管网信息
      */
-    @GetMapping("/get")
-    public CommonResult<DmModuleEntity> info(@RequestParam("id") String id){
-        DmModuleEntity module = dmModuleService.selectById(id);
+    @GetMapping("/get/{id}")
+    public CommonResult<DmModuleEntity> info(@PathVariable("id") String id){
+        DmModuleEntity info = dmModuleService.selectById(id);
 
-        return success(module);
+        return success(info);
     }
 
     /**
diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmItemTypeController.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmItemTypeController.java
index 8b88bdc..4063aff 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmItemTypeController.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmItemTypeController.java
@@ -38,7 +38,7 @@
     /**
      * 预测项类型信息
      */
-    @GetMapping("/info/{id}")
+    @GetMapping("/get/{id}")
     public CommonResult<MmItemTypeEntity> info(@PathVariable("id") String id) {
         MmItemTypeEntity itemType = mmItemTypeService.selectById(id);
 
diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmPredictItemController.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmPredictItemController.java
index 1c46986..eb504cc 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmPredictItemController.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmPredictItemController.java
@@ -40,7 +40,7 @@
     /**
      * 预测项信息
      */
-    @GetMapping("/info/{id}")
+    @GetMapping("/get/{id}")
     public CommonResult<MmPredictItemDTO> info(@PathVariable("id") String id, @RequestParam Map<String, Object> params){
         MmPredictItemDTO predictItem = mmPredictItemService.getDetailById(id, params);
         return success(predictItem);
@@ -49,7 +49,7 @@
     /**
      * 保存预测项
      */
-    @PostMapping
+    @PostMapping("/create")
     public CommonResult<Boolean> save(@RequestBody MmPredictItemDTO mmPredictItemDto){
         int count = mmPredictItemService.check(mmPredictItemDto.getMmPredictItem());
         if (count > 0) {
@@ -62,7 +62,7 @@
     /**
      * 修改预测项
      */
-    @PutMapping
+    @PutMapping("/update")
     public CommonResult<Boolean> update(@RequestBody MmPredictItemDTO mmPredictItemDto){
         int count = mmPredictItemService.check(mmPredictItemDto.getMmPredictItem());
         if (count > 0) {
@@ -75,12 +75,9 @@
     /**
      * 删除预测项
      */
-    @DeleteMapping("{id}")
-    public CommonResult<Boolean> delete(@RequestBody String[] itemIds){
-        if (itemIds == null || itemIds.length == 0) {
-            return error(999, "参数不能为空");
-        }
-        mmPredictItemService.deleteBatch(itemIds);
+    @DeleteMapping("/delete")
+    public CommonResult<Boolean> delete(@RequestParam("id") String id) {
+        mmPredictItemService.deleteBatch(new String[]{id});
         return success(true);
     }
 
diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmResultTableController.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmResultTableController.java
index ac0803e..57fd8c4 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmResultTableController.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmResultTableController.java
@@ -35,7 +35,7 @@
         return success(BeanUtils.toBean(page, MmItemTypeRespVO.class));
     }
 
-    @GetMapping("/info/{id}")
+    @GetMapping("/get/{id}")
     public CommonResult<MmResultTableEntity> info(@PathVariable("id") String id){
         MmResultTableEntity resultTable = mmResultTableService.selectById(id);
 
@@ -45,7 +45,7 @@
     /**
      * 保存结果存放
      */
-    @PostMapping
+    @PostMapping("/create")
     public CommonResult<Boolean> save(@RequestBody MmResultTableEntity resultTable){
         int count = mmResultTableService.check(resultTable);
         if (count > 0) {
@@ -58,7 +58,7 @@
     /**
      * 修改结果存放
      */
-    @PutMapping
+    @PutMapping("/update")
     public CommonResult<Boolean> update(@RequestBody MmResultTableEntity resultTable){
         int count = mmResultTableService.check(resultTable);
         if (count > 0) {
@@ -71,9 +71,9 @@
     /**
      * 删除结果存放
      */
-    @DeleteMapping("{id}")
-    public CommonResult<Boolean> delete(@RequestBody String[] ids){
-        mmResultTableService.deleteBatch(ids);
+    @DeleteMapping("/delete")
+    public CommonResult<Boolean> delete(@RequestParam("id") String id) {
+        mmResultTableService.deleteBatch(new String[]{id});
         return success(true);
     }
 }

--
Gitblit v1.9.3