package com.ruoyi.common.core.domain.model; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.common.core.domain.BasePage; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.text.SimpleDateFormat; import java.time.LocalDateTime; import java.util.Date; import java.util.Objects; @ApiModel("时间范围分页dto") public class TimeRangeQueryBody extends BasePage { @ApiModelProperty("开始时间 格式 yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date startTime; @ApiModelProperty("结束时间 格式 yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date endTime; public String getStartTime() { if (Objects.nonNull(startTime)) { return new SimpleDateFormat("yyyy-MM-dd").format(startTime) + " 00:00:00"; } return null; } public void setStartTime(Date startTime) { this.startTime = startTime; } public String getEndTime() { if (Objects.nonNull(endTime)) { return new SimpleDateFormat("yyyy-MM-dd").format(endTime) + " 23:59:59"; } return null; } public void setEndTime(Date endTime) { this.endTime = endTime; } }