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.org.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.DataScope;
34 import vip.xiaonuo.core.annotion.Permission;
35 import vip.xiaonuo.core.enums.LogAnnotionOpTypeEnum;
36 import vip.xiaonuo.core.pojo.base.param.BaseParam;
37 import vip.xiaonuo.core.pojo.response.ResponseData;
38 import vip.xiaonuo.core.pojo.response.SuccessResponseData;
39 import vip.xiaonuo.sys.modular.org.param.SysOrgParam;
40 import vip.xiaonuo.sys.modular.org.service.SysOrgService;
41
42 import javax.annotation.Resource;
43 import java.util.List;
44
45 /**
46  * 系统组织机构控制器
47  *
48  * @author xuyuxiang
49  * @date 2020/3/20 19:47
50  */
51 @RestController
52 public class SysOrgController {
53
54     @Resource
55     private SysOrgService sysOrgService;
56
57     /**
58      * 查询系统机构
59      *
60      * @author xuyuxiang
61      * @date 2020/5/11 15:49
62      */
63     @Permission
64     @DataScope
65     @GetMapping("/sysOrg/page")
66     @BusinessLog(title = "系统机构_查询", opType = LogAnnotionOpTypeEnum.QUERY)
67     public ResponseData page(SysOrgParam sysOrgParam) {
68         return new SuccessResponseData(sysOrgService.page(sysOrgParam));
69     }
70
71     /**
72      * 系统组织机构列表
73      *
74      * @author xuyuxiang
75      * @date 2020/3/26 10:20
76      */
77     @Permission
78     @DataScope
79     @GetMapping("/sysOrg/list")
80     @BusinessLog(title = "系统组织机构_列表", opType = LogAnnotionOpTypeEnum.QUERY)
81     public ResponseData list(SysOrgParam sysOrgParam) {
82         return new SuccessResponseData(sysOrgService.list(sysOrgParam));
83     }
84
85     /**
86      * 添加系统组织机构
87      *
88      * @author xuyuxiang
89      * @date 2020/3/25 14:44
90      */
91     @Permission
92     @DataScope
93     @PostMapping("/sysOrg/add")
94     @BusinessLog(title = "系统组织机构_增加", opType = LogAnnotionOpTypeEnum.ADD)
95     public ResponseData add(@RequestBody @Validated(BaseParam.add.class) SysOrgParam sysOrgParam) {
96         sysOrgService.add(sysOrgParam);
97         return new SuccessResponseData();
98     }
99
100     /**
101      * 删除系统组织机构
102      *
103      * @author xuyuxiang
104      * @date 2020/3/25 14:54
105      */
106     @Permission
107     @DataScope
108     @PostMapping("/sysOrg/delete")
109     @BusinessLog(title = "系统组织机构_删除", opType = LogAnnotionOpTypeEnum.DELETE)
110     public ResponseData delete(@RequestBody @Validated(BaseParam.delete.class) List<SysOrgParam> sysOrgParamList) {
111         sysOrgService.delete(sysOrgParamList);
112         return new SuccessResponseData();
113     }
114
115     /**
116      * 编辑系统组织机构
117      *
118      * @author xuyuxiang
119      * @date 2020/3/25 14:54
120      */
121     @Permission
122     @DataScope
123     @PostMapping("/sysOrg/edit")
124     @BusinessLog(title = "系统组织机构_编辑", opType = LogAnnotionOpTypeEnum.EDIT)
125     public ResponseData edit(@RequestBody @Validated(BaseParam.edit.class) SysOrgParam sysOrgParam) {
126         sysOrgService.edit(sysOrgParam);
127         return new SuccessResponseData();
128     }
129
130     /**
131      * 查看系统组织机构
132      *
133      * @author xuyuxiang
134      * @date 2020/3/26 9:49
135      */
136     @Permission
137     @GetMapping("/sysOrg/detail")
138     @BusinessLog(title = "系统组织机构_查看", opType = LogAnnotionOpTypeEnum.DETAIL)
139     public ResponseData detail(@Validated(BaseParam.detail.class) SysOrgParam sysOrgParam) {
140         return new SuccessResponseData(sysOrgService.detail(sysOrgParam));
141     }
142
143     /**
144      * 获取组织机构树
145      *
146      * @author xuyuxiang
147      * @date 2020/3/26 11:55
148      */
149     @Permission
150     @DataScope
151     @GetMapping("/sysOrg/tree")
152     @BusinessLog(title = "系统组织机构_树", opType = LogAnnotionOpTypeEnum.TREE)
153     public ResponseData tree(SysOrgParam sysOrgParam) {
154         return new SuccessResponseData(sysOrgService.tree(sysOrgParam));
155     }
156
157     /**
158      * 导出系统组织机构
159      *
160      * @author yubaoshan
161      * @date 2021/5/30 12:48
162      */
163     @Permission
164     @GetMapping("/sysOrg/export")
165     @BusinessLog(title = "系统组织机构_导出", opType = LogAnnotionOpTypeEnum.EXPORT)
166     public void export(SysOrgParam sysOrgParam) {
167         sysOrgService.export(sysOrgParam);
168     }
169 }