package com.lutao.cloud.consume.factory;

import com.fasterxml.jackson.databind.JsonNode;
import com.lutao.cloud.collect.vo.DataAddVO;
import com.lutao.cloud.common.core.util.MessageInfo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 命令策略
 *
 * @author yx
 * @date 2023/07/19
 */
@Transactional
@Service
public interface CommandStrategy<T> {

    /**
     * 执行
     *
     * @param command 命令
     * @param data    数据
     */
    MessageInfo execute(String command, JsonNode data, DataAddVO dataAddVO);

    /**
     * 执行批处理
     *
     * @param dataAddVOS 数据添加vos
     * @return {@link MessageInfo}
     */
    MessageInfo executeBatch(List<DataAddVO> dataAddVOS);
}
