package com.xydl.cac.entity;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

@JsonInclude(JsonInclude.Include.NON_NULL)
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "ied_dl_config")
@ApiModel("61850装置文件下载配置表")
public class IedDlConfig {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Integer id;

    @NotNull(message = "iedId不能为空")
    @ApiModelProperty("iedId")
    @Column(name = "ied_id")
    private Integer iedId;

    @NotNull(message = "devId不能为空")
    @ApiModelProperty("devId")
    @Column(name = "dev_id")
    private Integer devId;

    @ApiModelProperty("目录")
    @Column(name = "path")
    private String path;

    @ApiModelProperty("包含名字")
    @Column(name = "contain")
    private String contain;

    @ApiModelProperty("后缀名")
    @Column(name = "suffix")
    private String suffix;

    @NotNull(message = "是否删除不能为空")
    @ApiModelProperty("下载后是否删除")
    @Column(name = "todel")
    private Integer todel;

    @NotNull(message = "状态不能为空")
    @ApiModelProperty("状态 0:停用 1:启用")
    @Column(name = "active")
    private Integer active;

    @Transient
    private NSensor sensor;
    @Transient
    private IcdIed ied;

}