xiaoyong931011
2022-06-24 b2242780c6994327c105e97a2240e282ee52f90c
20220606
7 files modified
28 ■■■■■ 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/AdminUpdateArticleDto.java 3 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/farmer/cms/modules/system/entity/ArticleEntity.java 10 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ArticleServiceImpl.java 4 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/farmer/cms/modules/system/vo/AdminSeeArticleInfoVo.java 3 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/ArticleMapper.xml 2 ●●● patch | view | raw | blame | history
src/main/resources/mapper/MenuMapper.xml 3 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminAddArticleDto.java
@@ -48,6 +48,9 @@
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date releaseTime;
    @ApiModelProperty(value = "设置成热门文章 0:否 1:是")
    private Integer isTop;
    @ApiModelProperty(value = "是否立即发布 0:否 1:是")
    private Integer releaseStatus;
src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminUpdateArticleDto.java
@@ -50,6 +50,9 @@
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date releaseTime;
    @ApiModelProperty(value = "设置成热门文章 0:否 1:是")
    private Integer isTop;
    @ApiModelProperty(value = "是否立即发布 0:否 1:是")
    private Integer releaseStatus;
src/main/java/com/xcong/farmer/cms/modules/system/entity/ArticleEntity.java
@@ -30,6 +30,14 @@
     */
    public static final Integer DELETE_STATUS_YES = 0;
    /**
     * 设置成热门文章 0:否
     */
    public static final Integer ISTOP_NO = 0;
    /**
     * 设置成热门文章 1:是
     */
    public static final Integer ISTOP_YES = 1;
    /**
     * 访问量
     */
    public static final Integer VISITS_DEFAULT = 0;
@@ -55,6 +63,8 @@
    //发布时间
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date releaseTime;
    //设置成热门文章 0:否 1:是
    private Integer isTop;
    //是否立即发布 0:否 1:是
    private Integer releaseStatus;
    //文章详情
src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ArticleServiceImpl.java
@@ -92,6 +92,8 @@
            articleEntity.setAtlas(atlas);
        Date releaseTime = adminAddArticleDto.getReleaseTime();
            articleEntity.setReleaseTime(releaseTime);
        Integer isTop = adminAddArticleDto.getIsTop();
        articleEntity.setIsTop(isTop);
        Integer releaseStatus = adminAddArticleDto.getReleaseStatus();
        articleEntity.setReleaseStatus(releaseStatus);
        String articleDetails = adminAddArticleDto.getArticleDetails();
@@ -132,6 +134,8 @@
        if(ObjectUtil.isEmpty(articleEntity)){
            return Result.fail("文章不存在");
        }
        Integer isTop = adminUpdateArticleDto.getIsTop();
        articleEntity.setIsTop(isTop);
        Integer releaseStatus = adminUpdateArticleDto.getReleaseStatus();
        articleEntity.setReleaseStatus(releaseStatus);
        String title = adminUpdateArticleDto.getTitle();
src/main/java/com/xcong/farmer/cms/modules/system/vo/AdminSeeArticleInfoVo.java
@@ -43,6 +43,9 @@
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date releaseTime;
    @ApiModelProperty(value = "设置成热门文章 0:否 1:是")
    private Integer isTop;
    @ApiModelProperty(value = "是否立即发布 0:否 1:是")
    private Integer releaseStatus;
src/main/resources/mapper/ArticleMapper.xml
@@ -23,7 +23,7 @@
                </if>
            </if>
        </where>
        order by a.create_time desc
        order by a.is_top desc,a.create_time desc
    </select>
    <select id="selectAdminArticleByid" resultType="com.xcong.farmer.cms.modules.system.vo.AdminSeeArticleInfoVo">
src/main/resources/mapper/MenuMapper.xml
@@ -35,6 +35,7 @@
                    and a.parent_id = #{parentId}
                </if>
        </where>
        order by a.order_num ASC,a.order_num ASC
    </select>
    <select id="selectMenuEntityByIdAndParentId" resultType="com.xcong.farmer.cms.modules.system.entity.MenuEntity">
@@ -59,7 +60,7 @@
        <foreach collection = "list" item = "item"  separator=","  open = "(" close = ")" >
            #{item}
        </foreach >
        order by a.order_num ASC
        order by a.order_num ASC,a.order_num ASC
    </select>
</mapper>