package cn.skcks.docking.gb28181.wvp.dto.report;

import cn.hutool.core.date.DatePattern;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@AllArgsConstructor
@NoArgsConstructor
@Data
@Schema(description = "上报信息")
public class ReportReq {
    @Schema(description = "上报消息id")
    private String id;
    @Schema(description = "设备编码")
    private String deviceCode;
    @Schema(description = "设备id/通道id")
    private String deviceId;
    @Schema(description = "点播时长")
    private String durationTime;
    @Schema(description = "点播时长")
    private TimeRange timeRange;

    @DateTimeFormat(pattern= DatePattern.NORM_DATETIME_PATTERN)
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    @Schema(description = "日志记录时间")
    private Date logTime;

    @AllArgsConstructor
    @NoArgsConstructor
    @Data
    public static class TimeRange {
        @Schema(description = "开始时间")
        private Date startTime;
        @Schema(description = "结束时间")
        private Date endTime;
    }

    @Schema(description = "文件大小, 未知大小为 -1")
    private String fileSize;
}
