package com.engine.organization.wrapper;

import com.engine.common.util.ServiceUtil;
import com.engine.organization.entity.hrmresource.param.HrmRelationSaveParam;
import com.engine.organization.entity.hrmresource.param.HrmResourceSearchParam;
import com.engine.organization.entity.searchtree.SearchTreeParams;
import com.engine.organization.service.HrmResourceService;
import com.engine.organization.service.impl.HrmResourceServiceImpl;
import com.engine.organization.util.OrganizationWrapper;
import weaver.hrm.User;

import java.util.Map;

/**
 * @author:dxfeng
 * @createTime: 2022/06/21
 * @version: 1.0
 */
public class HrmResourceWrapper extends OrganizationWrapper {
    private HrmResourceService getHrmResourceService(User user) {
        return ServiceUtil.getService(HrmResourceServiceImpl.class, user);
    }


    public Map<String, Object> getSearchTree(SearchTreeParams params) {
        return getHrmResourceService(user).getSearchTree(params);
    }

    public Map<String, Object> listPage(HrmResourceSearchParam params) {
        return getHrmResourceService(user).listPage(params);
    }

    public Map<String, Object> getSaveForm() {
        return getHrmResourceService(user).getSaveForm();
    }

    public Long saveBaseForm(Map<String, Object> params) {
        Long resourceId = getHrmResourceService(user).saveBaseForm(params);
        return resourceId;
    }

    public Map<String, Object> getBaseForm(Map<String, Object> params) {
        return getHrmResourceService(user).getBaseForm(params);
    }

    public int updateForm(Map<String, Object> params) {
        int updateForm = getHrmResourceService(user).updateForm(params);
        return updateForm;
    }

    public Map<String, Object> getSearchCondition(Map<String, Object> params) {
        return getHrmResourceService(user).getSearchCondition(params);
    }

    public Map<String, Object> getHasRight() {
        return getHrmResourceService(user).getHasRight();
    }

    public Map<String, Object> getTabForm(Map<String, Object> params) {
        return getHrmResourceService(user).getTabForm(params);
    }

    public long saveTabForm(HrmRelationSaveParam params) {
        return getHrmResourceService(user).saveTabForm(params);
    }

    public long updateTabForm(HrmRelationSaveParam params) {
        return getHrmResourceService(user).updateTabForm(params);
    }

}
