package com.aip.gateway.api.entity;

import com.aip.gateway.api.dto.LinkedServerDto;
import lombok.Builder;
import lombok.Data;
import lombok.ToString;

import java.time.LocalDateTime;

@Data
@Builder
@ToString
public class TbLinkedServer {

    private int serverId;
    private int systemId;
    private String serverIpAddr;
    private String serverDesc;
    private LocalDateTime createdAt;
    private LocalDateTime deletedAt;
    private boolean useYn;

    public LinkedServerDto toDto() {
        return LinkedServerDto.builder()
                .serverId(this.serverId)
                .systemId(this.systemId)
                .serverIpAddr(this.serverIpAddr)
                .serverDesc(this.serverDesc)
                .createdAt(this.createdAt)
                .deletedAt(this.deletedAt)
                .useYn(this.useYn)
                .build();
    }
}
