package com.kingdee.eas.custom.integration.feishu;

import com.kingdee.bos.BOSException;
import com.kingdee.bos.Context;
import com.kingdee.bos.dao.IObjectPK;
import com.kingdee.bos.framework.ejb.EJBRemoteException;
import com.kingdee.bos.metadata.entity.EntityViewInfo;
import com.kingdee.bos.metadata.entity.SelectorItemCollection;
import com.kingdee.bos.util.BOSObjectType;
import com.kingdee.eas.common.EASBizException;
import com.kingdee.eas.custom.integration.feishu.app.FeishuMessageCardController;
import com.kingdee.shr.base.syssetting.SHRBaseItem;

import java.rmi.RemoteException;

/**
 * @Description 飞书消息卡片
 * @Date 2026/3/12 9:24
 * @Created by HeYuan
 */
public class FeishuMessageCard extends SHRBaseItem implements IFeishuMessageCard {
    public FeishuMessageCard() {
        super();
        registerInterface(IFeishuMessageCard.class, this);
    }

    public FeishuMessageCard(Context ctx) {
        super(ctx);
        registerInterface(IFeishuMessageCard.class, this);
    }

    public BOSObjectType getType() {
        return new BOSObjectType("D772710E");
    }

    private FeishuMessageCardController getController() throws BOSException {
        return (FeishuMessageCardController) getBizController();
    }

    /**
     * 取值-System defined method
     *
     * @param pk 取值
     * @return
     */
    public FeishuMessageCardInfo getFeishuMessageCardInfo(IObjectPK pk) throws BOSException, EASBizException {
        try {
            return getController().getFeishuMessageCardInfo(getContext(), pk);
        } catch (RemoteException err) {
            throw new EJBRemoteException(err);
        }
    }

    /**
     * 取值-System defined method
     *
     * @param pk       取值
     * @param selector 取值
     * @return
     */
    public FeishuMessageCardInfo getFeishuMessageCardInfo(IObjectPK pk, SelectorItemCollection selector) throws BOSException, EASBizException {
        try {
            return getController().getFeishuMessageCardInfo(getContext(), pk, selector);
        } catch (RemoteException err) {
            throw new EJBRemoteException(err);
        }
    }

    /**
     * 取值-System defined method
     *
     * @param oql 取值
     * @return
     */
    public FeishuMessageCardInfo getFeishuMessageCardInfo(String oql) throws BOSException, EASBizException {
        try {
            return getController().getFeishuMessageCardInfo(getContext(), oql);
        } catch (RemoteException err) {
            throw new EJBRemoteException(err);
        }
    }

    /**
     * 取集合-System defined method
     *
     * @return
     */
    public FeishuMessageCardCollection getFeishuMessageCardCollection() throws BOSException {
        try {
            return getController().getFeishuMessageCardCollection(getContext());
        } catch (RemoteException err) {
            throw new EJBRemoteException(err);
        }
    }

    /**
     * 取集合-System defined method
     *
     * @param view 取集合
     * @return
     */
    public FeishuMessageCardCollection getFeishuMessageCardCollection(EntityViewInfo view) throws BOSException {
        try {
            return getController().getFeishuMessageCardCollection(getContext(), view);
        } catch (RemoteException err) {
            throw new EJBRemoteException(err);
        }
    }

    /**
     * 取集合-System defined method
     *
     * @param oql 取集合
     * @return
     */
    public FeishuMessageCardCollection getFeishuMessageCardCollection(String oql) throws BOSException {
        try {
            return getController().getFeishuMessageCardCollection(getContext(), oql);
        } catch (RemoteException err) {
            throw new EJBRemoteException(err);
        }
    }
}