package com.its.safe.entity.its;

import com.its.safe.dto.its.TbNodeDto;
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 TbNode implements Serializable {
    private static final long serialVersionUID = 1L;

    private Long nodeId;
    private String nodeType;
    private String nodeName;
    private String turnP;
    private String rmrk;

    @ApiModelProperty("X 좌표")  // Y NUMBER(11,8)
    private Double xCrdn;

    @ApiModelProperty("Y 좌표")  // Y NUMBER(10,8)
    private Double yCrdn;

    public TbNodeDto toDto() {
        return TbNodeDto.builder()
                .nodeId(this.nodeId)
                .nodeType(this.nodeType)
                .nodeName(this.nodeName)
                .xCrdn(this.xCrdn)
                .yCrdn(this.yCrdn)
                .build();
    }

}
