package com.microservices.cms.doc.domain;

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

import java.util.List;

/**
 * @author otto
 */
@Data
@ApiModel("文章总览")
public class CmsDocOverviewDto implements Comparable<CmsDocOverviewDto> {
    /**
     * ID
     */
    @ApiModelProperty(value = "栏目Id", hidden = true)
    private Long id;
    /**
     * 栏目名称
     */
    @Excel(name = "栏目名称")
    @ApiModelProperty("栏目名称")
    private String name;
    /**
     * 排序
     */
    @Excel(name = "排序")
    @ApiModelProperty("排序")
    private Integer sort;

    /**
     * 文章列表
     */
    @ApiModelProperty("文章列表")
    private List<CmsDocBaseDto> cmsDocList;

    @Override
    public int compareTo(CmsDocOverviewDto cmsDocOverviewDto) {
        return this.sort - cmsDocOverviewDto.sort;
    }
}
