inleft
2024-05-18 2ddbd99aa5b2e396f96c6daba60fe1ac2573d9fb
commit | author | age
4d51af 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.modular.blogfriendshiplink.controller;
26
ff14c4 27 import org.springframework.validation.annotation.Validated;
I 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;
4d51af 32 import vip.xiaonuo.core.annotion.BusinessLog;
I 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.modular.blogfriendshiplink.param.BlogFriendshipLinkParam;
38 import vip.xiaonuo.modular.blogfriendshiplink.service.BlogFriendshipLinkService;
ff14c4 39
4d51af 40 import javax.annotation.Resource;
I 41 import java.util.List;
42
43 /**
44  * 友情链接控制器
45  *
46  * @author inleft
47  * @date 2022-02-17 15:05:44
48  */
49 @RestController
50 public class BlogFriendshipLinkController {
51
52     @Resource
53     private BlogFriendshipLinkService blogFriendshipLinkService;
54
55     /**
56      * 查询友情链接
57      *
58      * @author inleft
59      * @date 2022-02-17 15:05:44
60      */
61     @Permission
62     @GetMapping("/blogFriendshipLink/page")
63     @BusinessLog(title = "友情链接_查询", opType = LogAnnotionOpTypeEnum.QUERY)
64     public ResponseData page(BlogFriendshipLinkParam blogFriendshipLinkParam) {
65         return new SuccessResponseData(blogFriendshipLinkService.page(blogFriendshipLinkParam));
66     }
67
68     /**
69      * 添加友情链接
70      *
71      * @author inleft
72      * @date 2022-02-17 15:05:44
73      */
74     @Permission
75     @PostMapping("/blogFriendshipLink/add")
76     @BusinessLog(title = "友情链接_增加", opType = LogAnnotionOpTypeEnum.ADD)
77     public ResponseData add(@RequestBody @Validated(BlogFriendshipLinkParam.add.class) BlogFriendshipLinkParam blogFriendshipLinkParam) {
ff14c4 78         blogFriendshipLinkService.add(blogFriendshipLinkParam);
4d51af 79         return new SuccessResponseData();
I 80     }
81
82     /**
83      * 删除友情链接,可批量删除
84      *
85      * @author inleft
86      * @date 2022-02-17 15:05:44
87      */
88     @Permission
89     @PostMapping("/blogFriendshipLink/delete")
90     @BusinessLog(title = "友情链接_删除", opType = LogAnnotionOpTypeEnum.DELETE)
91     public ResponseData delete(@RequestBody @Validated(BlogFriendshipLinkParam.delete.class) List<BlogFriendshipLinkParam> blogFriendshipLinkParamList) {
ff14c4 92         blogFriendshipLinkService.delete(blogFriendshipLinkParamList);
4d51af 93         return new SuccessResponseData();
I 94     }
95
96     /**
97      * 编辑友情链接
98      *
99      * @author inleft
100      * @date 2022-02-17 15:05:44
101      */
102     @Permission
103     @PostMapping("/blogFriendshipLink/edit")
104     @BusinessLog(title = "友情链接_编辑", opType = LogAnnotionOpTypeEnum.EDIT)
105     public ResponseData edit(@RequestBody @Validated(BlogFriendshipLinkParam.edit.class) BlogFriendshipLinkParam blogFriendshipLinkParam) {
ff14c4 106         blogFriendshipLinkService.edit(blogFriendshipLinkParam);
4d51af 107         return new SuccessResponseData();
I 108     }
109
110     /**
111      * 查看友情链接
112      *
113      * @author inleft
114      * @date 2022-02-17 15:05:44
115      */
116     @Permission
117     @GetMapping("/blogFriendshipLink/detail")
118     @BusinessLog(title = "友情链接_查看", opType = LogAnnotionOpTypeEnum.DETAIL)
119     public ResponseData detail(@Validated(BlogFriendshipLinkParam.detail.class) BlogFriendshipLinkParam blogFriendshipLinkParam) {
120         return new SuccessResponseData(blogFriendshipLinkService.detail(blogFriendshipLinkParam));
121     }
122
123     /**
124      * 友情链接列表
125      *
126      * @author inleft
127      * @date 2022-02-17 15:05:44
128      */
129     @Permission
130     @GetMapping("/blogFriendshipLink/list")
131     @BusinessLog(title = "友情链接_列表", opType = LogAnnotionOpTypeEnum.QUERY)
132     public ResponseData list(BlogFriendshipLinkParam blogFriendshipLinkParam) {
133         return new SuccessResponseData(blogFriendshipLinkService.list(blogFriendshipLinkParam));
134     }
135
136     /**
137      * 导出系统用户
138      *
139      * @author inleft
140      * @date 2022-02-17 15:05:44
141      */
142     @Permission
143     @GetMapping("/blogFriendshipLink/export")
144     @BusinessLog(title = "友情链接_导出", opType = LogAnnotionOpTypeEnum.EXPORT)
145     public void export(BlogFriendshipLinkParam blogFriendshipLinkParam) {
146         blogFriendshipLinkService.export(blogFriendshipLinkParam);
147     }
148
149 }