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