package com.engine.recruit.wrapper;

import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.recruit.constant.RecruitConstant;
import com.engine.recruit.factory.ResumeRecognitionFactory;
import com.engine.recruit.service.ResumeRecognitionService;
import org.apache.commons.lang3.StringUtils;
import weaver.hrm.User;

import java.util.Map;

/**
 * @author:dxfeng
 * @createTime: 2023/12/12
 * @version: 1.0
 */
public class ResumeRecognitionWrapper extends Service {

    private ResumeRecognitionService getResumeRecognitionService(User user) {
        return ServiceUtil.getService(ResumeRecognitionFactory.getClass(RecruitConstant.OCR_TYPE), user);
    }

    public Map<String, Object> resumeUpload(Map<String, Object> param) {
        if (StringUtils.isBlank(RecruitConstant.OCR_TYPE)) {
            return null;
        }
        return getResumeRecognitionService(user).resumeUpload(param);
    }

    public Map<String, Object> importResume(Map<String, Object> param) {
        if (StringUtils.isBlank(RecruitConstant.OCR_TYPE)) {
            return null;
        }
        return getResumeRecognitionService(user).importResume(param);
    }

    public Map<String, Object> fetchResume(Map<String, Object> param) {
        if (StringUtils.isBlank(RecruitConstant.OCR_TYPE)) {
            return null;
        }
        return getResumeRecognitionService(user).fetchResume(param);
    }
}
