懒羊羊
2023-11-14 ee4d94defe7cc7f36f87aebf2e9efed38ba93a40
提交 | 用户 | 时间
3d2401 1 package cn.stylefeng.guns.modular.zsx.bs.equipment.controller;
2
3 import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
4 import cn.stylefeng.guns.modular.zsx.bs.equipment.entity.EquipmentInfo;
5 import cn.stylefeng.guns.modular.zsx.bs.equipment.model.params.EquipmentInfoParam;
6 import cn.stylefeng.guns.modular.zsx.bs.equipment.service.EquipmentInfoService;
7 import cn.stylefeng.roses.core.base.controller.BaseController;
8 import cn.stylefeng.roses.kernel.model.response.ResponseData;
9 import cn.stylefeng.roses.core.mutidatasource.annotion.DataSource;
10 import org.springframework.beans.factory.annotation.Autowired;
11 import org.springframework.stereotype.Controller;
12 import org.springframework.web.bind.annotation.RequestMapping;
13 import org.springframework.web.bind.annotation.ResponseBody;
14
15
16
17 /**
18  * 设备档案控制器
19  *
20  * @author ruimin
21  * @Date 2023-09-18 15:50:49
22  */
23 @Controller
24 @RequestMapping("/equipmentInfo")
25 public class EquipmentInfoController extends BaseController {
26
27     private String PREFIX = "/modular/bs/equipmentInfo";
28
29     @Autowired
30     private EquipmentInfoService equipmentInfoService;
31
32     /**
33      * 跳转到主页面
34      *
35      * @author ruimin
36      * @Date 2023-09-18
37      */
38     @RequestMapping("")
39     public String index() {
40         return PREFIX + "/equipmentInfo.html";
41     }
42
43     /**
44      * 新增页面
45      *
46      * @author ruimin
47      * @Date 2023-09-18
48      */
49     @RequestMapping("/add")
50     public String add() {
51         return PREFIX + "/equipmentInfo_add.html";
52     }
53
54     /**
55      * 编辑页面
56      *
57      * @author ruimin
58      * @Date 2023-09-18
59      */
60     @RequestMapping("/edit")
61     public String edit() {
62         return PREFIX + "/equipmentInfo_edit.html";
63     }
64
65     /**
66      * 新增接口
67      *
68      * @author ruimin
69      * @Date 2023-09-18
70      */
71     @RequestMapping("/addItem")
72     @ResponseBody
73     @DataSource(name = "self")
74     public ResponseData addItem(EquipmentInfoParam equipmentInfoParam) {
75         this.equipmentInfoService.add(equipmentInfoParam);
76         return ResponseData.success();
77     }
78
79     /**
80      * 编辑接口
81      *
82      * @author ruimin
83      * @Date 2023-09-18
84      */
85     @RequestMapping("/editItem")
86     @ResponseBody
87     @DataSource(name = "self")
88     public ResponseData editItem(EquipmentInfoParam equipmentInfoParam) {
89         this.equipmentInfoService.update(equipmentInfoParam);
90         return ResponseData.success();
91     }
92
93     /**
94      * 删除接口
95      *
96      * @author ruimin
97      * @Date 2023-09-18
98      */
99     @RequestMapping("/delete")
100     @ResponseBody
101     @DataSource(name = "self")
102     public ResponseData delete(EquipmentInfoParam equipmentInfoParam) {
103         this.equipmentInfoService.delete(equipmentInfoParam);
104         return ResponseData.success();
105     }
106
107     /**
108      * 查看详情接口
109      *
110      * @author ruimin
111      * @Date 2023-09-18
112      */
113     @RequestMapping("/detail")
114     @ResponseBody
115     @DataSource(name = "self")
116     public ResponseData detail(EquipmentInfoParam equipmentInfoParam) {
117         EquipmentInfo detail = this.equipmentInfoService.getById(equipmentInfoParam.getId());
118         return ResponseData.success(detail);
119     }
120
121     /**
122      * 查询列表
123      *
124      * @author ruimin
125      * @Date 2023-09-18
126      */
127     @ResponseBody
128     @RequestMapping("/list")
129     @DataSource(name = "self")
130     public LayuiPageInfo list(EquipmentInfoParam equipmentInfoParam) {
131         return this.equipmentInfoService.findPageBySpec(equipmentInfoParam);
132     }
133
134 }
135
136