package com.crunii.micro.domain.entity.main;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;

@Entity
@Table(name = "t_service")
@NamedQuery(name = "TService.findAll", query = "SELECT t FROM TService t")
@DynamicInsert
@DynamicUpdate
@Getter
@Setter
@ToString
@EqualsAndHashCode(of = { "serviceCode" })
@ApiModel(description = "")
public class TService implements Serializable {

    private static final long serialVersionUID = 1L;

	@Id
	@Column(name = "service_code")
	@ApiModelProperty(value = "spring.application.name (保持和项目名称一致不要使用下划线)")
	private String serviceCode;

	@Column(name = "service_name")
	@ApiModelProperty(value = "服务名")
	private String serviceName;

	@Column(name = "service_desc")
	@ApiModelProperty(value = "服务描述")
	private String serviceDesc;

	@Column(name = "port")
	@ApiModelProperty(value = "server.port 端口")
	private int port;

	@Column(name = "extend_ports")
	@ApiModelProperty(value = "扩展端口（多个用逗号分隔，例如启动socket的服务端）")
	private String extendPorts;

	@Column(name = "state")
	@ApiModelProperty(value = "状态 1 有效 0 无效")
	private int state;

	@Column(name = "create_time")
	@ApiModelProperty(value = "创建时间")
	private java.util.Date createTime;

}
