package com.kingdee.eas.custom.beisen.utils;


import com.alibaba.fastjson.JSONObject;

import java.io.IOException;
import java.util.Map;

/**
 * PushRequirement
 * 推送需求
 * @author wangfan
 */
public class PushRequirement {

    /**
     * 创建招聘需求
     * @param requirementData 招聘需求数据
     * @return 创建成功的招聘需求ID
     * @throws IOException 当API调用失败时抛出
     */
    public String createRequirement(Map<String, Object> requirementData) throws IOException {
        final String CREATE_REQUIREMENT_URL = "https://openapi.italent.cn/RecruitV6/api/v1/Requirement/CreateRequirement";

        JSONObject requestData = new JSONObject(requirementData);
        BeisenApiClient beisenApiClient = BeisenApiClient.getInstance();
        JSONObject response = beisenApiClient.callApi(CREATE_REQUIREMENT_URL, requestData);

        return response.getString("data");
    }





}
