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