inleft
2024-05-18 2ddbd99aa5b2e396f96c6daba60fe1ac2573d9fb
snowy-main/src/main/java/vip/xiaonuo/modular/blogfriendshiplink/controller/BlogLinkOutsideController.java
@@ -32,6 +32,7 @@
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;
@@ -121,6 +122,13 @@
    @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();