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