package com.xhpc.pp.logic;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.xhpc.common.data.up.PileConfigReplyData;
import com.xhpc.pp.tx.ServiceParameter;
import com.xhpc.pp.tx.ServiceResult;
import com.xhpc.pp.tx.logic.ServiceLogic;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

import java.util.Map;

@Lazy
@Component("RemoteRestartReplyDataLogic")
public class RemoteRestartReplyDataLogic implements ServiceLogic {

    private static Logger log = LoggerFactory.getLogger(RemoteRestartReplyDataLogic.class);

    @Override
    public ServiceResult service(ServiceParameter sp) throws Exception {

        Map<String, Object> req = sp.getParameters();
        ObjectMapper objectMapper = new ObjectMapper();
        PileConfigReplyData pileConfigReplyData = objectMapper.convertValue(req, PileConfigReplyData.class);
        //todo
        return new ServiceResult(false);
    }

}
