package com.its.safe.entity.its;

import com.its.safe.dto.its.TbLinkDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;

import java.io.Serializable;

/**
 * 링크정보 Entity Class
 */
@ApiModel("링크정보")
@Data
@Builder
public class TbLink implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("링크ID")  // N NUMBER(10)
    private Long linkId;

    @ApiModelProperty("시작노드ID")  // Y NUMBER(10)
    private Long fNodeId;

    @ApiModelProperty("종료노드ID")  // Y NUMBER(10)
    private Long tNodeId;

    @ApiModelProperty("차로수")  // Y NUMBER(4)
    private Integer lanes;

    @ApiModelProperty("도로등급")  // Y VARCHAR(3)
    private String roadRank;

    @ApiModelProperty("도로유형")  // Y VARCHAR(3)
    private String roadType;

    @ApiModelProperty("도로번호")  // Y VARCHAR(5)
    private String roadNo;

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

    @ApiModelProperty("최고제한속도")  // Y NUMBER(4)
    private Integer maxSpd;

    @ApiModelProperty("링크 길이")  // Y NUMBER(5)
    private Integer linkLeng;

    @ApiModelProperty("삭제 여부")  // Y CHAR(1)
    private String delYn;

    public TbLinkDto toDto() {
        return TbLinkDto.builder()
                .linkId(this.linkId)
                .fNodeId(this.fNodeId)
                .tNodeId(this.tNodeId)
                .lanes(this.lanes)
                .maxSpd(this.maxSpd)
                .linkLeng(this.linkLeng)
                .delYn(this.delYn)
                .build();
    }

}
