diff --git a/luoo_user/src/main/java/com/luoo/user/dto/artist/ArtistSearchDto.java b/luoo_user/src/main/java/com/luoo/user/dto/artist/ArtistSearchDto.java index e0c3879..0aa17a7 100644 --- a/luoo_user/src/main/java/com/luoo/user/dto/artist/ArtistSearchDto.java +++ b/luoo_user/src/main/java/com/luoo/user/dto/artist/ArtistSearchDto.java @@ -1,11 +1,12 @@ package com.luoo.user.dto.artist; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; import java.time.LocalDate; -import java.time.LocalDateTime; /** * @Author: yawei.huang @@ -31,8 +32,12 @@ public class ArtistSearchDto implements Serializable { private String style; @ApiModelProperty(value = "申请开始时间") - private LocalDateTime startTime; + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd") + private LocalDate startTime; @ApiModelProperty(value = "申请结束时间") - private LocalDateTime endTime; + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd") + private LocalDate endTime; } diff --git a/luoo_user/src/main/java/com/luoo/user/service/ArtistService.java b/luoo_user/src/main/java/com/luoo/user/service/ArtistService.java index eee8fcc..ca77937 100644 --- a/luoo_user/src/main/java/com/luoo/user/service/ArtistService.java +++ b/luoo_user/src/main/java/com/luoo/user/service/ArtistService.java @@ -316,11 +316,11 @@ public class ArtistService { } if (param.getStartTime() != null) { - predicateList.add(builder.greaterThanOrEqualTo(root.get("createTime"), param.getStartTime())); + predicateList.add(builder.greaterThanOrEqualTo(root.get("createTime"), param.getStartTime().atStartOfDay())); } if (param.getEndTime() != null) { - predicateList.add(builder.lessThanOrEqualTo(root.get("createTime"), param.getEndTime())); + predicateList.add(builder.lessThanOrEqualTo(root.get("createTime"), param.getEndTime().atStartOfDay())); }