package com.weather.modules.weather.dailydata.dto;

import lombok.Data;

import java.util.concurrent.atomic.AtomicInteger;

@Data
public class ImportProgress {
    private String taskId;
    private final AtomicInteger totalRows = new AtomicInteger(0);
    private final AtomicInteger processedRows = new AtomicInteger(0);
    private volatile String status;
    private volatile String errorMessage;
    /** 任务完成时间戳，用于过期清理 */
    private volatile Long completedAt;

    public ImportProgress(String taskId) {
        this.taskId = taskId;
    }

    public int getTotalRows() {
        return totalRows.get();
    }

    public void setTotalRows(int totalRows) {
        this.totalRows.set(totalRows);
    }

    public void incrementTotalRows() {
        totalRows.incrementAndGet();
    }
}
