xiaoyong931011
2022-07-05 9f3fcff71873d6145f249c4b342cb973de2095f2
20220606
7 files modified
30 ■■■■■ changed files
src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminAddArticleDto.java 3 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminArticleDto.java 3 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminUpdateArticleDto.java 3 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/farmer/cms/modules/system/entity/ArticleEntity.java 3 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ArticleServiceImpl.java 6 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/farmer/cms/modules/system/vo/AdminSeeArticleInfoVo.java 9 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/ArticleMapper.xml 3 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminAddArticleDto.java
@@ -65,4 +65,7 @@
    @ApiModelProperty(value = "外部链接地址")
    private String articleUrl;
    @ApiModelProperty(value = "内容类型 1:文章 2:图片 3:文件 4:音频")
    private Integer contentType;
}
src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminArticleDto.java
@@ -11,6 +11,9 @@
    @ApiModelProperty(value = "标题", example = "文章")
    private String title;
    @ApiModelProperty(value = "内容类型 1:文章 2:图片 3:文件 4:音频", example = "1")
    private Integer contentType;
    @ApiModelProperty(value = "所属栏目ID", example = "2")
    private Long columnId;
src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminUpdateArticleDto.java
@@ -67,4 +67,7 @@
    @ApiModelProperty(value = "外部链接地址")
    private String articleUrl;
    @ApiModelProperty(value = "内容类型 1:文章 2:图片 3:文件 4:音频")
    private Integer contentType;
}
src/main/java/com/xcong/farmer/cms/modules/system/entity/ArticleEntity.java
@@ -81,6 +81,9 @@
    private String articleUrl;
    //内容类型 1:文章 2:图片 3:文件 4:音频"
    private Integer contentType;
    @TableField(exist = false)
    private String columnCode;
src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ArticleServiceImpl.java
@@ -59,6 +59,10 @@
        if(StrUtil.isNotEmpty(title)){
            articleEntity.setTitle(title);
        }
        Integer contentType = adminArticleDto.getContentType() == null ? 0 : adminArticleDto.getContentType();
        if(contentType != 0){
            articleEntity.setContentType(adminArticleDto.getContentType());
        }
        if(UserEntity.USER_BELONG_TOP != companyId){
            articleEntity.setCompanyId(companyId);
        }
@@ -108,6 +112,7 @@
        articleEntity.setArticleUrl(adminAddArticleDto.getArticleUrl());
        articleEntity.setType(adminAddArticleDto.getType());
        articleEntity.setContentType(adminAddArticleDto.getContentType());
        this.baseMapper.insert(articleEntity);
        return Result.ok("添加成功");
    }
@@ -179,6 +184,7 @@
        articleEntity.setArticleUrl(adminUpdateArticleDto.getArticleUrl());
        articleEntity.setType(adminUpdateArticleDto.getType());
        articleEntity.setContentType(adminUpdateArticleDto.getContentType());
        this.baseMapper.updateById(articleEntity);
        return Result.ok("更新成功");
    }
src/main/java/com/xcong/farmer/cms/modules/system/vo/AdminSeeArticleInfoVo.java
@@ -54,4 +54,13 @@
    @ApiModelProperty(value = "附件")
    private String uploadFile;
    @ApiModelProperty(value = "1-站内 2-外部链接")
    private Integer type;
    @ApiModelProperty(value = "外部链接地址")
    private String articleUrl;
    @ApiModelProperty(value = "内容类型 1:文章 2:图片 3:文件 4:音频")
    private Integer contentType;
}
src/main/resources/mapper/ArticleMapper.xml
@@ -21,6 +21,9 @@
                <if test="record.title!=null">
                    and a.title like concat ('%',#{record.title},'%')
                </if>
                <if test="record.contentType != null">
                    and a.content_type = #{record.contentType}
                </if>
            </if>
        </where>
        order by a.is_top desc,a.create_time desc