首页 > 其他分享 >GetCaculator

GetCaculator

时间:2022-10-28 21:15:45浏览次数:29  
标签:GetCaculator name get prefer percentageParam parameMap caculator

import java.util.Map;

public class GetCaculator {
    // 将参数封装用于请求API接口
    public static Caculator getBean(Prefer prefer, Map<String, String> parameMap) {
        Caculator caculator = new Caculator();
        String name = prefer.getName();
        if (name != null && "percentageParam".equals(name)) {
            PercentageParam percentageParam = new PercentageParam();
            percentageParam.setNUM1(prefer.getBaseVal() + "");
            percentageParam.setNUM2(prefer.getTargetVal() + "");
            percentageParam.setPERIOD_ID(parameMap.get("time"));
            percentageParam.setREGION_CN_NAME(parameMap.get("organization"));
            percentageParam.setCOUNTRY_CN_NAME(parameMap.get("country"));
            percentageParam.setREPOFFCE_CN_NAME(parameMap.get("repoffce"));
            // 从配置表读取
            caculator.setRequestUrl(prefer.getUrl());
            caculator.setDataType(percentageParam);
            caculator.setApiName(name);
            caculator.setRequesType(prefer.getRequesType());
        }
        return caculator;
    }
}

 

标签:GetCaculator,name,get,prefer,percentageParam,parameMap,caculator
From: https://www.cnblogs.com/mingruifeng/p/16837485.html

相关文章