From a440ec3bfaa1363f5841100b8948d852971a2eb1 Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期二, 10 十二月 2024 13:19:58 +0800
Subject: [PATCH] MmPredictAlarmConfigService

---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/DmModuleController.java |    8 ++++++--
 1 files changed, 6 insertions(+), 2 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 9082921..61826c0 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
@@ -1,5 +1,6 @@
 package com.iailab.module.model.mcs.pre.controller.admin;
 
+import com.baomidou.dynamic.datasource.annotation.DSTransactional;
 import com.iailab.framework.common.exception.ErrorCode;
 import com.iailab.framework.common.pojo.CommonResult;
 import com.iailab.framework.common.pojo.PageResult;
@@ -58,7 +59,7 @@
     @GetMapping("/get/{id}")
     @PreAuthorize("@ss.hasPermission('model:pre-module:query')")
     public CommonResult<DmModuleEntity> info(@PathVariable("id") String id){
-        DmModuleEntity info = dmModuleService.selectById(id);
+        DmModuleEntity info = dmModuleService.info(id);
 
         return success(info);
     }
@@ -68,7 +69,8 @@
      */
     @PostMapping("/create")
     @PreAuthorize("@ss.hasPermission('model:pre-module:create')")
-    public CommonResult<Boolean> save(@RequestBody DmModuleEntity module){
+    @DSTransactional(rollbackFor= Exception.class)
+    public CommonResult<Boolean> create(@RequestBody DmModuleEntity module){
         int count = dmModuleService.check(module);
         if (count > 0) {
             ErrorCode errorCode = new ErrorCode(999, "名称重复");
@@ -83,6 +85,7 @@
      */
     @PutMapping("/update")
     @PreAuthorize("@ss.hasPermission('model:pre-module:update')")
+    @DSTransactional(rollbackFor= Exception.class)
     public CommonResult<Boolean> update(@RequestBody DmModuleEntity module){
         dmModuleService.update(module);
         return success(true);
@@ -93,6 +96,7 @@
      */
     @DeleteMapping("/delete")
     @PreAuthorize("@ss.hasPermission('model:pre-module:delete')")
+    @DSTransactional(rollbackFor= Exception.class)
     public CommonResult<Boolean> delete(@RequestParam("id") String id){
         dmModuleService.deleteBatch(new String[]{id});
         return success(true);

--
Gitblit v1.9.3