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