package com.sjyt.icom.asst.context.handle.cmd;

import com.sjyt.icom.asst.common.model.message.News;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * <p>Cmd上下文</p>
 *
 * @author renyanru
 * @version V1.0.0
 * @date 2022/6/22 14:22
 */
@Component
@AllArgsConstructor
public class IComMsgHandle {
    private final AvCmdHandle avCmdHandle;
    private final ContractCmdHandle contractCmdHandle;
    private final LogCmdHandle logCmdHandle;

    public void todo(News news) {
        CmdHandle.Builder<News> builder=new CmdHandle.Builder<>();
        builder.addHandler(avCmdHandle)
                .addHandler(contractCmdHandle)
                .addHandler(logCmdHandle);
         builder.build().doChain(news);
    }
}
