package com.qqchen.deploy.backend.deploy.entity;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.qqchen.deploy.backend.deploy.enums.DevelopmentLanguageTypeEnum;
import com.qqchen.deploy.backend.framework.domain.Entity;
import jakarta.persistence.Column;
import jakarta.persistence.FetchType;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.OneToMany;
import jakarta.persistence.Table;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.ArrayList;
import java.util.List;

/**
 * 应用实体
 */
@Data
@EqualsAndHashCode(callSuper = true)
@jakarta.persistence.Entity
@Table(name = "deploy_application")
public class Application extends Entity<Long> {

    /**
     * 应用编码
     */
    @Column(name = "app_code", nullable = false)
    private String appCode;

    /**
     * 应用名称
     */
    @Column(name = "app_name", nullable = false)
    private String appName;

    /**
     * 应用描述
     */
    @Column(name = "app_desc")
    private String appDesc;


    /**
     * 开发语言
     */
    @Column(name = "language")
    private DevelopmentLanguageTypeEnum language;

    @Column(name = "external_system_id", nullable = false)
    private Long externalSystemId;

    /**
     * 代码仓库组ID
     */
    @Column(name = "repo_group_id", nullable = false)
    private Long repoGroupId;

    /**
     * 代码仓库项目ID
     */
    @Column(name = "repo_project_id", nullable = false)
    private Long repoProjectId;

    /**
     * 项目组ID
     */
    @Column(name = "project_group_id", nullable = false)
    private Long projectGroupId;

    /**
     * 排序号
     */
    @Column(name = "sort", nullable = false)
    private Integer sort;

    /**
     * 应用状态
     */
    @Column(nullable = false)
    private Boolean enabled = true;

}