release- /artist/app/list/{page}/{size} 时间按yyyy-MM-dd 格式接受

release-2024-08-08
huangyawei 6 months ago
parent 17fe73d066
commit 2248fafdc4

@ -1,11 +1,12 @@
package com.luoo.user.dto.artist; package com.luoo.user.dto.artist;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime;
/** /**
* @Author: yawei.huang * @Author: yawei.huang
@ -31,8 +32,12 @@ public class ArtistSearchDto implements Serializable {
private String style; private String style;
@ApiModelProperty(value = "申请开始时间") @ApiModelProperty(value = "申请开始时间")
private LocalDateTime startTime; @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate startTime;
@ApiModelProperty(value = "申请结束时间") @ApiModelProperty(value = "申请结束时间")
private LocalDateTime endTime; @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate endTime;
} }

@ -316,11 +316,11 @@ public class ArtistService {
} }
if (param.getStartTime() != null) { 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) { if (param.getEndTime() != null) {
predicateList.add(builder.lessThanOrEqualTo(root.get("createTime"), param.getEndTime())); predicateList.add(builder.lessThanOrEqualTo(root.get("createTime"), param.getEndTime().atStartOfDay()));
} }

Loading…
Cancel
Save