package com.ecep.contract.task;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.ecep.contract.MessageHolder;
import com.ecep.contract.WebSocketClientTasker;

/**
 * 库存全量同步任务客户端实现
 * 用于通过WebSocket与服务器通信，执行库存数据的全量同步
 */
public class InventoryAllSyncTask extends Tasker<Object> implements WebSocketClientTasker {
    private static final Logger logger = LoggerFactory.getLogger(InventoryAllSyncTask.class);

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

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

    @Override
    protected Object execute(MessageHolder holder) throws Exception {
        // 设置任务标题
        updateTitle("全量库存同步任务");

        // 更新任务消息
        updateMessage("开始执行全量库存同步...");

        // 调用远程WebSocket任务
        return callRemoteTask(holder, getLocale());
    }
}