From 8fe93a9d05b7400d902a90d20bc3d59c81d7b87b Mon Sep 17 00:00:00 2001 From: Revers <0x00stone@gmail.com> Date: Sun, 25 Feb 2024 17:26:45 +0800 Subject: [PATCH] fix CMSAdvertisementService.search --- .../music/dto/response/cms/ArticleRespDTO.java | 17 +++++++++++++++++ .../music/service/CMSAdvertisementService.java | 6 +++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/luoo_music/src/main/java/com/luoo/music/dto/response/cms/ArticleRespDTO.java b/luoo_music/src/main/java/com/luoo/music/dto/response/cms/ArticleRespDTO.java index e37b784..1a2be13 100644 --- a/luoo_music/src/main/java/com/luoo/music/dto/response/cms/ArticleRespDTO.java +++ b/luoo_music/src/main/java/com/luoo/music/dto/response/cms/ArticleRespDTO.java @@ -35,6 +35,18 @@ public class ArticleRespDTO implements Serializable { @ApiModelProperty(value = "编辑日期,格式为: yyyy.MM.dd") private String date; + @ApiModelProperty(value = "是否定时发布 否:0 是:1") + private String isScheduled; + + @ApiModelProperty(value = "发布时间,格式为: yyyy.MM.dd") + private String pubTime; + + @ApiModelProperty(value = "是否允许评论 否:0 是:1") + private String allowCommit; + + @ApiModelProperty(value = "是否自动推送 否:0 是:1") + private String autoPush; + @ApiModelProperty(value = "总评论数,大于99,显示99+") private Long commitsNum; @ApiModelProperty(value = "总阅览数,大于99,显示99+") @@ -58,6 +70,11 @@ public class ArticleRespDTO implements Serializable { response.setDate(article.getPubTime().toString()); response.setCommitsNum(article.getComment()); response.setVistisNum(article.getVisits()); + response.setIsScheduled(article.getIsScheduled()); + response.setPubTime(article.getPubTime().format(Constants.formatter)); + response.setAllowCommit(article.getAllowCommit()); + response.setAutoPush(article.getAutoPush()); + return response; } } diff --git a/luoo_music/src/main/java/com/luoo/music/service/CMSAdvertisementService.java b/luoo_music/src/main/java/com/luoo/music/service/CMSAdvertisementService.java index 5e7936e..292c60c 100644 --- a/luoo_music/src/main/java/com/luoo/music/service/CMSAdvertisementService.java +++ b/luoo_music/src/main/java/com/luoo/music/service/CMSAdvertisementService.java @@ -209,9 +209,9 @@ public class CMSAdvertisementService { predicateList.add(builder.and(isDeleted, isDisplay)); - LocalDateTime now = LocalDateTime.now(); - predicateList.add(builder.lessThan(root.get("startTime"),now)); - predicateList.add(builder.greaterThan(root.get("endTime"), now)); +// LocalDateTime now = LocalDateTime.now(); +// predicateList.add(builder.lessThan(root.get("startTime"),now)); +// predicateList.add(builder.greaterThan(root.get("endTime"), now)); return builder.and(predicateList.toArray(new Predicate[predicateList.size()])); };