package com.tashow.cloud.sdk.feishu.util;
import com.lark.oapi.Client;
import com.tashow.cloud.sdk.feishu.config.LarkConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 飞书客户端工具类
 * 用于创建和获取飞书客户端实例
 */
@Component
public class LarkClientUtil {

    private final LarkConfig larkConfig;
    
    @Autowired
    public LarkClientUtil(LarkConfig larkConfig) {
        this.larkConfig = larkConfig;
    }

    /**
     * 获取飞书客户端实例
     * @return 飞书客户端
     */
    public Client getLarkClient() {
        return Client.newBuilder(larkConfig.getAppId(), larkConfig.getAppSecret()).build();
    }
}