inleft
2022-02-09 9bcb19959eeb9da9bde2561e7278f6d0a55eb151
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.SysDictTypeParam;
38 import vip.xiaonuo.sys.modular.dict.service.SysDictTypeService;
39
40 import javax.annotation.Resource;
41
42 /**
43  * 系统字典类型控制器
44  *
45  * @author xuyuxiang,xuyuxiang
46  * @date 2020/3/31 20:49
47  */
48 @RestController
49 public class SysDictTypeController {
50
51     @Resource
52     private SysDictTypeService sysDictTypeService;
53
54     /**
55      * 分页查询系统字典类型
56      *
57      * @author xuyuxiang,xuyuxiang
58      * @date 2020/3/31 20:30
59      */
60     @Permission
61     @GetMapping("/sysDictType/page")
62     @BusinessLog(title = "系统字典类型_分页查询", opType = LogAnnotionOpTypeEnum.QUERY)
63     public ResponseData page(SysDictTypeParam sysDictTypeParam) {
64         return new SuccessResponseData(sysDictTypeService.page(sysDictTypeParam));
65     }
66
67     /**
68      * 获取字典类型列表
69      *
70      * @author xuyuxiang,xuyuxiang
71      * @date 2020/3/31 21:03
72      */
73     @Permission
74     @GetMapping("/sysDictType/list")
75     @BusinessLog(title = "系统字典类型_列表", opType = LogAnnotionOpTypeEnum.QUERY)
76     public ResponseData list(SysDictTypeParam sysDictTypeParam) {
77         return new SuccessResponseData(sysDictTypeService.list(sysDictTypeParam));
78     }
79
80     /**
81      * 获取字典类型下所有字典,举例,返回格式为:[{code:"M",value:"男"},{code:"F",value:"女"}]
82      *
83      * @author xuyuxiang,xuyuxiang yubaoshan
84      * @date 2020/3/31 21:18
85      */
86     @GetMapping("/sysDictType/dropDown")
87     @BusinessLog(title = "系统字典类型_下拉", opType = LogAnnotionOpTypeEnum.QUERY)
88     public ResponseData dropDown(@Validated(SysDictTypeParam.dropDown.class) SysDictTypeParam sysDictTypeParam) {
89         return new SuccessResponseData(sysDictTypeService.dropDown(sysDictTypeParam));
90     }
91
92     /**
93      * 查看系统字典类型
94      *
95      * @author xuyuxiang,xuyuxiang
96      * @date 2020/3/31 20:31
97      */
98     @Permission
99     @GetMapping("/sysDictType/detail")
100     @BusinessLog(title = "系统字典类型_查看", opType = LogAnnotionOpTypeEnum.DETAIL)
101     public ResponseData detail(@Validated(SysDictTypeParam.detail.class) SysDictTypeParam sysDictTypeParam) {
102         return new SuccessResponseData(sysDictTypeService.detail(sysDictTypeParam));
103     }
104
105     /**
106      * 添加系统字典类型
107      *
108      * @author xuyuxiang,xuyuxiang
109      * @date 2020/3/31 20:30
110      */
111     @Permission
112     @PostMapping("/sysDictType/add")
113     @BusinessLog(title = "系统字典类型_增加", opType = LogAnnotionOpTypeEnum.ADD)
114     public ResponseData add(@RequestBody @Validated(SysDictTypeParam.add.class) SysDictTypeParam sysDictTypeParam) {
115         sysDictTypeService.add(sysDictTypeParam);
116         return new SuccessResponseData();
117     }
118
119     /**
120      * 删除系统字典类型
121      *
122      * @author xuyuxiang,xuyuxiang
123      * @date 2020/3/31 20:30
124      */
125     @Permission
126     @PostMapping("/sysDictType/delete")
127     @BusinessLog(title = "系统字典类型_删除", opType = LogAnnotionOpTypeEnum.DELETE)
128     public ResponseData delete(@RequestBody @Validated(SysDictTypeParam.delete.class) SysDictTypeParam sysDictTypeParam) {
129         sysDictTypeService.delete(sysDictTypeParam);
130         return new SuccessResponseData();
131     }
132
133     /**
134      * 编辑系统字典类型
135      *
136      * @author xuyuxiang,xuyuxiang
137      * @date 2020/3/31 20:31
138      */
139     @Permission
140     @PostMapping("/sysDictType/edit")
141     @BusinessLog(title = "系统字典类型_编辑", opType = LogAnnotionOpTypeEnum.EDIT)
142     public ResponseData edit(@RequestBody @Validated(SysDictTypeParam.edit.class) SysDictTypeParam sysDictTypeParam) {
143         sysDictTypeService.edit(sysDictTypeParam);
144         return new SuccessResponseData();
145     }
146
147     /**
148      * 修改状态
149      *
150      * @author yubaoshan
151      * @date 2020/4/30 22:20
152      */
153     @Permission
154     @PostMapping("/sysDictType/changeStatus")
155     @BusinessLog(title = "系统字典类型_修改状态", opType = LogAnnotionOpTypeEnum.CHANGE_STATUS)
156     public ResponseData changeStatus(@RequestBody @Validated(SysDictTypeParam.changeStatus.class) SysDictTypeParam sysDictTypeParam) {
157         sysDictTypeService.changeStatus(sysDictTypeParam);
158         return new SuccessResponseData();
159     }
160
161     /**
162      * 系统字典类型与字典值构造的树
163      *
164      * @author yubaoshan
165      * @date 2020/4/30 22:20
166      */
167     @GetMapping("/sysDictType/tree")
168     @BusinessLog(title = "系统字典类型_树", opType = LogAnnotionOpTypeEnum.QUERY)
169     public ResponseData tree() {
170         return new SuccessResponseData(sysDictTypeService.tree());
171     }
172 }