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