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/AdminAddColumnDto.java
@@ -42,6 +42,9 @@ @ApiModelProperty(value = "若栏目类型为标题类型 1-链接到内容 2-链接到栏目 3-外部地址") private Integer targetType; @ApiModelProperty(value = "内容类型 1:文章 2:图片 3:文件 4:音频") private Integer contentType; @ApiModelProperty(value = "目标地址") private String targetUrl; 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/dto/AdminUpdateColumnDto.java
@@ -49,4 +49,7 @@ @ApiModelProperty(value = "是否为导航 1-是 2-否") private Integer isNav; @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/entity/ColumnEntity.java
@@ -43,6 +43,9 @@ // 目标类型 1-链接到文章 2-链接到栏目 3-外部链接 private Integer targetType; // 内容类型 1:文章 2:图片 3:文件 4:音频 private Integer contentType; // 目标地址 (外部地址http/https开头 文章ID/栏目ID) private String targetUrl; 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/service/Impl/ColumnServiceImpl.java
@@ -116,6 +116,7 @@ columnEntity.setTargetType(adminAddColumnDto.getTargetType()); columnEntity.setTargetUrl(adminAddColumnDto.getTargetUrl()); columnEntity.setIsNav(adminAddColumnDto.getIsNav()); columnEntity.setContentType(adminAddColumnDto.getContentType()); this.baseMapper.insert(columnEntity); return Result.ok("添加成功"); } @@ -156,6 +157,7 @@ adminSeeColumnInfoVo.setIsNav(columnEntity.getIsNav()); adminSeeColumnInfoVo.setType(columnEntity.getType()); adminSeeColumnInfoVo.setTargetType(columnEntity.getTargetType()); adminSeeColumnInfoVo.setContentType(columnEntity.getContentType()); if (columnEntity.getType() == 2) { if (columnEntity.getTargetType() == 1) { ArticleEntity articleEntity = articleMapper.selectById(Long.parseLong(columnEntity.getTargetUrl())); @@ -216,6 +218,7 @@ columnEntity.setTargetType(adminUpdateColumnDto.getTargetType()); columnEntity.setTargetUrl(adminUpdateColumnDto.getTargetUrl()); columnEntity.setIsNav(adminUpdateColumnDto.getIsNav()); columnEntity.setContentType(adminUpdateColumnDto.getContentType()); this.baseMapper.updateById(columnEntity); return Result.ok("更新成功"); } @@ -242,6 +245,7 @@ child.setRemark(columnEntityChild.getRemark()); child.setPic(columnEntityChild.getPic()); child.setOrderNum(columnEntityChild.getOrderNum()); child.setContentType(columnEntityChild.getContentType()); adminColumnVoChilds.add(child); } } src/main/java/com/xcong/farmer/cms/modules/system/vo/AdminColumnVo.java
@@ -26,6 +26,9 @@ @ApiModelProperty(value = "图片") private String pic; @ApiModelProperty(value = "内容类型 1:文章 2:图片 3:文件 4:音频") private Integer contentType; @ApiModelProperty(value = "子菜单") private List<AdminColumnVo> child; } 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/java/com/xcong/farmer/cms/modules/system/vo/AdminSeeColumnInfoVo.java
@@ -49,4 +49,7 @@ @ApiModelProperty(value = "是否为导航 1-是 2-否") private Integer isNav; @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