From 2248fafdc4a3e8c3fa4049f310b0a96161842582 Mon Sep 17 00:00:00 2001 From: huangyawei Date: Mon, 3 Jun 2024 20:27:09 +0800 Subject: [PATCH] =?UTF-8?q?release-=20/artist/app/list/{page}/{size}=20?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=8C=89yyyy-MM-dd=20=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E6=8E=A5=E5=8F=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/luoo/user/dto/artist/ArtistSearchDto.java | 11 ++++++++--- .../java/com/luoo/user/service/ArtistService.java | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) 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())); }