package com.lantone.qc.trans;

import com.lantone.qc.pub.model.InputInfo;
import com.lantone.qc.pub.model.vo.QueryVo;
import lombok.extern.slf4j.Slf4j;

/**
 * @Description:
 * @author: rengb
 * @time: 2020/3/5 19:49
 */
@Slf4j
public class TransDispatch {

    public static InputInfo trans(QueryVo queryVo) {
        try {
            String classPath = "com.lantone.qc.trans."
                    + queryVo.getCid()
                    + "."
                    + queryVo.getCid().substring(0, 1).toUpperCase()
                    + queryVo.getCid().substring(1)
                    + "DocTrans";
            DocTrans docTrans = (DocTrans) Class.forName(classPath).newInstance();
            return docTrans.extract(queryVo);
        } catch (Exception e) {
            log.info(e.getMessage(), e);
            return null;
        }
    }

}