From 1373561069f7e19383dbc178c19787c4b3f0df3b Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期四, 26 九月 2024 10:37:36 +0800
Subject: [PATCH] MDK 上传

---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmItemTypeController.java |   26 ++++++++++++++++++++++++--
 1 files changed, 24 insertions(+), 2 deletions(-)

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 4063aff..ddd89b3 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
@@ -1,15 +1,21 @@
 package com.iailab.module.model.mcs.pre.controller.admin;
 
+import com.baomidou.dynamic.datasource.annotation.DSTransactional;
 import com.iailab.framework.common.pojo.CommonResult;
 import com.iailab.framework.common.pojo.PageResult;
 import com.iailab.framework.common.util.object.BeanUtils;
+import com.iailab.module.model.mcs.pre.entity.DmModuleEntity;
 import com.iailab.module.model.mcs.pre.entity.MmItemTypeEntity;
 import com.iailab.module.model.mcs.pre.service.MmItemTypeService;
 import com.iailab.module.model.mcs.pre.vo.MmItemTypePageReqVO;
 import com.iailab.module.model.mcs.pre.vo.MmItemTypeRespVO;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
 
 import static com.iailab.framework.common.pojo.CommonResult.error;
 import static com.iailab.framework.common.pojo.CommonResult.success;
@@ -19,7 +25,7 @@
  * @date 2021年04月22日 9:57
  */
 @RestController
-@RequestMapping("/pre/item-type")
+@RequestMapping("/model/pre/item-type")
 public class MmItemTypeController {
 
     @Autowired
@@ -29,18 +35,28 @@
      * 预测项类型列表
      */
     @GetMapping("/page")
+    @PreAuthorize("@ss.hasPermission('model:pre-type:query')")
     public CommonResult<PageResult<MmItemTypeRespVO>> page(@Validated MmItemTypePageReqVO reqVO) {
         PageResult<MmItemTypeEntity> page = mmItemTypeService.page(reqVO);
 
         return success(BeanUtils.toBean(page, MmItemTypeRespVO.class));
     }
 
+    @GetMapping("/list")
+    @PreAuthorize("@ss.hasPermission('model:pre-type:query')")
+    public CommonResult<List<MmItemTypeEntity>> list(@RequestParam Map<String, Object> params) {
+        List<MmItemTypeEntity> list = mmItemTypeService.list(params);
+
+        return success(list);
+    }
+
     /**
      * 预测项类型信息
      */
     @GetMapping("/get/{id}")
+    @PreAuthorize("@ss.hasPermission('model:pre-type:query')")
     public CommonResult<MmItemTypeEntity> info(@PathVariable("id") String id) {
-        MmItemTypeEntity itemType = mmItemTypeService.selectById(id);
+        MmItemTypeEntity itemType = mmItemTypeService.info(id);
 
         return success(itemType);
     }
@@ -49,6 +65,8 @@
      * 保存预测项类型
      */
     @PostMapping("/create")
+    @PreAuthorize("@ss.hasPermission('model:pre-type:create')")
+    @DSTransactional(rollbackFor= Exception.class)
     public CommonResult<Boolean> save(@RequestBody MmItemTypeEntity itemType) {
         int count = mmItemTypeService.check(itemType);
         if (count > 0) {
@@ -62,6 +80,8 @@
      * 修改预测项类型
      */
     @PutMapping("/update")
+    @PreAuthorize("@ss.hasPermission('model:pre-type:update')")
+    @DSTransactional(rollbackFor= Exception.class)
     public CommonResult<Boolean> update(@RequestBody MmItemTypeEntity itemType) {
         int count = mmItemTypeService.check(itemType);
         if (count > 0) {
@@ -75,6 +95,8 @@
      * 删除预测项类型
      */
     @DeleteMapping("/delete")
+    @PreAuthorize("@ss.hasPermission('model:pre-type:delete')")
+    @DSTransactional(rollbackFor= Exception.class)
     public CommonResult<Boolean> delete(@RequestParam("id") String id) {
         mmItemTypeService.deleteBatch(new String[]{id});
         return success(true);

--
Gitblit v1.9.3