package com.microservices.zone.project.domain.vo;

import com.alibaba.fastjson2.JSONObject;
import com.microservices.common.core.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @author otto
 */

@Data
@ApiModel("项目聚合数据对象")
public class ZoneProjectDataVo implements Comparable<ZoneProjectDataVo> {
    @ApiModelProperty(value = "项目聚合主键")
    private Long id;
    @ApiModelProperty(value = "项目属性")
    private JSONObject projectProperties;
    @ApiModelProperty(value = "聚合项目类型")
    private String projectType;
    @ApiModelProperty(value = "聚合项目类型Id")
    private Long projectTypeId;
    @ApiModelProperty(value = "所属组织")
    private String deptName;
    @ApiModelProperty(value = "项目访问地址")
    private String projectURL;
    @ApiModelProperty(value = "是否首页展示（0代表不展示 1代表展示）")
    private String isHomepage;
    @ApiModelProperty(value = "所属专区")
    private Long zoneId;
    @ApiModelProperty(value = "排序")
    private Integer sort;
    @ApiModelProperty(value = "是否有数据集")
    private Boolean hasDataset;

    /**
     * gitlink项目Id
     */
    @Excel(name = "gitlink项目Id")
    private Long gitlinkProjectId;

    @Override
    public int compareTo(ZoneProjectDataVo zoneProjectDataVo) {
        // 重写Comparable接口的compareTo方法，根据年龄升序排列，降序修改相减顺序即可
        return Math.toIntExact(this.sort-zoneProjectDataVo.getSort());
    }
}
