inleft
2022-08-12 ff14c4edc7aa41db4b8fd8722486027b8ff84af0
友链弹窗添加
7 files modified
103 ■■■■ changed files
snowy-base/snowy-system/src/main/java/vip/xiaonuo/sys/modular/dict/service/impl/SysDictTypeServiceImpl.java 3 ●●●● patch | view | raw | blame | history
snowy-main/src/main/java/vip/xiaonuo/modular/blogFile/BlogFileController.java 18 ●●●●● patch | view | raw | blame | history
snowy-main/src/main/java/vip/xiaonuo/modular/blogarticle/controller/BlogArticleOutsideController.java 2 ●●● patch | view | raw | blame | history
snowy-main/src/main/java/vip/xiaonuo/modular/blogfriendshiplink/controller/BlogFriendshipLinkController.java 17 ●●●● patch | view | raw | blame | history
snowy-main/src/main/java/vip/xiaonuo/modular/blogfriendshiplink/controller/BlogLinkOutsideController.java 50 ●●●●● patch | view | raw | blame | history
snowy-main/src/main/java/vip/xiaonuo/modular/blogfriendshiplink/entity/BlogLinkVo.java 2 ●●●●● patch | view | raw | blame | history
snowy-main/src/main/java/vip/xiaonuo/modular/blogfriendshiplink/param/BlogFriendshipLinkParam.java 11 ●●●● patch | view | raw | blame | history
snowy-base/snowy-system/src/main/java/vip/xiaonuo/sys/modular/dict/service/impl/SysDictTypeServiceImpl.java
@@ -104,7 +104,8 @@
    @Override
    public List<Dict> dropDown(SysDictTypeParam sysDictTypeParam) {
        LambdaQueryWrapper<SysDictType> queryWrapper = new LambdaQueryWrapper<SysDictType>()
                .eq(SysDictType::getCode, sysDictTypeParam.getCode());
                .eq(SysDictType::getCode, sysDictTypeParam.getCode())
                .eq(sysDictTypeParam.getStatus() != null, SysDictType::getStatus, sysDictTypeParam.getStatus());
        SysDictType sysDictType = this.getOne(queryWrapper);
        if (ObjectUtil.isNull(sysDictType)) {
snowy-main/src/main/java/vip/xiaonuo/modular/blogFile/BlogFileController.java
@@ -24,16 +24,16 @@
 */
package vip.xiaonuo.modular.blogFile;
import cn.hutool.core.util.StrUtil;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import vip.xiaonuo.core.annotion.BusinessLog;
import vip.xiaonuo.core.consts.MyConstant;
import vip.xiaonuo.core.context.constant.ConstantContextHolder;
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.blogarticle.service.BlogArticleService;
import vip.xiaonuo.modular.blogarticletype.service.BlogArticleTypeService;
import vip.xiaonuo.sys.modular.file.service.SysFileInfoService;
import javax.annotation.Resource;
@@ -55,13 +55,6 @@
public class BlogFileController {
    @Resource
    private BlogArticleService blogArticleService;
    @Resource
    private BlogArticleTypeService blogArticleTypeService;
    @Resource
    private SysFileInfoService fileInfoService;
    /**
@@ -79,9 +72,10 @@
            throw new BlogException("错误文件类型");
        }
//        if (StrUtil.isEmpty(authCode) || !authCode.equals(ConstantContextHolder.getAuthCode())) {
//            throw new BlogException("授权码错误");
//        }
        if (StrUtil.isEmpty(authCode) || !authCode.equals(ConstantContextHolder.getAuthCode())) {
            throw new BlogException("授权码错误");
        }
        String bucket = MyConstant.uploadFileBucketMap.getOrDefault(fileType, DEFAULT_BUCKET);
        Long fileId = fileInfoService.uploadFileBlog(file, bucket);
snowy-main/src/main/java/vip/xiaonuo/modular/blogarticle/controller/BlogArticleOutsideController.java
@@ -221,7 +221,7 @@
            throw new BlogException(BlogExceptionEnum.article_file_lose);
        vo.setArticleFileURL(tempURL);
        vo.setCoverFileURL(this.getBlogSourceURL(vo.getCoverFileId()));
        return new SuccessResponseData(vo);
    }
snowy-main/src/main/java/vip/xiaonuo/modular/blogfriendshiplink/controller/BlogFriendshipLinkController.java
@@ -24,6 +24,11 @@
 */
package vip.xiaonuo.modular.blogfriendshiplink.controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import vip.xiaonuo.core.annotion.BusinessLog;
import vip.xiaonuo.core.annotion.Permission;
import vip.xiaonuo.core.enums.LogAnnotionOpTypeEnum;
@@ -31,11 +36,7 @@
import vip.xiaonuo.core.pojo.response.SuccessResponseData;
import vip.xiaonuo.modular.blogfriendshiplink.param.BlogFriendshipLinkParam;
import vip.xiaonuo.modular.blogfriendshiplink.service.BlogFriendshipLinkService;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import javax.annotation.Resource;
import java.util.List;
@@ -74,7 +75,7 @@
    @PostMapping("/blogFriendshipLink/add")
    @BusinessLog(title = "友情链接_增加", opType = LogAnnotionOpTypeEnum.ADD)
    public ResponseData add(@RequestBody @Validated(BlogFriendshipLinkParam.add.class) BlogFriendshipLinkParam blogFriendshipLinkParam) {
            blogFriendshipLinkService.add(blogFriendshipLinkParam);
        blogFriendshipLinkService.add(blogFriendshipLinkParam);
        return new SuccessResponseData();
    }
@@ -88,7 +89,7 @@
    @PostMapping("/blogFriendshipLink/delete")
    @BusinessLog(title = "友情链接_删除", opType = LogAnnotionOpTypeEnum.DELETE)
    public ResponseData delete(@RequestBody @Validated(BlogFriendshipLinkParam.delete.class) List<BlogFriendshipLinkParam> blogFriendshipLinkParamList) {
            blogFriendshipLinkService.delete(blogFriendshipLinkParamList);
        blogFriendshipLinkService.delete(blogFriendshipLinkParamList);
        return new SuccessResponseData();
    }
@@ -102,7 +103,7 @@
    @PostMapping("/blogFriendshipLink/edit")
    @BusinessLog(title = "友情链接_编辑", opType = LogAnnotionOpTypeEnum.EDIT)
    public ResponseData edit(@RequestBody @Validated(BlogFriendshipLinkParam.edit.class) BlogFriendshipLinkParam blogFriendshipLinkParam) {
            blogFriendshipLinkService.edit(blogFriendshipLinkParam);
        blogFriendshipLinkService.edit(blogFriendshipLinkParam);
        return new SuccessResponseData();
    }
snowy-main/src/main/java/vip/xiaonuo/modular/blogfriendshiplink/controller/BlogLinkOutsideController.java
@@ -26,9 +26,8 @@
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.lang.Dict;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import vip.xiaonuo.core.annotion.BusinessLog;
import vip.xiaonuo.core.consts.CommonConstant;
import vip.xiaonuo.core.consts.MyConstant;
@@ -36,8 +35,9 @@
import vip.xiaonuo.core.pojo.response.ResponseData;
import vip.xiaonuo.core.pojo.response.SuccessResponseData;
import vip.xiaonuo.modular.blogfriendshiplink.entity.BlogFriendshipLink;
import vip.xiaonuo.modular.blogfriendshiplink.param.BlogFriendshipLinkVo;
import vip.xiaonuo.modular.blogfriendshiplink.entity.BlogLinkVo;
import vip.xiaonuo.modular.blogfriendshiplink.param.BlogFriendshipLinkParam;
import vip.xiaonuo.modular.blogfriendshiplink.param.BlogFriendshipLinkVo;
import vip.xiaonuo.modular.blogfriendshiplink.service.BlogFriendshipLinkService;
import vip.xiaonuo.sys.modular.dict.param.SysDictTypeParam;
import vip.xiaonuo.sys.modular.dict.service.SysDictTypeService;
@@ -67,6 +67,7 @@
    @Resource
    private SysDictTypeService sysDictTypeService;
    /**
     * 查询blog友情链接
     *
@@ -78,7 +79,7 @@
    public ResponseData queryBlogLinkGroup() {
        List<BlogFriendshipLink> linkList = blogFriendshipLinkService.lambdaQuery()
                .eq(BlogFriendshipLink::getIsEnable,MyConstant.Yes)
                .eq(BlogFriendshipLink::getIsEnable, MyConstant.Yes)
                .orderByAsc(BlogFriendshipLink::getTopValue)
                .orderByAsc(BlogFriendshipLink::getName)
                .list();
@@ -109,4 +110,43 @@
        return new SuccessResponseData(res);
    }
    /**
     * 添加友情链接
     *
     * @author inleft
     * @date 2022-02-17 15:05:44
     */
    @PostMapping("/blogLink/add")
    @BusinessLog(title = "外部blog系统_blog友情链接_增加", opType = LogAnnotionOpTypeEnum.ADD)
    public ResponseData add(@RequestBody @Validated(BlogFriendshipLinkParam.add.class) BlogFriendshipLinkParam blogFriendshipLinkParam) {
        blogFriendshipLinkParam.setIsEnable(MyConstant.Yes);
        blogFriendshipLinkService.add(blogFriendshipLinkParam);
        return new SuccessResponseData();
    }
    @GetMapping("/blogLink/getLinkType")
    @BusinessLog(title = "外部blog系统_blog友情链接_获取链接类型", opType = LogAnnotionOpTypeEnum.QUERY)
    public ResponseData getLinkType() {
        SysDictTypeParam param = new SysDictTypeParam();
        param.setCode("blog_link_type");
        param.setStatus(MyConstant.No);
        List<Dict> dictList = sysDictTypeService.dropDown(param);
        List<BlogLinkVo> res = new ArrayList<>(dictList.size());
        BlogLinkVo vo;
        for (Dict dict : dictList) {
            vo = new BlogLinkVo();
            vo.setGroupName(dict.get(CommonConstant.VALUE).toString());
            vo.setLinkTypeId(dict.getLong(CommonConstant.CODE));
            res.add(vo);
        }
        return new SuccessResponseData(res);
    }
}
snowy-main/src/main/java/vip/xiaonuo/modular/blogfriendshiplink/entity/BlogLinkVo.java
@@ -38,6 +38,8 @@
@Data
public class BlogLinkVo {
    private Long linkTypeId;
    private String groupName;
snowy-main/src/main/java/vip/xiaonuo/modular/blogfriendshiplink/param/BlogFriendshipLinkParam.java
@@ -29,13 +29,15 @@
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
/**
* 友情链接参数类
 * 友情链接参数类
 *
 * @author inleft
 * @date 2022-02-17 15:05:44
*/
 */
@Data
public class BlogFriendshipLinkParam extends BaseParam {
@@ -54,17 +56,22 @@
    /**
     * url地址
     */
    @Size(max = 50, groups = {add.class, edit.class})
    @NotBlank(message = "url地址不能为空,请检查url参数", groups = {add.class, edit.class})
    @Pattern(regexp = "^$|^((https|http)?:\\/\\/)[^\\s]+", message = "url格式错误", groups = {add.class})
    private String url;
    /**
     * 头像地址
     */
    @Size(max = 50, groups = {add.class, edit.class})
    @Pattern(regexp = "^$|^((https|http)?:\\/\\/)[^\\s]+", message = "头像格式错误", groups = {add.class})
    private String avatar;
    /**
     * 描述
     */
    @Size(max = 200)
    //@NotBlank(message = "描述不能为空,请检查remark参数", groups = {add.class, edit.class})
    private String remark;