package com.lingyue.extract.dto.request;

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

/**
 * 生成任务进度响应
 * 
 * @author lingyue
 * @since 2026-01-24
 */
@Data
@Schema(description = "生成任务进度响应")
public class GenerationProgressResponse {
    
    @Schema(description = "任务ID")
    private String id;
    
    @Schema(description = "状态")
    private String status;
    
    @Schema(description = "进度 0-100")
    private Integer progress;
    
    @Schema(description = "变量总数")
    private Integer total;
    
    @Schema(description = "已完成数")
    private Integer completed;
    
    @Schema(description = "当前处理的变量名")
    private String currentVariable;
    
    @Schema(description = "消息")
    private String message;
    
    public static GenerationProgressResponse of(String id, String status, int progress, 
                                                  int total, int completed, String currentVariable) {
        GenerationProgressResponse response = new GenerationProgressResponse();
        response.setId(id);
        response.setStatus(status);
        response.setProgress(progress);
        response.setTotal(total);
        response.setCompleted(completed);
        response.setCurrentVariable(currentVariable);
        return response;
    }
}
