package com.ecep.contract.controller.customer.tasker;

import com.ecep.contract.MessageHolder;
import com.ecep.contract.WebSocketClientTasker;
import com.ecep.contract.task.Tasker;
import com.ecep.contract.vo.CustomerVo;

import lombok.Getter;
import lombok.Setter;

/**
 * 客户文件重建任务类
 * 用于通过WebSocket与服务器通信，重建客户相关文件
 */
public class CustomerRebuildFilesTasker extends Tasker<Object> implements WebSocketClientTasker {
    @Getter
    @Setter
    private CustomerVo companyCustomer;

    @Getter
    @Setter
    protected boolean filesUpdated = false;

    @Override
    public String getTaskName() {
        return "CustomerRebuildFilesTasker";
    }

    @Override
    public void updateProgress(long current, long total) {
        super.updateProgress(current, total);
    }

    @Override
    protected Object execute(MessageHolder holder) throws Exception {
        updateTitle("重建客户文件");
        return callRemoteTask(holder, getLocale(), companyCustomer.getId());
    }
}