package com.yuchen.saas.park.service.xxlJobThread;

import cn.hutool.core.util.StrUtil;
import com.xxl.job.core.context.XxlJobHelper;

import java.util.HashMap;
import java.util.Map;

public class BaseXxlJob extends XxlJobHelper {
    public BaseXxlJob() {
    }

    public Map<String, String> getJobParams() {
        String jobParamsStr = XxlJobHelper.getJobParam();
        String[] jobParams = StrUtil.splitToArray(jobParamsStr, ",");
        HashMap<String, String> result = new HashMap<>(jobParams.length);
        if (jobParams.length > 0) {
            String[] var4 = jobParams;
            int var5 = jobParams.length;

            for (int var6 = 0; var6 < var5; ++var6) {
                String jobParamStr = var4[var6];
                String[] jobParam = StrUtil.splitToArray(jobParamStr, "=");
                if (jobParam.length == 2) {
                    result.putIfAbsent(jobParam[0], jobParam[1]);
                }
            }

        }
        return result;
    }
}
