package org.springblade.file.pojo.dto;

import com.google.common.collect.Lists;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springblade.core.tool.utils.StringUtil;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;

/**
 *  业务附件删除参数
 * @author bfhuange
 * @since 2024/12/3
 */
@NoArgsConstructor
@AllArgsConstructor
@Data
@Schema(description = "业务附件删除参数")
public class BusinessAttachmentDeleteDTO implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    /**
     *  业务id列表
     */
    @Schema(description = "业务id列表")
    private List<Long> bizIds;
    /**
     *  业务code列表
     */
    @Schema(description = "业务code列表")
    private List<String> bizCodes;
    /**
     *  是否删除
     */
    @Schema(description = "是否删除")
    private boolean delete = true;

    public BusinessAttachmentDeleteDTO(Long bizId) {
        this.bizIds = Lists.newArrayList(bizId);
    }

    public BusinessAttachmentDeleteDTO(Long bizId, String bizCode) {
        this.bizIds = Lists.newArrayList(bizId);
        if (StringUtil.isNotBlank(bizCode)) {
            this.bizCodes = Lists.newArrayList(bizCode);
        }
    }

}
