| | |
| | | import vip.xiaonuo.core.consts.CommonConstant; |
| | | import vip.xiaonuo.core.consts.MyConstant; |
| | | import vip.xiaonuo.core.enums.LogAnnotionOpTypeEnum; |
| | | import vip.xiaonuo.core.exception.BlogException; |
| | | import vip.xiaonuo.core.pojo.response.ResponseData; |
| | | import vip.xiaonuo.core.pojo.response.SuccessResponseData; |
| | | import vip.xiaonuo.modular.blogfriendshiplink.entity.BlogFriendshipLink; |
| | |
| | | @PostMapping("/blogLink/add") |
| | | @BusinessLog(title = "外部blog系统_blog友情链接_增加", opType = LogAnnotionOpTypeEnum.ADD) |
| | | public ResponseData add(@RequestBody @Validated(BlogFriendshipLinkParam.add.class) BlogFriendshipLinkParam blogFriendshipLinkParam) { |
| | | |
| | | if (blogFriendshipLinkService.lambdaQuery() |
| | | .eq(BlogFriendshipLink::getUrl, blogFriendshipLinkParam.getUrl()) |
| | | .count() > 0) { |
| | | throw new BlogException("已经有该链接的记录啦,不要重复提交哦.."); |
| | | } |
| | | |
| | | blogFriendshipLinkParam.setIsEnable(MyConstant.Yes); |
| | | blogFriendshipLinkService.add(blogFriendshipLinkParam); |
| | | return new SuccessResponseData(); |