package com.persagy.dmp.define.client;

import cn.hutool.extra.spring.SpringUtil;
import com.persagy.dmp.basic.model.QueryCriteria;
import com.persagy.dmp.common.model.response.CommonResult;
import com.persagy.dmp.common.utils.ResultHelper;
import com.persagy.dmp.define.entity.ObjectTypeDefine;

import java.util.List;

/**
 * 数据字典Client门面
 * @author Charlie Yu
 * @date 2021-05-15
 */
public class DigitalDefineFacade {

    private static DigitalDefineClient client = SpringUtil.getBean(DigitalDefineClient.class);

    /**
     * 查询类型定义
     * @param groupCode 集团编码
     * @param projectId 项目ID
     * @param appId 应用ID
     * @param userId 用户ID
     * @param criteria 查询条件
     * @return 类型定义
     */
    public static List<ObjectTypeDefine> queryObjectType(String groupCode, String projectId, String appId, String userId, QueryCriteria criteria) {
        CommonResult<List<ObjectTypeDefine>> result = client.queryObjectType(groupCode, projectId, appId, userId, criteria);
        return ResultHelper.getContent(result);
    }
}
