inleft
2022-02-17 4d51af31b49927bf401e432138d584f9ef40ef22
commit | author | age
9bcb19 1 /*
I 2 Copyright [2020] [https://www.xiaonuo.vip]
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8   http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15
16 Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
17
18 1.请不要删除和修改根目录下的LICENSE文件。
19 2.请不要删除和修改Snowy源码头部的版权声明。
20 3.请保留源码和相关描述文件的项目出处,作者声明等。
21 4.分发源码时候,请注明软件出处 https://gitee.com/xiaonuobase/snowy
22 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/xiaonuobase/snowy
23 6.若您的项目无法满足以上几点,可申请商业授权,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
24  */
25 package vip.xiaonuo.sys.modular.dict.controller;
26
27 import org.springframework.validation.annotation.Validated;
28 import org.springframework.web.bind.annotation.GetMapping;
29 import org.springframework.web.bind.annotation.PostMapping;
30 import org.springframework.web.bind.annotation.RequestBody;
31 import org.springframework.web.bind.annotation.RestController;
32 import vip.xiaonuo.core.annotion.BusinessLog;
33 import vip.xiaonuo.core.annotion.Permission;
34 import vip.xiaonuo.core.enums.LogAnnotionOpTypeEnum;
35 import vip.xiaonuo.core.pojo.response.ResponseData;
36 import vip.xiaonuo.core.pojo.response.SuccessResponseData;
37 import vip.xiaonuo.sys.modular.dict.param.SysDictDataParam;
38 import vip.xiaonuo.sys.modular.dict.service.SysDictDataService;
39
40 import javax.annotation.Resource;
41
42 /**
43  * 系统字典值控制器
44  *
45  * @author xuyuxiang
46  * @date 2020/3/31 20:49
47  */
48 @RestController
49 public class SysDictDataController {
50
51     @Resource
52     private SysDictDataService sysDictDataService;
53
54     /**
55      * 查询系统字典值
56      *
57      * @author xuyuxiang
58      * @date 2020/3/31 20:50
59      */
60     @Permission
61     @GetMapping("/sysDictData/page")
62     @BusinessLog(title = "系统字典值_查询", opType = LogAnnotionOpTypeEnum.QUERY)
63     public ResponseData page(SysDictDataParam sysDictDataParam) {
64         return new SuccessResponseData(sysDictDataService.page(sysDictDataParam));
65     }
66
67     /**
68      * 某个字典类型下所有的字典
69      *
70      * @author xuyuxiang
71      * @date 2020/3/31 21:03
72      */
73     @Permission
74     @GetMapping("/sysDictData/list")
75     @BusinessLog(title = "系统字典值_列表", opType = LogAnnotionOpTypeEnum.QUERY)
76     public ResponseData list(@Validated(SysDictDataParam.list.class) SysDictDataParam sysDictDataParam) {
77         return new SuccessResponseData(sysDictDataService.list(sysDictDataParam));
78     }
79
80     /**
81      * 查看系统字典值
82      *
83      * @author xuyuxiang
84      * @date 2020/3/31 20:51
85      */
86     @Permission
87     @GetMapping("/sysDictData/detail")
88     @BusinessLog(title = "系统字典值_查看", opType = LogAnnotionOpTypeEnum.DETAIL)
89     public ResponseData detail(@Validated(SysDictDataParam.detail.class) SysDictDataParam sysDictDataParam) {
90         return new SuccessResponseData(sysDictDataService.detail(sysDictDataParam));
91     }
92
93     /**
94      * 添加系统字典值
95      *
96      * @author xuyuxiang
97      * @date 2020/3/31 20:50
98      */
99     @Permission
100     @PostMapping("/sysDictData/add")
101     @BusinessLog(title = "系统字典值_增加", opType = LogAnnotionOpTypeEnum.ADD)
102     public ResponseData add(@RequestBody @Validated(SysDictDataParam.add.class) SysDictDataParam sysDictDataParam) {
103         sysDictDataService.add(sysDictDataParam);
104         return new SuccessResponseData();
105     }
106
107     /**
108      * 删除系统字典值
109      *
110      * @author xuyuxiang
111      * @date 2020/3/31 20:50
112      */
113     @Permission
114     @PostMapping("/sysDictData/delete")
115     @BusinessLog(title = "系统字典值_删除", opType = LogAnnotionOpTypeEnum.DELETE)
116     public ResponseData delete(@RequestBody @Validated(SysDictDataParam.delete.class) SysDictDataParam sysDictDataParam) {
117         sysDictDataService.delete(sysDictDataParam);
118         return new SuccessResponseData();
119     }
120
121     /**
122      * 编辑系统字典值
123      *
124      * @author xuyuxiang
125      * @date 2020/3/31 20:51
126      */
127     @Permission
128     @PostMapping("/sysDictData/edit")
129     @BusinessLog(title = "系统字典值_编辑", opType = LogAnnotionOpTypeEnum.EDIT)
130     public ResponseData edit(@RequestBody @Validated(SysDictDataParam.edit.class) SysDictDataParam sysDictDataParam) {
131         sysDictDataService.edit(sysDictDataParam);
132         return new SuccessResponseData();
133     }
134
135     /**
136      * 修改状态
137      *
138      * @author yubaoshan
139      * @date 2020/5/1 9:43
140      */
141     @Permission
142     @PostMapping("/sysDictData/changeStatus")
143     @BusinessLog(title = "系统字典值_修改状态", opType = LogAnnotionOpTypeEnum.CHANGE_STATUS)
144     public ResponseData changeStatus(@RequestBody @Validated(SysDictDataParam.changeStatus.class) SysDictDataParam sysDictDataParam) {
145         sysDictDataService.changeStatus(sysDictDataParam);
146         return new SuccessResponseData();
147     }
148
149 }