package com.its.op.dto.its.common;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.io.Serializable;
import java.util.List;

/**
 *  DTO Class
 */
@Data
@Builder
@ApiModel("DetlTrafLinkDto(링크 소통정보 상세)")
public class DetlTrafLinkDto implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("링크 ID")
    @JsonProperty("link_id")
    private Long linkId;

    @ApiModelProperty("레벨")
    @JsonProperty("levl")
    private Integer levl;

    @ApiModelProperty("구간 길이")
    @JsonProperty("sect_lngt")
    private Integer sectLngt;

    @ApiModelProperty("시작 노드 ID")
    @JsonProperty("f_node_id")
    private Long   fNodeId;
    @ApiModelProperty("시작 노드 명")
    @JsonProperty("f_node_nm")
    private String fNodeNm;

    @ApiModelProperty("종료 노드 ID")
    @JsonProperty("t_node_id")
    private Long   tNodeId;
    @ApiModelProperty("종료 노드 명")
    @JsonProperty("t_node_nm")
    private String tNodeNm;

    @ApiModelProperty("도로명")  // Y VARCHAR(50)
    @JsonProperty("road_name")
    private String roadName;

    @ApiModelProperty("구간 등급 코드")  // Y VARCHAR(7)
    @JsonProperty("sect_grad_cd")
    private String sectGradCd;

    @ApiModelProperty("현재소통정보")  // Y VARCHAR(50)
    @JsonProperty("traf")
    private DetlTrafLinkInfo traf;

    @ApiModelProperty("소통정보이력(1시간이내)")  // Y VARCHAR(50)
    @JsonProperty("traf_hs")
    private List<DetlTrafLinkInfo> trafHs;

    @ApiModel("DetlTrafLinkInfo(링크 소통정보 상세 정보)")
    @Data
    @ToString
    @Builder
    public static class DetlTrafLinkInfo {
        @ApiModelProperty("가공 일시")  // Y VARCHAR(14)
        @JsonProperty("prcn_dt")
        private String prcnDt;

        @ApiModelProperty("소통 등급 코드")  // Y VARCHAR(7)
        @JsonProperty("cmtr_grad_cd")
        private String cmtrGradCd;

        @ApiModelProperty("속도")  // Y NUMBER(3)
        @JsonProperty("sped")
        private Integer sped;

        @ApiModelProperty("통행 시간")  // Y NUMBER(6)
        @JsonProperty("trvl_hh")
        private Integer trvlHh;

        @ApiModelProperty("결측 여부")  // Y CHAR(1)
        @JsonProperty("miss_yn")
        private String missYn;

        @ApiModelProperty("가공 속도")  // Y NUMBER(3)
        @JsonProperty("prcn_sped")
        private Integer prcnSped;

        @ApiModelProperty("평활화 속도")  // Y NUMBER(3)
        @JsonProperty("smth_sped")
        private Integer smthSped;

        @ApiModelProperty("보정 속도")  // Y NUMBER(3)
        @JsonProperty("adjs_sped")
        private Integer adjsSped;

        @ApiModelProperty("패턴 속도")
        @JsonProperty("ptrn_sped")
        private Integer ptrnSped;

        @ApiModelProperty("데이터 개수")
        @JsonProperty("data_num")
        private Integer dataNum;

        @ApiModelProperty("소통 등급 코드 설명")
        @JsonProperty("cmtr_grad_desc")
        private String cmtrGradDesc;

        @ApiModelProperty("가공 소스 설명")
        @JsonProperty("prcn_sorc_desc")
        private String prcnSorcDesc;

        @ApiModelProperty("보정 소스 설명")
        @JsonProperty("adjs_sorc_desc")
        private String adjsSorcDesc;

        @ApiModelProperty("순서")
        @JsonProperty("rank")
        private Integer rank;

//        @Builder
//        public DetlTrafLinkInfo(String prcnDt, String cmtrGradCd, Integer sped, Integer trvlHh, String missYn, Integer prcnSped, Integer smthSped, Integer adjsSped, Integer ptrnSped, Integer dataNum, String cmtrGradDesc, String prcnSorcDesc, String adjsSorcDesc, Integer rank) {
//            this.prcnDt = prcnDt;
//            this.cmtrGradCd = cmtrGradCd;
//            this.sped = sped;
//            this.trvlHh = trvlHh;
//            this.missYn = missYn;
//            this.prcnSped = prcnSped;
//            this.smthSped = smthSped;
//            this.adjsSped = adjsSped;
//            this.ptrnSped = ptrnSped;
//            this.dataNum = dataNum;
//            this.cmtrGradDesc = cmtrGradDesc;
//            this.prcnSorcDesc = prcnSorcDesc;
//            this.adjsSorcDesc = adjsSorcDesc;
//            this.rank = rank;
//        }
    }

}
