package com.zhongshu.card.client.model.school;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author TRX
 * @date 2024/6/12
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ImportResultModel {
    @Schema(description = "导入总条数")
    private Integer total;

    @Schema(description = "成功导入条数")
    private Integer success;

    @Schema(description = "导入失败条数")
    private Integer fail;

    public Integer getFail() {
        if (fail == null && total != null && success != null) {
            return total - success;
        }
        return fail;
    }

    @Schema(description = "失败详情")
    private List<String> failDetails;
}
