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.app.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.app.param.SysAppParam; |
|
38 |
import vip.xiaonuo.sys.modular.app.service.SysAppService; |
|
39 |
|
|
40 |
import javax.annotation.Resource; |
|
41 |
|
|
42 |
/** |
|
43 |
* 系统应用控制器 |
|
44 |
* |
|
45 |
* @author xuyuxiang |
|
46 |
* @date 2020/3/20 21:25 |
|
47 |
*/ |
|
48 |
@RestController |
|
49 |
public class SysAppController { |
|
50 |
|
|
51 |
@Resource |
|
52 |
private SysAppService sysAppService; |
|
53 |
|
|
54 |
/** |
|
55 |
* 查询系统应用 |
|
56 |
* |
|
57 |
* @author xuyuxiang |
|
58 |
* @date 2020/3/20 21:23 |
|
59 |
*/ |
|
60 |
@Permission |
|
61 |
@GetMapping("/sysApp/page") |
|
62 |
@BusinessLog(title = "系统应用_查询", opType = LogAnnotionOpTypeEnum.QUERY) |
|
63 |
public ResponseData page(SysAppParam sysAppParam) { |
|
64 |
return new SuccessResponseData(sysAppService.page(sysAppParam)); |
|
65 |
} |
|
66 |
|
|
67 |
/** |
|
68 |
* 添加系统应用 |
|
69 |
* |
|
70 |
* @author xuyuxiang |
|
71 |
* @date 2020/3/25 14:44 |
|
72 |
*/ |
|
73 |
@Permission |
|
74 |
@PostMapping("/sysApp/add") |
|
75 |
@BusinessLog(title = "系统应用_增加", opType = LogAnnotionOpTypeEnum.ADD) |
|
76 |
public ResponseData add(@RequestBody @Validated(SysAppParam.add.class) SysAppParam sysAppParam) { |
|
77 |
sysAppService.add(sysAppParam); |
|
78 |
return new SuccessResponseData(); |
|
79 |
} |
|
80 |
|
|
81 |
/** |
|
82 |
* 删除系统应用 |
|
83 |
* |
|
84 |
* @author xuyuxiang |
|
85 |
* @date 2020/3/25 14:54 |
|
86 |
*/ |
|
87 |
@Permission |
|
88 |
@PostMapping("/sysApp/delete") |
|
89 |
@BusinessLog(title = "系统应用_删除", opType = LogAnnotionOpTypeEnum.DELETE) |
|
90 |
public ResponseData delete(@RequestBody @Validated(SysAppParam.delete.class) SysAppParam sysAppParam) { |
|
91 |
sysAppService.delete(sysAppParam); |
|
92 |
return new SuccessResponseData(); |
|
93 |
} |
|
94 |
|
|
95 |
/** |
|
96 |
* 编辑系统应用 |
|
97 |
* |
|
98 |
* @author xuyuxiang |
|
99 |
* @date 2020/3/25 14:54 |
|
100 |
*/ |
|
101 |
@Permission |
|
102 |
@PostMapping("/sysApp/edit") |
|
103 |
@BusinessLog(title = "系统应用_编辑", opType = LogAnnotionOpTypeEnum.EDIT) |
|
104 |
public ResponseData edit(@RequestBody @Validated(SysAppParam.edit.class) SysAppParam sysAppParam) { |
|
105 |
sysAppService.edit(sysAppParam); |
|
106 |
return new SuccessResponseData(); |
|
107 |
} |
|
108 |
|
|
109 |
/** |
|
110 |
* 查看系统应用 |
|
111 |
* |
|
112 |
* @author xuyuxiang |
|
113 |
* @date 2020/3/26 9:49 |
|
114 |
*/ |
|
115 |
@Permission |
|
116 |
@GetMapping("/sysApp/detail") |
|
117 |
@BusinessLog(title = "系统应用_查看", opType = LogAnnotionOpTypeEnum.DETAIL) |
|
118 |
public ResponseData detail(@Validated(SysAppParam.detail.class) SysAppParam sysAppParam) { |
|
119 |
return new SuccessResponseData(sysAppService.detail(sysAppParam)); |
|
120 |
} |
|
121 |
|
|
122 |
/** |
|
123 |
* 系统应用列表 |
|
124 |
* |
|
125 |
* @author xuyuxiang |
|
126 |
* @date 2020/4/19 14:55 |
|
127 |
*/ |
|
128 |
@Permission |
|
129 |
@GetMapping("/sysApp/list") |
|
130 |
@BusinessLog(title = "系统应用_列表", opType = LogAnnotionOpTypeEnum.QUERY) |
|
131 |
public ResponseData list(SysAppParam sysAppParam) { |
|
132 |
return new SuccessResponseData(sysAppService.list(sysAppParam)); |
|
133 |
} |
|
134 |
|
|
135 |
/** |
|
136 |
* 设为默认应用 |
|
137 |
* |
|
138 |
* @author xuyuxiang |
|
139 |
* @date 2020/6/29 16:49 |
|
140 |
*/ |
|
141 |
@Permission |
|
142 |
@PostMapping("/sysApp/setAsDefault") |
|
143 |
@BusinessLog(title = "系统应用_设为默认应用", opType = LogAnnotionOpTypeEnum.EDIT) |
|
144 |
public ResponseData setAsDefault(@RequestBody @Validated(SysAppParam.detail.class) SysAppParam sysAppParam) { |
|
145 |
sysAppService.setAsDefault(sysAppParam); |
|
146 |
return new SuccessResponseData(); |
|
147 |
} |
|
148 |
} |