All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.larksuite.oapi.core.card.Card Maven / Gradle / Ivy

Go to download

Larksuite open platform facilitates the integration of enterprise applications and larksuite, making collaboration and management more efficient

There is a newer version: 1.0.18-rc8
Show newest version
package com.larksuite.oapi.core.card;

import com.larksuite.oapi.core.Config;
import com.larksuite.oapi.core.Context;
import com.larksuite.oapi.core.card.mode.HTTPCard;
import com.larksuite.oapi.core.model.OapiRequest;
import com.larksuite.oapi.core.model.OapiResponse;

import static com.larksuite.oapi.core.card.handler.Handler.DEFAULT;

public class Card {

    public static void setHandler(Config config, IHandler handler) {
        IHandler.Hub.register(config, handler);
    }

    public static OapiResponse handle(Config config, OapiRequest request) {
        Context context = new Context();
        config.withContext(context);
        OapiResponse response = new OapiResponse();
        HTTPCard httpCard = new HTTPCard(request, response);
        DEFAULT.handle(context, httpCard);
        return response;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy