package com.nova.sankuai.domain.dto; import cn.hutool.core.date.DateUtil; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; import java.util.Date; /** * @author weikangdi * @create 2021/12/30 */ @Data @ApiModel(value = "渠道访问日志统计Dto") public class ChannelVisitDto { @ApiModelProperty(value = "渠道名") private String name; @ApiModelProperty(value = "渠道代码") private Integer code; @ApiModelProperty(value = "贷超id") private Long marketId; @ApiModelProperty(value = "开始日期") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date startDate; @ApiModelProperty(value = "结束日期") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date endDate; @ApiModelProperty(value = "会员服务类型 参考枚举VipCardTypeEnum") private Integer vipType; public ChannelVisitDto initDate() { if (this.getStartDate() == null) { this.setStartDate(DateUtil.beginOfDay(new Date())); } if (this.getEndDate() == null) { this.setEndDate(DateUtil.endOfDay(new Date())); } return this; } }