mitao
2024-04-19 b21c37b7899b17dede7773db3c799aab1063ae1c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package com.finance.common.core.domain.model;
 
import com.fasterxml.jackson.annotation.JsonFormat;
import com.finance.common.core.domain.BasePage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
 
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Objects;
 
@ApiModel("时间范围分页dto")
public class TimeRangeQueryBody extends BasePage {
 
    @ApiModelProperty("开始时间 格式 yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date startTime;
 
    @ApiModelProperty("结束时间 格式 yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", 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;
    }
 
}